diff options
author | chai <chaifix@163.com> | 2021-11-30 23:50:01 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-30 23:50:01 +0800 |
commit | 84d961f754c905b37420f4d1b3fee8f4e523e58a (patch) | |
tree | aa3669ac285f7186ecd6a26f874da9bba765178b /Client/Source/Phy2DLite/World.h | |
parent | 9e0e01b7f4375063f06e494113187d48614628e0 (diff) |
+phy2d lite
Diffstat (limited to 'Client/Source/Phy2DLite/World.h')
-rw-r--r-- | Client/Source/Phy2DLite/World.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Client/Source/Phy2DLite/World.h b/Client/Source/Phy2DLite/World.h new file mode 100644 index 0000000..a7a6238 --- /dev/null +++ b/Client/Source/Phy2DLite/World.h @@ -0,0 +1,36 @@ +#pragma once + +#include <vector> +#include <map> +#include "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<Body*> bodies; + std::vector<Joint*> joints; + std::map<ArbiterKey, Arbiter> arbiters; + Vec2 gravity; + int iterations; + static bool accumulateImpulses; + static bool warmStarting; + static bool positionCorrection; + }; + +} |