diff options
| author | raysan5 <raysan5@gmail.com> | 2016-08-06 19:29:58 +0200 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2016-08-06 19:29:58 +0200 |
| commit | 865b216ebef8e62a19f3a264001ddf17601f95c5 (patch) | |
| tree | f31468099c8d85cf8767161c3e9c4b16391276d1 /examples/core_3d_picking.lua | |
| parent | 7f9513fbf41e9d340307fc0f9aeed8e5f4293a96 (diff) | |
| download | raylib-865b216ebef8e62a19f3a264001ddf17601f95c5.tar.gz raylib-865b216ebef8e62a19f3a264001ddf17601f95c5.zip | |
Updated Lua examples
Most of the examples already working! Only some of them still fail,
mostly related to data arrays...
Diffstat (limited to 'examples/core_3d_picking.lua')
| -rw-r--r-- | examples/core_3d_picking.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/core_3d_picking.lua b/examples/core_3d_picking.lua index 2e1dc7c4..1adee67c 100644 --- a/examples/core_3d_picking.lua +++ b/examples/core_3d_picking.lua @@ -41,7 +41,7 @@ SetTargetFPS(60) -- Set our game to run at 60 frames-per-secon while not WindowShouldClose() do -- Detect window close button or ESC key -- Update --------------------------------------------------------------------------------------- - UpdateCamera(camera) -- Update internal camera and our camera + camera = UpdateCamera(camera) -- Update internal camera and our camera if (IsMouseButtonPressed(MOUSE.LEFT_BUTTON)) then -- NOTE: This function is NOT WORKING properly! @@ -49,8 +49,10 @@ while not WindowShouldClose() do -- Detect window close button or ESC -- Check collision between ray and box collision = CheckCollisionRayBox(ray, - (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))) + 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))) + + --print("collision check:", collision) end --------------------------------------------------------------------------------------- |
