Public Member Functions | Public Attributes | List of all members
PxSceneDesc Class Reference

Descriptor class for scenes. See PxScene. More...

#include <PxSceneDesc.h>

Collaboration diagram for PxSceneDesc:
Collaboration graph
[legend]

Public Member Functions

PX_INLINE PxSceneDesc (const PxTolerancesScale &scale)
 constructor sets to default. More...
 
PX_INLINE void setToDefault (const PxTolerancesScale &scale)
 (re)sets the structure to the default. More...
 
PX_INLINE bool isValid () const
 Returns true if the descriptor is valid. More...
 

Public Attributes

PxVec3 gravity
 Gravity vector. More...
 
PxSimulationEventCallbacksimulationEventCallback
 Possible notification callback. More...
 
PxContactModifyCallbackcontactModifyCallback
 Possible asynchronous callback for contact modification. More...
 
PxCCDContactModifyCallbackccdContactModifyCallback
 Possible asynchronous callback for contact modification. More...
 
const void * filterShaderData
 Shared global filter data which will get passed into the filter shader. More...
 
PxU32 filterShaderDataSize
 Size (in bytes) of the shared global filter data filterShaderData. More...
 
PxSimulationFilterShader filterShader
 The custom filter shader to use for collision filtering. More...
 
PxSimulationFilterCallbackfilterCallback
 A custom collision filter callback which can be used to implement more complex filtering operations which need access to the simulation state, for example. More...
 
PxBroadPhaseType::Enum broadPhaseType
 Selects the broad-phase algorithm to use. More...
 
PxBroadPhaseCallbackbroadPhaseCallback
 Broad-phase callback. More...
 
PxSceneLimits limits
 Expected scene limits. More...
 
PX_DEPRECATED PxReal meshContactMargin
 A small margin value used for mesh collision detection. (convex/box vs height field or convex/box vs triangle mesh) More...
 
PxFrictionType::Enum frictionType
 Selects the friction algorithm to use for simulation. More...
 
PX_DEPRECATED PxReal contactCorrelationDistance
 The patch friction model uses this coefficient to determine if a friction anchor can persist between frames. More...
 
PxReal bounceThresholdVelocity
 A contact with a relative velocity below this will not bounce. A typical value for simulation. stability is about 0.2 * gravity. More...
 
PxReal frictionOffsetThreshold
 A threshold of contact separation distance used to decide if a contact point will experience friction forces. More...
 
PxSceneFlags flags
 Flags used to select scene options. More...
 
PxCpuDispatchercpuDispatcher
 The CPU task dispatcher for the scene. More...
 
PxGpuDispatchergpuDispatcher
 The GPU task dispatcher for the scene. More...
 
PxSpuDispatcherspuDispatcher
 The SPU task dispatcher for the scene. More...
 
PxPruningStructure::Enum staticStructure
 Defines the structure used to store static objects. More...
 
PxPruningStructure::Enum dynamicStructure
 Defines the structure used to store dynamic objects. More...
 
PxU32 dynamicTreeRebuildRateHint
 Hint for how much work should be done per simulation frame to rebuild the pruning structure. More...
 
void * userData
 Will be copied to PxScene::userData. More...
 
PxU32 solverBatchSize
 Defines the number of actors required to spawn a separate rigid body solver island task chain. More...
 
PxU32 nbContactDataBlocks
 Setting to define the number of 16K blocks that will be initially reserved to store contact, friction, and contact cache data. This is the number of 16K memory blocks that will be automatically allocated from the user allocator when the scene is instantiated. Further 16k memory blocks may be allocated during the simulation up to maxNbContactDataBlocks. More...
 
PxU32 maxNbContactDataBlocks
 Setting to define the maximum number of 16K blocks that can be allocated to store contact, friction, and contact cache data. As the complexity of a scene increases, the SDK may require to allocate new 16k blocks in addition to the blocks it has already allocated. This variable controls the maximum number of blocks that the SDK can allocate. More...
 
PxU32 contactReportStreamBufferSize
 Size of the contact report stream (in bytes). More...
 
PxU32 ccdMaxPasses
 Maximum number of CCD passes. More...
 
