All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>

public class SubShape extends JoltPhysicsObject
An element of a compound shape. (native type: CompoundShape::SubShape)
  • Method Details

    • getLocalTransformNoScale

      public Mat44 getLocalTransformNoScale(Vec3Arg scale)
      Calculate the local transform for this shape, given the scale of the child. The sub-shape is unaffected.
      Parameters:
      scale - the scale of the child in the local space of this shape (not null, unaffected)
      Returns:
      a new transform matrix
    • getPositionCom

      public Vec3 getPositionCom()
      Copy the center-of-mass location. The sub-shape is unaffected. (native function: GetPositionCOM)
      Returns:
      a new vector
    • getRotation

      public Quat getRotation()
      Copy the rotation. The sub-shape is unaffected.
      Returns:
      a new rotation quaternion
    • getShape

      public ConstShape getShape()
      Access the child shape. The sub-shape is unaffected.
      Returns:
      a new JVM object with the pre-existing native object assigned
    • isValidScale

      public boolean isValidScale(Vec3Arg scale)
      Test whether the specified scale is valid for the sub-shape. The sub-shape is unaffected.
      Parameters:
      scale - the scale factors to validate (not null, unaffected)
      Returns:
      true if valid, otherwise false
    • setPositionCom

      public void setPositionCom(Vec3Arg location)
      Alter the center-of-mass location. (native function: SetPositionCOM)
      Parameters:
      location - the desired location (not null, unaffected)
    • setRotation

      public void setRotation(QuatArg rotation)
      Alter the rotation.
      Parameters:
      rotation - the desired rotation (not null, unaffected)
    • setTransform

      public void setTransform(Vec3Arg offset, QuatArg rotation, Vec3Arg centerOfMass)
      Alter the coordinate transform.
      Parameters:
      offset - the desired translation (not null, unaffected)
      rotation - the desired rotation (not null, unaffected)
      centerOfMass - the desired center of mass (not null, unaffected)
    • transformScale

      public Vec3 transformScale(Vec3Arg scale)
      Transform the specified scale to the local space of the child.
      Parameters:
      scale - the scale to transform (not null, unaffected)
      Returns:
      a new vector