diff options
| author | Marijn Tamis <[email protected]> | 2017-04-28 14:19:07 +0200 |
|---|---|---|
| committer | Marijn Tamis <[email protected]> | 2017-04-28 14:19:07 +0200 |
| commit | b350eb5f4d44e8448115796144375d79438d74ae (patch) | |
| tree | 8e102e8c28f45a1b87bd335ceee4f33c3d4ee7c2 /NvCloth/src/cuda/CuSolver.cpp | |
| parent | Add visual samples. (diff) | |
| download | nvcloth-b350eb5f4d44e8448115796144375d79438d74ae.tar.xz nvcloth-b350eb5f4d44e8448115796144375d79438d74ae.zip | |
NvCloth 1.1.0 Release. (22041545)
Diffstat (limited to 'NvCloth/src/cuda/CuSolver.cpp')
| -rw-r--r-- | NvCloth/src/cuda/CuSolver.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/NvCloth/src/cuda/CuSolver.cpp b/NvCloth/src/cuda/CuSolver.cpp index 7927a42..f0e328f 100644 --- a/NvCloth/src/cuda/CuSolver.cpp +++ b/NvCloth/src/cuda/CuSolver.cpp @@ -326,7 +326,7 @@ struct ClothSimCostGreater void cloth::CuSolver::addCloth(Cloth* cloth) { - CuCloth& cuCloth = static_cast<CuClothImpl&>(*cloth).mCloth; + CuCloth& cuCloth = *static_cast<CuCloth*>(cloth); NV_CLOTH_ASSERT(mCloths.find(&cuCloth) == mCloths.end()); @@ -348,7 +348,7 @@ void cloth::CuSolver::addCloth(Cloth* cloth) void cloth::CuSolver::removeCloth(Cloth* cloth) { - CuCloth& cuCloth = static_cast<CuClothImpl&>(*cloth).mCloth; + CuCloth& cuCloth = static_cast<CuCloth&>(*cloth); ClothVector::Iterator begin = mCloths.begin(), end = mCloths.end(); ClothVector::Iterator it = mCloths.find(&cuCloth); @@ -364,6 +364,18 @@ void cloth::CuSolver::removeCloth(Cloth* cloth) mClothDataDirty = true; } +int cloth::CuSolver::getNumCloths() const +{ + return mCloths.size(); +} +cloth::Cloth * const * cloth::CuSolver::getClothList() const +{ + if(getNumCloths()) + return reinterpret_cast<Cloth* const*>(&mCloths[0]); + else + return nullptr; +} + bool cloth::CuSolver::beginSimulation(float dt) { if (mCloths.empty()) |