PxCloth.h
Go to the documentation of this file.00001 // This code contains NVIDIA Confidential Information and is disclosed to you 00002 // under a form of NVIDIA software license agreement provided separately to you. 00003 // 00004 // Notice 00005 // NVIDIA Corporation and its licensors retain all intellectual property and 00006 // proprietary rights in and to this software and related documentation and 00007 // any modifications thereto. Any use, reproduction, disclosure, or 00008 // distribution of this software and related documentation without an express 00009 // license agreement from NVIDIA Corporation is strictly prohibited. 00010 // 00011 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES 00012 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO 00013 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, 00014 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. 00015 // 00016 // Information and code furnished is believed to be accurate and reliable. 00017 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such 00018 // information or for any infringement of patents or other rights of third parties that may 00019 // result from its use. No license is granted by implication or otherwise under any patent 00020 // or patent rights of NVIDIA Corporation. Details are subject to change without notice. 00021 // This code supersedes and replaces all information previously supplied. 00022 // NVIDIA Corporation products are not authorized for use as critical 00023 // components in life support devices or systems without express written approval of 00024 // NVIDIA Corporation. 00025 // 00026 // Copyright (c) 2008-2012 NVIDIA Corporation. All rights reserved. 00027 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. 00028 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. 00029 00030 00031 #ifndef PX_PHYSICS_NX_CLOTH 00032 #define PX_PHYSICS_NX_CLOTH 00033 00037 #include "PxPhysX.h" 00038 #include "PxActor.h" 00039 #include "cloth/PxClothFabricTypes.h" 00040 #include "cloth/PxClothTypes.h" 00041 #include "cloth/PxClothCollisionData.h" 00042 00043 #ifndef PX_DOXYGEN 00044 namespace physx 00045 { 00046 #endif 00047 00048 class PxScene; 00049 00062 class PxCloth : public PxActor 00063 { 00064 public: 00065 virtual void release() = 0; 00066 00071 virtual PxClothFabric* getFabric() const = 0; 00072 00083 virtual void setParticles(const PxClothParticle* currentParticles, const PxClothParticle* previousParticles) = 0; 00088 virtual PxU32 getNbParticles() const = 0; 00089 00097 virtual void setMotionConstraints(const PxClothParticleMotionConstraint* motionConstraints) = 0; 00103 virtual bool getMotionConstraints(PxClothParticleMotionConstraint* motionConstraintBuffer) const = 0; 00108 virtual PxU32 getNbMotionConstraints() const = 0; 00114 virtual void setMotionConstraintScaleBias(PxReal scale, PxReal bias) = 0; 00119 virtual void getMotionConstraintScaleBias(PxReal& scale, PxReal& bias) const = 0; 00120 00128 virtual void setSeparationConstraints(const PxClothParticleSeparationConstraint* separationConstraints) = 0; 00134 virtual bool getSeparationConstraints(PxClothParticleSeparationConstraint* separationConstraintBuffer) const = 0; 00139 virtual PxU32 getNbSeparationConstraints() const = 0; 00140 00147 virtual void clearInterpolation() = 0; 00148 00155 virtual void setParticleAccelerations(const PxVec4* particleAccelerations) = 0; 00161 virtual bool getParticleAccelerations(PxVec4* particleAccelerationsBuffer) const = 0; 00166 virtual PxU32 getNbParticleAccelerations() const = 0; 00167 00174 virtual void setCollisionSpheres(const PxClothCollisionSphere* sphereBuffer) = 0; 00185 virtual void getCollisionData(PxClothCollisionSphere* sphereBuffer, PxU32* pairIndexBuffer, 00186 PxClothCollisionPlane* planesBuffer, PxU32* convexMaskBuffer) const = 0; 00191 virtual PxU32 getNbCollisionSpheres() const = 0; 00196 virtual PxU32 getNbCollisionSpherePairs() const = 0; 00197 00204 virtual void addCollisionPlane(const PxClothCollisionPlane& plane) = 0; 00212 virtual void removeCollisionPlane(PxU32 index) = 0; 00218 virtual void setCollisionPlanes(const PxClothCollisionPlane* planesBuffer) = 0; 00224 virtual void addCollisionConvex(PxU32 mask) = 0; 00231 virtual void removeCollisionConvex(PxU32 index) = 0; 00236 virtual PxU32 getNbCollisionPlanes() const = 0; 00241 virtual PxU32 getNbCollisionConvexes() const = 0; 00242 00259 virtual void setVirtualParticles(PxU32 numParticles, const PxU32* triangleVertexAndWeightIndices, PxU32 weightTableSize, const PxVec3* triangleVertexWeightTable) = 0; 00264 virtual PxU32 getNbVirtualParticles() const = 0; 00270 virtual void getVirtualParticles(PxU32* userTriangleVertexAndWeightIndices) const = 0; 00275 virtual PxU32 getNbVirtualParticleWeights() const = 0; 00280 virtual void getVirtualParticleWeights(PxVec3* userTriangleVertexWeightTable) const = 0; 00281 00290 virtual void setGlobalPose(const PxTransform& pose) = 0; 00295 virtual PxTransform getGlobalPose() const = 0; 00296 00304 virtual void setTargetPose(const PxTransform& pose) = 0; 00305 00312 virtual void setInertiaScale(PxReal scale) = 0; 00317 virtual PxReal getInertiaScale() const = 0; 00323 virtual void setExternalAcceleration(PxVec3 acceleration) = 0; 00328 virtual PxVec3 getExternalAcceleration() const = 0; 00329 00335 virtual void setDampingCoefficient(PxReal dampingCoefficient) = 0; 00340 virtual PxReal getDampingCoefficient() const = 0; 00341 00347 virtual void setFrictionCoefficient(PxReal frictionCoefficient) = 0; 00352 virtual PxReal getFrictionCoefficient() const = 0; 00353 00360 virtual void setDragCoefficient(PxReal dragCoefficient) = 0; 00365 virtual PxReal getDragCoefficient() const = 0; 00366 00375 virtual void setCollisionMassScale(PxReal scalingCoefficient) = 0; 00380 virtual PxReal getCollisionMassScale() const = 0; 00381 00389 virtual void setSolverFrequency(PxReal frequency) = 0; 00394 virtual PxReal getSolverFrequency() const = 0; 00395 00402 virtual void setPhaseSolverConfig(PxClothFabricPhaseType::Enum phaseType, const PxClothPhaseSolverConfig& config) = 0; 00409 virtual PxClothPhaseSolverConfig getPhaseSolverConfig(PxClothFabricPhaseType::Enum phaseType) const = 0; 00410 00416 virtual void setClothFlag(PxClothFlag::Enum flag, bool value) = 0; 00421 virtual PxClothFlags getClothFlags() const = 0; 00422 00427 virtual bool isSleeping() const = 0; 00432 virtual PxReal getSleepLinearVelocity() const = 0; 00440 virtual void setSleepLinearVelocity(PxReal threshold) = 0; 00447 virtual void wakeUp(PxReal wakeCounterValue = PX_SLEEP_INTERVAL) = 0; 00451 virtual void putToSleep() = 0; 00452 00457 virtual PxClothReadData* lockClothReadData() const = 0; 00458 00464 virtual PxReal getPreviousTimeStep() const = 0; 00465 00470 virtual PxBounds3 getWorldBounds() const = 0; 00471 00472 virtual const char* getConcreteTypeName() const { return "PxCloth"; } 00473 00474 protected: 00475 PxCloth(PxRefResolver& v) : PxActor(v) {} 00476 PX_INLINE PxCloth() : PxActor() {} 00477 virtual ~PxCloth() {} 00478 virtual bool isKindOf(const char* name) const { return !strcmp("PxCloth", name) || PxActor::isKindOf(name); } 00479 }; 00480 00481 PX_INLINE PxCloth* PxActor::isCloth() { return is<PxCloth>(); } 00482 PX_INLINE const PxCloth* PxActor::isCloth() const { return is<PxCloth>(); } 00483 00484 00485 #ifndef PX_DOXYGEN 00486 } // namespace physx 00487 #endif 00488 00490 #endif
Copyright © 2008-2012 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com