java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.Shape
com.github.stephengold.joltjni.ConvexShape
com.github.stephengold.joltjni.CapsuleShape
- All Implemented Interfaces:
ConstConvexShape,ConstJoltPhysicsObject,ConstShape,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
A
Shape to represent a Y-axis right circular cylinder capped by 2
hemispheres.-
Constructor Summary
ConstructorsConstructorDescriptionCapsuleShape(float halfHeight, float radius) Instantiate a shape with the specified dimensions. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturn the half height of the cylindrical portion.floatReturn the radius.Methods inherited from class com.github.stephengold.joltjni.ConvexShape
getDensity, getSubmergedVolume, getSupportFunction, setDensityMethods 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, toRefCMethods 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, targetVaMethods 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
-
Constructor Details
-
CapsuleShape
public CapsuleShape(float halfHeight, float radius) Instantiate a shape with the specified dimensions.- Parameters:
halfHeight- half the desired height of the cylindrical portionradius- the desired radius
-
-
Method Details
-
getHalfHeightOfCylinder
public float getHalfHeightOfCylinder()Return the half height of the cylindrical portion. The shape is unaffected.- Returns:
- 1/2 of the height (≥0)
-
getRadius
public float getRadius()Return the radius. The shape is unaffected.- Returns:
- the radius (≥0)
-