Skip to content

Commit 0742530

Browse files
committed
- added documentation
1 parent cc74933 commit 0742530

File tree

5 files changed

+65
-244
lines changed

5 files changed

+65
-244
lines changed

Changelog.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
1.3.0
12
- added some documentation
23
- cleaned up project
34
- added new Joint demo

Demos/RigidBodyDemos/main.cpp

-235
This file was deleted.

PositionBasedDynamics/PositionBasedRigidBodyDynamics.h

+64-9
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ namespace PBD
2626
Eigen::Matrix3f &K);
2727

2828
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.
3130
*
3231
* @param x0 center of mass of first body
3332
* @param q0 rotation of first body
@@ -48,7 +47,7 @@ namespace PBD
4847
Eigen::Matrix<float, 3, 4> &ballJointInfo
4948
);
5049

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.
5251
* The ball joint info must be generated in the initialization process of the model
5352
* by calling the function initRigidBodyBallJointInfo().
5453
* This method should be called once per simulation step before executing the solver.\n\n
@@ -70,11 +69,12 @@ namespace PBD
7069
/** Perform a solver step for a ball joint which links two rigid bodies.
7170
* A ball joint removes three translational degrees of freedom between the bodies.
7271
* 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
7575
*
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
7878
*
7979
* @param mass0 mass of first body
8080
* @param x0 center of mass of first body
@@ -152,8 +152,12 @@ namespace PBD
152152
/** Perform a solver step for a ball-on-line-joint which links two rigid bodies.
153153
* A ball-on-line-joint removes two translational degrees of freedom between the bodies.
154154
* 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
157161
*
158162
* @param mass0 mass of first body
159163
* @param x0 center of mass of first body
@@ -185,6 +189,20 @@ namespace PBD
185189
Eigen::Vector3f &corr_x1, Eigen::Quaternionf &corr_q1);
186190

187191

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+
*/
188206
static bool initRigidBodyHingeJointInfo(
189207
const Eigen::Vector3f &x0, // center of mass of body 0
190208
const Eigen::Quaternionf &q0, // rotation of body 0
@@ -195,6 +213,17 @@ namespace PBD
195213
Eigen::Matrix<float, 3, 14> &hingeJointInfo
196214
);
197215

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+
*/
198227
static bool updateRigidBodyHingeJointInfo(
199228
const Eigen::Vector3f &x0, // center of mass of body 0
200229
const Eigen::Quaternionf &q0, // rotation of body 0
@@ -203,6 +232,32 @@ namespace PBD
203232
Eigen::Matrix<float, 3, 14> &hingeJointInfo
204233
);
205234

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+
*/
206261
static bool solveRigidBodyHingeJoint(
207262
const float mass0, // mass is zero if body is static
208263
const Eigen::Vector3f &x0, // center of mass of body 0

doc/images/ballonlinejoint.jpg

25.3 KB
Loading

doc/images/hingejoint.jpg

22.8 KB
Loading

0 commit comments

Comments
 (0)