APEX Framework: ClothingPhysicalMesh.h Source File

NVIDIA APEX

ClothingPhysicalMesh.h
00001 /*
00002  * Copyright (c) 2008-2017, NVIDIA CORPORATION.  All rights reserved.
00003  *
00004  * NVIDIA CORPORATION and its licensors retain all intellectual property
00005  * and proprietary rights in and to this software, related documentation
00006  * and any modifications thereto.  Any use, reproduction, disclosure or
00007  * distribution of this software and related documentation without an express
00008  * license agreement from NVIDIA CORPORATION is strictly prohibited.
00009  */
00010 
00011 
00012 #ifndef CLOTHING_PHYSICAL_MESH_H
00013 #define CLOTHING_PHYSICAL_MESH_H
00014 
00015 #include "ApexInterface.h"
00016 #include "IProgressListener.h"
00017 
00018 namespace nvidia
00019 {
00020 namespace apex
00021 {
00022 
00023 
00027 struct ClothingConstrainCoefficients
00028 {
00029     float maxDistance; 
00030     float collisionSphereRadius; 
00031     float collisionSphereDistance; 
00032 };
00033 
00034 
00035 PX_PUSH_PACK_DEFAULT
00036 
00040 struct ClothingPhysicalMeshStats
00041 {
00043     uint32_t    totalBytes;
00045     uint32_t    numVertices;
00047     uint32_t    numIndices;
00048 };
00049 
00050 
00054 class ClothingPhysicalMesh : public ApexInterface
00055 {
00056 public:
00060     virtual uint32_t getNumVertices() const = 0;
00061 
00065     virtual uint32_t getNumSimulatedVertices() const = 0;
00066 
00070     virtual uint32_t getNumMaxDistance0Vertices() const = 0;
00071 
00075     virtual uint32_t getNumIndices() const = 0;
00076 
00080     virtual uint32_t getNumSimulatedIndices() const = 0;
00081 
00089     virtual void getIndices(void* indexDestination, uint32_t byteStride, uint32_t numIndices) const = 0;
00090 
00094     virtual bool isTetrahedralMesh() const = 0;
00095 
00109     virtual void simplify(uint32_t subdivisions, int32_t maxSteps, float maxError, IProgressListener* progress) = 0;
00110 
00117     virtual void setGeometry(bool tetraMesh, uint32_t numVertices, uint32_t vertexByteStride, const void* vertices, const uint32_t* driveChannels, 
00118                             uint32_t numIndices, uint32_t indexByteStride, const void* indices) = 0;
00119 
00120     // direct access to specific buffers
00127     virtual bool getIndices(uint32_t* indices, uint32_t byteStride) const = 0;
00128 
00135     virtual bool getVertices(PxVec3* vertices, uint32_t byteStride) const = 0;
00136 
00143     virtual bool getNormals(PxVec3* normals, uint32_t byteStride) const = 0;
00144 
00148     virtual uint32_t getNumBonesPerVertex() const = 0;
00149 
00159     virtual bool getBoneIndices(uint16_t* boneIndices, uint32_t byteStride) const = 0;
00160 
00169     virtual bool getBoneWeights(float* boneWeights, uint32_t byteStride) const = 0;
00170 
00176     virtual void allocateMasterFlagsBuffer() = 0;
00177 
00183     virtual uint32_t* getMasterFlagsBuffer() = 0;
00184 
00192     virtual void allocateConstrainCoefficientBuffer() = 0;
00193 
00199     virtual ClothingConstrainCoefficients* getConstrainCoefficientBuffer() const = 0;
00200 
00206     virtual bool getConstrainCoefficients(ClothingConstrainCoefficients* coeffs, uint32_t byteStride) const = 0;
00207 
00211     virtual void getStats(ClothingPhysicalMeshStats& stats) const = 0;
00212 
00213 };
00214 
00215 PX_POP_PACK
00216 
00217 }
00218 } // namespace nvidia
00219 
00220 #endif // CLOTHING_PHYSICAL_MESH_H

Generated on Fri Dec 15 2017 13:58:35
Copyright © 2012-2017 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved.