From ca32c59a58d37c1822e185a2d5f3d0d3e8943593 Mon Sep 17 00:00:00 2001 From: Marijn Tamis Date: Thu, 3 May 2018 18:22:48 +0200 Subject: NvCloth 1.1.4 Release. (24070740) --- NvCloth/include/NvCloth/Cloth.h | 26 ++++++++++++++++++++++++++ NvCloth/include/NvCloth/Solver.h | 3 ++- 2 files changed, 28 insertions(+), 1 deletion(-) (limited to 'NvCloth/include') 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; -- cgit v1.2.3