java.lang.Object
physx.NativeObject
physx.physics.PxShapeExt
utility functions for use with PxShape
- See Also:
-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PxShapeExtarrayGet(long baseAddress, int index) voiddestroy()static PxTransformgetGlobalPose(PxShape shape, PxRigidActor actor) Retrieves the world space pose of the shape.static PxBounds3getWorldBounds(PxShape shape, PxRigidActor actor) Retrieves the axis aligned bounding box enclosing the shape.static PxBounds3getWorldBounds(PxShape shape, PxRigidActor actor, float inflation) Retrieves the axis aligned bounding box enclosing the shape.static booleanoverlap(PxShape shape, PxRigidActor actor, PxGeometry otherGeom, PxTransform otherGeomPose) Test overlap between the shape and a geometry objectstatic intraycast(PxShape shape, PxRigidActor actor, PxVec3 rayOrigin, PxVec3 rayDir, float maxDist, PxHitFlags hitFlags, int maxHits, PxRaycastHit rayHits) Raycast test against the shape.static booleansweep(PxShape shape, PxRigidActor actor, PxVec3 unitDir, float distance, PxGeometry otherGeom, PxTransform otherGeomPose, PxSweepHit sweepHit, PxHitFlags hitFlags) Sweep a geometry object against the shape.static PxShapeExtwrapPointer(long address) Methods 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
-
PxShapeExt
protected PxShapeExt() -
PxShapeExt
protected PxShapeExt(long address)
-
-
Method Details
-
wrapPointer
-
arrayGet
-
destroy
public void destroy() -
getGlobalPose
Retrieves the world space pose of the shape.- Parameters:
shape- The shape for which to get the global pose.actor- The actor to which the shape is attached- Returns:
- Global pose of shape.
-
raycast
public static int raycast(PxShape shape, PxRigidActor actor, PxVec3 rayOrigin, PxVec3 rayDir, float maxDist, PxHitFlags hitFlags, int maxHits, PxRaycastHit rayHits) Raycast test against the shape.- Parameters:
shape- the shapeactor- the actor to which the shape is attachedrayOrigin- The origin of the ray to test the geometry object againstrayDir- The direction of the ray to test the geometry object againstmaxDist- Maximum ray lengthhitFlags- Specify which properties per hit should be computed and written to result hit array. Combination of #PxHitFlag flagsmaxHits- max number of returned hits = size of 'rayHits' bufferrayHits- Raycast hits information- Returns:
- Number of hits between the ray and the shape
- See Also:
-
overlap
public static boolean overlap(PxShape shape, PxRigidActor actor, PxGeometry otherGeom, PxTransform otherGeomPose) Test overlap between the shape and a geometry object- Parameters:
shape- the shapeactor- the actor to which the shape is attachedotherGeom- The other geometry object to test overlap withotherGeomPose- Pose of the other geometry object- Returns:
- True if the shape overlaps the geometry object
- See Also:
-
sweep
public static boolean sweep(PxShape shape, PxRigidActor actor, PxVec3 unitDir, float distance, PxGeometry otherGeom, PxTransform otherGeomPose, PxSweepHit sweepHit, PxHitFlags hitFlags) Sweep a geometry object against the shape.Currently only box, sphere, capsule and convex mesh shapes are supported, i.e. the swept geometry object must be one of those types.
- Parameters:
shape- the shapeactor- the actor to which the shape is attachedunitDir- Normalized direction along which the geometry object should be swept.distance- Sweep distance. Needs to be larger than 0.otherGeom- The geometry object to sweep against the shapeotherGeomPose- Pose of the geometry objectsweepHit- The sweep hit information. Only valid if this method returns true.hitFlags- Specify which properties per hit should be computed and written to result hit array. Combination of #PxHitFlag flags- Returns:
- True if the swept geometry object hits the shape
- See Also:
-
getWorldBounds
Retrieves the axis aligned bounding box enclosing the shape.- Parameters:
shape- the shapeactor- the actor to which the shape is attached- Returns:
- The shape's bounding box.
- See Also:
-
getWorldBounds
Retrieves the axis aligned bounding box enclosing the shape.- Parameters:
shape- the shapeactor- the actor to which the shape is attachedinflation- Scale factor for computed world bounds. Box extents are multiplied by this value.- Returns:
- The shape's bounding box.
- See Also:
-