Package com.github.stephengold.joltjni
Class CapsuleShapeSettings
- All Implemented Interfaces:
ConstConvexShapeSettings
,ConstJoltPhysicsObject
,ConstShapeSettings
,RefTarget
,AutoCloseable
,Comparable<JoltPhysicsObject>
Settings used to construct a
CapsuleShape
.-
Constructor Summary
ConstructorsConstructorDescriptionCapsuleShapeSettings
(float halfHeight, float radius) Instantiate settings for the specified dimensions.CapsuleShapeSettings
(float halfHeight, float radius, PhysicsMaterial material) Instantiate settings for the specified dimensions and material. -
Method Summary
Modifier and TypeMethodDescriptionfloat
Return the half height of the cylindrical portion.float
Return the radius.void
setHalfHeightOfCylinder
(float halfHeight) Alter the half height of the cylindrical portion.void
setRadius
(float radius) Alter the radius.Methods inherited from class com.github.stephengold.joltjni.ConvexShapeSettings
getDensity, getMaterial, setDensity, setMaterial
Methods inherited from class com.github.stephengold.joltjni.ShapeSettings
clearCachedResult, create, getRefCount, setEmbedded, toRef, toRefC
Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, 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
-
Constructor Details
-
CapsuleShapeSettings
public CapsuleShapeSettings(float halfHeight, float radius) Instantiate settings for the specified dimensions.- Parameters:
halfHeight
- half the desired height of the cylindrical portionradius
- the desired radius
-
CapsuleShapeSettings
Instantiate settings for the specified dimensions and material.- Parameters:
halfHeight
- half the desired height of the cylindrical portionradius
- the desired radiusmaterial
- the desired material (default=null)
-
-
Method Details
-
getHalfHeightOfCylinder
public float getHalfHeightOfCylinder()Return the half height of the cylindrical portion. The settings are unaffected. (native attribute: mHalfHeightOfCylinder)- Returns:
- half the height
-
getRadius
public float getRadius()Return the radius. The settings are unaffected. (native attribute: mRadius)- Returns:
- the radius (≥0)
-
setHalfHeightOfCylinder
public void setHalfHeightOfCylinder(float halfHeight) Alter the half height of the cylindrical portion. (native attribute: mHalfHeightOfCylinder)- Parameters:
halfHeight
- one half of the desired height of the cylindrical portion (≥0)
-
setRadius
public void setRadius(float radius) Alter the radius. (native attribute: mRadius)- Parameters:
radius
- the radius (≥0)
-