updated crpgCameraUpdate to take delta time as a param
authormatthew <matthew@owens.tech>
Sat, 3 Nov 2018 16:21:02 +0000 (16:21 +0000)
committermatthew <matthew@owens.tech>
Sat, 3 Nov 2018 16:21:02 +0000 (16:21 +0000)
gl/main.c

index 3cc6d91..6084bac 100644 (file)
--- a/gl/main.c
+++ b/gl/main.c
@@ -100,9 +100,9 @@ static void initShapes()
 
 static void initView()
 {
-       crpgCameraSetAR((float)screen_width/(float)screen_height);
-       camera = crpgCameraNew(vec3(0,0,4), vec3(0,0,0), vec3(0,1,0));
+       camera = crpgCameraNew(vec3(0,0,3), vec3(0,1,0));
        crpgCameraSetSpeed(camera, 20);
+
        crpgCubeSetCamera(cubes[0], crpgCameraGetMat(camera));
        crpgCubeSetCamera(cubes[1], crpgCameraGetMat(camera));
 
@@ -165,7 +165,7 @@ static void update()
 
        // Updating physics as many times as we need to consume dt
        while(crpgTimeStepPhysRequired(physUpdates)){
-               crpgCameraUpdate(camera);
+               crpgCameraUpdate(camera, crpgTimeStepDelta());
                crpgCubeSetCamera(cubes[0], crpgCameraGetMat(camera));
                crpgCubeSetCamera(cubes[1], crpgCameraGetMat(camera));
                physUpdates++;