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.booleanisValidScale(Vec3Arg scale) Test whether the specified scale is valid for the sub-shape.voidsetPositionCom(Vec3Arg location) Alter the center-of-mass location.voidsetRotation(QuatArg rotation) Alter the rotation.voidsetTransform(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, vaMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods 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:
getLocalTransformNoScalein 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:
getPositionComin interfaceConstSubShape- Returns:
- a new vector
-
getRotation
Copy the rotation. The sub-shape is unaffected.- Specified by:
getRotationin interfaceConstSubShape- Returns:
- a new rotation quaternion
-
getShape
Access the child shape. The sub-shape is unaffected. (native field: mShape)- Specified by:
getShapein 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:
isValidScalein interfaceConstSubShape- Parameters:
scale- the scale factors to validate (not null, unaffected)- Returns:
trueif valid, otherwisefalse
-
transformScale
Transform the specified scale to the local space of the child. The sub-shape is unaffected.- Specified by:
transformScalein interfaceConstSubShape- Parameters:
scale- the scale to transform (not null, unaffected)- Returns:
- a new vector
-