Public Member Functions | Public Attributes | List of all members
PxCookingParams Struct Reference

Structure describing parameters affecting mesh cooking. More...

#include <PxCooking.h>

Collaboration diagram for PxCookingParams:
Collaboration graph
[legend]

Public Member Functions

 PxCookingParams (const PxTolerancesScale &sc)
 

Public Attributes

PxPlatform::Enum targetPlatform
 Target platform. More...
 
float skinWidth
 Skin width for convexes. More...
 
float areaTestEpsilon
 Zero-size area epsilon used in convex hull computation. More...
 
bool suppressTriangleMeshRemapTable
 When true, the face remap table is not created. This saves a significant amount of memory, but the SDK will not be able to provide the remap information for internal mesh triangles returned by collisions, sweeps or raycasts hits. More...
 
bool buildTriangleAdjacencies
 When true, the triangle adjacency information is created. You can get the adjacency triangles for a given triangle from getTriangle. More...
 
PxTolerancesScale scale
 Tolerance scale is used to check if cooked triangles are not too huge. This check will help with simulation stability. More...
 
PxMeshPreprocessingFlags meshPreprocessParams
 Mesh pre-processing parameters. Used to control options like whether the mesh cooking performs vertex welding before cooking. More...
 
PxMeshCookingHint::Enum meshCookingHint
 Mesh cooking hint. Used to specify mesh hierarchy construction preference. More...
 
PxReal meshWeldTolerance
 Mesh weld tolerance. If mesh welding is enabled, this controls the distance at which vertices are welded. If mesh welding is not enabled, this value defines the acceptance distance for mesh validation. Provided no two vertices are within this distance, the mesh is considered to be clean. If not, a warning will be emitted. Having a clean, welded mesh is required to achieve the best possible performance. More...
 
PxF32 meshSizePerformanceTradeOff
 Controls the trade-off between mesh size and runtime performance. More...
 

Detailed Description

Structure describing parameters affecting mesh cooking.

See Also
PxSetCookingParams() PxGetCookingParams()

Constructor & Destructor Documentation

PxCookingParams::PxCookingParams ( const PxTolerancesScale sc)
inline

Member Data Documentation

float PxCookingParams::areaTestEpsilon

Zero-size area epsilon used in convex hull computation.

If the area of a triangle of the hull is below this value, the triangle will be rejected. This test is done only if PxConvexFlag::eCHECK_ZERO_AREA_TRIANGLES is used.

See Also
PxConvexFlag::eCHECK_ZERO_AREA_TRIANGLES

Default value: 0.06f*PxTolerancesScale.length*PxTolerancesScale.length

Range: (0.0f, PX_MAX_F32)

bool PxCookingParams::buildTriangleAdjacencies

When true, the triangle adjacency information is created. You can get the adjacency triangles for a given triangle from getTriangle.

Default value: false

PxMeshCookingHint::Enum PxCookingParams::meshCookingHint

Mesh cooking hint. Used to specify mesh hierarchy construction preference.

Default value: PxMeshCookingHint::eSIM_PERFORMANCE

PxMeshPreprocessingFlags PxCookingParams::meshPreprocessParams

Mesh pre-processing parameters. Used to control options like whether the mesh cooking performs vertex welding before cooking.

Default value: 0

PxF32 PxCookingParams::meshSizePerformanceTradeOff

Controls the trade-off between mesh size and runtime performance.

Using a value of 1.0 will produce a larger cooked mesh with generally higher runtime performance, using 0.0 will produce a smaller cooked mesh, with generally lower runtime performance.

Values outside of [0,1] range will be clamped and cause a warning when any mesh gets cooked.

Default value: 0.55 Range: [0.0f, 1.0f]

PxReal PxCookingParams::meshWeldTolerance

Mesh weld tolerance. If mesh welding is enabled, this controls the distance at which vertices are welded. If mesh welding is not enabled, this value defines the acceptance distance for mesh validation. Provided no two vertices are within this distance, the mesh is considered to be clean. If not, a warning will be emitted. Having a clean, welded mesh is required to achieve the best possible performance.

The default vertex welding uses a snap-to-grid approach. This approach effectively truncates each vertex to integer values using meshWeldTolerance. Once these snapped vertices are produced, all vertices that snap to a given vertex on the grid are remapped to reference a single vertex. Following this, all triangles' indices are remapped to reference this subset of clean vertices. It should be noted that the vertices that we do not alter the position of the vertices; the snap-to-grid is only performed to identify nearby vertices.

The mesh validation approach also uses the same snap-to-grid approach to identify nearby vertices. If more than one vertex snaps to a given grid coordinate, we ensure that the distance between the vertices is at least meshWeldTolerance. If this is not the case, a warning is emitted.

Default value: 0.0

PxTolerancesScale PxCookingParams::scale

Tolerance scale is used to check if cooked triangles are not too huge. This check will help with simulation stability.

Note
The PxTolerancesScale values have to match the values used when creating a PxPhysics or PxScene instance.
See Also
PxTolerancesScale
float PxCookingParams::skinWidth

Skin width for convexes.

Specifies the amount to inflate the convex mesh when the PxConvexFlag::eINFLATE_CONVEX is used.

The value is used for moving planes outward, and beveling sharp edges. This helps the hull generator code produce more stable convexes for collision detection. Please note that the resulting hull will increase its size, so contact generation may produce noticeable separation between shapes. The separation distance can be reduced by decreasing the contactOffset and restOffset. See the user's manual on 'Shapes - Tuning Shape Collision Behavior' for details.

Change the value if the produced hulls are too thin or improper for your usage. Increasing the value too much will result in incorrect hull size and a large separation between shapes.

Default value: 0.025f*PxTolerancesScale.length

Range: (0.0f, PX_MAX_F32)

bool PxCookingParams::suppressTriangleMeshRemapTable

When true, the face remap table is not created. This saves a significant amount of memory, but the SDK will not be able to provide the remap information for internal mesh triangles returned by collisions, sweeps or raycasts hits.

Default value: false

PxPlatform::Enum PxCookingParams::targetPlatform

Target platform.

Should be set to the platform which you intend to load the cooked mesh data on. This allows the SDK to optimize the mesh data in an appropriate way for the platform and make sure that endianness issues are accounted for correctly.

Default value: Same as the platform on which the SDK is running.


The documentation for this struct 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