SamyBencherif / 3gw

https://samybencherif.github.io/documents/game-worlds-workshop.html
The Unlicense
0 stars 0 forks source link

engine-refactoring-raycastprep #22

Closed SamyBencherif closed 1 year ago

SamyBencherif commented 2 years ago

Just prepare for raycasting feature ! Make sure the code is oriented and shaped and what have you such that determining the object situated at Viewport[0.5, 0.5] and doing something with it is easy. Especially doing the action on a keypress!

I think i might do this by figuring out the RaycastTarget once per frame (or less !) and letting that be accessible to everything else by a reference. Right now my two use cases of interact and hold do not need an exact world-space coordinate. Just the object is fine.

Actually, remember the distance is important !!!