summaryrefslogtreecommitdiffhomepage
path: root/examples/models/models_billboard.c
diff options
context:
space:
mode:
authorCrydsch Cube <[email protected]>2023-02-14 17:47:21 +0100
committerGitHub <[email protected]>2023-02-14 17:47:21 +0100
commit73989a49817225f11f547d270598e93745bf7df0 (patch)
treec5ab826343e7b131c1e3733924156add0d445dbc /examples/models/models_billboard.c
parentf1bcabcc3799df741d54593980ac06afe2e0f081 (diff)
downloadraylib-73989a49817225f11f547d270598e93745bf7df0.tar.gz
raylib-73989a49817225f11f547d270598e93745bf7df0.zip
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 <[email protected]>
Diffstat (limited to 'examples/models/models_billboard.c')
-rw-r--r--examples/models/models_billboard.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/models/models_billboard.c b/examples/models/models_billboard.c
index ce313949..6d16cf01 100644
--- a/examples/models/models_billboard.c
+++ b/examples/models/models_billboard.c
@@ -48,14 +48,13 @@ int main(void)
// Here we choose to rotate around the image center
// NOTE: (-1, 1) is the range where origin.x, origin.y is inside the texture
Vector2 rotateOrigin = { 0.0f };
- SetCameraMode(camera, CAMERA_ORBITAL); // Set an orbital camera mode
// Distance is needed for the correct billboard draw order
// Larger distance (further away from the camera) should be drawn prior to smaller distance.
float distanceStatic;
float distanceRotating;
-
float rotation = 0.0f;
+
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
@@ -64,7 +63,8 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(&camera);
+ UpdateCamera(&camera, CAMERA_ORBITAL);
+
rotation += 0.4f;
distanceStatic = Vector3Distance(camera.position, billPositionStatic);
distanceRotating = Vector3Distance(camera.position, billPositionRotating);