PhysX SDK 3.2 API Reference: PxScene Class Reference

PhysX SDK 3.2 API

PxScene Class Reference
[Physics]

A scene is a collection of bodies, particle systems and constraints which can interact. More...

#include <PxScene.h>

List of all members.


Public Member Functions

Simulation
virtual void simulate (PxReal elapsedTime, physx::pxtask::BaseTask *completionTask=NULL, void *scratchMemBlock=0, PxU32 scratchMemBlockSize=0, bool controlSimulation=true)=0
 Advances the simulation by an elapsedTime time.
virtual bool checkResults (bool block=false)=0
 This checks to see if the simulation run has completed.
virtual bool fetchResults (bool block=false, PxU32 *errorState=0)=0
virtual void flush (bool sendPendingReports=false)=0
 Clear internal buffers and free memory.
Threads and Memory
virtual
physx::pxtask::TaskManager * 
getTaskManager () const =0
 Get the task manager associated with this scene.
virtual void setSolverBatchSize (PxU32 solverBatchSize)=0
 Sets the number of actors required to spawn a separate rigid body solver thread.
virtual PxU32 getSolverBatchSize () const =0
 Retrieves the number of actors required to spawn a separate rigid body solver thread.
virtual void setNbContactDataBlocks (PxU32 numBlocks)=0
 set the cache blocks that can be used during simulate().
virtual PxU32 getNbContactDataBlocksUsed () const =0
 get the number of cache blocks currently used by the scene
virtual PxU32 getMaxNbContactDataBlocksUsed () const =0
 get the maximum number of cache blocks used by the scene
Create/Release Objects
virtual void addArticulation (PxArticulation &articulation)=0
 Adds an articulation to this scene.
virtual void removeArticulation (PxArticulation &articulation)=0
 Removes an articulation from this scene.
virtual void addActor (PxActor &actor)=0
 Adds an actor to this scene.
virtual void addActors (PxU32 nbActors, PxActor **actors)=0
virtual void removeActor (PxActor &actor)=0
 Removes an actor from this scene.
virtual void addAggregate (PxAggregate &aggregate)=0
 Adds an aggregate to this scene.
virtual void removeAggregate (PxAggregate &aggregate)=0
 Removes an aggregate from this scene.
virtual PxU32 getNbAggregates () const =0
 Returns the number of aggregates in the scene.
