Public Member Functions
nvidia::apex::ClothingPhysicalMesh Class Reference

Holder for a physical mesh, this can be generated through various ways (see single- and multi-layered clothing) or hand crafted. More...

#include <ClothingPhysicalMesh.h>

List of all members.

Public Member Functions

virtual uint32_t getNumVertices () const =0
 returns the number of vertices
virtual uint32_t getNumSimulatedVertices () const =0
 returns the number of simulated vertices
virtual uint32_t getNumMaxDistance0Vertices () const =0
 returns the number of vertices with zero max distance
virtual uint32_t getNumIndices () const =0
 returns the number of indices
virtual uint32_t getNumSimulatedIndices () const =0
 returns the number of simulated indices
virtual void getIndices (void *indexDestination, uint32_t byteStride, uint32_t numIndices) const =0
 writes the indices to a destination buffer
virtual bool isTetrahedralMesh () const =0
 returns whether the mesh is built out of tetrahedra or triangles
virtual void simplify (uint32_t subdivisions, int32_t maxSteps, float maxError, IProgressListener *progress)=0
 This will simplify the current mesh.
virtual void setGeometry (bool tetraMesh, uint32_t numVertices, uint32_t vertexByteStride, const void *vertices, const uint32_t *driveChannels, uint32_t numIndices, uint32_t indexByteStride, const void *indices)=0
 Create a physical mesh from scratch.
virtual bool getIndices (uint32_t *indices, uint32_t byteStride) const =0
 writes the indices into a user specified buffer.
virtual bool getVertices (PxVec3 *vertices, uint32_t byteStride) const =0
 Writes the vertex positions into a user specified buffer.
virtual bool getNormals (PxVec3 *normals, uint32_t byteStride) const =0
 Writes the normals into a user specified buffer.
virtual uint32_t getNumBonesPerVertex () const =0
 Returns the number of bones per vertex.
virtual bool getBoneIndices (uint16_t *boneIndices, uint32_t byteStride) const =0
 Writes the bone indices into a user specified buffer.
virtual bool getBoneWeights (float *boneWeights, uint32_t byteStride) const =0
 Writes the bone weights into a user specified buffer.
virtual void allocateMasterFlagsBuffer ()=0
 Allocates and initializes the drive channels (master flags) of the physics mesh.
virtual uint32_t * getMasterFlagsBuffer ()=0
 Returns the masterFlag buffer pointer in order to edit the values.
virtual void allocateConstrainCoefficientBuffer ()=0
 Allocates and initializes the constrain coefficients of the physics mesh.
virtual
ClothingConstrainCoefficients
getConstrainCoefficientBuffer () const =0
 Returns the constrain coefficient buffer pointer in order to edit the values.
virtual bool getConstrainCoefficients (ClothingConstrainCoefficients *coeffs, uint32_t byteStride) const =0
 Writes the cloth constrain coefficients into a user specified buffer.
virtual void getStats (ClothingPhysicalMeshStats &stats) const =0
 Returns stats (sizes, counts) for the asset. See ClothingPhysicalMeshStats.

Detailed Description

Holder for a physical mesh, this can be generated through various ways (see single- and multi-layered clothing) or hand crafted.


Member Function Documentation

virtual void nvidia::apex::ClothingPhysicalMesh::allocateConstrainCoefficientBuffer ( ) [pure virtual]

Allocates and initializes the constrain coefficients of the physics mesh.

This allows to set the constrain coefficients like maxDistance directly on the physics mesh. If this is not called by the authoring tool, the constrain coefficients are read from the graphical mesh.

virtual void nvidia::apex::ClothingPhysicalMesh::allocateMasterFlagsBuffer ( ) [pure virtual]

Allocates and initializes the drive channels (master flags) of the physics mesh.

This allows to set the drive channels directly on the physics mesh.

virtual bool nvidia::apex::ClothingPhysicalMesh::getBoneIndices ( uint16_t *  boneIndices,
uint32_t  byteStride 
) const [pure virtual]

Writes the bone indices into a user specified buffer.

Returns false if the buffer doesn't exist. The buffer must be bigger than sizeof(uint16_t) * getNumVertices() * getNumBonesPerVertex(). (numBonesPerVertex is the same as in the graphical mesh for LOD 0)

The bytestride is applied only after writing numBonesPerVertex and thus must be >= sizoef(uint16_t) * numBonesPerVertex

