Package physx.physics

Class PxSceneSQSystem

Direct Known Subclasses:
PxScene

public class PxSceneSQSystem extends PxSceneQuerySystemBase
Traditional SQ system for 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:
  • 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

      public static PxSceneSQSystem wrapPointer(long address)
    • arrayGet

      public static PxSceneSQSystem arrayGet(long baseAddress, int index)
    • setSceneQueryUpdateMode

      public void setSceneQueryUpdateMode(PxSceneQueryUpdateModeEnum updateMode)
      Sets scene query update mode
      Parameters:
      updateMode - Scene query update mode.
    • getSceneQueryUpdateMode

      public PxSceneQueryUpdateModeEnum 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 objects
      rebuildDynamicStructure - True to rebuild the dynamic tree containing dynamic objects
    • getStaticStructure

      public PxPruningStructureTypeEnum getStaticStructure()
      Return the value of PxSceneQueryDesc::staticStructure that was set when creating the scene with PxPhysics::createScene
    • getDynamicStructure

      public PxPruningStructureTypeEnum 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

      public void sceneQueriesUpdate(PxBaseTask completionTask)
      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

      public void sceneQueriesUpdate(PxBaseTask completionTask, boolean controlSimulation)
      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.