Facepunch / sbox-issues

175 stars 12 forks source link

`SceneCamera.GetRay` accepts a `Vector3` cursor position #6418

Open Remscar opened 1 month ago

Remscar commented 1 month ago

What it is?

There exists a function

public Ray GetRay(Vector3 cursorPosition, Vector3 screenSize)

Whose functionality is described as "Given a cursor position get a scene aiming ray."

Last I checked, modern computers don't have 3rd axis on screens, nor can their sizes be in 3 dimensions.

Reading the summary makes me think I found the right function, but seeing it accepts Vector3 then makes me doubt I found the right function.

Looking at the decompiled code, I can see that the z axis is not used.

Related public Ray ScreenPixelToRay(Vector3 pixelPosition) in CameraComponent.cs

What should it be?

Both cursorPosition and sceenSize should be Vector2

garrynewman commented 1 month ago

You are correct - we can't fix this right now though, since it's a breaking change