remove third person cameras height limitation
This commit is contained in:
@@ -554,9 +554,7 @@ glm::vec3 Chunks::rayCastToObstacle(glm::vec3 start, glm::vec3 dir, float maxDis
|
|||||||
|
|
||||||
while (t <= maxDist) {
|
while (t <= maxDist) {
|
||||||
voxel* voxel = get(ix, iy, iz);
|
voxel* voxel = get(ix, iy, iz);
|
||||||
if (voxel == nullptr) {
|
if (voxel) {
|
||||||
return glm::vec3(px + t * dx, py + t * dy, pz + t * dz);
|
|
||||||
}
|
|
||||||
const auto def = indices->blocks.get(voxel->id);
|
const auto def = indices->blocks.get(voxel->id);
|
||||||
if (def->obstacle) {
|
if (def->obstacle) {
|
||||||
if (!def->rt.solid) {
|
if (!def->rt.solid) {
|
||||||
@@ -584,6 +582,7 @@ glm::vec3 Chunks::rayCastToObstacle(glm::vec3 start, glm::vec3 dir, float maxDis
|
|||||||
return glm::vec3(px + t * dx, py + t * dy, pz + t * dz);
|
return glm::vec3(px + t * dx, py + t * dy, pz + t * dz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (txMax < tyMax) {
|
if (txMax < tyMax) {
|
||||||
if (txMax < tzMax) {
|
if (txMax < tzMax) {
|
||||||
ix += stepx;
|
ix += stepx;
|
||||||
|
|||||||
Reference in New Issue
Block a user