diff options
Diffstat (limited to '2d/_collisions/rectangle_rectangle')
-rw-r--r-- | 2d/_collisions/rectangle_rectangle/main.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/2d/_collisions/rectangle_rectangle/main.cpp b/2d/_collisions/rectangle_rectangle/main.cpp index 6913749..3cd4f46 100644 --- a/2d/_collisions/rectangle_rectangle/main.cpp +++ b/2d/_collisions/rectangle_rectangle/main.cpp @@ -1,4 +1,4 @@ -#include "../../../shared_cpp/OrthographicRenderer.h" +#include "../../../shared_cpp/Renderer2d.h" #include "../../../shared_cpp/types.h" #include "../../../shared_cpp/WebglContext.h" #include "../../../shared_cpp/mathlib.h" @@ -67,14 +67,14 @@ struct Edge { }; struct Rectangle { - OrthographicShape shape; + Mesh2d shape; Rigidbody body; Rigidbody previousBody; Vector4 color; float32 width = 0.f; float32 height = 0.f; - void load(OrthographicRenderer* renderer, Vector4 inColor, float32 inWidth, float32 inHeight) { + void load(Renderer2d* renderer, Vector4 inColor, float32 inWidth, float32 inHeight) { color = inColor.toNormalizedColor(); width = inWidth;; height = inHeight; @@ -82,7 +82,7 @@ struct Rectangle { float32 halfWidth = width / 2.f; float32 halfHeight = height / 2.f; - OrthographicVertex vertices[6]; + Vertex2d vertices[6]; vertices[0].position = Vector2 { -halfWidth, -halfHeight }; vertices[1].position = Vector2 { -halfWidth, halfHeight }; vertices[2].position = Vector2 { halfWidth, halfHeight }; @@ -106,7 +106,7 @@ struct Rectangle { shape.model = Mat4x4().translateByVec2(body.position).rotate2D(body.rotation); } - void render(OrthographicRenderer* renderer) { + void render(Renderer2d* renderer) { shape.render(renderer); } @@ -169,7 +169,7 @@ void update(float32 time, void* userData); void unload(); WebglContext context; -OrthographicRenderer renderer; +Renderer2d renderer; MainLoop mainLoop; Rectangle rectangleList[4]; |