add graph for collision system

pull/1/head
Evan Hemsley 2019-06-11 12:25:21 -07:00
parent 14ae5c3ca6
commit 2e90479a32
1 changed files with 13 additions and 1 deletions

View File

@ -30,7 +30,19 @@ We already have MotionMessages. Let's keep those, but redirect them slightly. We
Let's have the MotionEngine consolidate all the MotionMessages per-component, send out an UpdatePositionMessage with that final delta, but then also send out a CollisionCheckMessage for everything that has a BoundingBoxComponent. Let's have the MotionEngine consolidate all the MotionMessages per-component, send out an UpdatePositionMessage with that final delta, but then also send out a CollisionCheckMessage for everything that has a BoundingBoxComponent.
Finally, a CollisionDispatchEngine figures out what two kinds of objects collided and emits a Message in response. We can then implement Engines that read each of those kinds of Messages. Finally, a CollisionDispatchEngine figures out what two kinds of objects collided and emits a Message in response. We can then implement various collision resolution Engines that read each of those kinds of Messages. For example, a BallWallCollisionMessage would be handled by a BallWallCollisionEngine.
{{<mermaid align="center">}}
graph TD;
Engines(Various Engines) -->|MotionMessage| MotionEngine[MotionEngine]
MotionEngine -->|CollisionCheckMessage| CollisionCheckEngine[CollisionCheckEngine]
CollisionCheckEngine -->|CollisionMessage| CollisionDispatchEngine[CollisionDispatchEngine]
CollisionDispatchEngine -->|BallWallCollisionMessage| BallWallCollisionEngine[BallWallCollisionEngine]
CollisionDispatchEngine -->|BallPaddleCollisionMessage| BallPaddleCollisionEngine[BallPaddleCollisionEngine]
BallWallCollisionEngine -->|UpdatePositionMessage| UpdatePositionEngine
BallPaddleCollisionEngine -->|UpdatePositionMessage| UpdatePositionEngine
MotionEngine -->|UpdatePositionMessage| UpdatePositionEngine
{{< /mermaid >}}
Whew! That's a lot! You might be wondering why we're doing all this work just to get some objects reacting to each other. Whew! That's a lot! You might be wondering why we're doing all this work just to get some objects reacting to each other.