WIP rcamera redesign vector (#2563)

* core functionality CAMERA_FREE

* fix example

* add remaining camera modes

* add view bobbing

* view bobbing

* catch curser in SetCameraMode

* adjust examples

* fix compilation on linux

* fix example text_draw_3d

* actually fix text_draw_3d

* Updated camera API

* Improve Vector3RotateByAxisAngle() function

* remove camera.mode dependency from low-level functions

* remove camera.mode from struct

* fixes after rebase

* adjust examples for new UpdateCamera function

* adjust example models_loading_m3d

---------

Co-authored-by: Ray <raysan5@gmail.com>
This commit is contained in:
Crydsch Cube 2023-02-14 17:47:21 +01:00 committed by GitHub
parent f1bcabcc37
commit 73989a4981
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 996 additions and 477 deletions

View file

@ -41,8 +41,6 @@ int main(void)
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
camera.fovy = 65.0f; // Camera field-of-view Y
SetCameraMode(camera, CAMERA_FREE); // Set camera mode
// Load raymarching shader
// NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex shader
Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/raymarching.fs", GLSL_VERSION));
@ -58,6 +56,7 @@ int main(void)
float runTime = 0.0f;
DisableCursor(); // Catch cursor
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
@ -66,7 +65,7 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
UpdateCamera(&camera);
UpdateCamera(&camera, CAMERA_FIRST_PERSON);
float cameraPos[3] = { camera.position.x, camera.position.y, camera.position.z };
float cameraTarget[3] = { camera.target.x, camera.target.y, camera.target.z };