Class BoxShapeSettings

All Implemented Interfaces:
ConstConvexShapeSettings, ConstJoltPhysicsObject, ConstShapeSettings, RefTarget, AutoCloseable, Comparable<JoltPhysicsObject>

public class BoxShapeSettings extends ConvexShapeSettings
Settings used to construct a BoxShape.
  • Constructor Details

    • BoxShapeSettings

      public BoxShapeSettings(float xHalfExtent, float yHalfExtent, float zHalfExtent)
      Instantiate a shape with the specified half extents.
      Parameters:
      xHalfExtent - the desired half extents on the local X axis (≥0.05)
      yHalfExtent - the desired half extents on the local Y axis (≥0.05)
      zHalfExtent - the desired half extents on the local Z axis (≥0.05)
    • BoxShapeSettings

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

      public BoxShapeSettings(Vec3Arg halfExtents, float convexRadius)
      Instantiate settings for 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 (≥0, default=0.05)
    • BoxShapeSettings

      public BoxShapeSettings(Vec3Arg halfExtents, float convexRadius, ConstPhysicsMaterial material)
      Instantiate settings for the specified half extents, convex radius, and material.
      Parameters:
      halfExtents - the desired half extents on each local axis (not null, all components ≥0, unaffected)
      convexRadius - the desired convex radius (≥0, default=0.05)
      material - the desired surface properties (not null, unaffected) or null for default properties (default=null)
  • Method Details

    • getConvexRadius

      public float getConvexRadius()
      Return the convex radius. The settings are unaffected. (native attribute: mConvexRadius)
      Returns:
      the convex radius (≥0)
    • getHalfExtent

      public Vec3 getHalfExtent()
      Copy the extent of the box. The settings are unaffected. (native attribute: mHalfExtent)
      Returns:
      a new vector: one-half of extent on each local axis
    • setConvexRadius

      public void setConvexRadius(float radius)
      Alter the convex radius. (native attribute: mConvexRadius)
      Parameters:
      radius - the desired convex radius (≥0, default=0.05)
    • setHalfExtent

      public void setHalfExtent(Vec3Arg halfExtents)
      Alter the extent of the box. (native attribute: mHalfExtent)
      Parameters:
      halfExtents - the desired half extents on each local axis (not null, all components ≥0, unaffected, default=(0,0,0))