Class CounterWeightGarageDoorAnimationComponent
java.lang.Object
nl.pim16aap2.animatedarchitecture.structures.garagedoor.CounterWeightGarageDoorAnimationComponent
- All Implemented Interfaces:
IAnimationComponent
- Direct Known Subclasses:
SectionalGarageDoorAnimationComponent
public class CounterWeightGarageDoorAnimationComponent
extends Object
implements IAnimationComponent
Represents a
Animator for GarageDoors.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final doubleprotected final BlockFaceprotected final Vector3Diprotected final Cuboidprotected final doubleprotected final Cuboidprotected final booleanprotected final Cuboidprotected final IPlayerprotected final Vector3Ddprotected final Vector3Diprotected final TriFunction<Vector3Dd, IVector3D, Double, Vector3Dd> protected final StructureSnapshotprotected final boolean -
Constructor Summary
ConstructorsConstructorDescriptionCounterWeightGarageDoorAnimationComponent(AnimationRequestData data, MovementDirection movementDirection) -
Method Summary
Modifier and TypeMethodDescriptionvoidexecuteAnimationStep(IAnimator animator, Iterable<IAnimatedBlock> animatedBlocks, int ticks) Runs a single step of the animation.getFinalPosition(int xAxis, int yAxis, int zAxis) Calculates the final position from the original coordinates of the block that will be animated.protected RotatedPositiongetGoalPos(double angle, IAnimatedBlock animatedBlock) floatgetRadius(int xAxis, int yAxis, int zAxis) Gets the radius of a block at the given coordinates.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
getBlockDataRotator, getStartPosition, prepareAnimation
-
Field Details
-
snapshot
-
rotationPoint
-
northSouth
protected final boolean northSouth -
oldCuboid
-
mergedCuboid
-
mergedCuboidRadius
protected final double mergedCuboidRadius -
newCuboid
-
player
-
rotator
-
animationDirectionFace
-
directionVec
-
rotationCenter
-
wasVertical
protected final boolean wasVertical -
angle
protected final double angle
-
-
Constructor Details
-
CounterWeightGarageDoorAnimationComponent
public CounterWeightGarageDoorAnimationComponent(AnimationRequestData data, MovementDirection movementDirection)
-
-
Method Details
-
getGoalPos
-
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.
-
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.
-
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.
-