diff options
author | chai <chaifix@163.com> | 2021-11-30 22:25:37 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-30 22:25:37 +0800 |
commit | 9e0e01b7f4375063f06e494113187d48614628e0 (patch) | |
tree | 21a4901612ad92c121f4c887a33b1bbbe87c6b00 /Client/Source/Phy2D/Dynamic/Body.h |
+init
Diffstat (limited to 'Client/Source/Phy2D/Dynamic/Body.h')
-rw-r--r-- | Client/Source/Phy2D/Dynamic/Body.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Client/Source/Phy2D/Dynamic/Body.h b/Client/Source/Phy2D/Dynamic/Body.h new file mode 100644 index 0000000..6d86e07 --- /dev/null +++ b/Client/Source/Phy2D/Dynamic/Body.h @@ -0,0 +1,34 @@ +#pragma once + +#include "../Common/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 |