diff options
| author | Brian E <[email protected]> | 2023-10-01 22:00:25 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-10-01 23:00:25 +0200 |
| commit | 7351240218849b1579db962f30e42fb982400c7e (patch) | |
| tree | af6def67874c4c7b5bad83584d090c3286c04b01 /src/rcore.c | |
| parent | c3a1c8c8eb8c9b7fac20fa6993e4663a84be17f1 (diff) | |
| download | raylib-7351240218849b1579db962f30e42fb982400c7e.tar.gz raylib-7351240218849b1579db962f30e42fb982400c7e.zip | |
[rcore] reveiwed GetWorldToScreenEx (#3351)
* reveiwed GetWorldToScreenEx
Used the inputted "width" instead of global CORE.window.
Used Vector3Transform instead of quaternion.
* reverted accidental unrelated change
* reverted Vector3Transform back
* fixed mistyped result
---------
Co-authored-by: Brian-E <[email protected]>
Diffstat (limited to 'src/rcore.c')
| -rw-r--r-- | src/rcore.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/rcore.c b/src/rcore.c index 26ff79d9..3ba0404d 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2952,7 +2952,7 @@ Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int heigh } else if (camera.projection == CAMERA_ORTHOGRAPHIC) { - float aspect = (float)CORE.Window.screen.width/(float)CORE.Window.screen.height; + double aspect = ((double)width/(double)height); double top = camera.fovy/2.0; double right = top*aspect; @@ -2963,8 +2963,6 @@ Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int heigh // Calculate view matrix from camera look at (and transpose it) Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up); - // TODO: Why not use Vector3Transform(Vector3 v, Matrix mat)? - // Convert world position vector to quaternion Quaternion worldPos = { position.x, position.y, position.z, 1.0f }; |
