Document raycasting

This commit is contained in:
Dane Johnson
2021-04-21 21:30:48 -05:00
parent fa20631e7b
commit c68ee69c9b
2 changed files with 10 additions and 1 deletions

View File

@@ -37,7 +37,7 @@ function onkey(key, code, action, mod)
local res = couch.World.GetWorld():Raycast(camera_transform.position,
camera_transform.position + camera_transform:Forward() * 100.0)
if (res.hit) then
res.object:ApplyImpulse(res.normal * -100.0)
res.object:ApplyImpulse(camera_transform:Forward() * 100.0)
end
end
end