summaryrefslogtreecommitdiff
path: root/2d/_collisions/polygon_polygon
diff options
context:
space:
mode:
Diffstat (limited to '2d/_collisions/polygon_polygon')
-rw-r--r--2d/_collisions/polygon_polygon/main.cpp12
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];