-
Nested Class Summary
Nested classes/interfaces inherited from class physx.NativeObject
NativeObject.Allocator<T> -
Field Summary
FieldsFields inherited from class physx.NativeObject
address, isExternallyAllocated, SIZEOF_BYTE, SIZEOF_DOUBLE, SIZEOF_FLOAT, SIZEOF_INT, SIZEOF_LONG, SIZEOF_POINTER, SIZEOF_SHORT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PxCookingParamsarrayGet(long baseAddress, int index) voiddestroy()floatZero-size area epsilon used in convex hull computation.booleanWhen true, additional information required for GPU-accelerated rigid body simulation is created.booleanWhen true, the triangle adjacency information is created.Convex hull creation algorithm.intVertex limit beyond which additional acceleration structures are computed for each convex mesh.Mesh pre-processing parameters.floatMesh weld tolerance.Controls the desired midphase desc structure for triangle meshes.floatPlane tolerance used in convex hull computation.getScale()Tolerance scale is used to check if cooked triangles are not too huge.booleanWhen true, the face remap table is not created.voidsetAreaTestEpsilon(float value) Zero-size area epsilon used in convex hull computation.voidsetBuildGPUData(boolean value) When true, additional information required for GPU-accelerated rigid body simulation is created.voidsetBuildTriangleAdjacencies(boolean value) When true, the triangle adjacency information is created.voidConvex hull creation algorithm.voidsetGaussMapLimit(int value) Vertex limit beyond which additional acceleration structures are computed for each convex mesh.voidMesh pre-processing parameters.voidsetMeshWeldTolerance(float value) Mesh weld tolerance.voidsetMidphaseDesc(PxMidphaseDesc value) Controls the desired midphase desc structure for triangle meshes.voidsetPlaneTolerance(float value) Plane tolerance used in convex hull computation.voidsetScale(PxTolerancesScale value) Tolerance scale is used to check if cooked triangles are not too huge.voidsetSuppressTriangleMeshRemapTable(boolean value) When true, the face remap table is not created.static PxCookingParamswrapPointer(long address) Methods inherited from class physx.NativeObject
checkNotNull, equals, getAddress, hashCode
-
Field Details
-
SIZEOF
public static final int SIZEOF -
ALIGNOF
public static final int ALIGNOF- See Also:
-
-
Constructor Details
-
PxCookingParams
protected PxCookingParams() -
PxCookingParams
protected PxCookingParams(long address) -
PxCookingParams
- Parameters:
sc- WebIDL type:PxTolerancesScale[Const, Ref]
-
-
Method Details
-
wrapPointer
-
arrayGet
-
destroy
public void destroy() -
getAreaTestEpsilon
public float getAreaTestEpsilon()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.
Default value: 0.06f*PxTolerancesScale.length*PxTolerancesScale.length
Range: (0.0f, PX_MAX_F32)
-
setAreaTestEpsilon
public void setAreaTestEpsilon(float value) 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.
Default value: 0.06f*PxTolerancesScale.length*PxTolerancesScale.length
Range: (0.0f, PX_MAX_F32)
-
getPlaneTolerance
public float getPlaneTolerance()Plane tolerance used in convex hull computation.The value is used during hull construction. When a new point is about to be added to the hull it gets dropped when the point is closer to the hull than the planeTolerance. The planeTolerance is increased according to the hull size.
If 0.0f is set all points are accepted when the convex hull is created. This may lead to edge cases where the new points may be merged into an existing polygon and the polygons plane equation might slightly change therefore. This might lead to failures during polygon merging phase in the hull computation.
It is recommended to use the default value, however if it is required that all points needs to be accepted or huge thin convexes are created, it might be required to lower the default value.
Note: The plane tolerance is used only within PxConvexMeshCookingType::eQUICKHULL algorithm.
Default value: 0.0007f
Range: <0.0f, PX_MAX_F32)
-
setPlaneTolerance
public void setPlaneTolerance(float value) Plane tolerance used in convex hull computation.The value is used during hull construction. When a new point is about to be added to the hull it gets dropped when the point is closer to the hull than the planeTolerance. The planeTolerance is increased according to the hull size.
If 0.0f is set all points are accepted when the convex hull is created. This may lead to edge cases where the new points may be merged into an existing polygon and the polygons plane equation might slightly change therefore. This might lead to failures during polygon merging phase in the hull computation.
It is recommended to use the default value, however if it is required that all points needs to be accepted or huge thin convexes are created, it might be required to lower the default value.
Note: The plane tolerance is used only within PxConvexMeshCookingType::eQUICKHULL algorithm.
Default value: 0.0007f
Range: <0.0f, PX_MAX_F32)
-
getConvexMeshCookingType
Convex hull creation algorithm.Default value: PxConvexMeshCookingType::eQUICKHULL
-
setConvexMeshCookingType
Convex hull creation algorithm.Default value: PxConvexMeshCookingType::eQUICKHULL
-
getSuppressTriangleMeshRemapTable
public boolean getSuppressTriangleMeshRemapTable()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
-
setSuppressTriangleMeshRemapTable
public void setSuppressTriangleMeshRemapTable(boolean value) 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
-
getBuildTriangleAdjacencies
public boolean getBuildTriangleAdjacencies()When true, the triangle adjacency information is created. You can get the adjacency triangles for a given triangle from getTriangle.Default value: false
-
setBuildTriangleAdjacencies
public void setBuildTriangleAdjacencies(boolean value) When true, the triangle adjacency information is created. You can get the adjacency triangles for a given triangle from getTriangle.Default value: false
-
getBuildGPUData
public boolean getBuildGPUData()When true, additional information required for GPU-accelerated rigid body simulation is created. This can increase memory usage and cooking times for convex meshes and triangle meshes.Default value: false
-
setBuildGPUData
public void setBuildGPUData(boolean value) When true, additional information required for GPU-accelerated rigid body simulation is created. This can increase memory usage and cooking times for convex meshes and triangle meshes.Default value: false
-
getScale
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:
-
setScale
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:
-
getMeshPreprocessParams
Mesh pre-processing parameters. Used to control options like whether the mesh cooking performs vertex welding before cooking.Default value: 0
-
setMeshPreprocessParams
Mesh pre-processing parameters. Used to control options like whether the mesh cooking performs vertex welding before cooking.Default value: 0
-
getMeshWeldTolerance
public float getMeshWeldTolerance()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
-
setMeshWeldTolerance
public void setMeshWeldTolerance(float value) 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
-
getMidphaseDesc
Controls the desired midphase desc structure for triangle meshes.- See Also:
-
setMidphaseDesc
Controls the desired midphase desc structure for triangle meshes.- See Also:
-
getGaussMapLimit
public int getGaussMapLimit()Vertex limit beyond which additional acceleration structures are computed for each convex mesh. Increase that limit to reduce memory usage. Computing the extra structures all the time does not guarantee optimal performance. There is a per-platform break-even point below which the extra structures actually hurt performance.Default value: 32
-
setGaussMapLimit
public void setGaussMapLimit(int value) Vertex limit beyond which additional acceleration structures are computed for each convex mesh. Increase that limit to reduce memory usage. Computing the extra structures all the time does not guarantee optimal performance. There is a per-platform break-even point below which the extra structures actually hurt performance.Default value: 32
-