diff options
| author | Marijn Tamis <[email protected]> | 2018-05-03 18:22:48 +0200 |
|---|---|---|
| committer | Marijn Tamis <[email protected]> | 2018-05-03 18:22:48 +0200 |
| commit | ca32c59a58d37c1822e185a2d5f3d0d3e8943593 (patch) | |
| tree | b06b9eec03f34344ef8fc31aa147b2714d3962ee /NvCloth/include | |
| parent | Forced rename of platform folders in cmake dir. Git didn't pick this up before. (diff) | |
| download | nvcloth-ca32c59a58d37c1822e185a2d5f3d0d3e8943593.tar.xz nvcloth-ca32c59a58d37c1822e185a2d5f3d0d3e8943593.zip | |
NvCloth 1.1.4 Release. (24070740)
Diffstat (limited to 'NvCloth/include')
| -rw-r--r-- | NvCloth/include/NvCloth/Cloth.h | 26 | ||||
| -rw-r--r-- | NvCloth/include/NvCloth/Solver.h | 3 |
2 files changed, 28 insertions, 1 deletions
diff --git a/NvCloth/include/NvCloth/Cloth.h b/NvCloth/include/NvCloth/Cloth.h index 6b745f5..e00deb3 100644 --- a/NvCloth/include/NvCloth/Cloth.h +++ b/NvCloth/include/NvCloth/Cloth.h @@ -168,6 +168,32 @@ class Cloth : public UserAllocated /** \brief Adjust the position of the cloth without affecting the dynamics (to call after a world origin shift, for example). */ virtual void teleport(const physx::PxVec3& delta) = 0; + /** \brief Adjust the position and rotation of the cloth without affecting the dynamics (to call after a world origin shift, for example). + The velocity will be set to zero this frame, unless setTranslation/setRotation is called with a different value after this function is called. + The correct order to use this is: + \code + cloth->teleportToLocation(pos, rot); + pos += velocity * dt; + rot += 0.5 * angularVelocity * rot * dt; + cloth->setTranslation(pos); + cloth->setRotation(rot); + \endcode + */ + virtual void teleportToLocation(const physx::PxVec3& translation, const physx::PxQuat& rotation) = 0; + + /** \brief Don't recalculate the velocity based on the values provided by setTranslation and setRotation for one frame (so it acts as if the velocity was the same as last frame). + This is useful when the cloth is moving while teleported, but the integration of the cloth position for that frame is already included in the teleport. + Example: + \code + pos += velocity * dt; + rot += 0.5 * angularVelocity * rot * dt; + cloth->teleportToLocation(pos, rot); + cloth->ignoreVelocityDiscontinuity(); + \endcode + */ + virtual void ignoreVelocityDiscontinuity() = 0; + + /* solver parameters */ /** \brief Returns the delta time used for previous iteration.*/ diff --git a/NvCloth/include/NvCloth/Solver.h b/NvCloth/include/NvCloth/Solver.h index a293524..2ff0e9c 100644 --- a/NvCloth/include/NvCloth/Solver.h +++ b/NvCloth/include/NvCloth/Solver.h @@ -93,7 +93,8 @@ class Solver : public UserAllocated */ virtual int getSimulationChunkCount() const = 0; - // inter-collision parameters + /// inter-collision parameters + /// Note that using intercollision with more than 32 cloths added to the solver will cause undefined behavior virtual void setInterCollisionDistance(float distance) = 0; virtual float getInterCollisionDistance() const = 0; virtual void setInterCollisionStiffness(float stiffness) = 0; |