From 0862f6ddcb7614857443de3fa3c0bc48f746173e Mon Sep 17 00:00:00 2001 From: InventorXtreme Date: Mon, 4 Dec 2023 00:00:12 -0500 Subject: [PATCH] fnaf --- c3d.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/c3d.c b/c3d.c index 59567fd..b555110 100644 --- a/c3d.c +++ b/c3d.c @@ -16,7 +16,7 @@ const float WIDTHSCALE = (float)RENDERWIDTH / SCREENWIDTH; const float HEIGHTSCALE = (float) RENDERHEIGHT / SCREENHEIGHT; -const float fov = 90.0 / 180.0 * 3.14159265369; +const float fov = 70.0 / 180.0 * 3.14159265369; const float half_fov = fov / 2; float proj; //HALFWIDTH / tan(half_fov) Inited later @@ -93,11 +93,40 @@ void CtrlLocalCam(LocalCam *cam, float time) { //cam->velocity.z = cam->velocity.z + 50000*time*sin(cam->angles.y); //cam->velocity.x = cam->velocity.x + 500*time*cos(cam->angles.y); } + if (IsKeyDown(KEY_S)) { + Vector3 forceForward = (Vector3){0,0,-500}; + Vector3 rotatedforce = RotateAboutY(forceForward,cam->angles.y); + cam->velocity = Vector3Sum(cam->velocity,rotatedforce); + + //cam->velocity.z = cam->velocity.z + 50000*time*sin(cam->angles.y); + //cam->velocity.x = cam->velocity.x + 500*time*cos(cam->angles.y); + } + + if (IsKeyDown(KEY_A)) { + Vector3 forceForward = (Vector3){-500,0,0}; + Vector3 rotatedforce = RotateAboutY(forceForward,cam->angles.y); + cam->velocity = Vector3Sum(cam->velocity,rotatedforce); + + //cam->velocity.z = cam->velocity.z + 50000*time*sin(cam->angles.y); + //cam->velocity.x = cam->velocity.x + 500*time*cos(cam->angles.y); + } + if (IsKeyDown(KEY_D)) { + Vector3 forceForward = (Vector3){500,0,0}; + Vector3 rotatedforce = RotateAboutY(forceForward,cam->angles.y); + cam->velocity = Vector3Sum(cam->velocity,rotatedforce); + + //cam->velocity.z = cam->velocity.z + 50000*time*sin(cam->angles.y); + //cam->velocity.x = cam->velocity.x + 500*time*cos(cam->angles.y); + } if(IsKeyDown(KEY_SPACE)) { cam->velocity.y = cam->velocity.y - 50; } + if(IsKeyDown(KEY_LEFT_SHIFT)) { + cam->velocity.y = cam->velocity.y + 50; + } + if (IsKeyDown(KEY_Q)){ cam->angleVelocity.y = cam->angleVelocity.y + time*1000; }