mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-20 18:28:15 +00:00
MOVED: rlUnproject() [rlgl] -> Vector3Unproject() [raymath]
This commit is contained in:
@@ -1633,13 +1633,13 @@ Ray GetMouseRay(Vector2 mouse, Camera camera)
|
||||
}
|
||||
|
||||
// Unproject far/near points
|
||||
Vector3 nearPoint = rlUnproject((Vector3){ deviceCoords.x, deviceCoords.y, 0.0f }, matProj, matView);
|
||||
Vector3 farPoint = rlUnproject((Vector3){ deviceCoords.x, deviceCoords.y, 1.0f }, matProj, matView);
|
||||
Vector3 nearPoint = Vector3Unproject((Vector3){ deviceCoords.x, deviceCoords.y, 0.0f }, matProj, matView);
|
||||
Vector3 farPoint = Vector3Unproject((Vector3){ deviceCoords.x, deviceCoords.y, 1.0f }, matProj, matView);
|
||||
|
||||
// Unproject the mouse cursor in the near plane.
|
||||
// We need this as the source position because orthographic projects, compared to perspect doesn't have a
|
||||
// convergence point, meaning that the "eye" of the camera is more like a plane than a point.
|
||||
Vector3 cameraPlanePointerPos = rlUnproject((Vector3){ deviceCoords.x, deviceCoords.y, -1.0f }, matProj, matView);
|
||||
Vector3 cameraPlanePointerPos = Vector3Unproject((Vector3){ deviceCoords.x, deviceCoords.y, -1.0f }, matProj, matView);
|
||||
|
||||
// Calculate normalized direction vector
|
||||
Vector3 direction = Vector3Normalize(Vector3Subtract(farPoint, nearPoint));
|
||||
|
Reference in New Issue
Block a user