mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 06:51:51 +00:00
remove third person cameras height limitation
This commit is contained in:
parent
b6ceadcee7
commit
ec4043bc12
1 changed files with 22 additions and 23 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue