-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
public float ScreenToWorldScale(float z = 0) => 1 / Vector2.Distance(ScreenToWorld(0, 0, z), ScreenToWorld(1, 0, z));
Should be
public float ScreenToWorldScale(float z = 0) => Vector2.Distance(ScreenToWorld(0, 0, z), ScreenToWorld(1, 0, z));
The reason it's bad is that let's say I have 200 pixels in screen scale and I want to know how many pixels that is in world scale, right now you have to do:
float inWorldScale = 200f / ScreenToWorldScale();
but it should be
float inWorldScale = 200f * ScreenToWorldScale();
Saves 2 divisions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels