Class DrawbridgeAnimationComponent

java.lang.Object
nl.pim16aap2.animatedarchitecture.structures.drawbridge.DrawbridgeAnimationComponent
All Implemented Interfaces:
IAnimationComponent
Direct Known Subclasses:
ClockAnimationComponent, WindmillAnimationComponent

public class DrawbridgeAnimationComponent extends Object implements IAnimationComponent
Represents a Animator for Drawbridges.
  • Constructor Details

  • Method Details

    • getStartPosition

      public RotatedPosition getStartPosition(int xAxis, int yAxis, int zAxis)
      Description copied from interface: IAnimationComponent
      Calculates the starting position from the original coordinates of the block that will be animated.
      Specified by:
      getStartPosition in interface IAnimationComponent
      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

      protected Vector3Dd getGoalRotation(double angle)
    • 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

      public RotatedPosition getFinalPosition(int xAxis, int yAxis, int zAxis)
      Description copied from interface: IAnimationComponent
      Calculates the final position from the original coordinates of the block that will be animated.
      Specified by:
      getFinalPosition in interface IAnimationComponent
      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: IAnimationComponent
      Runs a single step of the animation.
      Specified by:
      executeAnimationStep in interface IAnimationComponent
      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: IAnimationComponent
      Gets the radius of a block at the given coordinates.
      Specified by:
      getRadius in interface IAnimationComponent
      Parameters:
      xAxis - The x coordinate.
      yAxis - The y coordinate.
      zAxis - The z coordinate.
      Returns:
      The radius of a block at the given coordinates.
    • getBlockDataRotator

      @Nullable public @Nullable Consumer<IAnimatedBlockData> getBlockDataRotator()
      Description copied from interface: IAnimationComponent
      Provides the consumer that applies the rotation to the IAnimatedBlockData.

      When set to null (the default value), it does not do anything.

      Specified by:
      getBlockDataRotator in interface IAnimationComponent
      Returns:
      The rotation function for the animated block data.