Package net.thewinnt.cutscenes.path
Class Path
java.lang.Object
net.thewinnt.cutscenes.path.Path
- All Implemented Interfaces:
PathLike
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.thewinnt.cutscenes.path.PathLike
PathLike.SegmentSerializer<T extends PathLike> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddBezier(net.minecraft.world.phys.Vec3 control_a, net.minecraft.world.phys.Vec3 control_b, net.minecraft.world.phys.Vec3 end) addBezier(net.minecraft.world.phys.Vec3 control_a, net.minecraft.world.phys.Vec3 control_b, net.minecraft.world.phys.Vec3 end, int weight) addLinear(net.minecraft.world.phys.Vec3 end, Easing easingX, Easing easingY, Easing easingZ, boolean isRotation) addLinear(net.minecraft.world.phys.Vec3 end, Easing easingX, Easing easingY, Easing easingZ, boolean isRotation, int weight) continueBezier(net.minecraft.world.phys.Vec3 control_b, net.minecraft.world.phys.Vec3 end) continueBezier(net.minecraft.world.phys.Vec3 control_b, net.minecraft.world.phys.Vec3 end, int weight) static Pathstatic PathfromNetwork(net.minecraft.network.FriendlyByteBuf buf, Path path) getEnd(net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 cutsceneStart) Returns aPointProviderrepresenting the end position for this segment.net.minecraft.world.phys.Vec3getPoint(double delta, net.minecraft.world.level.Level l, net.minecraft.world.phys.Vec3 s) Returns the position at the given moment.getSegment(int index) getSegmentRange(PathLike segment) Returns the serializer that is associated with this segment type.getStart(net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 cutsceneStart) Returns aPointProviderrepresenting the starting position for this segment.getUtilityPoints(net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 cutsceneStart, int initLevel) Returns a list oflinesrepresenting the utility points used for constructing this segment's path.intReturns the weight of this segment.intintlast()intsize()voidtoNetwork(net.minecraft.network.FriendlyByteBuf buf) Writes this segment's parameters to the providedFriendlyByteBuf.
-
Constructor Details
-
Path
-
Path
-
-
Method Details
-
getPoint
public net.minecraft.world.phys.Vec3 getPoint(double delta, net.minecraft.world.level.Level l, net.minecraft.world.phys.Vec3 s) Description copied from interface:PathLikeReturns the position at the given moment. Depending on the context, it may be treated differently:- If the segment is representing the camera position, the resulting position will be treated as an offset from the cutscene starting position, which will then be rotated around the starting point by three axes, depending on the parameters the cutscene was started with.
- If the segment is representing camera rotation, this method's output will be treated as an offset from the starting camera rotation of the cutscene.
- Specified by:
getPointin interfacePathLike- Parameters:
delta- the progress of the current segment, in range [0, 1]. 0 corresponds to the starting position and 1 is the end position.l- the level where the cutscene is runs- the starting position of the cutscene- Returns:
- a point corresponding to the given progress value of the segment.
-
getStart
public PointProvider getStart(net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 cutsceneStart) Description copied from interface:PathLikeReturns aPointProviderrepresenting the starting position for this segment. Ideally, this should match the output ofgetPoint(0, level, cutsceneStart). Used inpathsandpath transitions.- Specified by:
getStartin interfacePathLike- Parameters:
level- the level where the cutscene is runcutsceneStart- the starting position of the cutscene- Returns:
- the
PointProviderrepresenting the starting position for this segment
-
getEnd
public PointProvider getEnd(net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 cutsceneStart) Description copied from interface:PathLikeReturns aPointProviderrepresenting the end position for this segment. Ideally, this should match the output ofgetPoint(1, level, cutsceneStart). Used inpathsandpath transitions.- Specified by:
getEndin interfacePathLike- Parameters:
level- the level where the cutscene is runcutsceneStart- the starting position of the cutscene- Returns:
- the
PointProviderrepresenting the end position for this segment
-
getWeight
public int getWeight()Description copied from interface:PathLikeReturns the weight of this segment. Used for timing inpaths. The higher the value, the more time is dedicated to this segment and the slower it runs, and vice-versa. -
getUtilityPoints
public Collection<PathPreviewRenderer.Line> getUtilityPoints(net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 cutsceneStart, int initLevel) Description copied from interface:PathLikeReturns a list oflinesrepresenting the utility points used for constructing this segment's path. Used for rendering a cutscene's preview.- Specified by:
getUtilityPointsin interfacePathLike- Parameters:
level- the level where the preview is renderedcutsceneStart- the starting position of the cutscene previewinitLevel- the depth level for this segment. For every segment nested inside another segment, this value increases by 1. This argument should be passed to created lines without changing it.- Returns:
- a collection of lines representing this segment's utility points.
- See Also:
-
last
-
continueBezier
public Path continueBezier(net.minecraft.world.phys.Vec3 control_b, net.minecraft.world.phys.Vec3 end, int weight) -
continueBezier
public Path continueBezier(net.minecraft.world.phys.Vec3 control_b, net.minecraft.world.phys.Vec3 end) -
addBezier
public Path addBezier(net.minecraft.world.phys.Vec3 control_a, net.minecraft.world.phys.Vec3 control_b, net.minecraft.world.phys.Vec3 end, int weight) -
addBezier
public Path addBezier(net.minecraft.world.phys.Vec3 control_a, net.minecraft.world.phys.Vec3 control_b, net.minecraft.world.phys.Vec3 end) -
addLinear
-
addLinear
-
add
-
set
-
indexOf
-
getSerializer
Description copied from interface:PathLikeReturns the serializer that is associated with this segment type. Preferably, this should return the same object every time it's called.- Specified by:
getSerializerin interfacePathLike- Returns:
- a serializer for this segment's type
-
fromNetwork
-
toNetwork
public void toNetwork(net.minecraft.network.FriendlyByteBuf buf) Description copied from interface:PathLikeWrites this segment's parameters to the providedFriendlyByteBuf. This data should be enough to fully reconstruct this segment on the client. -
fromJSON
-
size
public int size() -
getSegment
-
getWeightSum
public int getWeightSum() -
getSegmentRange
-