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

Unified Diff: lib/src/dynamics/joints/prismatic_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/joints/mouse_joint.dart ('k') | lib/src/dynamics/joints/pulley_joint.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/dynamics/joints/prismatic_joint.dart
diff --git a/lib/src/dynamics/joints/prismatic_joint.dart b/lib/src/dynamics/joints/prismatic_joint.dart
index 1799682e046ae30a2534fc2958cc9611e0abcff8..c3ddfecb851f28357ef95163ffa46208e970fc99 100644
--- a/lib/src/dynamics/joints/prismatic_joint.dart
+++ b/lib/src/dynamics/joints/prismatic_joint.dart
@@ -484,12 +484,10 @@ class PrismaticJoint extends Joint {
temp.setFrom(_axis).scale(_motorImpulse + _impulse.z);
P.setFrom(_perp).scale(_impulse.x).add(temp);
- double LA = _impulse.x * _s1 +
- _impulse.y +
- (_motorImpulse + _impulse.z) * _a1;
- double LB = _impulse.x * _s2 +
- _impulse.y +
- (_motorImpulse + _impulse.z) * _a2;
+ double LA =
+ _impulse.x * _s1 + _impulse.y + (_motorImpulse + _impulse.z) * _a1;
+ double LB =
+ _impulse.x * _s2 + _impulse.y + (_motorImpulse + _impulse.z) * _a2;
vA.x -= mA * P.x;
vA.y -= mA * P.y;
@@ -589,9 +587,7 @@ class PrismaticJoint extends Joint {
final Vector2 b = pool.popVec2();
final Vector2 f2r = pool.popVec2();
- temp
- .setValues(_K.entry(0, 2), _K.entry(1, 2))
- .scale(_impulse.z - f1.z);
+ temp.setValues(_K.entry(0, 2), _K.entry(1, 2)).scale(_impulse.z - f1.z);
b.setFrom(Cdot1).negate().sub(temp);
Matrix3.solve2(_K, f2r, b);
@@ -678,10 +674,8 @@ class PrismaticJoint extends Joint {
iB = _invIB;
// Compute fresh Jacobians
- Rot.mulToOutUnsafe(
- qA, temp.setFrom(_localAnchorA).sub(_localCenterA), rA);
- Rot.mulToOutUnsafe(
- qB, temp.setFrom(_localAnchorB).sub(_localCenterB), rB);
+ Rot.mulToOutUnsafe(qA, temp.setFrom(_localAnchorA).sub(_localCenterA), rA);
+ Rot.mulToOutUnsafe(qB, temp.setFrom(_localAnchorB).sub(_localCenterB), rB);
d.setFrom(cB).add(rB).sub(cA).sub(rA);
Rot.mulToOutUnsafe(qA, _localXAxisA, axis);
« no previous file with comments | « lib/src/dynamics/joints/mouse_joint.dart ('k') | lib/src/dynamics/joints/pulley_joint.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698