Interface ConstShape

All Superinterfaces:
Comparable<ConstJoltPhysicsObject>, ConstJoltPhysicsObject
All Known Implementing Classes:
BoxShape, CapsuleShape, CompoundShape, ConvexHullShape, ConvexShape, CylinderShape, DecoratedShape, EmptyShape, HeightFieldShape, MeshShape, MutableCompoundShape, OffsetCenterOfMassShape, PlaneShape, RotatedTranslatedShape, ScaledShape, Shape, ShapeRefC, SphereShape, StaticCompoundShape, TaperedCapsuleShape, TaperedCylinderShape, TriangleShape

public interface ConstShape extends ConstJoltPhysicsObject
Read-only access to a Shape. (native type: const Shape)
  • Method Details

    • copyDebugTriangles

      void copyDebugTriangles(FloatBuffer storeBuffer)
      Copy the vertex coordinates of the shape's debug mesh to the specified buffer. The shape is unaffected.
      Parameters:
      storeBuffer - the buffer to fill with vertex coordinates (not null, modified)
    • countDebugTriangles

      int countDebugTriangles()
      Return the number of triangles in the shape's debug mesh. The shape is unaffected.
      Returns:
      the count (>0)
    • draw

      void draw(DebugRenderer renderer, RMat44Arg comTransform, Vec3Arg scale, ConstColor color, boolean useMaterialColors, boolean wireframe)
      Draw the shape using the specified renderer. The shape is unaffected.
      Parameters:
      renderer - the renderer to use (not null)
      comTransform - the coordinate transform from the shape's center of mass to system coordinates (not null, unaffected)
      scale - the desired scaling (not null, unaffected)
      color - the desired color if useMaterialColors is false (not null, unaffected)
      useMaterialColors - true to use the color in the shape's material
      wireframe - true to draw a wire frame, false for solid triangles
    • getCenterOfMass

      Vec3 getCenterOfMass()
      Locate the shape's center of mass. The shape is unaffected.
      Returns:
      a new location vector
    • getInnerRadius

      float getInnerRadius()
      Return the radius of the largest sphere that fits inside the shape. The shape is unaffected.
      Returns:
      the radius (≥0)
    • getLocalBounds

      AaBox getLocalBounds()
      Return a bounding box that includes the convex radius. The shape is unaffected.
      Returns:
      a new, mutable box (relative to the shape's center of mass)
    • getMassProperties

      MassProperties getMassProperties()
      Copy the shape's mass properties. The shape is unaffected.
      Returns:
      a new, mutable properties object
    • getSubType

      EShapeSubType getSubType()
      Return the shape's subtype. The shape is unaffected.
      Returns:
      an enum value (not null)
    • getType

      EShapeType getType()
      Return the shape's type. The shape is unaffected.
      Returns:
      an enum value (not null)
    • getUserData

      long getUserData()
      Return the shape's user data: can be used for anything. The shape is unaffected.
      Returns:
      the value
    • getWorldSpaceBounds

      AaBox getWorldSpaceBounds(Mat44Arg comTransform, Vec3Arg scale)
      Return the bounding box including convex radius. The shape is unaffected.
      Parameters:
      comTransform - the center-of-mass transform to apply to the shape (not null, unaffected)
      scale - the scale factors to apply to the shape (not null, unaffected)
      Returns:
      a new, mutable box (in system coordinates)
    • mustBeStatic

      boolean mustBeStatic()
      Test whether the shape can be used in a dynamic/kinematic body. The shape is unaffected.
      Returns:
      true if it can be only be static, otherwise false
    • toRefC

      ShapeRefC toRefC()
      Create a counted reference to the native Shape.
      Returns:
      a new JVM object with a new native object assigned