Class BoundingBox

java.lang.Object
com.hypixel.hytale.server.core.modules.entity.component.BoundingBox
All Implemented Interfaces:
Component<EntityStore>, Cloneable

public class BoundingBox extends Object implements Component<EntityStore>
  • Constructor Details

    • BoundingBox

      public BoundingBox()
    • BoundingBox

      public BoundingBox(@Nonnull Box boundingBox)
  • Method Details

    • getComponentType

      public static ComponentType<EntityStore, BoundingBox> getComponentType()
    • getBoundingBox

      @Nonnull public Box getBoundingBox()
    • setBoundingBox

      public void setBoundingBox(@Nonnull Box boundingBox)
    • setBaseModelBox

      public void setBaseModelBox(@Nullable Box baseModelBox)
    • getScale

      public float getScale()
    • setScale

      public void setScale(float scale)
      Scales the bounding box and the detail boxes around the entity origin.

      The scale survives the calls that recompute the box. A scaled entity keeps its scale when its model, its movement state or its rotation changes.

      This method ignores a scale that is not finite or not larger than zero. Such a value makes the box empty or inverted. The scale reaches the server as persisted data or in a packet.

    • applyRotation

      public void applyRotation(float pitch, float yaw, float roll)
      Recomputes the bounding box as the enclosing AABB of the base model box rotated by the given Euler angles. No-op if no base model box is stored.
    • getDetailBoxes

      public Map<String, DetailBox[]> getDetailBoxes()
    • setDetailBoxes

      public void setDetailBoxes(Map<String, DetailBox[]> detailBoxes)
    • clone

      @Nonnull public Component<EntityStore> clone()
      Specified by:
      clone in interface Component<EntityStore>
      Returns:
      a clone instance of the original component instance.