aboutsummaryrefslogtreecommitdiff
path: root/include/NvFlexExt.h
diff options
context:
space:
mode:
authorMiles Macklin <[email protected]>2018-03-19 15:10:24 +1300
committerMiles Macklin <[email protected]>2018-03-19 15:10:24 +1300
commit8ee05c79ae1748ef132a12e4fb0af284899faec6 (patch)
tree82bd5aa1892e28ce7886b6cfeafe66a47ff38e67 /include/NvFlexExt.h
parentFlex 1.2 (beta 2) (diff)
downloadflex-8ee05c79ae1748ef132a12e4fb0af284899faec6.tar.xz
flex-8ee05c79ae1748ef132a12e4fb0af284899faec6.zip
Flex 1.2.0 release
Diffstat (limited to 'include/NvFlexExt.h')
-rw-r--r--include/NvFlexExt.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/include/NvFlexExt.h b/include/NvFlexExt.h
index e43163e..fd17f11 100644
--- a/include/NvFlexExt.h
+++ b/include/NvFlexExt.h
@@ -364,6 +364,25 @@ struct NvFlexExtInstance
void* userData; //!< User data pointer
};
+/**
+* Represents a soft joint with a radius overlapping different flex objects
+* Each soft joint can be spawned into a container using NvFlexExtCreateSoftJoint()
+*/
+struct NvFlexExtSoftJoint
+{
+ int* particleIndices; //!< Global indices
+ float* particleLocalPositions; //!< Relative offsets from the particles of the joint to the center
+ int shapeIndex; //!< Index in the container's shape body constraints array
+ int numParticles; //!< Number of particles in the joint
+
+ float shapeTranslations[3]; //!< Joint shape matching group translations (vec3s)
+ float shapeRotations[4]; //!< Joint shape matching group rotations (quaternions)
+
+ float stiffness; //!< Joint stiffness
+
+ bool initialized; //!< Joint status flag
+};
+
/**
* Opaque type representing a simulation
*/
@@ -767,7 +786,33 @@ NV_FLEX_API void NvFlexExtDestroyForceFieldCallback(NvFlexExtForceFieldCallback*
*/
NV_FLEX_API void NvFlexExtSetForceFields(NvFlexExtForceFieldCallback* callback, const NvFlexExtForceField* forceFields, int numForceFields);
+/**
+* Create a soft joint, the container will internally store a reference to the joint array
+*
+* @param[in] container The container to spawn into
+* @param[in] particleIndices A pointer to an array of particle indices
+* @param[in] particleLocalPositions A pointer to an array of particle local positions
+* @param[in] numJointParticles The number of particles in the joint
+* @param[in] stiffness The stiffness of the joint
+* @return A pointer to the soft joint
+*/
+NV_FLEX_API NvFlexExtSoftJoint* NvFlexExtCreateSoftJoint(NvFlexExtContainer* container, const int* particleIndices, const float* particleLocalPositions, const int numJointParticles, const float stiffness);
+
+/** Destroy a soft joint
+*
+* @param[in] container The container the joint belongs to
+* @param[in] joint The soft joint to destroy
+*/
+NV_FLEX_API void NvFlexExtDestroySoftJoint(NvFlexExtContainer* container, NvFlexExtSoftJoint* joint);
+/** Transform all the local particles of the soft joint
+*
+* @param[in] container The container to spawn into
+* @param[in] joint The soft joint to destroy
+* @param[in] position A pointer to a vec3 storing the soft joint new position
+* @param[in] rotation A pointer to a quaternion storing the soft joint new rotation
+*/
+NV_FLEX_API void NvFlexExtSoftJointSetTransform(NvFlexExtContainer* container, NvFlexExtSoftJoint* joint, const float* position, const float* rotation);
} // extern "C"