alex-moon / vf

VoidFill
MIT License
0 stars 0 forks source link

Raycasting #25

Open alex-moon opened 1 year ago

alex-moon commented 1 year ago

You can in fact do raycasting with Cannon: https://pmndrs.github.io/cannon-es/docs/classes/World.html#rayTest

Use this to move the camera closer as needed. Use raycastCosest, should just work.

alex-moon commented 1 year ago

As part of this work, it would be good to do something similar for Jack walking on the asteroid surface - if Jack is below the surface, he should be pushed up until he's at it - if he is above the surface but less than some distance (maybe 0.5m?) then he should be pushed down until he's at it.