From 461f1810d6434f1d7438c2332594a844316cc963 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Wed, 9 Dec 2020 12:21:01 -0500 Subject: started platform building --- sim.hpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'sim.hpp') diff --git a/sim.hpp b/sim.hpp index 0f4dbd7..dcc32fb 100644 --- a/sim.hpp +++ b/sim.hpp @@ -138,7 +138,10 @@ typedef struct { v2 move_p1; v2 move_p2; + float rotate_speed; + + u32 color; } Platform; typedef struct { @@ -150,7 +153,9 @@ typedef struct { typedef struct { bool initialized; - i32 win_width, win_height; // width,height of window + float win_width, win_height; // width,height of window in pixels + + v2 mouse_pos; // mouse position in Box2D (not GL) coordinates float dt; // time in seconds since last frame @@ -159,12 +164,16 @@ typedef struct { // will be some left over, if the frame time is not a multiple of the fixed time step) float time_residue; m4 transform; // the transform for converting our coordinates to GL coordinates + m4 inv_transform; // inverse of transform (for converting GL coordinates to our coordinates) GL gl; // gl functions ShaderPlatform shader_platform; ShaderBall shader_ball; - b2World *world; + bool building; // is the user building a setup? + bool simulating; // are we simulating the world's physics? + + b2World *world; // Box2D world Ball ball; float bottom_y; // y-position of "floor" (if y goes below here, it's over) @@ -172,6 +181,8 @@ typedef struct { Font font; + Platform platform_building; // the platform the user is currently placing + float platform_thickness; u32 nplatforms; Platform platforms[1000]; -- cgit v1.2.3