Package physx.physics

Class PxShapeExt

java.lang.Object
physx.NativeObject
physx.physics.PxShapeExt

public class PxShapeExt extends NativeObject
utility functions for use with PxShape
See Also:
  • 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

      public static PxShapeExt wrapPointer(long address)
    • arrayGet

      public static PxShapeExt arrayGet(long baseAddress, int index)
    • destroy

      public void destroy()
    • getGlobalPose

      public static PxTransform getGlobalPose(PxShape shape, PxRigidActor actor)
      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 shape
      actor - the actor to which the shape is attached
      rayOrigin - The origin of the ray to test the geometry object against
      rayDir - The direction of the ray to test the geometry object against
      maxDist - Maximum ray length
      hitFlags - Specify which properties per hit should be computed and written to result hit array. Combination of #PxHitFlag flags
      maxHits - max number of returned hits = size of 'rayHits' buffer
      rayHits - 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 shape
      actor - the actor to which the shape is attached
      otherGeom - The other geometry object to test overlap with
      otherGeomPose - 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 shape
      actor - the actor to which the shape is attached
      unitDir - 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 shape
      otherGeomPose - Pose of the geometry object
      sweepHit - 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

      public static PxBounds3 getWorldBounds(PxShape shape, PxRigidActor actor)
      Retrieves the axis aligned bounding box enclosing the shape.
      Parameters:
      shape - the shape
      actor - the actor to which the shape is attached
      Returns:
      The shape's bounding box.
      See Also:
    • getWorldBounds

      public static PxBounds3 getWorldBounds(PxShape shape, PxRigidActor actor, float inflation)
      Retrieves the axis aligned bounding box enclosing the shape.
      Parameters:
      shape - the shape
      actor - the actor to which the shape is attached
      inflation - Scale factor for computed world bounds. Box extents are multiplied by this value.
      Returns:
      The shape's bounding box.
      See Also: