clamp ray hit y position to ground plane height (#1311)
This commit is contained in:
parent
7760575d3f
commit
bdd253a66a
1 changed files with 1 additions and 0 deletions
|
@ -2862,6 +2862,7 @@ RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight)
|
||||||
result.distance = distance;
|
result.distance = distance;
|
||||||
result.normal = (Vector3){ 0.0, 1.0, 0.0 };
|
result.normal = (Vector3){ 0.0, 1.0, 0.0 };
|
||||||
result.position = Vector3Add(ray.position, Vector3Scale(ray.direction, distance));
|
result.position = Vector3Add(ray.position, Vector3Scale(ray.direction, distance));
|
||||||
|
result.position.y = groundHeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue