java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.Shape
com.github.stephengold.joltjni.ConvexShape
- All Implemented Interfaces:
ConstConvexShape
,ConstJoltPhysicsObject
,ConstShape
,RefTarget
,AutoCloseable
,Comparable<JoltPhysicsObject>
- Direct Known Subclasses:
BoxShape
,CapsuleShape
,ConvexHullShape
,CylinderShape
,SphereShape
,TaperedCapsuleShape
,TaperedCylinderShape
,TriangleShape
A type of
Shape
that inherently possesses the convex property.-
Method Summary
Modifier and TypeMethodDescriptionfloat
Return the density.void
getSubmergedVolume
(Mat44Arg comTransform, Vec3Arg scale, ConstPlane surface, float[] storeTotalVolume, float[] storeSubmergedVolume, Vec3 storeCenterOfBuoyancy, RVec3Arg baseOffset) Calculate the shape's volume, submerged volume, and center of buoyancy.getSupportFunction
(ESupportMode supportMode, SupportBuffer buffer, Vec3Arg scale) Generate a support function for the shape.void
setDensity
(float density) Alter the density.Methods inherited from class com.github.stephengold.joltjni.Shape
copyDebugTriangles, countDebugTriangles, draw, drawGetSupportFunction, getCenterOfMass, getInnerRadius, getLeafShape, getLocalBounds, getMassProperties, getMaterial, getRefCount, getRevisionCount, getStats, getSubShapeIdBitsRecursive, getSubType, getType, getWorldSpaceBounds, getWorldSpaceBounds, isValidScale, makeScaleValid, mustBeStatic, saveBinaryState, scaleShape, setEmbedded, setVirtualAddressAsCoOwner, sRestoreFromBinaryState, toRef, toRefC
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
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstShape
copyDebugTriangles, countDebugTriangles, draw, drawGetSupportFunction, getCenterOfMass, getInnerRadius, getLeafShape, getLocalBounds, getMassProperties, getMaterial, getRefCount, getRevisionCount, getStats, getSubShapeIdBitsRecursive, getSubType, getType, getWorldSpaceBounds, getWorldSpaceBounds, isValidScale, makeScaleValid, mustBeStatic, saveBinaryState, scaleShape, toRefC
-
Method Details
-
setDensity
public void setDensity(float density) Alter the density.- Parameters:
density
- the desired density
-
getDensity
public float getDensity()Return the density.- Specified by:
getDensity
in interfaceConstConvexShape
- Returns:
- the density
-
getSubmergedVolume
public void getSubmergedVolume(Mat44Arg comTransform, Vec3Arg scale, ConstPlane surface, float[] storeTotalVolume, float[] storeSubmergedVolume, Vec3 storeCenterOfBuoyancy, RVec3Arg baseOffset) Calculate the shape's volume, submerged volume, and center of buoyancy.- Specified by:
getSubmergedVolume
in interfaceConstConvexShape
- Parameters:
comTransform
- the local-to-system transform (not null, unaffected)scale
- the scale vector (not null, unaffected)surface
- the boundary of the submerged region (not null, unaffected)storeTotalVolume
- storage for the total volume, ornull
storeSubmergedVolume
- storage for the submerged volume, ornull
storeCenterOfBuoyancy
- storage for the center of buoyancy, ornull
baseOffset
- the base offset to use (ignored if the native library doesn't implement debug rendering)
-
getSupportFunction
Generate a support function for the shape.- Specified by:
getSupportFunction
in interfaceConstConvexShape
- Parameters:
supportMode
- how to handle convex radius (not null)buffer
- buffer storage (not null)scale
- scale factors to apply (in local coordinates, not null, unaffected)- Returns:
- a new JVM object with the pre-existing native object assigned
-