瀏覽代碼

[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 <brian@intra.fo>
pull/3379/head
Brian E 1 年之前
committed by GitHub
父節點
當前提交
7351240218
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. +1
    -3
      src/rcore.c

+ 1
- 3
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 = (kt">float)CORE.Window.screen.width/(float)CORE.Window.screen.height;
double aspect = (p">(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 };

Loading…
取消
儲存