aboutsummaryrefslogtreecommitdiff
path: root/NvCloth/src/SwFactory.cpp
diff options
context:
space:
mode:
authorMarijn Tamis <[email protected]>2017-04-28 14:19:07 +0200
committerMarijn Tamis <[email protected]>2017-04-28 14:19:07 +0200
commitb350eb5f4d44e8448115796144375d79438d74ae (patch)
tree8e102e8c28f45a1b87bd335ceee4f33c3d4ee7c2 /NvCloth/src/SwFactory.cpp
parentAdd visual samples. (diff)
downloadnvcloth-b350eb5f4d44e8448115796144375d79438d74ae.tar.xz
nvcloth-b350eb5f4d44e8448115796144375d79438d74ae.zip
NvCloth 1.1.0 Release. (22041545)
Diffstat (limited to 'NvCloth/src/SwFactory.cpp')
-rw-r--r--NvCloth/src/SwFactory.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/NvCloth/src/SwFactory.cpp b/NvCloth/src/SwFactory.cpp
index 418eb13..6f46c96 100644
--- a/NvCloth/src/SwFactory.cpp
+++ b/NvCloth/src/SwFactory.cpp
@@ -31,7 +31,6 @@
#include "SwFabric.h"
#include "SwCloth.h"
#include "SwSolver.h"
-#include "ClothImpl.h"
#include <string.h> // for memcpy
using namespace nv;
@@ -66,7 +65,7 @@ cloth::Fabric* cloth::SwFactory::createFabric(uint32_t numParticles, Range<const
cloth::Cloth* cloth::SwFactory::createCloth(Range<const PxVec4> particles, Fabric& fabric)
{
- return NV_CLOTH_NEW(SwClothImpl)(*this, fabric, particles);
+ return NV_CLOTH_NEW(SwCloth)(*this, static_cast<SwFabric&>(fabric), particles);
}
cloth::Solver* cloth::SwFactory::createSolver()
@@ -80,7 +79,7 @@ cloth::Cloth* cloth::SwFactory::clone(const Cloth& cloth)
return cloth.clone(*this); // forward to CuCloth
// copy construct
- return NV_CLOTH_NEW(SwClothImpl)(*this, static_cast<const SwClothImpl&>(cloth));
+ return NV_CLOTH_NEW(SwCloth)(*this, static_cast<const SwCloth&>(cloth));
}
void cloth::SwFactory::extractFabricData(const Fabric& fabric, Range<uint32_t> phaseIndices, Range<uint32_t> sets,
@@ -157,7 +156,7 @@ void cloth::SwFactory::extractCollisionData(const Cloth& cloth, Range<PxVec4> sp
{
NV_CLOTH_ASSERT(&cloth.getFactory() == this);
- const SwCloth& swCloth = static_cast<const SwClothImpl&>(cloth).mCloth;
+ const SwCloth& swCloth = static_cast<const SwCloth&>(cloth);
NV_CLOTH_ASSERT(spheres.empty() || spheres.size() == swCloth.mStartCollisionSpheres.size());
NV_CLOTH_ASSERT(capsules.empty() || capsules.size() == swCloth.mCapsuleIndices.size() * 2);
@@ -188,7 +187,7 @@ void cloth::SwFactory::extractMotionConstraints(const Cloth& cloth, Range<PxVec4
{
NV_CLOTH_ASSERT(&cloth.getFactory() == this);
- const SwCloth& swCloth = static_cast<const SwClothImpl&>(cloth).mCloth;
+ const SwCloth& swCloth = static_cast<const SwCloth&>(cloth);
Vector<PxVec4>::Type const& srcConstraints = !swCloth.mMotionConstraints.mTarget.empty()
? swCloth.mMotionConstraints.mTarget
@@ -207,7 +206,7 @@ void cloth::SwFactory::extractSeparationConstraints(const Cloth& cloth, Range<Px
{
NV_CLOTH_ASSERT(&cloth.getFactory() == this);
- const SwCloth& swCloth = static_cast<const SwClothImpl&>(cloth).mCloth;
+ const SwCloth& swCloth = static_cast<const SwCloth&>(cloth);
Vector<PxVec4>::Type const& srcConstraints = !swCloth.mSeparationConstraints.mTarget.empty()
? swCloth.mSeparationConstraints.mTarget
@@ -226,7 +225,7 @@ void cloth::SwFactory::extractParticleAccelerations(const Cloth& cloth, Range<Px
{
NV_CLOTH_ASSERT(&cloth.getFactory() == this);
- const SwCloth& swCloth = static_cast<const SwClothImpl&>(cloth).mCloth;
+ const SwCloth& swCloth = static_cast<const SwCloth&>(cloth);
if (!swCloth.mParticleAccelerations.empty())
{
@@ -242,7 +241,7 @@ void cloth::SwFactory::extractVirtualParticles(const Cloth& cloth, Range<uint32_
{
NV_CLOTH_ASSERT(this == &cloth.getFactory());
- const SwCloth& swCloth = static_cast<const SwClothImpl&>(cloth).mCloth;
+ const SwCloth& swCloth = static_cast<const SwCloth&>(cloth);
uint32_t numIndices = cloth.getNumVirtualParticles();
uint32_t numWeights = cloth.getNumVirtualParticleWeights();
@@ -286,14 +285,14 @@ void cloth::SwFactory::extractVirtualParticles(const Cloth& cloth, Range<uint32_
void cloth::SwFactory::extractSelfCollisionIndices(const Cloth& cloth, Range<uint32_t> destIndices) const
{
- const SwCloth& swCloth = static_cast<const SwClothImpl&>(cloth).mCloth;
+ const SwCloth& swCloth = static_cast<const SwCloth&>(cloth);
NV_CLOTH_ASSERT(destIndices.size() == swCloth.mSelfCollisionIndices.size());
memcpy(destIndices.begin(), swCloth.mSelfCollisionIndices.begin(), destIndices.size() * sizeof(uint32_t));
}
void cloth::SwFactory::extractRestPositions(const Cloth& cloth, Range<PxVec4> destRestPositions) const
{
- const SwCloth& swCloth = static_cast<const SwClothImpl&>(cloth).mCloth;
+ const SwCloth& swCloth = static_cast<const SwCloth&>(cloth);
NV_CLOTH_ASSERT(destRestPositions.size() == swCloth.mRestPositions.size());
memcpy(destRestPositions.begin(), swCloth.mRestPositions.begin(), destRestPositions.size() * sizeof(PxVec4));
}