java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SubShape
- All Implemented Interfaces:
ConstJoltPhysicsObject
,ConstSubShape
,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, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Method Details
-
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)
-
getLocalTransformNoScale
Calculate the local transform for this shape, given the scale of the child. The sub-shape is unaffected.- Specified by:
getLocalTransformNoScale
in interfaceConstSubShape
- 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)- Specified by:
getPositionCom
in interfaceConstSubShape
- Returns:
- a new vector
-
getRotation
Copy the rotation. The sub-shape is unaffected.- Specified by:
getRotation
in interfaceConstSubShape
- Returns:
- a new rotation quaternion
-
getShape
Access the child shape. The sub-shape is unaffected. (native field: mShape)- Specified by:
getShape
in interfaceConstSubShape
- 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.- Specified by:
isValidScale
in interfaceConstSubShape
- Parameters:
scale
- the scale factors to validate (not null, unaffected)- Returns:
true
if valid, otherwisefalse
-
transformScale
Transform the specified scale to the local space of the child. The sub-shape is unaffected.- Specified by:
transformScale
in interfaceConstSubShape
- Parameters:
scale
- the scale to transform (not null, unaffected)- Returns:
- a new vector
-