aboutsummaryrefslogtreecommitdiff
path: root/Client/Source/Phy2D/Dynamic/Body.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-12-02 14:44:36 +0800
committerchai <chaifix@163.com>2021-12-02 14:44:36 +0800
commitfdd228071a3112aeebda20766c7df3b20b8651aa (patch)
treeedc6e05bda6c537582235dbe110e3ed783e0e36a /Client/Source/Phy2D/Dynamic/Body.cpp
parentb1d4e9866de19c70174553e543e81ef4473dee6c (diff)
+Fix32
Diffstat (limited to 'Client/Source/Phy2D/Dynamic/Body.cpp')
-rw-r--r--Client/Source/Phy2D/Dynamic/Body.cpp47
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;
- }
-}