@@ -25,6 +25,7 @@ namespace PBD
25
25
Vector3r m_x0;
26
26
/* * center of mass velocity */
27
27
Vector3r m_v;
28
+ Vector3r m_v0;
28
29
/* * acceleration (by external forces) */
29
30
Vector3r m_a;
30
31
@@ -57,6 +58,7 @@ namespace PBD
57
58
Matrix3r m_rot;
58
59
/* * Angular velocity, defines rotation axis and velocity (magnitude of the vector) */
59
60
Vector3r m_omega;
61
+ Vector3r m_omega0;
60
62
/* * external torque */
61
63
Vector3r m_torque;
62
64
@@ -152,8 +154,8 @@ namespace PBD
152
154
getOldRotation () = getRotation0 ();
153
155
getLastRotation () = getRotation0 ();
154
156
155
- getVelocity (). setZero ();
156
- getAngularVelocity (). setZero ();
157
+ getVelocity () = getVelocity0 ();
158
+ getAngularVelocity () = getAngularVelocity0 ();
157
159
158
160
getAcceleration ().setZero ();
159
161
getTorque ().setZero ();
@@ -369,6 +371,21 @@ namespace PBD
369
371
m_v = value;
370
372
}
371
373
374
+ FORCE_INLINE Vector3r &getVelocity0 ()
375
+ {
376
+ return m_v0;
377
+ }
378
+
379
+ FORCE_INLINE const Vector3r &getVelocity0 () const
380
+ {
381
+ return m_v0;
382
+ }
383
+
384
+ FORCE_INLINE void setVelocity0 (const Vector3r &value)
385
+ {
386
+ m_v0 = value;
387
+ }
388
+
372
389
FORCE_INLINE Vector3r &getAcceleration ()
373
390
{
374
391
return m_a;
@@ -535,6 +552,21 @@ namespace PBD
535
552
m_omega = value;
536
553
}
537
554
555
+ FORCE_INLINE Vector3r &getAngularVelocity0 ()
556
+ {
557
+ return m_omega0;
558
+ }
559
+
560
+ FORCE_INLINE const Vector3r &getAngularVelocity0 () const
561
+ {
562
+ return m_omega0;
563
+ }
564
+
565
+ FORCE_INLINE void setAngularVelocity0 (const Vector3r &value)
566
+ {
567
+ m_omega0 = value;
568
+ }
569
+
538
570
FORCE_INLINE Vector3r &getTorque ()
539
571
{
540
572
return m_torque;
0 commit comments