Closed afritz1 closed 6 years ago
Added barebones proof-of-concept functionality in commit 4c627ff2b34d2f7bb47f82651dcb619fac5a8c8a. I can now actually click on some blocks. The player can delete wall blocks by clicking on them or by pressing E in modern mode.
Things still left to do:
GameWorldPanel::handleClickInWorld()
(i.e., maximum range, check menu blocks for transitions, etc.)I'm going to split up this issue into more pieces since some of them are already solved (doors, MENU voxels) and others will probably not be solved until they're being implemented (entities).
This feature will allow the player to click on voxels and sprites to interact with them.
Currently I am thinking of doing a 3D ray casting algorithm that will step through the voxel grid until an intersection occurs, and it will retrieve the intersection data (distance, point in space, voxel coordinates, normal, voxel type).
Certain voxels like fences and store signs probably do not register a hit, so there should be some collision mask capability (or simply ignoring certain voxels in the ray caster).