PxSimulationOrder::Enum simulationOrder
 The simulation order PhysX supports 2 simulation update approaches. The default model - eCOLLIDE_SOLVE - performs collision detection before solver. The alternative model, eSOLVE_COLLIDE (This feature is currently disabled), performs solve before collision. This has the performance benefit of allowing the game to defer collision detection for the subsequent frame so that it can overlap with things like game logic, rendering etc. However, it has the disadvantage that it requires insertions, removals and teleports to be deferred between dispatching collision detection and solve, which can potentially cause 1 frame's delay in these operations. More...
 
PxReal wakeCounterResetValue
 The wake counter reset value. More...
 
PxBounds3 sanityBounds
 The bounds used to sanity check user-set positions of actors and articulation links. More...
 

Detailed Description

Descriptor class for scenes. See PxScene.

This struct must be initialized with the same PxTolerancesScale values used to initialize PxPhysics.

See Also
PxScene PxPhysics.createScene PxTolerancesScale

Member Data Documentation

PxReal PxSceneDesc::bounceThresholdVelocity

A contact with a relative velocity below this will not bounce. A typical value for simulation. stability is about 0.2 * gravity.

Range: [0, PX_MAX_F32)
Default: 0.2 * PxTolerancesScale::speed

See Also
PxMaterial

Referenced by isValid().

PxBroadPhaseCallback* PxSceneDesc::broadPhaseCallback

Broad-phase callback.

This callback will be associated with the client PX_DEFAULT_CLIENT. Please use PxScene::setBroadPhaseCallback() to register callbacks for other clients.

Default: NULL

See Also
PxBroadPhaseCallback
PxBroadPhaseType::Enum PxSceneDesc::broadPhaseType

Selects the broad-phase algorithm to use.

Default: PxBroadPhaseType::eSAP

See Also
PxBroadPhaseType
PxCCDContactModifyCallback* PxSceneDesc::ccdContactModifyCallback

Possible asynchronous callback for contact modification.

Default: NULL

See Also
PxContactModifyCallback PxScene.setContactModifyCallback() PxScene.getContactModifyCallback()
PxU32 PxSceneDesc::ccdMaxPasses

Maximum number of CCD passes.

The CCD performs multiple passes, where each pass every object advances to its time of first impact. This value defines how many passes the CCD system should perform.

Note
The CCD system is a multi-pass best-effort conservative advancement approach. After the defined number of passes has been completed, any remaining time is dropped.
This defines the maximum number of passes the CCD can perform. It may perform fewer if additional passes are not necessary.

Default: 1 Range: [1, PX_MAX_U32]

PX_DEPRECATED PxReal PxSceneDesc::contactCorrelationDistance

The patch friction model uses this coefficient to determine if a friction anchor can persist between frames.

Deprecated:

A friction anchor is a point on a body where friction gets applied, similar to a contact point. The simulation determines new potential friction anchors every time step, and deletes them if over time the bodies that they are attached to slide apart by more than this distance. We believe the user does not need to modify this parameter from its default. For this reason we are planning to remove it in future releases. If you have an application that is relying on modifying this parameter, please let us know.

The alternative Coulomb friction model does not use this coefficient.

Range: [0, PX_MAX_F32)
Default: 0.025 * PxTolerancesScale::length

Referenced by isValid().

PxContactModifyCallback* PxSceneDesc::contactModifyCallback

Possible asynchronous callback for contact modification.

Default: NULL

See Also
PxContactModifyCallback PxScene.setContactModifyCallback() PxScene.getContactModifyCallback()
PxU32 PxSceneDesc::contactReportStreamBufferSize

Size of the contact report stream (in bytes).

The contact report stream buffer is used during the simulation to store all the contact reports. If the size is not sufficient, the buffer will grow by a factor of two. It is possible to disable the buffer growth by setting the flag PxSceneFlag::eDISABLE_CONTACT_REPORT_BUFFER_RESIZE. In that case the buffer will not grow but contact reports not stored in the buffer will not get sent in the contact report callbacks.

Default: 8192

Range: (0, PX_MAX_U32]

Referenced by isValid().

PxCpuDispatcher* PxSceneDesc::cpuDispatcher

The CPU task dispatcher for the scene.

See PxCpuDispatcher, PxScene::getCpuDispatcher

Referenced by isValid().

PxPruningStructure::Enum PxSceneDesc::dynamicStructure

Defines the structure used to store dynamic objects.

PxU32 PxSceneDesc::dynamicTreeRebuildRateHint

Hint for how much work should be done per simulation frame to rebuild the pruning structure.