virtual bool nvidia::apex::ClothingPhysicalMesh::getBoneWeights ( float *  boneWeights,
uint32_t  byteStride 
) const [pure virtual]

Writes the bone weights into a user specified buffer.

Returns false if the buffer doesn't exist. The buffer must be bigger than sizeof(float) * getNumVertices() * getNumBonesPerVertex(). (numBonesPerVertex is the same as in the graphical mesh for LOD 0) The bytestride is applied only after writing numBonesPerVertex and thus must be >= sizoef(float) * numBonesPerVertex

virtual ClothingConstrainCoefficients* nvidia::apex::ClothingPhysicalMesh::getConstrainCoefficientBuffer ( ) const [pure virtual]

Returns the constrain coefficient buffer pointer in order to edit the values.

This allows to set the constrain coefficients like maxDistance directly on the physics mesh.

virtual bool nvidia::apex::ClothingPhysicalMesh::getConstrainCoefficients ( ClothingConstrainCoefficients coeffs,
uint32_t  byteStride 
) const [pure virtual]

Writes the cloth constrain coefficients into a user specified buffer.

Returns false if the buffer doesn't exist. The buffer must be bigger than sizeof(ClothingConstrainCoefficients) * getNumVertices().

virtual bool nvidia::apex::ClothingPhysicalMesh::getIndices ( uint32_t *  indices,
uint32_t  byteStride 
) const [pure virtual]

writes the indices into a user specified buffer.

Returns false if the buffer doesn't exist. The buffer must be bigger than sizeof(uint32_t) * getNumIndices()

virtual void nvidia::apex::ClothingPhysicalMesh::getIndices ( void *  indexDestination,
uint32_t  byteStride,
uint32_t  numIndices 
) const [pure virtual]

writes the indices to a destination buffer

Parameters:
[out]indexDestinationdestination buffer where to write the indices
[in]byteStridestride of the destination buffer
[in]numIndicesnumber of indices the buffer can hold. This can be smaller than getNumIndices()
virtual uint32_t* nvidia::apex::ClothingPhysicalMesh::getMasterFlagsBuffer ( ) [pure virtual]

Returns the masterFlag buffer pointer in order to edit the values.

This allows to set values directly on the physics mesh.

virtual bool nvidia::apex::ClothingPhysicalMesh::getNormals ( PxVec3 *  normals,
uint32_t  byteStride 
) const [pure virtual]

Writes the normals into a user specified buffer.

Returns false if the buffer doesn't exist. The buffer must be bigger than sizeof(PxVec3) * getNumVertices()

virtual bool nvidia::apex::ClothingPhysicalMesh::getVertices ( PxVec3 *  vertices,
uint32_t  byteStride 
) const [pure virtual]

Writes the vertex positions into a user specified buffer.

Returns false if the buffer doesn't exist. The buffer must be bigger than sizeof(PxVec3) * getNumVertices()

virtual void nvidia::apex::ClothingPhysicalMesh::setGeometry ( bool  tetraMesh,
uint32_t  numVertices,
uint32_t  vertexByteStride,
const void *  vertices,
const uint32_t *  driveChannels,
uint32_t  numIndices,
uint32_t  indexByteStride,
const void *  indices 
) [pure virtual]

Create a physical mesh from scratch.

Overwrites all vertices/indices, and invalidates all misc vertex buffers. vertices must be PxVec3 and indices uint32_t. If driveChannels is NULL, all vertices are assigned to all drive channels (initialized to 0xffffffff)

virtual void nvidia::apex::ClothingPhysicalMesh::simplify ( uint32_t  subdivisions,
int32_t  maxSteps,
float  maxError,
IProgressListener *  progress 
) [pure virtual]

This will simplify the current mesh.

Parameters:
[in]subdivisionsused to derive the maximal length a new edge can get.
Divide the bounding box diagonal by this value to get the maximal edge length for newly created edges
Use 0 to not restrict the maximal edge length
[in]maxStepsThe maximum number of edges to be considered for simplification.
Use 0 to turn off
[in]maxErrorThe maximal quadric error an edge can cause to be considered simplifyable.
Use any value < 0 to turn off
[in]progressCallback class that will be fired every now and then to update a progress bar in the gui.
Returns:
The number of edges collapsed

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

Generated on Sat Dec 1 2018 15:51:51

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