@@ -26,8 +26,7 @@ namespace PBD
26
26
Eigen::Matrix3f &K);
27
27
28
28
public:
29
- /* * Initialize rigid ball joint and return infos which are required by the solver step.
30
- * Recomputation is only necessary when rest shape changes.\n\n
29
+ /* * Initialize ball joint and return info which is required by the solver step.
31
30
*
32
31
* @param x0 center of mass of first body
33
32
* @param q0 rotation of first body
@@ -48,7 +47,7 @@ namespace PBD
48
47
Eigen::Matrix<float , 3 , 4 > &ballJointInfo
49
48
);
50
49
51
- /* * Update rigid ball joint info which are required by the solver step.
50
+ /* * Update ball joint info which is required by the solver step.
52
51
* The ball joint info must be generated in the initialization process of the model
53
52
* by calling the function initRigidBodyBallJointInfo().
54
53
* This method should be called once per simulation step before executing the solver.\n\n
@@ -70,11 +69,12 @@ namespace PBD
70
69
/* * Perform a solver step for a ball joint which links two rigid bodies.
71
70
* A ball joint removes three translational degrees of freedom between the bodies.
72
71
* The ball joint info must be generated in the initialization process of the model
73
- * by calling the function initRigidBodyBallJointInfo() updated each time the bodies
74
- * change their state by updateRigidBodyBallJointInfo().
72
+ * by calling the function initRigidBodyBallJointInfo() and updated each time the bodies
73
+ * change their state by updateRigidBodyBallJointInfo().\n\n
74
+ * More information can be found in: \cite Deul2014
75
75
*
76
- * \image html balljoint.jpg "Ball joint"
77
- * \image latex balljoint.jpg "Ball joint" width=0.5\textwidth
76
+ * \image html balljoint.jpg "ball joint"
77
+ * \image latex balljoint.jpg "ball joint" width=0.5\textwidth
78
78
*
79
79
* @param mass0 mass of first body
80
80
* @param x0 center of mass of first body
@@ -152,8 +152,12 @@ namespace PBD
152
152
/* * Perform a solver step for a ball-on-line-joint which links two rigid bodies.
153
153
* A ball-on-line-joint removes two translational degrees of freedom between the bodies.
154
154
* The joint info must be generated in the initialization process of the model
155
- * by calling the function initRigidBodyBallOnLineJointInfo() updated each time the bodies
156
- * change their state by updateRigidBodyBallOnLineJointInfo().
155
+ * by calling the function initRigidBodyBallOnLineJointInfo() and updated each time the bodies
156
+ * change their state by updateRigidBodyBallOnLineJointInfo().\n\n
157
+ * More information can be found in: \cite Deul2014
158
+ *
159
+ * \image html ballonlinejoint.jpg "ball-on-line joint"
160
+ * \image latex ballonlinejoint.jpg "ball-on-line joint" width=0.5\textwidth
157
161
*
158
162
* @param mass0 mass of first body
159
163
* @param x0 center of mass of first body
@@ -185,6 +189,20 @@ namespace PBD
185
189
Eigen::Vector3f &corr_x1, Eigen::Quaternionf &corr_q1);
186
190
187
191
192
+ /* * Initialize hinge joint and return info which is required by the solver step.
193
+ *
194
+ * @param x0 center of mass of first body
195
+ * @param q0 rotation of first body
196
+ * @param x1 center of mass of second body
197
+ * @param q1 rotation of second body
198
+ * @param hingeJointPosition position of hinge joint
199
+ * @param hingeJointAxis axis of hinge joint
200
+ * @param hingeJointInfo Stores the local and global positions of the connector points.
201
+ * The hinge joint is a combination of a ball joint and a ball-on-line joint.
202
+ * The joint info stores first the info of the ball joint and then the info of
203
+ * the ball-on-line joint. The info must be updated in each simulation step
204
+ * by calling updateRigidBodyHingeJointInfo().
205
+ */
188
206
static bool initRigidBodyHingeJointInfo (
189
207
const Eigen::Vector3f &x0, // center of mass of body 0
190
208
const Eigen::Quaternionf &q0, // rotation of body 0
@@ -195,6 +213,17 @@ namespace PBD
195
213
Eigen::Matrix<float , 3 , 14 > &hingeJointInfo
196
214
);
197
215
216
+ /* * Update hinge joint info which is required by the solver step.
217
+ * The ball joint info must be generated in the initialization process of the model
218
+ * by calling the function initRigidBodyHingeJointInfo().
219
+ * This method should be called once per simulation step before executing the solver.\n\n
220
+ *
221
+ * @param x0 center of mass of first body
222
+ * @param q0 rotation of first body
223
+ * @param x1 center of mass of second body
224
+ * @param q1 rotation of second body
225
+ * @param hingeJointInfo hinge joint information which should be updated
226
+ */
198
227
static bool updateRigidBodyHingeJointInfo (
199
228
const Eigen::Vector3f &x0, // center of mass of body 0
200
229
const Eigen::Quaternionf &q0, // rotation of body 0
@@ -203,6 +232,32 @@ namespace PBD
203
232
Eigen::Matrix<float , 3 , 14 > &hingeJointInfo
204
233
);
205
234
235
+ /* * Perform a solver step for a hinge joint which links two rigid bodies.
236
+ * A hinge joint removes three translational and two rotational degrees of freedom between the bodies.
237
+ * The hinge joint info must be generated in the initialization process of the model
238
+ * by calling the function initRigidBodyHingeJointInfo() and updated each time the bodies
239
+ * change their state by updateRigidBodyHingeJointInfo().\n\n
240
+ * More information can be found in: \cite Deul2014
241
+ *
242
+ * \image html hingejoint.jpg "hinge joint"
243
+ * \image latex hingejoint.jpg "hinge joint" width=0.5\textwidth
244
+ *
245
+ * @param mass0 mass of first body
246
+ * @param x0 center of mass of first body
247
+ * @param inertiaInverseW0 inverse inertia tensor in world coordinates of first body
248
+ * @param q0 rotation of first body
249
+ * @param mass1 mass of second body
250
+ * @param x1 center of mass of second body
251
+ * @param inertiaInverseW1 inverse inertia tensor in world coordinates of second body
252
+ * @param q1 rotation of second body
253
+ * @param hingeJointInfo Hinge joint information which is required by the solver. This
254
+ * information must be generated in the beginning by calling initRigidBodyHingeJointInfo()
255
+ * and updated each time the bodies change their state by updateRigidBodyHingeJointInfo().
256
+ * @param corr_x0 position correction of center of mass of first body
257
+ * @param corr_q0 rotation correction of first body
258
+ * @param corr_x1 position correction of center of mass of second body
259
+ * @param corr_q1 rotation correction of second body
260
+ */
206
261
static bool solveRigidBodyHingeJoint (
207
262
const float mass0, // mass is zero if body is static
208
263
const Eigen::Vector3f &x0, // center of mass of body 0
0 commit comments