- Direct Known Subclasses:
PxScene
Methods defined here are only available through the traditional PxScene API. Thus PxSceneSQSystem effectively captures the scene-query related part of the PxScene 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 PxSceneSQSystemarrayGet(long baseAddress, int index) booleanThis checks to see if the scene queries update has completed.booleancheckQueries(boolean block) This checks to see if the scene queries update has completed.booleanThis method must be called after sceneQueriesUpdate.booleanfetchQueries(boolean block) This method must be called after sceneQueriesUpdate.voidFlushes any changes to the scene query representation.voidforceDynamicTreeRebuild(boolean rebuildStaticStructure, boolean rebuildDynamicStructure) Forces dynamic trees to be immediately rebuilt.Return the value of PxSceneQueryDesc::dynamicStructure that was set when creating the scene with PxPhysics::createSceneintRetrieves the scene's internal scene query timestamp, increased each time a change to the static scene query structure is performed.Gets scene query update modeReturn the value of PxSceneQueryDesc::staticStructure that was set when creating the scene with PxPhysics::createScenevoidExecutes scene queries update tasks.voidsceneQueriesUpdate(PxBaseTask completionTask) Executes scene queries update tasks.voidsceneQueriesUpdate(PxBaseTask completionTask, boolean controlSimulation) Executes scene queries update tasks.voidsetSceneQueryUpdateMode(PxSceneQueryUpdateModeEnum updateMode) Sets scene query update modestatic PxSceneSQSystemwrapPointer(long address) Methods inherited from class physx.physics.PxSceneQuerySystemBase
flushUpdates, forceRebuildDynamicTree, getDynamicTreeRebuildRateHint, getStaticTimestamp, getUpdateMode, overlap, overlap, raycast, raycast, raycast, setDynamicTreeRebuildRateHint, setUpdateMode, sweep, sweep, sweepMethods 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
-
PxSceneSQSystem
protected PxSceneSQSystem() -
PxSceneSQSystem
protected PxSceneSQSystem(long address)
-
-
Method Details
-
wrapPointer
-
arrayGet
-
setSceneQueryUpdateMode
Sets scene query update mode- Parameters:
updateMode- Scene query update mode.
-
getSceneQueryUpdateMode
Gets scene query update mode- Returns:
- Current scene query update mode.
-
getSceneQueryStaticTimestamp
public int getSceneQueryStaticTimestamp()Retrieves the scene's internal scene query timestamp, increased each time a change to the static scene query structure is performed.- Returns:
- scene query static timestamp
-
flushQueryUpdates
public void flushQueryUpdates()Flushes any changes to the scene query representation. -
forceDynamicTreeRebuild
public void forceDynamicTreeRebuild(boolean rebuildStaticStructure, boolean rebuildDynamicStructure) Forces dynamic trees to be immediately rebuilt.- Parameters:
rebuildStaticStructure- True to rebuild the dynamic tree containing static objectsrebuildDynamicStructure- True to rebuild the dynamic tree containing dynamic objects
-
getStaticStructure
Return the value of PxSceneQueryDesc::staticStructure that was set when creating the scene with PxPhysics::createScene -
getDynamicStructure
Return the value of PxSceneQueryDesc::dynamicStructure that was set when creating the scene with PxPhysics::createScene -
sceneQueriesUpdate
public void sceneQueriesUpdate()Executes scene queries update tasks.This function will refit dirty shapes within the pruner and will execute a task to build a new AABB tree, which is build on a different thread. The new AABB tree is built based on the dynamic tree rebuild hint rate. Once the new tree is ready it will be commited in next fetchQueries call, which must be called after.
This function is equivalent to the following PxSceneQuerySystem calls: Synchronous calls: - PxSceneQuerySystemBase::flushUpdates() - handle0 = PxSceneQuerySystem::prepareSceneQueryBuildStep(PX_SCENE_PRUNER_STATIC) - handle1 = PxSceneQuerySystem::prepareSceneQueryBuildStep(PX_SCENE_PRUNER_DYNAMIC) Asynchronous calls: - PxSceneQuerySystem::sceneQueryBuildStep(handle0); - PxSceneQuerySystem::sceneQueryBuildStep(handle1);
This function is part of the PxSceneSQSystem interface because it uses the PxScene task system under the hood. But it calls PxSceneQuerySystem functions, which are independent from this system and could be called in a similar fashion by a separate, possibly user-defined task manager.
Note: If PxSceneQueryUpdateMode::eBUILD_DISABLED_COMMIT_DISABLED is used, it is required to update the scene queries using this function.
decremented when the scene is ready to have fetchQueries called. So the task will not run until the application also calls removeReference(). true unless the application is calling the PxTaskManager start/stopSimulation() methods itself.
-
sceneQueriesUpdate
Executes scene queries update tasks.This function will refit dirty shapes within the pruner and will execute a task to build a new AABB tree, which is build on a different thread. The new AABB tree is built based on the dynamic tree rebuild hint rate. Once the new tree is ready it will be commited in next fetchQueries call, which must be called after.
This function is equivalent to the following PxSceneQuerySystem calls: Synchronous calls: - PxSceneQuerySystemBase::flushUpdates() - handle0 = PxSceneQuerySystem::prepareSceneQueryBuildStep(PX_SCENE_PRUNER_STATIC) - handle1 = PxSceneQuerySystem::prepareSceneQueryBuildStep(PX_SCENE_PRUNER_DYNAMIC) Asynchronous calls: - PxSceneQuerySystem::sceneQueryBuildStep(handle0); - PxSceneQuerySystem::sceneQueryBuildStep(handle1);
This function is part of the PxSceneSQSystem interface because it uses the PxScene task system under the hood. But it calls PxSceneQuerySystem functions, which are independent from this system and could be called in a similar fashion by a separate, possibly user-defined task manager.
Note: If PxSceneQueryUpdateMode::eBUILD_DISABLED_COMMIT_DISABLED is used, it is required to update the scene queries using this function.
- Parameters:
completionTask- if non-NULL, this task will have its refcount incremented in sceneQueryUpdate(), then decremented when the scene is ready to have fetchQueries called. So the task will not run until the application also calls removeReference(). true unless the application is calling the PxTaskManager start/stopSimulation() methods itself.
-
sceneQueriesUpdate
Executes scene queries update tasks.This function will refit dirty shapes within the pruner and will execute a task to build a new AABB tree, which is build on a different thread. The new AABB tree is built based on the dynamic tree rebuild hint rate. Once the new tree is ready it will be commited in next fetchQueries call, which must be called after.
This function is equivalent to the following PxSceneQuerySystem calls: Synchronous calls: - PxSceneQuerySystemBase::flushUpdates() - handle0 = PxSceneQuerySystem::prepareSceneQueryBuildStep(PX_SCENE_PRUNER_STATIC) - handle1 = PxSceneQuerySystem::prepareSceneQueryBuildStep(PX_SCENE_PRUNER_DYNAMIC) Asynchronous calls: - PxSceneQuerySystem::sceneQueryBuildStep(handle0); - PxSceneQuerySystem::sceneQueryBuildStep(handle1);
This function is part of the PxSceneSQSystem interface because it uses the PxScene task system under the hood. But it calls PxSceneQuerySystem functions, which are independent from this system and could be called in a similar fashion by a separate, possibly user-defined task manager.
Note: If PxSceneQueryUpdateMode::eBUILD_DISABLED_COMMIT_DISABLED is used, it is required to update the scene queries using this function.
- Parameters:
completionTask- if non-NULL, this task will have its refcount incremented in sceneQueryUpdate(), then decremented when the scene is ready to have fetchQueries called. So the task will not run until the application also calls removeReference().controlSimulation- if true, the scene controls its PxTaskManager simulation state. Leave true unless the application is calling the PxTaskManager start/stopSimulation() methods itself.
-
checkQueries
public boolean checkQueries()This checks to see if the scene queries update has completed.This does not cause the data available for reading to be updated with the results of the scene queries update, it is simply a status check. The bool will allow it to either return immediately or block waiting for the condition to be met so that it can return true
- Returns:
- True if the results are available.
- See Also:
-
checkQueries
public boolean checkQueries(boolean block) This checks to see if the scene queries update has completed.This does not cause the data available for reading to be updated with the results of the scene queries update, it is simply a status check. The bool will allow it to either return immediately or block waiting for the condition to be met so that it can return true
- Parameters:
block- When set to true will block until the condition is met.- Returns:
- True if the results are available.
- See Also:
-
fetchQueries
public boolean fetchQueries()This method must be called after sceneQueriesUpdate. It will wait for the scene queries update to finish. If the user makes an illegal scene queries update call, the SDK will issue an error message.If a new AABB tree build finished, then during fetchQueries the current tree within the pruning structure is swapped with the new tree.
-
fetchQueries
public boolean fetchQueries(boolean block) This method must be called after sceneQueriesUpdate. It will wait for the scene queries update to finish. If the user makes an illegal scene queries update call, the SDK will issue an error message.If a new AABB tree build finished, then during fetchQueries the current tree within the pruning structure is swapped with the new tree.
- Parameters:
block- When set to true will block until the condition is met, which is tree built task must finish running.
-