summaryrefslogtreecommitdiff
path: root/2d/rigidbody/rigidbody_3
diff options
context:
space:
mode:
Diffstat (limited to '2d/rigidbody/rigidbody_3')
-rw-r--r--2d/rigidbody/rigidbody_3/main.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/2d/rigidbody/rigidbody_3/main.cpp b/2d/rigidbody/rigidbody_3/main.cpp
index 2a0af24..7d3edd0 100644
--- a/2d/rigidbody/rigidbody_3/main.cpp
+++ b/2d/rigidbody/rigidbody_3/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"
@@ -100,13 +100,13 @@ struct Rigidbody {
};
struct Circle {
- OrthographicShape shape;
+ Mesh2d shape;
Rigidbody body;
Rigidbody previousBody;
Vector2 force;
float32 radius;
- void load(OrthographicRenderer* renderer, float32 inRadius, Vector4 startColor, Vector4 endColor) {
+ void load(Renderer2d* renderer, float32 inRadius, Vector4 startColor, Vector4 endColor) {
radius = inRadius;
const int32 numSegments = 36;
const float32 radiansPerSegment = (2.f * PI) / static_cast<float>(numSegments);
@@ -115,7 +115,7 @@ struct Circle {
startColor = startColor.toNormalizedColor();
endColor = endColor.toNormalizedColor();
- OrthographicVertex vertices[numSegments * 3];
+ Vertex2d vertices[numSegments * 3];
for (int idx = 0; idx < numSegments; idx++) {
int vIdx = idx * 3;
@@ -146,7 +146,7 @@ struct Circle {
body.update(dtSeconds);
}
- void render(OrthographicRenderer* renderer) {
+ void render(Renderer2d* renderer) {
shape.render(renderer);
}
@@ -175,7 +175,7 @@ void update(float32 time, void* userData);
void unload();
WebglContext context;
-OrthographicRenderer renderer;
+Renderer2d renderer;
MainLoop mainLoop;
Circle c1;
Circle c2;