Class StripBox

All Implemented Interfaces:
Pickable, Hintable, Renderable, Savable

public class StripBox extends Mesh
  • Field Details

    • _xExtent

      public double _xExtent
    • _yExtent

      public double _yExtent
    • _zExtent

      public double _zExtent
    • _center

      public final Vector3 _center
  • Constructor Details

    • StripBox

      public StripBox()
      instantiates a new StripBox object. All information must be applies later. For internal usage only
    • StripBox

      public StripBox(String name)
      Constructor instantiates a new StripBox object. Center and vertex information must be supplied later.
      Parameters:
      name - the name of the scene element. This is required for identification and comparison purposes.
    • StripBox

      public StripBox(String name, Vector3 min, Vector3 max)
      Constructor instantiates a new StripBox object. The minimum and maximum point are provided. These two points define the shape and size of the box, but not it's orientation or position. You should use the setTranslation and setLocalRotation for those attributes.
      Parameters:
      name - the name of the scene element. This is required for identification and comparison purposes.
      min - the minimum point that defines the box.
      max - the maximum point that defines the box.
    • StripBox

      public StripBox(String name, Vector3 center, double xExtent, double yExtent, double zExtent)
      Constructs a new box. The box has the given center and extends in the x, y, and z out from the center (+ and -) by the given amounts. So, for example, a box with extent of .5 would be the unit cube.
      Parameters:
      name - Name of the box.
      center - Center of the box.
      xExtent - x extent of the box, in both directions.
      yExtent - y extent of the box, in both directions.
      zExtent - z extent of the box, in both directions.
  • Method Details

    • setData

      public void setData(Vector3 minPoint, Vector3 maxPoint)
      Changes the data of the box so that the two opposite corners are minPoint and maxPoint. The other corners are created from those two poitns. If update buffers is flagged as true, the vertex/normal/texture/color/index buffers are updated when the data is changed.
      Parameters:
      minPoint - The new minPoint of the box.
      maxPoint - The new maxPoint of the box.
    • setData

      public void setData(Vector3 center, double xExtent, double yExtent, double zExtent)
      Changes the data of the box so that its center is center and it extends in the x, y, and z directions by the given extent. Note that the actual sides will be 2x the given extent values because the box extends in + & - from the center for each extent.
      Parameters:
      center - The center of the box.
      xExtent - x extent of the box, in both directions.
      yExtent - y extent of the box, in both directions.
      zExtent - z extent of the box, in both directions.
    • clone

      public StripBox clone()
      clone creates a new StripBox object containing the same data as this one.
      Overrides:
      clone in class Object
      Returns:
      the new StripBox
    • computeVertices

      public Vector3[] computeVertices()
      Returns:
      a size 8 array of Vectors representing the 8 points of the box.
    • getCenter

      public Vector3 getCenter()
      Returns the current center of the box.
      Returns:
      The box's center.
    • write

      public void write(OutputCapsule capsule) throws IOException
      Specified by:
      write in interface Savable
      Overrides:
      write in class Mesh
      Parameters:
      capsule - the capsule
      Throws:
      IOException - Signals that an I/O exception has occurred.
      See Also:
    • read

      public void read(InputCapsule capsule) throws IOException
      Specified by:
      read in interface Savable
      Overrides:
      read in class Mesh
      Parameters:
      capsule - the input capsule
      Throws:
      IOException - Signals that an I/O exception has occurred.
      See Also: