java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SubShape
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
An element of a compound shape. (native type:
CompoundShape::SubShape
)-
Method Summary
Modifier and TypeMethodDescriptiongetLocalTransformNoScale
(Vec3Arg scale) Calculate the local transform for this shape, given the scale of the child.Copy the center-of-mass location.Copy the rotation.getShape()
Access the child shape.boolean
isValidScale
(Vec3Arg scale) Test whether the specified scale is valid for the sub-shape.void
setPositionCom
(Vec3Arg location) Alter the center-of-mass location.void
setRotation
(QuatArg rotation) Alter the rotation.void
setTransform
(Vec3Arg offset, QuatArg rotation, Vec3Arg centerOfMass) Alter the coordinate transform.transformScale
(Vec3Arg scale) Transform the specified scale to the local space of the child.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Method Details
-
getLocalTransformNoScale
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
Copy the center-of-mass location. The sub-shape is unaffected. (native function: GetPositionCOM)- Returns:
- a new vector
-
getRotation
Copy the rotation. The sub-shape is unaffected.- Returns:
- a new rotation quaternion
-
getShape
Access the child shape. The sub-shape is unaffected.- Returns:
- a new JVM object with the pre-existing native object assigned
-
isValidScale
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, otherwisefalse
-
setPositionCom
Alter the center-of-mass location. (native function: SetPositionCOM)- Parameters:
location
- the desired location (not null, unaffected)
-
setRotation
Alter the rotation.- Parameters:
rotation
- the desired rotation (not null, unaffected)
-
setTransform
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
Transform the specified scale to the local space of the child.- Parameters:
scale
- the scale to transform (not null, unaffected)- Returns:
- a new vector
-