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

Side by Side Diff: lib/src/collision/shapes/circle_shape.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 unified diff | Download patch
OLDNEW
1 /******************************************************************************* 1 /*******************************************************************************
2 * Copyright (c) 2015, Daniel Murphy, Google 2 * Copyright (c) 2015, Daniel Murphy, Google
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without modificati on, 5 * Redistribution and use in source and binary forms, with or without modificati on,
6 * are permitted provided that the following conditions are met: 6 * are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright notice, 7 * * Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer. 8 * this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright notice, 9 * * Redistributions in binary form must reproduce the above copyright notice,
10 * this list of conditions and the following disclaimer in the documentation 10 * this list of conditions and the following disclaimer in the documentation
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 aabb.upperBound.y = py + radius; 168 aabb.upperBound.y = py + radius;
169 } 169 }
170 170
171 void computeMass(final MassData massData, final double density) { 171 void computeMass(final MassData massData, final double density) {
172 massData.mass = density * Math.PI * radius * radius; 172 massData.mass = density * Math.PI * radius * radius;
173 massData.center.x = p.x; 173 massData.center.x = p.x;
174 massData.center.y = p.y; 174 massData.center.y = p.y;
175 175
176 // inertia about the local origin 176 // inertia about the local origin
177 // massData.I = massData.mass * (0.5f * _radius * _radius + Vec2.dot(_p, _p) ); 177 // massData.I = massData.mass * (0.5f * _radius * _radius + Vec2.dot(_p, _p) );
178 massData.I = massData.mass * 178 massData.I =
179 (0.5 * radius * radius + (p.x * p.x + p.y * p.y)); 179 massData.mass * (0.5 * radius * radius + (p.x * p.x + p.y * p.y));
180 } 180 }
181 } 181 }
OLDNEW
« no previous file with comments | « lib/src/collision/broadphase/dynamic_tree.dart ('k') | lib/src/collision/shapes/polygon_shape.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698