- Direct Known Subclasses:
PxSceneSQSystem
Methods defined here are common to both the traditional PxScene API and the PxSceneQuerySystem API.
- 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 PxSceneQuerySystemBasearrayGet(long baseAddress, int index) voidFlushes any changes to the scene query representation.voidforceRebuildDynamicTree(int prunerIndex) Forces dynamic trees to be immediately rebuilt.intRetrieves the rebuild rate of the dynamic tree pruning structures.intRetrieves the system's internal scene query timestamp, increased each time a change to the static scene query structure is performed.Gets scene query update modebooleanoverlap(PxGeometry geometry, PxTransform pose, PxOverlapCallback hitCall) Performs an overlap test of a given geometry against objects in the scene, returns results in a PxOverlapBuffer object or via a custom user callback implementation inheriting from PxOverlapCallback.booleanoverlap(PxGeometry geometry, PxTransform pose, PxOverlapCallback hitCall, PxQueryFilterData filterData) Performs an overlap test of a given geometry against objects in the scene, returns results in a PxOverlapBuffer object or via a custom user callback implementation inheriting from PxOverlapCallback.booleanraycast(PxVec3 origin, PxVec3 unitDir, float distance, PxRaycastCallback hitCall) Performs a raycast against objects in the scene, returns results in a PxRaycastBuffer object or via a custom user callback implementation inheriting from PxRaycastCallback.booleanraycast(PxVec3 origin, PxVec3 unitDir, float distance, PxRaycastCallback hitCall, PxHitFlags hitFlags) Performs a raycast against objects in the scene, returns results in a PxRaycastBuffer object or via a custom user callback implementation inheriting from PxRaycastCallback.booleanraycast(PxVec3 origin, PxVec3 unitDir, float distance, PxRaycastCallback hitCall, PxHitFlags hitFlags, PxQueryFilterData filterData) Performs a raycast against objects in the scene, returns results in a PxRaycastBuffer object or via a custom user callback implementation inheriting from PxRaycastCallback.voidsetDynamicTreeRebuildRateHint(int dynamicTreeRebuildRateHint) Sets the rebuild rate of the dynamic tree pruning structures.voidsetUpdateMode(PxSceneQueryUpdateModeEnum updateMode) Sets scene query update modebooleansweep(PxGeometry geometry, PxTransform pose, PxVec3 unitDir, float distance, PxSweepCallback hitCall) Performs a sweep test against objects in the scene, returns results in a PxSweepBuffer object or via a custom user callback implementation inheriting from PxSweepCallback.booleansweep(PxGeometry geometry, PxTransform pose, PxVec3 unitDir, float distance, PxSweepCallback hitCall, PxHitFlags hitFlags) Performs a sweep test against objects in the scene, returns results in a PxSweepBuffer object or via a custom user callback implementation inheriting from PxSweepCallback.booleansweep(PxGeometry geometry, PxTransform pose, PxVec3 unitDir, float distance, PxSweepCallback hitCall, PxHitFlags hitFlags, PxQueryFilterData filterData) Performs a sweep test against objects in the scene, returns results in a PxSweepBuffer object or via a custom user callback implementation inheriting from PxSweepCallback.static PxSceneQuerySystemBasewrapPointer(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
-
PxSceneQuerySystemBase
protected PxSceneQuerySystemBase() -
PxSceneQuerySystemBase
protected PxSceneQuerySystemBase(long address)
-
-
Method Details
-
wrapPointer
-
arrayGet
-
setDynamicTreeRebuildRateHint
public void setDynamicTreeRebuildRateHint(int dynamicTreeRebuildRateHint) Sets the rebuild rate of the dynamic tree pruning structures.- Parameters:
dynamicTreeRebuildRateHint- Rebuild rate of the dynamic tree pruning structures.- See Also:
-
getDynamicTreeRebuildRateHint
public int getDynamicTreeRebuildRateHint()Retrieves the rebuild rate of the dynamic tree pruning structures.- Returns:
- The rebuild rate of the dynamic tree pruning structures.
- See Also:
-
forceRebuildDynamicTree
public void forceRebuildDynamicTree(int prunerIndex) Forces dynamic trees to be immediately rebuilt.- Parameters:
prunerIndex- Index of pruner containing the dynamic tree to rebuildNote: PxScene will call this function with the PX_SCENE_PRUNER_STATIC or PX_SCENE_PRUNER_DYNAMIC value.
- See Also:
-
setUpdateMode
Sets scene query update mode- Parameters:
updateMode- Scene query update mode.
-
getUpdateMode
Gets scene query update mode- Returns:
- Current scene query update mode.
-
getStaticTimestamp
public int getStaticTimestamp()Retrieves the system's internal scene query timestamp, increased each time a change to the static scene query structure is performed.- Returns:
- scene query static timestamp
-
flushUpdates
public void flushUpdates()Flushes any changes to the scene query representation.This method updates the state of the scene query representation to match changes in the scene state.
By default, these changes are buffered until the next query is submitted. Calling this function will not change the results from scene queries, but can be used to ensure that a query will not perform update work in the course of its execution.
A thread performing updates will hold a write lock on the query structure, and thus stall other querying threads. In multithread scenarios it can be useful to explicitly schedule the period where this lock may be held for a significant period, so that subsequent queries issued from multiple threads will not block.
-
raycast
Performs a raycast against objects in the scene, returns results in a PxRaycastBuffer object or via a custom user callback implementation inheriting from PxRaycastCallback.Note: Touching hits are not ordered. Note: Shooting a ray from within an object leads to different results depending on the shape type. Please check the details in user guide article SceneQuery. User can ignore such objects by employing one of the provided filter mechanisms.
- Parameters:
origin- Origin of the ray.unitDir- Normalized direction of the ray.distance- Length of the ray. Has to be in the [0, inf) range.hitCall- Raycast hit buffer or callback object used to report raycast hits. Note: Filtering is not executed for a cached shape if supplied; instead, if a hit is found, it is assumed to be a blocking hit. Note: Using past touching hits as cache will produce incorrect behavior since the cached hit will always be treated as blocking.- Returns:
- True if any touching or blocking hits were found or any hit was found in case PxQueryFlag::eANY_HIT was specified.
- See Also:
-
raycast
public boolean raycast(PxVec3 origin, PxVec3 unitDir, float distance, PxRaycastCallback hitCall, PxHitFlags hitFlags) Performs a raycast against objects in the scene, returns results in a PxRaycastBuffer object or via a custom user callback implementation inheriting from PxRaycastCallback.Note: Touching hits are not ordered. Note: Shooting a ray from within an object leads to different results depending on the shape type. Please check the details in user guide article SceneQuery. User can ignore such objects by employing one of the provided filter mechanisms.
- Parameters:
origin- Origin of the ray.unitDir- Normalized direction of the ray.distance- Length of the ray. Has to be in the [0, inf) range.hitCall- Raycast hit buffer or callback object used to report raycast hits.hitFlags- Specifies which properties per hit should be computed and returned via the hit callback. Note: Filtering is not executed for a cached shape if supplied; instead, if a hit is found, it is assumed to be a blocking hit. Note: Using past touching hits as cache will produce incorrect behavior since the cached hit will always be treated as blocking.- Returns:
- True if any touching or blocking hits were found or any hit was found in case PxQueryFlag::eANY_HIT was specified.
- See Also:
-
raycast
public boolean raycast(PxVec3 origin, PxVec3 unitDir, float distance, PxRaycastCallback hitCall, PxHitFlags hitFlags, PxQueryFilterData filterData) Performs a raycast against objects in the scene, returns results in a PxRaycastBuffer object or via a custom user callback implementation inheriting from PxRaycastCallback.Note: Touching hits are not ordered. Note: Shooting a ray from within an object leads to different results depending on the shape type. Please check the details in user guide article SceneQuery. User can ignore such objects by employing one of the provided filter mechanisms.
- Parameters:
origin- Origin of the ray.unitDir- Normalized direction of the ray.distance- Length of the ray. Has to be in the [0, inf) range.hitCall- Raycast hit buffer or callback object used to report raycast hits.hitFlags- Specifies which properties per hit should be computed and returned via the hit callback.filterData- Filtering data passed to the filter shader. Note: Filtering is not executed for a cached shape if supplied; instead, if a hit is found, it is assumed to be a blocking hit. Note: Using past touching hits as cache will produce incorrect behavior since the cached hit will always be treated as blocking.- Returns:
- True if any touching or blocking hits were found or any hit was found in case PxQueryFlag::eANY_HIT was specified.
- See Also:
-
sweep
public boolean sweep(PxGeometry geometry, PxTransform pose, PxVec3 unitDir, float distance, PxSweepCallback hitCall) Performs a sweep test against objects in the scene, returns results in a PxSweepBuffer object or via a custom user callback implementation inheriting from PxSweepCallback.Note: Touching hits are not ordered. Note: If a shape from the scene is already overlapping with the query shape in its starting position, the hit is returned unless eASSUME_NO_INITIAL_OVERLAP was specified.
- Parameters:
geometry- Geometry of object to sweep (supported types are: box, sphere, capsule, convex).pose- Pose of the sweep object.unitDir- Normalized direction of the sweep.distance- Sweep distance. Needs to be in [0, inf) range and >0 if eASSUME_NO_INITIAL_OVERLAP was specified. Will be clamped to PX_MAX_SWEEP_DISTANCE.hitCall- Sweep hit buffer or callback object used to report sweep hits. Note: Filtering is not executed for a cached shape if supplied; instead, if a hit is found, it is assumed to be a blocking hit. Note: Using past touching hits as cache will produce incorrect behavior since the cached hit will always be treated as blocking. Note: ePRECISE_SWEEP doesn't support inflation. Therefore the sweep will be performed with zero inflation.- Returns:
- True if any touching or blocking hits were found or any hit was found in case PxQueryFlag::eANY_HIT was specified.
- See Also:
-
sweep
public boolean sweep(PxGeometry geometry, PxTransform pose, PxVec3 unitDir, float distance, PxSweepCallback hitCall, PxHitFlags hitFlags) Performs a sweep test against objects in the scene, returns results in a PxSweepBuffer object or via a custom user callback implementation inheriting from PxSweepCallback.Note: Touching hits are not ordered. Note: If a shape from the scene is already overlapping with the query shape in its starting position, the hit is returned unless eASSUME_NO_INITIAL_OVERLAP was specified.
- Parameters:
geometry- Geometry of object to sweep (supported types are: box, sphere, capsule, convex).pose- Pose of the sweep object.unitDir- Normalized direction of the sweep.distance- Sweep distance. Needs to be in [0, inf) range and >0 if eASSUME_NO_INITIAL_OVERLAP was specified. Will be clamped to PX_MAX_SWEEP_DISTANCE.hitCall- Sweep hit buffer or callback object used to report sweep hits.hitFlags- Specifies which properties per hit should be computed and returned via the hit callback. Note: Filtering is not executed for a cached shape if supplied; instead, if a hit is found, it is assumed to be a blocking hit. Note: Using past touching hits as cache will produce incorrect behavior since the cached hit will always be treated as blocking. Note: ePRECISE_SWEEP doesn't support inflation. Therefore the sweep will be performed with zero inflation.- Returns:
- True if any touching or blocking hits were found or any hit was found in case PxQueryFlag::eANY_HIT was specified.
- See Also:
-
sweep
public boolean sweep(PxGeometry geometry, PxTransform pose, PxVec3 unitDir, float distance, PxSweepCallback hitCall, PxHitFlags hitFlags, PxQueryFilterData filterData) Performs a sweep test against objects in the scene, returns results in a PxSweepBuffer object or via a custom user callback implementation inheriting from PxSweepCallback.Note: Touching hits are not ordered. Note: If a shape from the scene is already overlapping with the query shape in its starting position, the hit is returned unless eASSUME_NO_INITIAL_OVERLAP was specified.
- Parameters:
geometry- Geometry of object to sweep (supported types are: box, sphere, capsule, convex).pose- Pose of the sweep object.unitDir- Normalized direction of the sweep.distance- Sweep distance. Needs to be in [0, inf) range and >0 if eASSUME_NO_INITIAL_OVERLAP was specified. Will be clamped to PX_MAX_SWEEP_DISTANCE.hitCall- Sweep hit buffer or callback object used to report sweep hits.hitFlags- Specifies which properties per hit should be computed and returned via the hit callback.filterData- Filtering data and simple logic. Note: Filtering is not executed for a cached shape if supplied; instead, if a hit is found, it is assumed to be a blocking hit. Note: Using past touching hits as cache will produce incorrect behavior since the cached hit will always be treated as blocking. Note: ePRECISE_SWEEP doesn't support inflation. Therefore the sweep will be performed with zero inflation.- Returns:
- True if any touching or blocking hits were found or any hit was found in case PxQueryFlag::eANY_HIT was specified.
- See Also:
-
overlap
Performs an overlap test of a given geometry against objects in the scene, returns results in a PxOverlapBuffer object or via a custom user callback implementation inheriting from PxOverlapCallback.Note: Filtering: returning eBLOCK from user filter for overlap queries will cause a warning (see #PxQueryHitType).
- Parameters:
geometry- Geometry of object to check for overlap (supported types are: box, sphere, capsule, convex).pose- Pose of the object.hitCall- Overlap hit buffer or callback object used to report overlap hits. Note: Filtering is not executed for a cached shape if supplied; instead, if a hit is found, it is assumed to be a blocking hit. Note: Using past touching hits as cache will produce incorrect behavior since the cached hit will always be treated as blocking.- Returns:
- True if any touching or blocking hits were found or any hit was found in case PxQueryFlag::eANY_HIT was specified.
Note: eBLOCK should not be returned from user filters for overlap(). Doing so will result in undefined behavior, and a warning will be issued. Note: If the PxQueryFlag::eNO_BLOCK flag is set, the eBLOCK will instead be automatically converted to an eTOUCH and the warning suppressed.
- See Also:
-
overlap
public boolean overlap(PxGeometry geometry, PxTransform pose, PxOverlapCallback hitCall, PxQueryFilterData filterData) Performs an overlap test of a given geometry against objects in the scene, returns results in a PxOverlapBuffer object or via a custom user callback implementation inheriting from PxOverlapCallback.Note: Filtering: returning eBLOCK from user filter for overlap queries will cause a warning (see #PxQueryHitType).
- Parameters:
geometry- Geometry of object to check for overlap (supported types are: box, sphere, capsule, convex).pose- Pose of the object.hitCall- Overlap hit buffer or callback object used to report overlap hits.filterData- Filtering data and simple logic. See #PxQueryFilterData #PxQueryFilterCallback Note: Filtering is not executed for a cached shape if supplied; instead, if a hit is found, it is assumed to be a blocking hit. Note: Using past touching hits as cache will produce incorrect behavior since the cached hit will always be treated as blocking.- Returns:
- True if any touching or blocking hits were found or any hit was found in case PxQueryFlag::eANY_HIT was specified.
Note: eBLOCK should not be returned from user filters for overlap(). Doing so will result in undefined behavior, and a warning will be issued. Note: If the PxQueryFlag::eNO_BLOCK flag is set, the eBLOCK will instead be automatically converted to an eTOUCH and the warning suppressed.
- See Also:
-