Class PxGeometryQuery

java.lang.Object
physx.NativeObject
physx.geometry.PxGeometryQuery

public class PxGeometryQuery extends NativeObject
Collection of geometry object queries (sweeps, raycasts, overlaps, ...).
  • Field Details

    • SIZEOF

      public static final int SIZEOF
    • ALIGNOF

      public static final int ALIGNOF
      See Also:
  • Constructor Details

    • PxGeometryQuery

      protected PxGeometryQuery()
    • PxGeometryQuery

      protected PxGeometryQuery(long address)
  • Method Details

    • wrapPointer

      public static PxGeometryQuery wrapPointer(long address)
    • arrayGet

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

      public void destroy()
    • sweep

      public static boolean sweep(PxVec3 unitDir, float maxDist, PxGeometry geom0, PxTransform pose0, PxGeometry geom1, PxTransform pose1, PxSweepHit sweepHit)
      Sweep a specified geometry object in space and test for collision with a given object.

      The following combinations are supported.

      \li PxSphereGeometry vs. {PxSphereGeometry, PxPlaneGeometry, PxCapsuleGeometry, PxBoxGeometry, PxConvexMeshGeometry, PxTriangleMeshGeometry, PxHeightFieldGeometry} \li PxCapsuleGeometry vs. {PxSphereGeometry, PxPlaneGeometry, PxCapsuleGeometry, PxBoxGeometry, PxConvexMeshGeometry, PxTriangleMeshGeometry, PxHeightFieldGeometry} \li PxBoxGeometry vs. {PxSphereGeometry, PxPlaneGeometry, PxCapsuleGeometry, PxBoxGeometry, PxConvexMeshGeometry, PxTriangleMeshGeometry, PxHeightFieldGeometry} \li PxConvexMeshGeometry vs. {PxSphereGeometry, PxPlaneGeometry, PxCapsuleGeometry, PxBoxGeometry, PxConvexMeshGeometry, PxTriangleMeshGeometry, PxHeightFieldGeometry}

      Parameters:
      unitDir - Normalized direction along which object geom0 should be swept
      maxDist - Maximum sweep distance, has to be in the [0, inf) range
      geom0 - The geometry object to sweep. Supported geometries are #PxSphereGeometry, #PxCapsuleGeometry, #PxBoxGeometry and #PxConvexMeshGeometry
      pose0 - Pose of the geometry object to sweep
      geom1 - The geometry object to test the sweep against
      pose1 - Pose of the geometry object to sweep against
      sweepHit - The sweep hit information. Only valid if this method returns true.
      Returns:
      True if the swept geometry object geom0 hits the object geom1
      See Also:
    • sweep

      public static boolean sweep(PxVec3 unitDir, float maxDist, PxGeometry geom0, PxTransform pose0, PxGeometry geom1, PxTransform pose1, PxSweepHit sweepHit, PxHitFlags hitFlags)
      Sweep a specified geometry object in space and test for collision with a given object.

      The following combinations are supported.

      \li PxSphereGeometry vs. {PxSphereGeometry, PxPlaneGeometry, PxCapsuleGeometry, PxBoxGeometry, PxConvexMeshGeometry, PxTriangleMeshGeometry, PxHeightFieldGeometry} \li PxCapsuleGeometry vs. {PxSphereGeometry, PxPlaneGeometry, PxCapsuleGeometry, PxBoxGeometry, PxConvexMeshGeometry, PxTriangleMeshGeometry, PxHeightFieldGeometry} \li PxBoxGeometry vs. {PxSphereGeometry, PxPlaneGeometry, PxCapsuleGeometry, PxBoxGeometry, PxConvexMeshGeometry, PxTriangleMeshGeometry, PxHeightFieldGeometry} \li PxConvexMeshGeometry vs. {PxSphereGeometry, PxPlaneGeometry, PxCapsuleGeometry, PxBoxGeometry, PxConvexMeshGeometry, PxTriangleMeshGeometry, PxHeightFieldGeometry}

      Parameters:
      unitDir - Normalized direction along which object geom0 should be swept
      maxDist - Maximum sweep distance, has to be in the [0, inf) range
      geom0 - The geometry object to sweep. Supported geometries are #PxSphereGeometry, #PxCapsuleGeometry, #PxBoxGeometry and #PxConvexMeshGeometry
      pose0 - Pose of the geometry object to sweep
      geom1 - The geometry object to test the sweep against
      pose1 - Pose of the geometry object to sweep against
      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 geom0 hits the object geom1
      See Also:
    • sweep

      public static boolean sweep(PxVec3 unitDir, float maxDist, PxGeometry geom0, PxTransform pose0, PxGeometry geom1, PxTransform pose1, PxSweepHit sweepHit, PxHitFlags hitFlags, float inflation)
      Sweep a specified geometry object in space and test for collision with a given object.

      The following combinations are supported.

      \li PxSphereGeometry vs. {PxSphereGeometry, PxPlaneGeometry, PxCapsuleGeometry, PxBoxGeometry, PxConvexMeshGeometry, PxTriangleMeshGeometry, PxHeightFieldGeometry} \li PxCapsuleGeometry vs. {PxSphereGeometry, PxPlaneGeometry, PxCapsuleGeometry, PxBoxGeometry, PxConvexMeshGeometry, PxTriangleMeshGeometry, PxHeightFieldGeometry} \li PxBoxGeometry vs. {PxSphereGeometry, PxPlaneGeometry, PxCapsuleGeometry, PxBoxGeometry, PxConvexMeshGeometry, PxTriangleMeshGeometry, PxHeightFieldGeometry} \li PxConvexMeshGeometry vs. {PxSphereGeometry, PxPlaneGeometry, PxCapsuleGeometry, PxBoxGeometry, PxConvexMeshGeometry, PxTriangleMeshGeometry, PxHeightFieldGeometry}

      Parameters:
      unitDir - Normalized direction along which object geom0 should be swept
      maxDist - Maximum sweep distance, has to be in the [0, inf) range
      geom0 - The geometry object to sweep. Supported geometries are #PxSphereGeometry, #PxCapsuleGeometry, #PxBoxGeometry and #PxConvexMeshGeometry
      pose0 - Pose of the geometry object to sweep
      geom1 - The geometry object to test the sweep against
      pose1 - Pose of the geometry object to sweep against
      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
      inflation - Surface of the swept shape is additively extruded in the normal direction, rounding corners and edges.
      Returns:
      True if the swept geometry object geom0 hits the object geom1
      See Also:
    • overlap

      public static boolean overlap(PxGeometry geom0, PxTransform pose0, PxGeometry geom1, PxTransform pose1)
      Overlap test for two geometry objects.

      All combinations are supported except: \li PxPlaneGeometry vs. {PxPlaneGeometry, PxTriangleMeshGeometry, PxHeightFieldGeometry} \li PxTriangleMeshGeometry vs. PxHeightFieldGeometry \li PxHeightFieldGeometry vs. PxHeightFieldGeometry \li Anything involving PxParticleSystemGeometry, PxTetrahedronMeshGeometry or PxHairSystemGeometry.

      Parameters:
      geom0 - The first geometry object
      pose0 - Pose of the first geometry object
      geom1 - The second geometry object
      pose1 - Pose of the second geometry object
      Returns:
      True if the two geometry objects overlap
      See Also:
    • raycast

      @Deprecated public static int raycast(PxVec3 origin, PxVec3 unitDir, PxGeometry geom, PxTransform pose, float maxDist, PxHitFlags hitFlags, int maxHits, PxRaycastHit rayHits)
      Deprecated.
      * @brief Backward compatibility helper * @deprecated
    • pointDistance

      public static float pointDistance(PxVec3 point, PxGeometry geom, PxTransform pose)
      Computes distance between a point and a geometry object.

      Currently supported geometry objects: box, sphere, capsule, convex, mesh.

      Note: For meshes, only the BVH34 midphase data-structure is supported.

      Parameters:
      point - The point P
      geom - The geometry object
      pose - Pose of the geometry object
      Returns:
      Square distance between the point and the geom object, or 0.0 if the point is inside the object, or -1.0 if an error occured (geometry type is not supported, or invalid pose)
      See Also:
    • pointDistance

      public static float pointDistance(PxVec3 point, PxGeometry geom, PxTransform pose, PxVec3 closestPoint)
      Computes distance between a point and a geometry object.

      Currently supported geometry objects: box, sphere, capsule, convex, mesh.

      Note: For meshes, only the BVH34 midphase data-structure is supported.

      Parameters:
      point - The point P
      geom - The geometry object
      pose - Pose of the geometry object
      closestPoint - Optionally returned closest point to P on the geom object. Only valid when returned distance is strictly positive.
      Returns:
      Square distance between the point and the geom object, or 0.0 if the point is inside the object, or -1.0 if an error occured (geometry type is not supported, or invalid pose)
      See Also:
    • getWorldBounds

      @Deprecated public static PxBounds3 getWorldBounds(PxGeometry geom, PxTransform pose)
      Deprecated.
      get the bounds for a geometry object
      Parameters:
      geom - The geometry object
      pose - Pose of the geometry object
      Returns:
      The bounds of the object
      See Also:
    • getWorldBounds

      @Deprecated public static PxBounds3 getWorldBounds(PxGeometry geom, PxTransform pose, float inflation)
      Deprecated.
      get the bounds for a geometry object
      Parameters:
      geom - The geometry object
      pose - Pose of the geometry object
      inflation - Scale factor for computed world bounds. Box extents are multiplied by this value.
      Returns:
      The bounds of the object
      See Also:
    • isValid

      public static boolean isValid(PxGeometry geom)
      Checks if provided geometry is valid.
      Parameters:
      geom - The geometry object.
      Returns:
      True if geometry is valid.
      See Also: