mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
Added flight mode ('F' button)
This commit is contained in:
parent
1dd9a72fb3
commit
b6c328fe1d
7 changed files with 30 additions and 9 deletions
|
|
@ -13,6 +13,7 @@ public:
|
|||
bool lightPassing = false;
|
||||
bool skyLightPassing = false;
|
||||
bool obstacle = true;
|
||||
bool selectable = true;
|
||||
|
||||
Block(unsigned int id, int texture);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ voxel* Chunks::rayCast(vec3 a, vec3 dir, float maxDist, vec3& end, vec3& norm, v
|
|||
|
||||
while (t <= maxDist){
|
||||
voxel* voxel = get(ix, iy, iz);
|
||||
if (voxel == nullptr || voxel->id){
|
||||
if (voxel == nullptr || Block::blocks[voxel->id]->selectable){
|
||||
end.x = px + t * dx;
|
||||
end.y = py + t * dy;
|
||||
end.z = pz + t * dz;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue