Class ConvexShape

All Implemented Interfaces:
Comparable<NativePhysicsObject>
Direct Known Subclasses:
Box2dShape, BoxCollisionShape, CapsuleCollisionShape, ConeCollisionShape, ConicalFrustum, Convex2dShape, CustomConvexShape, CylinderCollisionShape, HullCollisionShape, MinkowskiSum, MultiSphere, SimplexCollisionShape, SphereCollisionShape, SphericalSegment

public abstract class ConvexShape extends CollisionShape
The abstract base class for convex collision shapes based on Bullet's btConvexShape.

Subclasses include BoxCollisionShape and CapsuleCollisionShape.

  • Field Details

    • loggerX

      public static final Logger loggerX
      message logger for this class
  • Constructor Details

    • ConvexShape

      protected ConvexShape()
      Instantiate a collision shape with no tracker and no assigned native object.

      This no-arg constructor was made explicit to avoid javadoc warnings from JDK 18+.

  • Method Details

    • toHullShape

      public HullCollisionShape toHullShape()
      Approximate this shape with a HullCollisionShape. Meant to be overridden.
      Returns:
      a new shape
    • isConcave

      public boolean isConcave()
      Test whether this shape has concave type. In Bullet, "concave" is a property of types of shapes. Specific instances of those types might actually be "convex" in the mathematical sense of the word.
      Overrides:
      isConcave in class CollisionShape
      Returns:
      false
    • isConvex

      public boolean isConvex()
      Test whether this shape has convex type. In Bullet, "convex" is a property of types of shapes. Specific instances of non-convex types might still be "convex" in the mathematical sense of the word.
      Overrides:
      isConvex in class CollisionShape
      Returns:
      true
    • scaledVolume

      public float scaledVolume()
      Estimate the volume of this shape, including scale and margin.
      Overrides:
      scaledVolume in class CollisionShape
      Returns:
      the volume (in physics-space units cubed, ≥0)
    • toSplittableShape

      public CollisionShape toSplittableShape()
      Approximate this shape with a splittable shape.
      Overrides:
      toSplittableShape in class CollisionShape
      Returns:
      a new splittable shape