aboutsummaryrefslogtreecommitdiff
path: root/Client/Source/Phy2DLite/Body.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-11-30 23:50:01 +0800
committerchai <chaifix@163.com>2021-11-30 23:50:01 +0800
commit84d961f754c905b37420f4d1b3fee8f4e523e58a (patch)
treeaa3669ac285f7186ecd6a26f874da9bba765178b /Client/Source/Phy2DLite/Body.h
parent9e0e01b7f4375063f06e494113187d48614628e0 (diff)
+phy2d lite
Diffstat (limited to 'Client/Source/Phy2DLite/Body.h')
-rw-r--r--Client/Source/Phy2DLite/Body.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/Client/Source/Phy2DLite/Body.h b/Client/Source/Phy2DLite/Body.h
new file mode 100644
index 0000000..a2366ce
--- /dev/null
+++ b/Client/Source/Phy2DLite/Body.h
@@ -0,0 +1,34 @@
+#pragma once
+
+#include "Math.h"
+
+namespace Phy2D
+{
+
+ struct Body
+ {
+ Body();
+ void Set(const Vec2& w, number m);
+
+ void AddForce(const Vec2& f)
+ {
+ force += f;
+ }
+
+ Vec2 position;
+ number rotation;
+
+ Vec2 velocity;
+ number angularVelocity;
+
+ Vec2 force;
+ number torque;
+
+ Vec2 width;
+
+ number friction;
+ number mass, invMass;
+ number I, invI;
+ };
+
+} \ No newline at end of file