Class DrawbridgeAnimationComponent
java.lang.Object
nl.pim16aap2.animatedarchitecture.structures.drawbridge.DrawbridgeAnimationComponent
- All Implemented Interfaces:
IAnimationComponent
- Direct Known Subclasses:
ClockAnimationComponent,WindmillAnimationComponent
Represents a
Animator for Drawbridges.-
Constructor Summary
ConstructorsConstructorDescriptionDrawbridgeAnimationComponent(AnimationRequestData data, MovementDirection movementDirection, boolean isNorthSouthAligned, int quarterCircles) -
Method Summary
Modifier and TypeMethodDescriptionvoidexecuteAnimationStep(IAnimator animator, Iterable<IAnimatedBlock> animatedBlocks, int ticks) Runs a single step of the animation.@Nullable Consumer<IAnimatedBlockData> Provides the consumer that applies the rotation to theIAnimatedBlockData.getFinalPosition(int xAxis, int yAxis, int zAxis) Calculates the final position from the original coordinates of the block that will be animated.protected RotatedPositiongetGoalPos(@Nullable Vector3Dd localRotation, double angle, double x, double y, double z) protected RotatedPositiongetGoalPos(@Nullable Vector3Dd localRotation, double angle, IAnimatedBlock animatedBlock) protected Vector3DdgetGoalRotation(double angle) static floatfloatgetRadius(int xAxis, int yAxis, int zAxis) Gets the radius of a block at the given coordinates.getStartPosition(int xAxis, int yAxis, int zAxis) Calculates the starting position from the original coordinates of the block that will be animated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nl.pim16aap2.animatedarchitecture.core.animation.IAnimationComponent
prepareAnimation
-
Constructor Details
-
DrawbridgeAnimationComponent
public DrawbridgeAnimationComponent(AnimationRequestData data, MovementDirection movementDirection, boolean isNorthSouthAligned, int quarterCircles)
-
-
Method Details
-
getStartPosition
Description copied from interface:IAnimationComponentCalculates the starting position from the original coordinates of the block that will be animated.- Specified by:
getStartPositionin interfaceIAnimationComponent- Parameters:
xAxis- The x-coordinate of the original location of the block.yAxis- The y-coordinate of the original location of the block.zAxis- The z-coordinate of the original location of the block.- Returns:
- The starting position of an
IAnimatedBlock.
-
getGoalRotation
-
getGoalPos
protected RotatedPosition getGoalPos(@Nullable @Nullable Vector3Dd localRotation, double angle, double x, double y, double z) -
getGoalPos
protected RotatedPosition getGoalPos(@Nullable @Nullable Vector3Dd localRotation, double angle, IAnimatedBlock animatedBlock) -
getFinalPosition
Description copied from interface:IAnimationComponentCalculates the final position from the original coordinates of the block that will be animated.- Specified by:
getFinalPositionin interfaceIAnimationComponent- Parameters:
xAxis- The x-coordinate of the original location of the block.yAxis- The y-coordinate of the original location of the block.zAxis- The z-coordinate of the original location of the block.- Returns:
- The final position of an
IAnimatedBlock.
-
executeAnimationStep
public void executeAnimationStep(IAnimator animator, Iterable<IAnimatedBlock> animatedBlocks, int ticks) Description copied from interface:IAnimationComponentRuns a single step of the animation.- Specified by:
executeAnimationStepin interfaceIAnimationComponent- Parameters:
animator- The animator responsible for the animation.animatedBlocks- The animated blocks for which to execute the animation step.ticks- The number of ticks that have passed since the start of the animation.
-
getRadius
public static float getRadius(boolean northSouthAligned, IVector3D rotationPoint, int xAxis, int yAxis, int zAxis) -
getRadius
public float getRadius(int xAxis, int yAxis, int zAxis) Description copied from interface:IAnimationComponentGets the radius of a block at the given coordinates.- Specified by:
getRadiusin interfaceIAnimationComponent- Parameters:
xAxis- The x coordinate.yAxis- The y coordinate.zAxis- The z coordinate.- Returns:
- The radius of a block at the given coordinates.
-
getBlockDataRotator
Description copied from interface:IAnimationComponentProvides the consumer that applies the rotation to theIAnimatedBlockData.When set to null (the default value), it does not do anything.
- Specified by:
getBlockDataRotatorin interfaceIAnimationComponent- Returns:
- The rotation function for the animated block data.
-