This parameter gives a hint on the distribution of the workload for rebuilding the dynamic AABB tree pruning structure PxPruningStructure::eDYNAMIC_AABB_TREE. It specifies the desired number of simulation frames the rebuild process should take. Higher values will decrease the workload per frame but the pruning structure will get more and more outdated the longer the rebuild takes (which can make scene queries less efficient).

Note
Only used for PxPruningStructure::eDYNAMIC_AABB_TREE pruning structure.
This parameter gives only a hint. The rebuild process might still take more or less time depending on the number of objects involved.

Range: [4, PX_MAX_U32)
Default: 100

Referenced by isValid().

PxSimulationFilterCallback* PxSceneDesc::filterCallback

A custom collision filter callback which can be used to implement more complex filtering operations which need access to the simulation state, for example.

Default: NULL

See Also
PxSimulationFilterCallback
PxSimulationFilterShader PxSceneDesc::filterShader

The custom filter shader to use for collision filtering.

Note
This parameter is compulsory. If you don't want to define your own filter shader you can use the default shader PxDefaultSimulationFilterShader which can be found in the PhysX extensions library.
See Also
PxSimulationFilterShader

Referenced by isValid().

const void* PxSceneDesc::filterShaderData

Shared global filter data which will get passed into the filter shader.

Note
The provided data will get copied to internal buffers and this copy will be used for filtering calls.

Default: NULL

See Also
PxSimulationFilterShader

Referenced by isValid().

PxU32 PxSceneDesc::filterShaderDataSize

Size (in bytes) of the shared global filter data filterShaderData.

Default: 0

See Also
PxSimulationFilterShader filterShaderData

Referenced by isValid().

PxSceneFlags PxSceneDesc::flags

Flags used to select scene options.

See Also
PxSceneFlag PxSceneFlags

Referenced by isValid().

PxReal PxSceneDesc::frictionOffsetThreshold

A threshold of contact separation distance used to decide if a contact point will experience friction forces.

Note
If the separation distance of a contact point is greater than the threshold then the contact point will not experience friction forces.
If the aggregated contact offset of a pair of shapes is large it might be desirable to neglect friction for contact points whose separation distance is sufficiently large that the shape surfaces are clearly separated.
This parameter can be used to tune the separation distance of contact points at which friction starts to have an effect.

Range: [0, PX_MAX_F32)
Default: 0.04 * PxTolerancesScale::length

Referenced by isValid().

PxFrictionType::Enum PxSceneDesc::frictionType

Selects the friction algorithm to use for simulation.

Note
frictionType cannot be modified after the first call to any of PxScene::simulate, PxScene::solve and PxScene::collide
See Also
PxFrictionType Default: PxFrictionType::ePATCH
PxScene::setFrictionType, PxScene::getFrictionType
PxGpuDispatcher* PxSceneDesc::gpuDispatcher

The GPU task dispatcher for the scene.

Platform specific: Applies to PC GPU only.

See PxGpuDispatcher, PxScene::getGpuDispatcher

PxVec3 PxSceneDesc::gravity

Gravity vector.

Range: force vector
Default: Zero

See Also
PxScene.setGravity()

When setting gravity, you should probably also set bounce threshold.

PxSceneLimits PxSceneDesc::limits

Expected scene limits.

See Also
PxSceneLimits

Referenced by isValid().

PxU32 PxSceneDesc::maxNbContactDataBlocks

Setting to define the maximum number of 16K blocks that can be allocated to store contact, friction, and contact cache data. As the complexity of a scene increases, the SDK may require to allocate new 16k blocks in addition to the blocks it has already allocated. This variable controls the maximum number of blocks that the SDK can allocate.

In the case that the scene is sufficiently complex that all the permitted 16K blocks are used, contacts will be dropped and a warning passed to the error stream.

If a warning is reported to the error stream to indicate the number of 16K blocks is insufficient for the scene complexity then the choices are either (i) re-tune the number of 16K data blocks until a number is found that is sufficient for the scene complexity, (ii) to simplify the scene or (iii) to opt to not increase the memory requirements of physx and accept some dropped contacts.

Default: 65536, or 256 on PS3

Range: [0, PX_MAX_U32]

See Also
nbContactDataBlocks PxScene::setNbContactDataBlocks

Referenced by isValid().

