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.voidgetPositionCom(Vec3 storeResult) Copy the center-of-mass location.Copy the rotation.voidgetRotation(Quat storeResult) Copy the rotation.getShape()Access the child shape.booleanisValidScale(Vec3Arg scale) Test whether the specified scale is valid for the sub-shape.voidsetPositionCom(float x, float y, float z) Alter the center-of-mass location.voidsetPositionCom(Vec3Arg location) Alter the center-of-mass location.voidsetRotation(float qx, float qy, float qz, float qw) Alter the rotation.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, targetVaOrZero, 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, targetVaOrZero
-
Method Details
-
setPositionCom
public void setPositionCom(float x, float y, float z) Alter the center-of-mass location. (native function: SetPositionCOM)- Parameters:
x- the desired X coordinate of the center of massy- the desired Y coordinate of the center of massz- the desired Z coordinate of the center of mass
-
setPositionCom
Alter the center-of-mass location. (native function: SetPositionCOM)- Parameters:
location- the desired location (notnull, unaffected)
-
setRotation
public void setRotation(float qx, float qy, float qz, float qw) Alter the rotation.- Parameters:
qx- the X component of the desired rotationqy- the Y component of the desired rotationqz- the Z component of the desired rotationqw- the W component of the desired rotation
-
setRotation
Alter the rotation.- Parameters:
rotation- the desired rotation (notnull, unaffected)
-
setTransform
Alter the coordinate transform.- Parameters:
offset- the desired translation (notnull, unaffected)rotation- the desired rotation (notnull, unaffected)centerOfMass- the desired center of mass (notnull, 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
-
getPositionCom
Copy the center-of-mass location. The sub-shape is unaffected. (native function: GetPositionCOM)- Specified by:
getPositionComin interfaceConstSubShape- Parameters:
storeResult- storage for the location (notnull, modified)
-
getRotation
Copy the rotation. The sub-shape is unaffected.- Specified by:
getRotationin interfaceConstSubShape- Returns:
- a new rotation quaternion
-
getRotation
Copy the rotation. The sub-shape is unaffected.- Specified by:
getRotationin interfaceConstSubShape- Parameters:
storeResult- storage for the rotation (notnull, modified)
-
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 (notnull, 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 (notnull, unaffected)- Returns:
- a new vector
-