Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Unified Diff: lib/src/dynamics/joints/distance_joint.dart

Issue 1138063003: pkg/box2d: 0.2.0 release (Closed) Base URL: https://github.com/google/dbox2d.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/dynamics/contacts/contact_solver.dart ('k') | lib/src/dynamics/joints/friction_joint.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/dynamics/joints/distance_joint.dart
diff --git a/lib/src/dynamics/joints/distance_joint.dart b/lib/src/dynamics/joints/distance_joint.dart
index c67721a7e2579a40214131bc819577ca4bd7019c..857a815b31123349bc308d528be027ba44e239de 100644
--- a/lib/src/dynamics/joints/distance_joint.dart
+++ b/lib/src/dynamics/joints/distance_joint.dart
@@ -124,10 +124,8 @@ class DistanceJoint extends Joint {
qB.setAngle(aB);
// use _u as temporary variable
- Rot.mulToOutUnsafe(
- qA, _u.setFrom(_localAnchorA).sub(_localCenterA), _rA);
- Rot.mulToOutUnsafe(
- qB, _u.setFrom(_localAnchorB).sub(_localCenterB), _rB);
+ Rot.mulToOutUnsafe(qA, _u.setFrom(_localAnchorA).sub(_localCenterA), _rA);
+ Rot.mulToOutUnsafe(qB, _u.setFrom(_localAnchorB).sub(_localCenterB), _rB);
_u.setFrom(cB).add(_rB).sub(cA).sub(_rA);
pool.pushRot(2);
@@ -143,10 +141,8 @@ class DistanceJoint extends Joint {
double crAu = _rA.cross(_u);
double crBu = _rB.cross(_u);
- double invMass = _invMassA +
- _invIA * crAu * crAu +
- _invMassB +
- _invIB * crBu * crBu;
+ double invMass =
+ _invMassA + _invIA * crAu * crAu + _invMassB + _invIB * crBu * crBu;
// Compute the effective mass matrix.
_mass = invMass != 0.0 ? 1.0 / invMass : 0.0;
« no previous file with comments | « lib/src/dynamics/contacts/contact_solver.dart ('k') | lib/src/dynamics/joints/friction_joint.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698