virtual PxU32 getAggregates (PxAggregate **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
 Retrieve all the aggregates in the scene.
Dominance
virtual void setDominanceGroupPair (PxDominanceGroup group1, PxDominanceGroup group2, const PxConstraintDominance &dominance)=0
 Specifies the dominance behavior of constraints between two actors with two certain dominance groups.
virtual PxConstraintDominance getDominanceGroupPair (PxDominanceGroup group1, PxDominanceGroup group2) const =0
 Samples the dominance matrix.
Enumeration
virtual PxU32 getNbActors (PxActorTypeSelectionFlags types) const =0
 Retrieve the number of actors of certain types in the scene.
virtual PxU32 getActors (PxActorTypeSelectionFlags types, PxActor **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
 Retrieve an array of all the actors of certain types in the scene.
virtual PxActiveTransformgetActiveTransforms (PxU32 &nbTransformsOut, PxClientID client=PX_DEFAULT_CLIENT)=0
 Queries the PxScene for a list of the PxActors whose transforms have been updated during the previous simulation step.
virtual PxU32 getNbArticulations () const =0
 Returns the number of articulations in the scene.
virtual PxU32 getArticulations (PxArticulation **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
 Retrieve all the articulations in the scene.
virtual PxU32 getNbConstraints () const =0
 Returns the number of constraint shaders in the scene.
virtual PxU32 getConstraints (PxConstraint **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
 Retrieve all the constraint shaders in the scene.
Multiclient
virtual PxClientID createClient ()=0
 Reserves a new client ID.
virtual void setClientBehaviorBits (PxClientID client, PxU32 clientBehaviorBits)=0
 Sets behavior bits for a client.
virtual PxU32 getClientBehaviorBits (PxClientID client) const =0
 Retrieves behavior bits for a client.
Callbacks
virtual void setSimulationEventCallback (PxSimulationEventCallback *callback, PxClientID client=PX_DEFAULT_CLIENT)=0
 Sets a user notify object which receives special simulation events when they occur.
virtual PxSimulationEventCallbackgetSimulationEventCallback (PxClientID client=PX_DEFAULT_CLIENT) const =0
 Retrieves the simulationEventCallback pointer set with setSimulationEventCallback().
virtual void setContactModifyCallback (PxContactModifyCallback *callback)=0
 Sets a user callback object, which receives callbacks on all contacts generated for specified actors.
virtual PxContactModifyCallbackgetContactModifyCallback () const =0
 Retrieves the PxContactModifyCallback pointer set with setContactModifyCallback().
Collision Filtering
virtual const void * getFilterShaderData () const =0
 Gets the shared global filter data in use for this scene.
virtual PxU32 getFilterShaderDataSize () const =0
 Gets the size of the shared global filter data (PxSceneDesc.filterShaderData).
virtual PxSimulationFilterShader getFilterShader () const =0
 Gets the custom collision filter shader in use for this scene.
virtual
PxSimulationFilterCallback
getFilterCallback () const =0
 Gets the custom collision filter callback in use for this scene.
Scene Query
virtual PxBatchQuerycreateBatchQuery (const PxBatchQueryDesc &desc)=0
 Creates a BatchQuery object.
virtual PX_DEPRECATED
PxSweepCache
createSweepCache (PxReal dimensions=5.0f)=0
 Creates a sweep cache, for use with PxBatchQuery::linearCompoundGeometrySweepMultiple(). See the Guide, "Sweep API" section for more information.
virtual void setDynamicTreeRebuildRateHint (PxU32 dynamicTreeRebuildRateHint)=0
 Sets the rebuild rate of the dynamic tree pruning structure.
virtual PxU32 getDynamicTreeRebuildRateHint () const =0
 Retrieves the rebuild rate of the dynamic tree pruning structure.
virtual bool raycastAny (const PxVec3 &origin, const PxVec3 &unitDir, const PxReal distance, PxSceneQueryHit &hit, const PxSceneQueryFilterData &filterData=PxSceneQueryFilterData(), PxSceneQueryFilterCallback *filterCall=NULL, const PxSceneQueryCache *cache=NULL, PxClientID queryClient=PX_DEFAULT_CLIENT) const =0
 Raycast returning any blocking hit, not necessarily the closest.
virtual bool raycastSingle (const PxVec3 &origin, const PxVec3 &unitDir, const PxReal distance, PxSceneQueryFlags outputFlags, PxRaycastHit &hit, const PxSceneQueryFilterData &filterData=PxSceneQueryFilterData(), PxSceneQueryFilterCallback *filterCall=NULL, const PxSceneQueryCache *cache=NULL, PxClientID queryClient=PX_DEFAULT_CLIENT) const =0
 Raycast returning a single result.
virtual PxI32 raycastMultiple (const PxVec3 &origin, const PxVec3 &unitDir, const PxReal distance, PxSceneQueryFlags outputFlags, PxRaycastHit *hitBuffer, PxU32 hitBufferSize, bool &blockingHit, const PxSceneQueryFilterData &filterData=PxSceneQueryFilterData(), PxSceneQueryFilterCallback *filterCall=NULL, const PxSceneQueryCache *cache=NULL, PxClientID queryClient=PX_DEFAULT_CLIENT) const =0
 Raycast returning multiple results.
virtual bool sweepAny (const PxGeometry &geometry, const PxTransform &pose, const PxVec3 &unitDir, const PxReal distance, PxSceneQueryFlags queryFlags, PxSceneQueryHit &hit, const PxSceneQueryFilterData &filterData=PxSceneQueryFilterData(), PxSceneQueryFilterCallback *filterCall=NULL, const PxSceneQueryCache *cache=NULL, PxClientID queryClient=PX_DEFAULT_CLIENT) const =0
 Sweep returning any blocking hit, not necessarily the closest.
virtual bool sweepAny (const PxGeometry **geometryList, const PxTransform *poseList, const PxFilterData *filterDataList, PxU32 geometryCount, const PxVec3 &unitDir, const PxReal distance, PxSceneQueryFlags queryFlags, PxSceneQueryHit &hit, PxSceneQueryFilterFlags filterFlags=PxSceneQueryFilterFlag::eDYNAMIC|PxSceneQueryFilterFlag::eSTATIC, PxSceneQueryFilterCallback *filterCall=NULL, const PxSceneQueryCache *cache=NULL, PxClientID queryClient=PX_DEFAULT_CLIENT) const =0
 Sweep of geometry compound returning any blocking hit, not necessarily the closest.
virtual bool sweepSingle (const PxGeometry &geometry, const PxTransform &pose, const PxVec3 &unitDir, const PxReal distance, PxSceneQueryFlags outputFlags, PxSweepHit &hit, const PxSceneQueryFilterData &filterData=PxSceneQueryFilterData(), PxSceneQueryFilterCallback *filterCall=NULL, const PxSceneQueryCache *cache=NULL, PxClientID queryClient=PX_DEFAULT_CLIENT) const =0
 Sweep returning a single result.
virtual bool sweepSingle (const PxGeometry **geometryList, const PxTransform *poseList, const PxFilterData *filterDataList, PxU32 geometryCount, const PxVec3 &unitDir, const PxReal distance, PxSceneQueryFlags outputFlags, PxSweepHit &hit, PxSceneQueryFilterFlags filterFlags=PxSceneQueryFilterFlag::eDYNAMIC|PxSceneQueryFilterFlag::eSTATIC, PxSceneQueryFilterCallback *filterCall=NULL, const PxSceneQueryCache *cache=NULL, PxClientID queryClient=PX_DEFAULT_CLIENT) const =0
 Sweep of geometry compound returning a single result.
virtual PxI32 sweepMultiple (const PxGeometry &geometry, const PxTransform &pose, const PxVec3 &unitDir, const PxReal distance, PxSceneQueryFlags outputFlags, PxSweepHit *hitBuffer, PxU32 hitBufferSize, bool &blockingHit, const PxSceneQueryFilterData &filterData=PxSceneQueryFilterData(), PxSceneQueryFilterCallback *filterCall=NULL, const PxSceneQueryCache *cache=NULL, PxClientID queryClient=PX_DEFAULT_CLIENT) const =0
 Sweep returning multiple results.
virtual PxI32 sweepMultiple (const PxGeometry **geometryList, const PxTransform *poseList, const PxFilterData *filterDataList, PxU32 geometryCount, const PxVec3 &unitDir, const PxReal distance, PxSceneQueryFlags outputFlags, PxSweepHit *hitBuffer, PxU32 hitBufferSize, bool &blockingHit, PxSceneQueryFilterFlags filterFlags=PxSceneQueryFilterFlag::eDYNAMIC|PxSceneQueryFilterFlag::eSTATIC, PxSceneQueryFilterCallback *filterCall=NULL, const PxSceneQueryCache *cache=NULL, PxClientID queryClient=PX_DEFAULT_CLIENT) const =0
 Sweep of geometry compound returning multiple results.
virtual PxI32 overlapMultiple (const PxGeometry &geometry, const PxTransform &pose, PxShape **hitBuffer, PxU32 hitBufferSize, const PxSceneQueryFilterData &filterData=PxSceneQueryFilterData(), PxSceneQueryFilterCallback *filterCall=NULL, PxClientID queryClient=PX_DEFAULT_CLIENT) const =0
 Test overlap between a geometry and objects in the scene.
PX_INLINE bool overlapAny (const PxGeometry &geometry, const PxTransform &pose, PxShape *&hit, const PxSceneQueryFilterData &filterData=PxSceneQueryFilterData(), PxSceneQueryFilterCallback *filterCall=NULL, PxClientID queryClient=PX_DEFAULT_CLIENT) const
 Test returning, for a given geometry, any overlapping object in the scene.
Visualization and Statistics
virtual bool setVisualizationParameter (PxVisualizationParameter::Enum param, PxReal value)=0
 Function that lets you set debug visualization parameters.
virtual PxReal getVisualizationParameter (PxVisualizationParameter::Enum paramEnum) const =0
 Function that lets you query debug visualization parameters.
virtual void setVisualizationCullingBox (const PxBounds3 &box)=0
virtual const PxBounds3getVisualizationCullingBox () const =0
virtual const PxRenderBuffergetRenderBuffer ()=0
 Retrieves the render buffer.
virtual void getSimulationStatistics (PxSimulationStatistics &stats) const =0
 Call this method to retrieve statistics for the current simulation step.

Protected Member Functions

 PxScene ()
virtual ~PxScene ()

Basics

void * userData
 user can assign this to whatever, usually to create a 1:1 relationship with a user object.
virtual void release ()=0
 Deletes the scene.
virtual bool saveToDesc (PxSceneDesc &desc) const =0
 Saves the Scene descriptor.
virtual void setFlag (PxSceneFlag::Enum flag, bool value)=0
 Sets a scene flag. You can only set one flag at a time.
virtual PxSceneFlags getFlags () const =0
 Get the scene flags.
virtual void setGravity (const PxVec3 &vec)=0
 Sets a constant gravity for the entire scene.
virtual PxVec3 getGravity () const =0
 Retrieves the current gravity setting.
virtual PxPhysicsgetPhysics ()=0
 Call this method to retrieve the Physics SDK.
virtual PxU32 getTimestamp () const =0
 Retrieves the scene's internal timestamp, increased each time a simulation step is completed.
virtual PxU32 getSceneQueryStaticTimestamp () const =0
 Retrieves the scene's internal scene query timestamp, increased each time a change to the static scene query structure is performed.

Detailed Description

A scene is a collection of bodies, particle systems and constraints which can interact.

The scene simulates the behavior of these objects over time. Several scenes may exist at the same time, but each body, particle system or constraint is specific to a scene -- they may not be shared.

See also:
PxSceneDesc PxPhysics.createScene() release()

Constructor & Destructor Documentation

PxScene::PxScene (  )  [inline, protected]

virtual PxScene::~PxScene (  )  [inline, protected, virtual]


Member Function Documentation

virtual void PxScene::addActor ( PxActor actor  )  [pure virtual]

Adds an actor to this scene.

Note:
If the actor is already assigned to a scene (see PxActor::getScene), the call is ignored and a error is issued.

You can not add individual articulation links (see PxArticulationLink) to the scene. Use addArticulation() instead.

If the actor is a PxRigidActor then each assigned PxConstraint object will get added to the scene automatically if it connects to another actor that is part of the scene already.

Parameters:
[in] actor Actor to add to scene.
See also:
PxActor

virtual void PxScene::addActors ( PxU32  nbActors,
PxActor **  actors 
) [pure virtual]

virtual void PxScene::addAggregate ( PxAggregate aggregate  )  [pure virtual]

Adds an aggregate to this scene.

Note:
If the aggregate is already assigned to a scene (see PxAggregate::getScene), the call is ignored and a error is issued.

If the aggregate already contains actors, those actors are added to the scene as well.

Parameters:
[in] aggregate Aggregate to add to scene.
See also:
PxAggregate

virtual void PxScene::addArticulation ( PxArticulation articulation  )  [pure virtual]

Adds an articulation to this scene.

Note:
If the articulation is already assigned to a scene (see PxArticulation::getScene), the call is ignored and a error is issued.
Parameters:
[in] articulation Articulation to add to scene. See PxArticulation
See also:
PxArticulation

virtual bool PxScene::checkResults ( bool  block = false  )  [pure virtual]

This checks to see if the simulation run has completed.

This does not cause the data available for reading to be updated with the results of the simulation, 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:
[in] block When set to true will block until the condition is met.
Returns:
True if the results are available.
See also:
simulate() fetchResults()

virtual PxBatchQuery* PxScene::createBatchQuery ( const PxBatchQueryDesc desc  )  [pure virtual]

Creates a BatchQuery object.

Scene queries like raycasts, overlap tests and sweeps are batched in this object and are then executed at once. See PxBatchQuery.

Parameters:
[in] desc The descriptor of scene query. Scene Queries need to register a callback. See PxBatchQueryDesc.
See also:
PxBatchQuery PxBatchQueryDesc

virtual PxClientID PxScene::createClient (  )  [pure virtual]

Reserves a new client ID.

PX_DEFAULT_CLIENT is always available as the default clientID. Additional clients are returned by this function. Clients cannot be released once created. An error is reported when more than a supported number of clients (currently 128) are created.

virtual PX_DEPRECATED PxSweepCache* PxScene::createSweepCache ( PxReal  dimensions = 5.0f  )  [pure virtual]

Creates a sweep cache, for use with PxBatchQuery::linearCompoundGeometrySweepMultiple(). See the Guide, "Sweep API" section for more information.

Parameters:
[in] dimensions the dimensions of the sweep cache. Objects within this distance of the swept volume will be cached
See also:
PxSweepCache PxBatchQuery

virtual bool PxScene::fetchResults ( bool  block = false,
PxU32 errorState = 0 
) [pure virtual]

This is the big brother to checkResults() it basically does the following:

    if ( checkResults(block) )
    {
        fire appropriate callbacks
        swap buffers
        return true
    }
    else
        return false

Parameters:
[in] block When set to true will block until the condition is met.
[out] errorState Used to retrieve hardware error codes. A non zero value indicates an error.
Returns:
True if the results have been fetched.
See also:
simulate() checkResults()

virtual void PxScene::flush ( bool  sendPendingReports = false  )  [pure virtual]

Clear internal buffers and free memory.

This method can be used to clear buffers and free internal memory without having to destroy the scene. Can be usefull if the physics data gets streamed in and a checkpoint with a clean state should be created.

Note:
It is not allowed to call this method while the simulation is running. The call will fail.
Parameters:
[in] sendPendingReports When set to true pending reports will be sent out before the buffers get cleaned up (for instance lost touch contact/trigger reports due to deleted objects).

virtual PxActiveTransform* PxScene::getActiveTransforms ( PxU32 nbTransformsOut,
PxClientID  client = PX_DEFAULT_CLIENT 
) [pure virtual]

Queries the PxScene for a list of the PxActors whose transforms have been updated during the previous simulation step.

Note: PxSceneFlag::eENABLE_ACTIVETRANSFORMS must be set. Multiclient behavior: Active transforms now return only the list of active actors owned by the specified client.

Note:
Do not use this method while the simulation is running. Calls to this method while the simulation is running will be ignored and NULL will be returned.
Parameters:
[out] nbTransformsOut The number of transforms returned.
[in] client The client whose actors the caller is interested in.
Returns:
A pointer to the list of PxActiveTransforms generated during the last call to fetchResults().
See also:
PxActiveTransform

virtual PxU32 PxScene::getActors ( PxActorTypeSelectionFlags  types,
PxActor **  userBuffer,
PxU32  bufferSize,
PxU32  startIndex = 0 
) const [pure virtual]

Retrieve an array of all the actors of certain types in the scene.

Parameters:
[in] types Combination of actor types to retrieve.
[out] userBuffer The buffer to receive actor pointers.
[in] bufferSize Size of provided user buffer.
[in] startIndex Index of first actor pointer to be retrieved
Returns:
Number of actors written to the buffer.
See also:
getNbActors()

virtual PxU32 PxScene::getAggregates ( PxAggregate **  userBuffer,
PxU32  bufferSize,
PxU32  startIndex = 0 
) const [pure virtual]

Retrieve all the aggregates in the scene.

Parameters:
[out] userBuffer The buffer to receive aggregates pointers.
[in] bufferSize Size of provided user buffer.
[in] startIndex Index of first aggregate pointer to be retrieved
Returns:
Number of aggregates written to the buffer.
See also:
getNbAggregates()

virtual PxU32 PxScene::getArticulations ( PxArticulation **  userBuffer,
PxU32  bufferSize,
PxU32  startIndex = 0 
) const [pure virtual]

Retrieve all the articulations in the scene.

Parameters:
[out] userBuffer The buffer to receive articulations pointers.
[in] bufferSize Size of provided user buffer.
[in] startIndex Index of first articulations pointer to be retrieved
Returns:
Number of articulations written to the buffer.
See also:
getNbArticulations()

virtual PxU32 PxScene::getClientBehaviorBits ( PxClientID  client  )  const [pure virtual]

Retrieves behavior bits for a client.

See also:
PxClientBehaviorBit PxClientID setClientBehaviorBits() createClient()

virtual PxU32 PxScene::getConstraints ( PxConstraint **  userBuffer,
PxU32  bufferSize,
PxU32  startIndex = 0 
) const [pure virtual]

Retrieve all the constraint shaders in the scene.

Parameters:
[out] userBuffer The buffer to receive constraint shader pointers.
[in] bufferSize Size of provided user buffer.
[in] startIndex Index of first constraint pointer to be retrieved
Returns:
Number of constraint shaders written to the buffer.
See also:
getNbConstraints()

virtual PxContactModifyCallback* PxScene::getContactModifyCallback (  )  const [pure virtual]

Retrieves the PxContactModifyCallback pointer set with setContactModifyCallback().

Returns:
The current user contact modify callback pointer. See PxContactModifyCallback.
See also:
PxContactModifyCallback setContactModifyCallback()

virtual PxConstraintDominance PxScene::getDominanceGroupPair ( PxDominanceGroup  group1,
PxDominanceGroup  group2 
) const [pure virtual]

virtual PxU32 PxScene::getDynamicTreeRebuildRateHint (  )  const [pure virtual]

Retrieves the rebuild rate of the dynamic tree pruning structure.

Returns:
The rebuild rate of the dyamic tree pruning structure.
See also:
PxSceneDesc.dynamicTreeRebuildRateHint setDynamicTreeRebuildRateHint()

virtual PxSimulationFilterCallback* PxScene::getFilterCallback (  )  const [pure virtual]

Gets the custom collision filter callback in use for this scene.

Returns:
Filter callback class that defines the collision pair filtering.
See also:
PxSceneDesc.filterCallback PxSimulationFilterCallback

virtual PxSimulationFilterShader PxScene::getFilterShader (  )  const [pure virtual]

Gets the custom collision filter shader in use for this scene.

Returns:
Filter shader class that defines the collision pair filtering.
See also:
PxSceneDesc.filterShader PxSimulationFilterShader

virtual const void* PxScene::getFilterShaderData (  )  const [pure virtual]

Gets the shared global filter data in use for this scene.

Note:
The reference points to a copy of the original filter data specified in PxSceneDesc.filterShaderData.
Returns:
Shared filter data for filter shader.
See also:
getFilterShaderDataSize() PxSceneDesc.filterShaderData PxSimulationFilterShader

virtual PxU32 PxScene::getFilterShaderDataSize (  )  const [pure virtual]

Gets the size of the shared global filter data (PxSceneDesc.filterShaderData).

Returns:
Size of shared filter data [bytes].
See also:
getFilterShaderData() PxSceneDesc.filterShaderDataSize PxSimulationFilterShader

virtual PxSceneFlags PxScene::getFlags (  )  const [pure virtual]

Get the scene flags.

Returns:
The scene flags. See PxSceneFlag
See also:
PxSceneFlag

virtual PxVec3 PxScene::getGravity (  )  const [pure virtual]

Retrieves the current gravity setting.

Returns:
The current gravity for the scene.
See also:
setGravity() PxSceneDesc.gravity

virtual PxU32 PxScene::getMaxNbContactDataBlocksUsed (  )  const [pure virtual]

get the maximum number of cache blocks used by the scene

This function may not be called while the scene is simulating

Returns:
the maximum number of cache blocks ever used by the scene
See also:
PxSceneDesc.nbContactDataBlocks PxSceneDesc.maxNbContactDataBlocks flush() setNbContactDataBlocks() getNbContactDataBlocksUsed()

virtual PxU32 PxScene::getNbActors ( PxActorTypeSelectionFlags  types  )  const [pure virtual]

Retrieve the number of actors of certain types in the scene.

Parameters:
[in] types Combination of actor types.
Returns:
the number of actors.
See also:
getActors()

virtual PxU32 PxScene::getNbAggregates (  )  const [pure virtual]

Returns the number of aggregates in the scene.

Returns:
the number of aggregates in this scene.
See also:
getAggregates()

virtual PxU32 PxScene::getNbArticulations (  )  const [pure virtual]

Returns the number of articulations in the scene.

Returns:
the number of articulations in this scene.
See also:
getArticulations()

virtual PxU32 PxScene::getNbConstraints (  )  const [pure virtual]

Returns the number of constraint shaders in the scene.

Returns:
the number of constraint shaders in this scene.
See also:
getConstraints()

virtual PxU32 PxScene::getNbContactDataBlocksUsed (  )  const [pure virtual]

get the number of cache blocks currently used by the scene

This function may not be called while the scene is simulating

Returns:
the number of cache blocks currently used by the scene
See also:
PxSceneDesc.nbContactDataBlocks PxSceneDesc.maxNbContactDataBlocks flush() setNbContactDataBlocks() getMaxNbContactDataBlocksUsed()

virtual PxPhysics& PxScene::getPhysics (  )  [pure virtual]

Call this method to retrieve the Physics SDK.

Returns:
The physics SDK this scene is associated with.
See also:
PxPhysics

virtual const PxRenderBuffer& PxScene::getRenderBuffer (  )  [pure virtual]

Retrieves the render buffer.

This will contain the results of any active visualization for this scene.

Note:
Do not use this method while the simulation is running. Calls to this method while result in undefined behaviour.
Returns:
The render buffer.
See also:
PxRenderBuffer

virtual PxU32 PxScene::getSceneQueryStaticTimestamp (  )  const [pure virtual]

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

virtual PxSimulationEventCallback* PxScene::getSimulationEventCallback ( PxClientID  client = PX_DEFAULT_CLIENT  )  const [pure virtual]

Retrieves the simulationEventCallback pointer set with setSimulationEventCallback().

Parameters:
[in] client The client whose callback object is to be returned.
Returns:
The current user notify pointer. See PxSimulationEventCallback.
See also:
PxSimulationEventCallback setSimulationEventCallback()

virtual void PxScene::getSimulationStatistics ( PxSimulationStatistics stats  )  const [pure virtual]

Call this method to retrieve statistics for the current simulation step.

Note:
Do not use this method while the simulation is running. Calls to this method while the simulation is running will be ignored.
Parameters:
[out] stats Used to retrieve statistics for the current simulation step.
See also:
PxSimulationStatistics

virtual PxU32 PxScene::getSolverBatchSize (  )  const [pure virtual]

Retrieves the number of actors required to spawn a separate rigid body solver thread.

Returns:
Current number of actors required to spawn a separate rigid body solver thread.
Platform:
  • PC SW: Yes
  • PS3 : Not applicable
  • XB360: Yes
  • WII : Yes
See also:
PxSceneDesc.solverBatchSize setSolverBatchSize()

virtual physx::pxtask::TaskManager* PxScene::getTaskManager (  )  const [pure virtual]

Get the task manager associated with this scene.

Returns:
the task manager associated with the scene

virtual PxU32 PxScene::getTimestamp (  )  const [pure virtual]

Retrieves the scene's internal timestamp, increased each time a simulation step is completed.

Returns:
scene timestamp

virtual const PxBounds3& PxScene::getVisualizationCullingBox (  )  const [pure virtual]

virtual PxReal PxScene::getVisualizationParameter ( PxVisualizationParameter::Enum  paramEnum  )  const [pure virtual]

Function that lets you query debug visualization parameters.

Parameters:
[in] paramEnum The Parameter to retrieve.
Returns:
The value of the parameter.
See also:
setVisualizationParameter PxVisualizationParameter

PX_INLINE bool PxScene::overlapAny ( const PxGeometry geometry,
const PxTransform pose,
PxShape *&  hit,
const PxSceneQueryFilterData filterData = PxSceneQueryFilterData(),
PxSceneQueryFilterCallback filterCall = NULL,
PxClientID  queryClient = PX_DEFAULT_CLIENT 
) const [inline]

Test returning, for a given geometry, any overlapping object in the scene.

Note:
Filtering: Overlap tests do not distinguish between touching and blocking hit types (see PxSceneQueryHitType). Both trigger a hit.

PxSceneQueryFilterFlag::eMESH_MULTIPLE and PxSceneQueryFilterFlag::eBACKFACE have no effect in this case

Parameters:
[in] geometry Geometry of object to check for overlap (supported types are: box, sphere, capsule, convex).
[in] pose Pose of the object.
[out] hit Pointer to store the overlapping object to.
[in] filterData Filtering data and simple logic.
[in] filterCall Custom filtering logic (optional). Only used if the corresponding PxSceneQueryFilterFlag flags are set. If NULL, all hits are assumed to overlap.
[in] queryClient ID of the client doing the query (see createClient())
Returns:
True if an overlap was found.
See also:
PxSceneQueryFlags PxSceneQueryFilterData PxSceneQueryFilterCallback

virtual PxI32 PxScene::overlapMultiple ( const PxGeometry geometry,
const PxTransform pose,
PxShape **  hitBuffer,
PxU32  hitBufferSize,
const PxSceneQueryFilterData filterData = PxSceneQueryFilterData(),
PxSceneQueryFilterCallback filterCall = NULL,
PxClientID  queryClient = PX_DEFAULT_CLIENT 
) const [pure virtual]

Test overlap between a geometry and objects in the scene.

Note:
Filtering: Overlap tests do not distinguish between touching and blocking hit types (see PxSceneQueryHitType). Both get written to the hit buffer.

PxSceneQueryFilterFlag::eMESH_MULTIPLE and PxSceneQueryFilterFlag::eBACKFACE have no effect in this case

Parameters:
[in] geometry Geometry of object to check for overlap (supported types are: box, sphere, capsule, convex).
[in] pose Pose of the object.
[out] hitBuffer Buffer to store the overlapping objects to. If the buffer overflows, an arbitrary subset of overlapping objects is stored (typically the query should be restarted with a larger buffer).
[in] hitBufferSize Size of the hit buffer.
[in] filterData Filtering data and simple logic.
[in] filterCall Custom filtering logic (optional). Only used if the corresponding PxSceneQueryFilterFlag flags are set. If NULL, all hits are assumed to overlap.
[in] queryClient ID of the client doing the query (see createClient())
Returns:
Number of hits in the buffer, or -1 if the buffer overflowed.
See also:
PxSceneQueryFlags PxSceneQueryFilterData PxSceneQueryFilterCallback

virtual bool PxScene::raycastAny ( const PxVec3 origin,
const PxVec3 unitDir,
const PxReal  distance,
PxSceneQueryHit hit,
const PxSceneQueryFilterData filterData = PxSceneQueryFilterData(),
PxSceneQueryFilterCallback filterCall = NULL,
const PxSceneQueryCache cache = NULL,
PxClientID  queryClient = PX_DEFAULT_CLIENT 
) const [pure virtual]

Raycast returning any blocking hit, not necessarily the closest.

Returns whether any rigid actor is hit along the ray.

Note:
Shooting a ray from within an object leads to different results depending on the shape type. Please check the details in article SceneQuery. User can ignore such objects by using one of the provided filter mechanisms.
Parameters:
[in] origin Origin of the ray.
[in] unitDir Normalized direction of the ray.
[in] distance Length of the ray. Needs to be larger than 0.
[out] hit Raycast hit information.
[in] filterData Filtering data and simple logic.
[in] filterCall Custom filtering logic (optional). Only used if the corresponding PxSceneQueryFilterFlag flags are set. If NULL, all hits are assumed to be blocking.
[in] cache Cached hit shape (optional). Ray is tested against cached shape first. If no hit is found the ray gets queried against the scene. 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.
[in] queryClient ID of the client doing the query (see createClient())
Returns:
True if a blocking hit was found.
See also:
PxSceneQueryFilterData PxSceneQueryFilterCallback PxSceneQueryCache PxSceneQueryHit

virtual PxI32 PxScene::raycastMultiple ( const PxVec3 origin,
const PxVec3 unitDir,
const PxReal  distance,
PxSceneQueryFlags  outputFlags,
PxRaycastHit hitBuffer,
PxU32  hitBufferSize,
bool &  blockingHit,
const PxSceneQueryFilterData filterData = PxSceneQueryFilterData(),
PxSceneQueryFilterCallback filterCall = NULL,
const PxSceneQueryCache cache = NULL,
PxClientID  queryClient = PX_DEFAULT_CLIENT 
) const [pure virtual]

Raycast returning multiple results.

Find all rigid actors that get hit along the ray. Each result contains data as specified by the outputFlags field.

Note:
Touching hits are not ordered.

Shooting a ray from within an object leads to different results depending on the shape type. Please check the details in article SceneQuery. User can ignore such objects by using one of the provided filter mechanisms.

Parameters:
[in] origin Origin of the ray.
[in] unitDir Normalized direction of the ray.
[in] distance Length of the ray. Needs to be larger than 0.
[in] outputFlags Specifies which properties should be written to the hit information
[out] hitBuffer Raycast hit information buffer. If the buffer overflows, the blocking hit is returned as the last entry together with an arbitrary subset of the nearer touching hits (typically the query should be restarted with a larger buffer).
[in] hitBufferSize Size of the hit buffer.
[out] blockingHit True if a blocking hit was found. If found, it is the last in the buffer, preceded by any touching hits which are closer. Otherwise the touching hits are listed.
[in] filterData Filtering data and simple logic.
[in] filterCall Custom filtering logic (optional). Only used if the corresponding PxSceneQueryFilterFlag flags are set. If NULL, all hits are assumed to be touching.
[in] cache Cached hit shape (optional). Ray is tested against cached shape first then against the scene. 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.
[in] queryClient ID of the client doing the query (see createClient())
Returns:
Number of hits in the buffer, or -1 if the buffer overflowed.
See also:
PxSceneQueryFlags PxRaycastHit PxSceneQueryFilterData PxSceneQueryFilterCallback PxSceneQueryCache

virtual bool PxScene::raycastSingle ( const PxVec3 origin,
const PxVec3 unitDir,
const PxReal  distance,
PxSceneQueryFlags  outputFlags,
PxRaycastHit hit,
const PxSceneQueryFilterData filterData = PxSceneQueryFilterData(),
PxSceneQueryFilterCallback filterCall = NULL,
const PxSceneQueryCache cache = NULL,
PxClientID  queryClient = PX_DEFAULT_CLIENT 
) const [pure virtual]

Raycast returning a single result.

Returns the first rigid actor that is hit along the ray. Data for a blocking hit will be returned as specified by the outputFlags field. Touching hits will be ignored.

Note:
Shooting a ray from within an object leads to different results depending on the shape type. Please check the details in article SceneQuery. User can ignore such objects by using one of the provided filter mechanisms.
Parameters:
[in] origin Origin of the ray.
[in] unitDir Normalized direction of the ray.
[in] distance Length of the ray. Needs to be larger than 0.
[in] outputFlags Specifies which properties should be written to the hit information
[out] hit Raycast hit information.
[in] filterData Filtering data and simple logic.
[in] filterCall Custom filtering logic (optional). Only used if the corresponding PxSceneQueryFilterFlag flags are set. If NULL, all hits are assumed to be blocking.
[in] cache Cached hit shape (optional). Ray is tested against cached shape first then against the scene. 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.
[in] queryClient ID of the client doing the query (see createClient())
Returns:
True if a blocking hit was found.
See also:
PxSceneQueryFlags PxRaycastHit PxSceneQueryFilterData PxSceneQueryFilterCallback PxSceneQueryCache

virtual void PxScene::release (  )  [pure virtual]

Deletes the scene.

Removes any actors, particle systems, and constraint shaders from this scene (if the user hasn't already done so).

Be sure to not keep a reference to this object after calling release. Avoid release calls while the scene is simulating (in between simulate() and fetchResults() calls).

See also:
PxPhysics.createScene()

virtual void PxScene::removeActor ( PxActor actor  )  [pure virtual]

Removes an actor from this scene.

Note:
If the actor is not part of this scene (see PxActor::getScene), the call is ignored and a error is issued.

You can not remove individual articulation links (see PxArticulationLink) from the scene. Use removeArticulation() instead.

If the actor is a PxRigidActor then all assigned PxConstraint objects will get removed from the scene automatically.

Parameters:
[in] actor Actor to remove from scene.
See also:
PxActor

virtual void PxScene::removeAggregate ( PxAggregate aggregate  )  [pure virtual]

Removes an aggregate from this scene.

Note:
If the aggregate is not part of this scene (see PxAggregate::getScene), the call is ignored and a error is issued.

If the aggregate contains actors, those actors are removed from the scene as well.

Parameters:
[in] aggregate Aggregate to remove from scene.
See also:
PxAggregate

virtual void PxScene::removeArticulation ( PxArticulation articulation  )  [pure virtual]

Removes an articulation from this scene.

Note:
If the articulation is not part of this scene (see PxArticulation::getScene), the call is ignored and a error is issued.
Parameters:
[in] articulation Articulation to remove from scene. See PxArticulation
See also:
PxArticulation

virtual bool PxScene::saveToDesc ( PxSceneDesc desc  )  const [pure virtual]

Saves the Scene descriptor.

Parameters:
[out] desc The descriptor used to retrieve the state of the object.
Returns:
True on success.
See also:
PxSceneDesc

virtual void PxScene::setClientBehaviorBits ( PxClientID  client,
PxU32  clientBehaviorBits 
) [pure virtual]

Sets behavior bits for a client.

The behavior bits are a property of a client that determine when it receives callbacks. PxU32 is a combo of PxClientBehaviorBit.

It is permissible to change the behavior for PX_DEFAULT_CLIENT with this call. Initially all created clients, as well as PX_DEFAULT_CLIENT have all bits set to 0.

Note that in addition to setting a client to listen to a particular foreign actor event type, the user must also configure actors to send that particular event type to foreign clients using PxActor::setClientBehaviorBits().

See also:
PxClientBehaviorBit PxClientID createClient() getClientBehaviorBits() PxActor::setClientBehaviorBits()

virtual void PxScene::setContactModifyCallback ( PxContactModifyCallback callback  )  [pure virtual]

Sets a user callback object, which receives callbacks on all contacts generated for specified actors.

Note:
Do not set the callback while the simulation is running. Calls to this method while the simulation is running will be ignored.
Parameters:
[in] callback Asynchronous user contact modification callback. See PxContactModifyCallback.

virtual void PxScene::setDominanceGroupPair ( PxDominanceGroup  group1,
PxDominanceGroup  group2,
const PxConstraintDominance dominance 
) [pure virtual]

Specifies the dominance behavior of constraints between two actors with two certain dominance groups.

It is possible to assign each actor to a dominance groups using PxActor::setDominanceGroup().

With dominance groups one can have all constraints (contacts and joints) created between actors act in one direction only. This is useful if you want to make sure that the movement of the rider of a vehicle or the pony tail of a character doesn't influence the object it is attached to, while keeping the motion of both inherently physical.

Whenever a constraint (i.e. joint or contact) between two actors (a0, a1) needs to be solved, the groups (g0, g1) of both actors are retrieved. Then the PxConstraintDominance setting for this group pair is retrieved with getDominanceGroupPair(g0, g1).

In the constraint, PxConstraintDominance::dominance0 becomes the dominance setting for a0, and PxConstraintDominance::dominance1 becomes the dominance setting for a1. A dominanceN setting of 1.0f, the default, will permit aN to be pushed or pulled by a(1-N) through the constraint. A dominanceN setting of 0.0f, will however prevent aN to be pushed or pulled by a(1-N) through the constraint. Thus, a PxConstraintDominance of (1.0f, 0.0f) makes the interaction one-way.

The matrix sampled by getDominanceGroupPair(g1, g2) is initialised by default such that:

if g1 == g2, then (1.0f, 1.0f) is returned if g1 < g2, then (0.0f, 1.0f) is returned if g1 > g2, then (1.0f, 0.0f) is returned

In other words, we permit actors in higher groups to be pushed around by actors in lower groups by default.

These settings should cover most applications, and in fact not overriding these settings may likely result in higher performance.

It is not possible to make the matrix asymetric, or to change the diagonal. In other words:

it is not possible to change (g1, g2) if (g1==g2) if you set

(g1, g2) to X, then (g2, g1) will implicitly and automatically be set to ~X, where:

~(1.0f, 1.0f) is (1.0f, 1.0f) ~(0.0f, 1.0f) is (1.0f, 0.0f) ~(1.0f, 0.0f) is (0.0f, 1.0f)

These two restrictions are to make sure that constraints between two actors will always evaluate to the same dominance setting, regardless of which order the actors are passed to the constraint.

Dominance settings are currently specified as floats 0.0f or 1.0f because in the future we may permit arbitrary fractional settings to express 'partly-one-way' interactions.

Sleeping: Does NOT wake actors up automatically.

See also:
getDominanceGroupPair() PxDominanceGroup PxConstraintDominance PxActor::setDominanceGroup() PxActor::getDominanceGroup()

virtual void PxScene::setDynamicTreeRebuildRateHint ( PxU32  dynamicTreeRebuildRateHint  )  [pure virtual]

Sets the rebuild rate of the dynamic tree pruning structure.

Parameters:
[in] dynamicTreeRebuildRateHint Rebuild rate of the dynamic tree pruning structure.
See also:
PxSceneDesc.dynamicTreeRebuildRateHint getDynamicTreeRebuildRateHint()

virtual void PxScene::setFlag ( PxSceneFlag::Enum  flag,
bool  value 
) [pure virtual]

Sets a scene flag. You can only set one flag at a time.

Only the below flags are mutable. Trying to change the others will result in an error:

PxSceneFlag::eENABLE_SWEPT_INTEGRATION

See also:
PxSceneFlag

virtual void PxScene::setGravity ( const PxVec3 vec  )  [pure virtual]

Sets a constant gravity for the entire scene.

Sleeping: Does NOT wake the actor up automatically.

Parameters:
[in] vec A new gravity vector(e.g. PxVec3(0.0f,-9.8f,0.0f) ) Range: force vector
See also:
PxSceneDesc.gravity getGravity()

virtual void PxScene::setNbContactDataBlocks ( PxU32  numBlocks  )  [pure virtual]

set the cache blocks that can be used during simulate().

Each frame the simulation requires memory to store contact, friction, and contact cache data. This memory is used in blocks of 16K. Each frame the blocks used by the previous frame are freed, and may be retrieved by the application using PxScene::flush()

This call will force allocation of cache blocks if the numBlocks parameter is greater than the currently allocated number of blocks, and less than the max16KContactDataBlocks parameter specified at scene creation time.

Parameters:
[in] numBlocks The number of blocks to allocate.
See also:
PxSceneDesc.nbContactDataBlocks PxSceneDesc.maxNbContactDataBlocks flush() getNbContactDataBlocksUsed getMaxNbContactDataBlocksUsed

virtual void PxScene::setSimulationEventCallback ( PxSimulationEventCallback callback,
PxClientID  client = PX_DEFAULT_CLIENT 
) [pure virtual]

Sets a user notify object which receives special simulation events when they occur.

Multiclient behavior: Unlike the PxSimulationEventCallback that can be specified in the PxSceneDesc, this method lets the user associate additional callbacks with clients other than PX_DEFAULT_CLIENT. This way each client can register its own callback class. Each callback function has a somewhat differnt way of determining which clients' callbacks will be called in a certain event. Refer to the documentation of particular callback functions inside PxSimulationEventCallback for this information.

Note:
Do not set the callback while the simulation is running. Calls to this method while the simulation is running will be ignored.
Parameters:
[in] callback User notification callback. See PxSimulationEventCallback.
[in] client The client to be associated with this callback.
See also:
PxSimulationEventCallback getSimulationEventCallback

virtual void PxScene::setSolverBatchSize ( PxU32  solverBatchSize  )  [pure virtual]

Sets the number of actors required to spawn a separate rigid body solver thread.

Parameters:
[in] solverBatchSize Number of actors required to spawn a separate rigid body solver thread.
Platform:
  • PC SW: Yes
  • PS3 : Not applicable
  • XB360: Yes
  • WII : Yes
See also:
PxSceneDesc.solverBatchSize getSolverBatchSize()

virtual void PxScene::setVisualizationCullingBox ( const PxBounds3 box  )  [pure virtual]

virtual bool PxScene::setVisualizationParameter ( PxVisualizationParameter::Enum  param,
PxReal  value 
) [pure virtual]

Function that lets you set debug visualization parameters.

Returns false if the value passed is out of range for usage specified by the enum.

Parameters:
[in] param Parameter to set. See PxVisualizationParameter
[in] value The value to set, see PxVisualizationParameter for allowable values.
Returns:
False if the parameter is out of range.
See also:
getVisualizationParameter PxVisualizationParameter

virtual void PxScene::simulate ( PxReal  elapsedTime,
physx::pxtask::BaseTask *  completionTask = NULL,
void *  scratchMemBlock = 0,
PxU32  scratchMemBlockSize = 0,
bool  controlSimulation = true 
) [pure virtual]

Advances the simulation by an elapsedTime time.

Note:
Large elapsedTime values can lead to instabilities. In such cases elapsedTime should be subdivided into smaller time intervals and simulate() should be called multiple times for each interval.
Calls to simulate() should pair with calls to fetchResults(): Each fetchResults() invocation corresponds to exactly one simulate() invocation; calling simulate() twice without an intervening fetchResults() or fetchResults() twice without an intervening simulate() causes an error condition.

scene->simulate(); ...do some processing until physics is computed... scene->fetchResults(); ...now results of run may be retrieved.

Parameters:
[in] elapsedTime Amount of time to advance simulation by. The parameter has to be larger than 0, else the resulting behavior will be undefined. Range: (0,inf)
[in] completionTask if non-NULL, this task will have its refcount incremented in simulate(), then decremented when the scene is ready to have fetchResults called. So the task will not run until the application also calls removeReference().
[in] scratchMemBlock a memory region for physx to use for temporary data during simulation. This block may be reused by the application after fetchResults returns. Must be aligned on a 16-byte boundary
[in] scratchMemBlockSize the size of the scratch memory block. Must be a multiple of 16K.
[in] controlSimulation if true, the scene controls its TaskManager simulation state. Leave true unless the application is calling the TaskManager start/stopSimulation() methods itself.
See also:
fetchResults() checkResults()

virtual bool PxScene::sweepAny ( const PxGeometry **  geometryList,
const PxTransform poseList,
const PxFilterData filterDataList,
PxU32  geometryCount,
const PxVec3 unitDir,
const PxReal  distance,
PxSceneQueryFlags  queryFlags,
PxSceneQueryHit hit,
PxSceneQueryFilterFlags  filterFlags = PxSceneQueryFilterFlag::eDYNAMIC|PxSceneQueryFilterFlag::eSTATIC,
PxSceneQueryFilterCallback filterCall = NULL,
const PxSceneQueryCache cache = NULL,
PxClientID  queryClient = PX_DEFAULT_CLIENT 
) const [pure virtual]

Sweep of geometry compound returning any blocking hit, not necessarily the closest.

The function sweeps all specified geometry objects through space and returns whether any rigid actor is hit along the sweep path.

Note:
If a shape from the scene is already overlapping with the query shape in its starting position, behavior is controlled by the PxSceneQueryFlag::eINITIAL_OVERLAP flag.
Parameters:
[in] geometryList Geometries of objects to sweep (supported types are: box, sphere, capsule, convex).
[in] poseList The world pose for each geometry object.
[in] filterDataList Filter data for each geometry object. NULL, if no filtering should be done, all hits are assumed to be blocking in that case.
[in] geometryCount Number of geometry objects specified.
[in] unitDir Normalized direction of the sweep.
[in] distance Sweep distance. Needs to be larger than 0. Will be clamped to PX_MAX_SWEEP_DISTANCE.
[in] queryFlags Combination of PxSceneQueryFlag defining the query behavior
[out] hit Sweep hit information.
[in] filterFlags Simple filter logic.
[in] filterCall Custom filtering logic (optional). Only used if the corresponding PxSceneQueryFilterFlag flags are set. If NULL, all hits are assumed to be blocking.
[in] cache Cached hit shape (optional). Sweep is performed against cached shape first. If no hit is found the sweep gets queried against the scene. 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.
[in] queryClient ID of the client doing the query (see createClient())
Returns:
True if a blocking hit was found.
See also:
PxSceneQueryFilterData PxSceneQueryFilterCallback PxSceneQueryHit PxSceneQueryCache

virtual bool PxScene::sweepAny ( const PxGeometry geometry,
const PxTransform pose,
const PxVec3 unitDir,
const PxReal  distance,
PxSceneQueryFlags  queryFlags,
PxSceneQueryHit hit,
const PxSceneQueryFilterData filterData = PxSceneQueryFilterData(),
PxSceneQueryFilterCallback filterCall = NULL,
const PxSceneQueryCache cache = NULL,
PxClientID  queryClient = PX_DEFAULT_CLIENT 
) const [pure virtual]

Sweep returning any blocking hit, not necessarily the closest.

Returns whether any rigid actor is hit along the sweep path.

Note:
If a shape from the scene is already overlapping with the query shape in its starting position, behavior is controlled by the PxSceneQueryFlag::eINITIAL_OVERLAP flag.
Parameters:
[in] geometry Geometry of object to sweep (supported types are: box, sphere, capsule, convex).
[in] pose Pose of the sweep object.
[in] unitDir Normalized direction of the sweep.
[in] distance Sweep distance. Needs to be larger than 0. Will be clamped to PX_MAX_SWEEP_DISTANCE.
[in] queryFlags Combination of PxSceneQueryFlag defining the query behavior
[out] hit Sweep hit information.
[in] filterData Filtering data and simple logic.
[in] filterCall Custom filtering logic (optional). Only used if the corresponding PxSceneQueryFilterFlag flags are set. If NULL, all hits are assumed to be blocking.
[in] cache Cached hit shape (optional). Sweep is performed against cached shape first. If no hit is found the sweep gets queried against the scene. 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.
[in] queryClient ID of the client doing the query (see createClient())
Returns:
True if a blocking hit was found.
See also:
PxSceneQueryFilterData PxSceneQueryFilterCallback PxSceneQueryHit PxSceneQueryCache

virtual PxI32 PxScene::sweepMultiple ( const PxGeometry **  geometryList,
const PxTransform poseList,
const PxFilterData filterDataList,
PxU32  geometryCount,
const PxVec3 unitDir,
const PxReal  distance,
PxSceneQueryFlags  outputFlags,
PxSweepHit hitBuffer,
PxU32  hitBufferSize,
bool &  blockingHit,
PxSceneQueryFilterFlags  filterFlags = PxSceneQueryFilterFlag::eDYNAMIC|PxSceneQueryFilterFlag::eSTATIC,
PxSceneQueryFilterCallback filterCall = NULL,
const PxSceneQueryCache cache = NULL,
PxClientID  queryClient = PX_DEFAULT_CLIENT 
) const [pure virtual]

Sweep of geometry compound returning multiple results.

The function sweeps all specified geometry objects through space and finds all rigid actors that get hit along the sweep. Each result contains data as specified by the outputFlags field.

Note:
Touching hits are not ordered.

If a shape from the scene is already overlapping with the query shape in its starting position, behavior is controlled by the PxSceneQueryFlag::eINITIAL_OVERLAP flag.

Parameters:
[in] geometryList Geometries of objects to sweep (supported types are: box, sphere, capsule, convex).
[in] poseList The world pose for each geometry object.
[in] filterDataList Filter data for each geometry object. NULL, if no filtering should be done, all hits are assumed to be blocking in that case.
[in] geometryCount Number of geometry objects specified.
[in] unitDir Normalized direction of the sweep.
[in] distance Sweep distance. Needs to be larger than 0. Will be clamped to PX_MAX_SWEEP_DISTANCE.
[in] outputFlags Specifies which properties should be written to the hit information.
[out] hitBuffer Sweep hit information buffer. If the buffer overflows, the blocking hit is returned as the last entry together with an arbitrary subset of the nearer touching hits (typically the query should be restarted with a larger buffer).
[in] hitBufferSize Size of the hit buffer.
[out] blockingHit True if a blocking hit was found. If found, it is the last in the buffer, preceded by any touching hits which are closer. Otherwise the touching hits are listed.
[in] filterFlags Simple filter logic.
[in] filterCall Custom filtering logic (optional). Only used if the corresponding PxSceneQueryFilterFlag flags are set. If NULL, all hits are assumed to be touching.
[in] cache Cached hit shape (optional). Sweep is performed against cached shape first then against the scene. 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.
[in] queryClient ID of the client doing the query (see createClient())
Returns:
Number of hits in the buffer, or -1 if the buffer overflowed.
See also:
PxSceneQueryFlags PxSweepHit PxSceneQueryFilterData PxSceneQueryFilterCallback PxSceneQueryCache

virtual PxI32 PxScene::sweepMultiple ( const PxGeometry geometry,
const PxTransform pose,
const PxVec3 unitDir,
const PxReal  distance,
PxSceneQueryFlags  outputFlags,
PxSweepHit hitBuffer,
PxU32  hitBufferSize,
bool &  blockingHit,
const PxSceneQueryFilterData filterData = PxSceneQueryFilterData(),
PxSceneQueryFilterCallback filterCall = NULL,
const PxSceneQueryCache cache = NULL,
PxClientID  queryClient = PX_DEFAULT_CLIENT 
) const [pure virtual]

Sweep returning multiple results.

Find all rigid actors that get hit along the sweep. Each result contains data as specified by the outputFlags field.

Note:
Touching hits are not ordered.

If a shape from the scene is already overlapping with the query shape in its starting position, behavior is controlled by the PxSceneQueryFlag::eINITIAL_OVERLAP flag.

Parameters:
[in] geometry Geometry of object to sweep (supported types are: box, sphere, capsule, convex).
[in] pose Pose of the sweep object.
[in] unitDir Normalized direction of the sweep.
[in] distance Sweep distance. Needs to be larger than 0. Will be clamped to PX_MAX_SWEEP_DISTANCE.
[in] outputFlags Specifies which properties should be written to the hit information.
[out] hitBuffer Sweep hit information buffer. If the buffer overflows, the blocking hit is returned as the last entry together with an arbitrary subset of the nearer touching hits (typically the query should be restarted with a larger buffer).
[in] hitBufferSize Size of the hit buffer.
[out] blockingHit True if a blocking hit was found. If found, it is the last in the buffer, preceded by any touching hits which are closer. Otherwise the touching hits are listed.
[in] filterData Filtering data and simple logic.
[in] filterCall Custom filtering logic (optional). Only used if the corresponding PxSceneQueryFilterFlag flags are set. If NULL, all hits are assumed to be touching.
[in] cache Cached hit shape (optional). Sweep is performed against cached shape first then against the scene. 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.
[in] queryClient ID of the client doing the query (see createClient())
Returns:
Number of hits in the buffer, or -1 if the buffer overflowed.
See also:
PxSceneQueryFlags PxSweepHit PxSceneQueryFilterData PxSceneQueryFilterCallback PxSceneQueryCache

virtual bool PxScene::sweepSingle ( const PxGeometry **  geometryList,
const PxTransform poseList,
const PxFilterData filterDataList,
PxU32  geometryCount,
const PxVec3 unitDir,
const PxReal  distance,
PxSceneQueryFlags  outputFlags,
PxSweepHit hit,
PxSceneQueryFilterFlags  filterFlags = PxSceneQueryFilterFlag::eDYNAMIC|PxSceneQueryFilterFlag::eSTATIC,
PxSceneQueryFilterCallback filterCall = NULL,
const PxSceneQueryCache cache = NULL,
PxClientID  queryClient = PX_DEFAULT_CLIENT 
) const [pure virtual]

Sweep of geometry compound returning a single result.

The function sweeps all specified geometry objects through space and returns the first rigid actor that is hit along the ray. Data for a blocking hit will be returned as specified by the outputFlags field. Touching hits will be ignored.

Note:
If a shape from the scene is already overlapping with the query shape in its starting position, behavior is controlled by the PxSceneQueryFlag::eINITIAL_OVERLAP flag.
Parameters:
[in] geometryList Geometries of objects to sweep (supported types are: box, sphere, capsule, convex).
[in] poseList The world pose for each geometry object.
[in] filterDataList Filter data for each geometry object. NULL, if no filtering should be done, all hits are assumed to be blocking in that case.
[in] geometryCount Number of geometry objects specified.
[in] unitDir Normalized direction of the sweep.
[in] distance Sweep distance. Needs to be larger than 0. Will be clamped to PX_MAX_SWEEP_DISTANCE.
[in] outputFlags Specifies which properties should be written to the hit information.
[out] hit Sweep hit information.
[in] filterFlags Simple filter logic.
[in] filterCall Custom filtering logic (optional). Only used if the corresponding PxSceneQueryFilterFlag flags are set. If NULL, all hits are assumed to be blocking.
[in] cache Cached hit shape (optional). Sweep is performed against cached shape first then against the scene. 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.
[in] queryClient ID of the client doing the query (see createClient())
Returns:
True if a blocking hit was found.
See also:
PxSceneQueryFlags PxSweepHit PxSceneQueryFilterData PxSceneQueryFilterCallback PxSceneQueryCache

virtual bool PxScene::sweepSingle ( const PxGeometry geometry,
const PxTransform pose,
const PxVec3 unitDir,
const PxReal  distance,
PxSceneQueryFlags  outputFlags,
PxSweepHit hit,
const PxSceneQueryFilterData filterData = PxSceneQueryFilterData(),
PxSceneQueryFilterCallback filterCall = NULL,
const PxSceneQueryCache cache = NULL,
PxClientID  queryClient = PX_DEFAULT_CLIENT 
) const [pure virtual]

Sweep returning a single result.

Returns the first rigid actor that is hit along the ray. Data for a blocking hit will be returned as specified by the outputFlags field. Touching hits will be ignored.

Note:
If a shape from the scene is already overlapping with the query shape in its starting position, behavior is controlled by the PxSceneQueryFlag::eINITIAL_OVERLAP flag.
Parameters:
[in] geometry Geometry of object to sweep (supported types are: box, sphere, capsule, convex).
[in] pose Pose of the sweep object.
[in] unitDir Normalized direction of the sweep.
[in] distance Sweep distance. Needs to be larger than 0. Will be clamped to PX_MAX_SWEEP_DISTANCE.
[in] outputFlags Specifies which properties should be written to the hit information.
[out] hit Sweep hit information.
[in] filterData Filtering data and simple logic.
[in] filterCall Custom filtering logic (optional). Only used if the corresponding PxSceneQueryFilterFlag flags are set. If NULL, all hits are assumed to be blocking.
[in] cache Cached hit shape (optional). Sweep is performed against cached shape first then against the scene. 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.
[in] queryClient ID of the client doing the query (see createClient())
Returns:
True if a blocking hit was found.
See also:
PxSceneQueryFlags PxSweepHit PxSceneQueryFilterData PxSceneQueryFilterCallback PxSceneQueryCache


Member Data Documentation

user can assign this to whatever, usually to create a 1:1 relationship with a user object.


The documentation for this class was generated from the following file:



Copyright © 2008-2012 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com