diff options
author | Matthew Kosarek <mattkae@protonmail.com> | 2021-10-31 13:54:11 -0400 |
---|---|---|
committer | Matthew Kosarek <mattkae@protonmail.com> | 2021-10-31 13:54:11 -0400 |
commit | 5c613a10364f30bd6add25f7950433f0c482c3ca (patch) | |
tree | af8f6e481b6400329eca12bd8cdb35e0237d63af /2d/_collisions/polygon_polygon | |
parent | a214b4f8977a4b115710b5c9d152b392ac8e24f7 (diff) |
(mkosarek) Working undamped spring motion
Diffstat (limited to '2d/_collisions/polygon_polygon')
-rw-r--r-- | 2d/_collisions/polygon_polygon/main.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/2d/_collisions/polygon_polygon/main.cpp b/2d/_collisions/polygon_polygon/main.cpp index 9cb3eb2..3d8561f 100644 --- a/2d/_collisions/polygon_polygon/main.cpp +++ b/2d/_collisions/polygon_polygon/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" @@ -112,7 +112,7 @@ struct Edge { }; struct ConvexPolygon { - OrthographicShape shape; + Mesh2d shape; Rigidbody body; Rigidbody previousBody; Vector4 color; @@ -123,7 +123,7 @@ struct ConvexPolygon { Vector2* transformedVertices; Edge* edges; - void load(OrthographicRenderer* renderer) { + void load(Renderer2d* renderer) { transformedVertices = new Vector2[numVertices]; // This will be used for SAT calculations later originalVertices = new Vector2[numVertices]; @@ -134,7 +134,7 @@ struct ConvexPolygon { // is the 2k lines of JavaScript that are required to display it. int32 verticesNeeded = numVertices * 3; float32 angleIncrements = (2.f * PI) / static_cast<float32>(numVertices); - OrthographicVertex* shaderVertices = new OrthographicVertex[verticesNeeded]; + Vertex2d* shaderVertices = new Vertex2d[verticesNeeded]; for (int32 vidx = 0; vidx < numVertices; vidx++) { int32 indexPosition = vidx * 3; @@ -186,7 +186,7 @@ struct ConvexPolygon { body = previousBody; } - void render(OrthographicRenderer* renderer) { + void render(Renderer2d* renderer) { shape.render(renderer); } @@ -213,7 +213,7 @@ void update(float32 time, void* userData); void unload(); WebglContext context; -OrthographicRenderer renderer; +Renderer2d renderer; MainLoop mainLoop; ConvexPolygon polygons[4]; |