diff options
| author | victorfisac <victorfisac@gmail.com> | 2016-03-16 12:40:08 +0100 |
|---|---|---|
| committer | victorfisac <victorfisac@gmail.com> | 2016-03-16 12:40:08 +0100 |
| commit | d72849409982266b99dd00741bf807ef10ba3c6c (patch) | |
| tree | 86098d3d7f0254712ed2fa9f64d43ab98fc54ce3 /examples/core_3d_picking.c | |
| parent | 78e4772f21cda45c219ce88a713708b6b0680e8f (diff) | |
| parent | 5bcda7bf1526c40f605de3abcde4fd10d81c6cc5 (diff) | |
| download | raylib-d72849409982266b99dd00741bf807ef10ba3c6c.tar.gz raylib-d72849409982266b99dd00741bf807ef10ba3c6c.zip | |
Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop
Diffstat (limited to 'examples/core_3d_picking.c')
| -rw-r--r-- | examples/core_3d_picking.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/core_3d_picking.c b/examples/core_3d_picking.c index fdf77030..33eaed8a 100644 --- a/examples/core_3d_picking.c +++ b/examples/core_3d_picking.c @@ -25,6 +25,7 @@ int main() camera.position = (Vector3){ 0.0f, 10.0f, 10.0f }; // Camera position camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target) + camera.fovy = 45.0f; // Camera field-of-view Y Vector3 cubePosition = { 0.0f, 1.0f, 0.0f }; Vector3 cubeSize = { 2.0f, 2.0f, 2.0f }; @@ -35,6 +36,7 @@ int main() SetCameraMode(CAMERA_FREE); // Set a free camera mode SetCameraPosition(camera.position); // Set internal camera position to match our camera position + SetCameraFovy(camera.fovy); // Set internal camera field-of-view Y SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- @@ -53,8 +55,8 @@ int main() // Check collision between ray and box collision = CheckCollisionRayBox(ray, - (Vector3){ cubePosition.x - cubeSize.x/2, cubePosition.y - cubeSize.y/2, cubePosition.z - cubeSize.z/2 }, - (Vector3){ cubePosition.x + cubeSize.x/2, cubePosition.y + cubeSize.y/2, cubePosition.z + cubeSize.z/2 }); + (BoundingBox){(Vector3){ cubePosition.x - cubeSize.x/2, cubePosition.y - cubeSize.y/2, cubePosition.z - cubeSize.z/2 }, + (Vector3){ cubePosition.x + cubeSize.x/2, cubePosition.y + cubeSize.y/2, cubePosition.z + cubeSize.z/2 }}); } //---------------------------------------------------------------------------------- |
