Update the camera before sending it to the shader

This commit is contained in:
JeffMyers 2026-08-06 15:26:07 -07:00
commit 421fd7e6f5

View file

@ -111,9 +111,11 @@ int main(void)
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
float deltaTime = GetFrameTime(); float deltaTime = GetFrameTime();
UpdateCamera(&camera, CAMERA_ORBITAL);
// send the updated camera position to the shader so that it can calculate the correct lighting for the scene
Vector3 cameraPos = camera.position; Vector3 cameraPos = camera.position;
SetShaderValue(shadowShader, shadowShader.locs[SHADER_LOC_VECTOR_VIEW], &cameraPos, SHADER_UNIFORM_VEC3); SetShaderValue(shadowShader, shadowShader.locs[SHADER_LOC_VECTOR_VIEW], &cameraPos, SHADER_UNIFORM_VEC3);
UpdateCamera(&camera, CAMERA_ORBITAL);
frameCounter++; frameCounter++;
frameCounter %= (anims[0].keyframeCount); frameCounter %= (anims[0].keyframeCount);