All Superinterfaces:
Comparable<JoltPhysicsObject>, ConstJoltPhysicsObject
All Known Implementing Classes:
BoxShape, CapsuleShape, CompoundShape, ConvexHullShape, ConvexShape, CylinderShape, DecoratedShape, EmptyShape, HeightFieldShape, MeshShape, MutableCompoundShape, OffsetCenterOfMassShape, PlaneShape, RotatedTranslatedShape, ScaledShape, Shape, ShapeRefC, SoftBodyShape, 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()
      Count the 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
    • drawGetSupportFunction

      void drawGetSupportFunction(DebugRenderer renderer, RMat44Arg comTransform, Vec3Arg scale, ConstColor color, boolean drawSupportDirection)
      Draw the support function with the convex radius added back on. The shape is unaffected.
      Parameters:
      renderer - the renderer to use (not null)
      comTransform - transform to apply (not null, unaffected)
      scale - scaling to apply (not null, unaffected)
      color - the color using for drawing (not null, unaffected)
      drawSupportDirection - the direction to draw
    • 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)
    • getLeafShape

      ConstShape getLeafShape(int subShapeId, int[] storeRemainderId)
      Access the leaf shape for the specified sub-shape ID.
      Parameters:
      subShapeId - an ID that indicates the path to the desired leaf shape (not null, unaffected)
      storeRemainderId - storage for the remainder of the ID after removing the path to the leaf shape (not null, modified)
      Returns:
      a new JVM object with the pre-existing native object assigned, or null if the ID is invalid
    • 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
    • getMaterial

      ConstPhysicsMaterial getMaterial(int subShapeId)
      Access the material of the specified sub-shape. The shape is unaffected.
      Parameters:
      subShapeId - which sub-shape
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getRevisionCount

      long getRevisionCount()
      Return the shape's revision count, which is automatically incremented each time the shape is altered. The shape is unaffected.
      Returns:
      the count
    • getStats

      Stats getStats()
      Copy the statistics. The shape is unaffected.
      Returns:
      a new object
    • getSubShapeIdBitsRecursive

      int getSubShapeIdBitsRecursive()
      Count how many bits are used to address leaf shapes. The shape is unaffected.
      Returns:
      the number of bits (≥0)
    • 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)
    • 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)
    • getWorldSpaceBounds

      AaBox getWorldSpaceBounds(RMat44Arg 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)
    • isValidScale

      boolean isValidScale(Vec3Arg scale)
      Test whether the specified scale vector is valid for wrapping the current shape in a ScaledShape. The current shape is unaffected.
      Parameters:
      scale - the proposed scale vector (not null, unaffected)
      Returns:
      true if valid, otherwise false
    • makeScaleValid

      Vec3 makeScaleValid(Vec3Arg scale)
      Transform the specified scale vector such that it will be valid for wrapping the current shape in a ScaledShape. The current shape is unaffected.
      Parameters:
      scale - the proposed scale vector (not null, unaffected)
      Returns:
      a new scale vector
    • 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
    • saveBinaryState

      void saveBinaryState(StreamOut stream)
      Save the shape to the specified binary stream. The shape is unaffected.
      Parameters:
      stream - the stream to write to (not null)
    • toRefC

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