diff options
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()) |