PX_DEPRECATED PxReal PxSceneDesc::meshContactMargin

A small margin value used for mesh collision detection. (convex/box vs height field or convex/box vs triangle mesh)

Deprecated:
Note
If interested in distance-based collision, please see the PxSceneFlag::eENABLE_PCM to enable the GJK/EPA path.
Will be removed in future releases.
See Also
PxTolerancesScale Default: 0.01 * PxTolerancesScale::length

Referenced by isValid().

PxU32 PxSceneDesc::nbContactDataBlocks

Setting to define the number of 16K blocks that will be initially reserved to store contact, friction, and contact cache data. This is the number of 16K memory blocks that will be automatically allocated from the user allocator when the scene is instantiated. Further 16k memory blocks may be allocated during the simulation up to maxNbContactDataBlocks.

Note
This value cannot be larger than maxNbContactDataBlocks because that defines the maximum number of 16k blocks that can be allocated by the SDK.

Default: 0, or 256 on PS3

Range: [0, PX_MAX_U32]

See Also
PxPhysics::createScene PxScene::setNbContactDataBlocks

Referenced by isValid().

PxBounds3 PxSceneDesc::sanityBounds

The bounds used to sanity check user-set positions of actors and articulation links.

These bounds are used to check the position values of rigid actors inserted into the scene, and positions set for rigid actors already within the scene.

Range: any valid PxBounds3
Default: (-PX_MAX_BOUNDS_EXTENTS, PX_MAX_BOUNDS_EXTENTS) on each axis

Referenced by isValid().

PxSimulationEventCallback* PxSceneDesc::simulationEventCallback

Possible notification callback.

This callback will be associated with the client PX_DEFAULT_CLIENT. Please use PxScene::setSimulationEventCallback() to register callbacks for other clients.

Default: NULL

See Also
PxSimulationEventCallback PxScene.setSimulationEventCallback() PxScene.getSimulationEventCallback()
PxSimulationOrder::Enum PxSceneDesc::simulationOrder

The simulation order PhysX supports 2 simulation update approaches. The default model - eCOLLIDE_SOLVE - performs collision detection before solver. The alternative model, eSOLVE_COLLIDE (This feature is currently disabled), performs solve before collision. This has the performance benefit of allowing the game to defer collision detection for the subsequent frame so that it can overlap with things like game logic, rendering etc. However, it has the disadvantage that it requires insertions, removals and teleports to be deferred between dispatching collision detection and solve, which can potentially cause 1 frame's delay in these operations.

Default: eCOLLIDE_SOLVE

Referenced by isValid().

PxU32 PxSceneDesc::solverBatchSize

Defines the number of actors required to spawn a separate rigid body solver island task chain.

This parameter defines the minimum number of actors required to spawn a separate rigid body solver task chain. Setting a low value will potentially cause more task chains to be generated. This may result in the overhead of spawning tasks can become a limiting performance factor. Setting a high value will potentially cause fewer islands to be generated. This may reduce thread scaling (fewer task chains spawned) and may detrimentally affect performance if some bodies in the scene have large solver iteration counts because all constraints in a given island are solved by the maximum number of solver iterations requested by any body in the island.

Default: 32

Platform specific: Not applicable on PS3. All bodies are batched into one island.

See Also
PxScene.setSolverBatchSize() PxScene.getSolverBatchSize()
PxSpuDispatcher* PxSceneDesc::spuDispatcher

The SPU task dispatcher for the scene.

Platform specific: Applies to PS3 only.

See PxSpuDispatcher, PxScene::getSpuDispatcher

PxPruningStructure::Enum PxSceneDesc::staticStructure

Defines the structure used to store static objects.

Note
Only PxPruningStructure::eSTATIC_AABB_TREE and PxPruningStructure::eDYNAMIC_AABB_TREE are allowed here.

Referenced by isValid().

void* PxSceneDesc::userData

Will be copied to PxScene::userData.

Default: NULL

PxReal PxSceneDesc::wakeCounterResetValue

The wake counter reset value.

Calling wakeUp() on objects which support sleeping will set their wake counter value to the specified reset value.

Range: (0, PX_MAX_F32)
Default: 0.4 (which corresponds to 20 frames for a time step of 0.02)

See Also
PxRigidDynamic::wakeUp() PxArticulation::wakeUp() PxCloth::wakeUp()

Referenced by isValid().


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


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