From 9e0e01b7f4375063f06e494113187d48614628e0 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 30 Nov 2021 22:25:37 +0800 Subject: +init --- Client/Source/Phy2D/Dynamic/Body.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Client/Source/Phy2D/Dynamic/Body.h (limited to 'Client/Source/Phy2D/Dynamic/Body.h') 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 -- cgit v1.1-26-g67d0