diff options
Diffstat (limited to 'Client/Source/Phy2D/Dynamic/Body.cpp')
-rw-r--r-- | Client/Source/Phy2D/Dynamic/Body.cpp | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/Client/Source/Phy2D/Dynamic/Body.cpp b/Client/Source/Phy2D/Dynamic/Body.cpp deleted file mode 100644 index 1d896fd..0000000 --- a/Client/Source/Phy2D/Dynamic/Body.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include "Body.h"
- -using namespace Phy2D; - -Body::Body() -{ - position.Set(0.0f, 0.0f); - rotation = 0.0f; - velocity.Set(0.0f, 0.0f); - angularVelocity = 0.0f; - force.Set(0.0f, 0.0f); - torque = 0.0f; - friction = 0.2f; - - width.Set(1.0f, 1.0f); - mass = NUMBER_MAX; - invMass = 0.0f; - I = NUMBER_MAX; - invI = 0.0f; -} - -void Body::Set(const Vec2& w, number m) -{ - position.Set(0.0f, 0.0f); - rotation = 0.0f; - velocity.Set(0.0f, 0.0f); - angularVelocity = 0.0f; - force.Set(0.0f, 0.0f); - torque = 0.0f; - friction = 0.2f; - - width = w; - mass = m; - - if (mass < NUMBER_MAX) - { - invMass = (number)1.0f / mass; - I = mass * (width.x * width.x + width.y * width.y) / 12.0f; - invI = (number)1.0f / I; - } - else - { - invMass = 0.0f; - I = NUMBER_MAX; - invI = 0.0f; - } -} |