mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-12 14:28:15 +00:00
clamp ray hit y position to ground plane height (#1311)
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user