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

Unified Diff: lib/src/dynamics/joints/wheel_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/weld_joint.dart ('k') | lib/src/dynamics/world.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/dynamics/joints/wheel_joint.dart
diff --git a/lib/src/dynamics/joints/wheel_joint.dart b/lib/src/dynamics/joints/wheel_joint.dart
index 6e3054b1f494b7cc6008993faf9be3687e6be3f2..758d252ccd55cdfba2648a136a7ead5a2cc29363 100644
--- a/lib/src/dynamics/joints/wheel_joint.dart
+++ b/lib/src/dynamics/joints/wheel_joint.dart
@@ -234,10 +234,8 @@ class WheelJoint extends Joint {
qB.setAngle(aB);
// Compute the effective masses.
- 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);
// Point to line constraint
@@ -357,10 +355,8 @@ class WheelJoint extends Joint {
// Solve spring constraint
{
- double Cdot =
- _ax.dot(temp.setFrom(vB).sub(vA)) + _sBx * wB - _sAx * wA;
- double impulse =
- -_springMass * (Cdot + _bias + _gamma * _springImpulse);
+ double Cdot = _ax.dot(temp.setFrom(vB).sub(vA)) + _sBx * wB - _sAx * wA;
+ double impulse = -_springMass * (Cdot + _bias + _gamma * _springImpulse);
_springImpulse += impulse;
P.x = impulse * _ax.x;
@@ -394,8 +390,7 @@ class WheelJoint extends Joint {
// Solve point to line constraint
{
- double Cdot =
- _ay.dot(temp.setFrom(vB).sub(vA)) + _sBy * wB - _sAy * wA;
+ double Cdot = _ay.dot(temp.setFrom(vB).sub(vA)) + _sBy * wB - _sAy * wA;
double impulse = -_mass * Cdot;
_impulse += impulse;
@@ -445,10 +440,8 @@ class WheelJoint extends Joint {
double C = d.dot(ay);
- double k = _invMassA +
- _invMassB +
- _invIA * _sAy * _sAy +
- _invIB * _sBy * _sBy;
+ double k =
+ _invMassA + _invMassB + _invIA * _sAy * _sAy + _invIB * _sBy * _sBy;
double impulse;
if (k != 0.0) {
« no previous file with comments | « lib/src/dynamics/joints/weld_joint.dart ('k') | lib/src/dynamics/world.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698