Package net.thewinnt.cutscenes.path
Class ConstantPoint
java.lang.Object
net.thewinnt.cutscenes.path.ConstantPoint
- 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
ConstructorsConstructorDescriptionConstantPoint(net.minecraft.world.phys.Vec3 point) ConstantPoint(net.minecraft.world.phys.Vec3 point, int weight) ConstantPoint(PointProvider point, int weight) -
Method Summary
Modifier and TypeMethodDescriptionstatic ConstantPointstatic ConstantPointfromNetwork(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 t, net.minecraft.world.level.Level l, net.minecraft.world.phys.Vec3 s) Returns the position at the given moment.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.intReturns the weight of this segment.voidtoNetwork(net.minecraft.network.FriendlyByteBuf buf) Writes this segment's parameters to the providedFriendlyByteBuf.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.thewinnt.cutscenes.path.PathLike
getAllPoints, getUtilityPoints
-
Constructor Details
-
ConstantPoint
public ConstantPoint(net.minecraft.world.phys.Vec3 point) -
ConstantPoint
public ConstantPoint(net.minecraft.world.phys.Vec3 point, int weight) -
ConstantPoint
-
-
Method Details
-
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
-
getPoint
public net.minecraft.world.phys.Vec3 getPoint(double t, 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:
t- 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.
-
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. -
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. -
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
-
fromJSON
-