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/World.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Client/Source/Phy2D/Dynamic/World.h (limited to 'Client/Source/Phy2D/Dynamic/World.h') diff --git a/Client/Source/Phy2D/Dynamic/World.h b/Client/Source/Phy2D/Dynamic/World.h new file mode 100644 index 0000000..d5c652c --- /dev/null +++ b/Client/Source/Phy2D/Dynamic/World.h @@ -0,0 +1,36 @@ +#pragma once + +#include +#include +#include "../Common/Math.h" +#include "Arbiter.h" + +namespace Phy2D +{ + + struct Body; + struct Joint; + + struct World + { + World(Vec2 gravity, int iterations) : gravity(gravity), iterations(iterations) {} + + void Add(Body* body); + void Add(Joint* joint); + void Clear(); + + void Step(number dt); + + void BroadPhase(); + + std::vector bodies; + std::vector joints; + std::map arbiters; + Vec2 gravity; + int iterations; + static bool accumulateImpulses; + static bool warmStarting; + static bool positionCorrection; + }; + +} -- cgit v1.1-26-g67d0