Main Page   Class List   Class Members  

  • Main Page
  • Modules
  • Classes
  • Files
  • File List

Factory.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-2017 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 #pragma once
00031 
00032 #include "NvCloth/Range.h"
00033 #include <foundation/PxVec4.h>
00034 #include <foundation/PxVec3.h>
00035 #include "NvCloth/Allocator.h"
00036 
00037 typedef struct CUctx_st* CUcontext;
00038 
00039 namespace nv
00040 {
00041 namespace cloth
00042 {
00043 class DxContextManagerCallback;
00044 class Factory;
00045 }
00046 }
00047 NV_CLOTH_API(nv::cloth::Factory*) NvClothCreateFactoryCPU();
00048 NV_CLOTH_API(nv::cloth::Factory*) NvClothCreateFactoryCUDA(CUcontext);
00049 NV_CLOTH_API(nv::cloth::Factory*) NvClothCreateFactoryDX11(nv::cloth::DxContextManagerCallback*);
00050 NV_CLOTH_API(void) NvClothDestroyFactory(nv::cloth::Factory*);
00051 
00053 NV_CLOTH_API(bool) NvClothCompiledWithCudaSupport();
00055 NV_CLOTH_API(bool) NvClothCompiledWithDxSupport();
00056 
00057 namespace nv
00058 {
00059 namespace cloth
00060 {
00061 
00062 class Fabric;
00063 class Cloth;
00064 class Solver;
00065 
00066 enum struct Platform
00067 {
00068     CPU,
00069     CUDA,
00070     DX11
00071 };
00072 
00075 class Factory : public UserAllocated
00076 {
00077   protected:
00078     Factory() {}
00079     Factory(const Factory&);
00080     Factory& operator = (const Factory&);
00081     virtual ~Factory() {}
00082 
00083     friend NV_CLOTH_IMPORT void NV_CLOTH_CALL_CONV ::NvClothDestroyFactory(nv::cloth::Factory*);
00084 
00085   public:
00086     virtual Platform getPlatform() const = 0;
00087 
00098     virtual Fabric* createFabric(uint32_t numParticles, Range<const uint32_t> phaseIndices, Range<const uint32_t> sets,
00099                                  Range<const float> restvalues, Range<const float> stiffnessValues, Range<const uint32_t> indices,
00100                                  Range<const uint32_t> anchors, Range<const float> tetherLengths,
00101                                  Range<const uint32_t> triangles) = 0;
00102 
00108     virtual Cloth* createCloth(Range<const physx::PxVec4> particles, Fabric& fabric) = 0;
00109 
00113     virtual Solver* createSolver() = 0;
00114 
00119     virtual Cloth* clone(const Cloth& cloth) = 0;
00120 
00130     virtual void extractFabricData(const Fabric& fabric, Range<uint32_t> phaseIndices, Range<uint32_t> sets,
00131                                    Range<float> restvalues, Range<float> stiffnessValues, Range<uint32_t> indices, Range<uint32_t> anchors,
00132                                    Range<float> tetherLengths, Range<uint32_t> triangles) const = 0;
00133 
00144     virtual void extractCollisionData(const Cloth& cloth, Range<physx::PxVec4> spheres, Range<uint32_t> capsules,
00145                                       Range<physx::PxVec4> planes, Range<uint32_t> convexes, Range<physx::PxVec3> triangles) const = 0;
00146 
00153     virtual void extractMotionConstraints(const Cloth& cloth, Range<physx::PxVec4> destConstraints) const = 0;
00154 
00160     virtual void extractSeparationConstraints(const Cloth& cloth, Range<physx::PxVec4> destConstraints) const = 0;
00161 
00167     virtual void extractParticleAccelerations(const Cloth& cloth, Range<physx::PxVec4> destAccelerations) const = 0;
00168 
00175     virtual void extractVirtualParticles(const Cloth& cloth, Range<uint32_t[4]> destIndices,
00176                                          Range<physx::PxVec3> destWeights) const = 0;
00177 
00183     virtual void extractSelfCollisionIndices(const Cloth& cloth, Range<uint32_t> destIndices) const = 0;
00184 
00190     virtual void extractRestPositions(const Cloth& cloth, Range<physx::PxVec4> destRestPositions) const = 0;
00191 };
00192 
00193 } // namespace cloth
00194 } // namespace nv
Copyright © 2016-2017 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com