Class BoxShape

All Implemented Interfaces:
ConstJoltPhysicsObject, ConstShape, RefTarget, AutoCloseable, Comparable<ConstJoltPhysicsObject>

public class BoxShape extends ConvexShape
A Shape to represent centered, axis-aligned rectangular solids.
  • Constructor Details

    • BoxShape

      public BoxShape(Vec3Arg halfExtents)
      Instantiate a shape with the specified half extents.
      Parameters:
      halfExtents - the desired half extents on each local axis (not null, all components ≥0, unaffected)
    • BoxShape

      public BoxShape(Vec3Arg halfExtents, float convexRadius)
      Instantiate a shape with the specified half extents and convex radius.
      Parameters:
      halfExtents - the desired half extents on each local axis (not null, all components ≥0, unaffected)
      convexRadius - the desired convex radius (default=0.05)
  • Method Details

    • getConvexRadius

      public float getConvexRadius()
      Return the convex radius. The shape is unaffected.
      Returns:
      the radius (≥0)
    • getHalfExtent

      public Vec3 getHalfExtent()
      Copy the half extents. The shape is unaffected.
      Returns:
      a new vector