java.lang.Object
physx.NativeObject
physx.geometry.PxGeometry
physx.geometry.PxCapsuleGeometry
Class representing the geometry of a capsule.
Capsules are shaped as the union of a cylinder of length 2 * halfHeight and with the given radius centered at the origin and extending along the x axis, and two hemispherical ends. Note: The scaling of the capsule is expected to be baked into these values, there is no additional scaling parameter.
The function PxTransformFromSegment is a helper for generating an appropriate transform for the capsule from the capsule's interior line segment.
-
Nested Class Summary
Nested classes/interfaces inherited from class physx.NativeObject
NativeObject.Allocator<T> -
Field Summary
FieldsFields inherited from class physx.NativeObject
address, isExternallyAllocated, SIZEOF_BYTE, SIZEOF_DOUBLE, SIZEOF_FLOAT, SIZEOF_INT, SIZEOF_LONG, SIZEOF_POINTER, SIZEOF_SHORT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPxCapsuleGeometry(float radius, float halfHeight) Constructor, initializes to a capsule with passed radius and half height.protectedPxCapsuleGeometry(long address) -
Method Summary
Modifier and TypeMethodDescriptionstatic PxCapsuleGeometryarrayGet(long baseAddress, int index) static PxCapsuleGeometrycreateAt(long address, float radius, float halfHeight) static <T> PxCapsuleGeometrycreateAt(T allocator, NativeObject.Allocator<T> allocate, float radius, float halfHeight) voiddestroy()floathalf of the capsule's height, measured between the centers of the hemispherical ends.floatThe radius of the capsule.voidsetHalfHeight(float value) half of the capsule's height, measured between the centers of the hemispherical ends.voidsetRadius(float value) The radius of the capsule.static PxCapsuleGeometrywrapPointer(long address) Methods inherited from class physx.geometry.PxGeometry
getTypeMethods inherited from class physx.NativeObject
checkNotNull, equals, getAddress, hashCode
-
Field Details
-
SIZEOF
public static final int SIZEOF -
ALIGNOF
public static final int ALIGNOF- See Also:
-
-
Constructor Details
-
PxCapsuleGeometry
protected PxCapsuleGeometry() -
PxCapsuleGeometry
protected PxCapsuleGeometry(long address) -
PxCapsuleGeometry
public PxCapsuleGeometry(float radius, float halfHeight) Constructor, initializes to a capsule with passed radius and half height.
-
-
Method Details
-
wrapPointer
-
arrayGet
-
createAt
- Parameters:
address- Pre-allocated memory, where the object is created.radius- WebIDL type: floathalfHeight- WebIDL type: float- Returns:
- Stack allocated object of PxCapsuleGeometry
-
createAt
public static <T> PxCapsuleGeometry createAt(T allocator, NativeObject.Allocator<T> allocate, float radius, float halfHeight) - Type Parameters:
T- Allocator class, e.g. LWJGL's MemoryStack.- Parameters:
allocator- Object to use for allocation, e.g. an instance of LWJGL's MemoryStack.allocate- Method to call on allocator to obtain the target address, e.g. MemoryStack::nmalloc.radius- WebIDL type: floathalfHeight- WebIDL type: float- Returns:
- Stack allocated object of PxCapsuleGeometry
-
destroy
public void destroy()- Overrides:
destroyin classPxGeometry
-
getRadius
public float getRadius()The radius of the capsule. -
setRadius
public void setRadius(float value) The radius of the capsule. -
getHalfHeight
public float getHalfHeight()half of the capsule's height, measured between the centers of the hemispherical ends. -
setHalfHeight
public void setHalfHeight(float value) half of the capsule's height, measured between the centers of the hemispherical ends.
-