public void GetScreenVectorToWorld(Vec2 argScreen, Vec2 argWorld) { inv.Set(Box.R); inv.InvertLocal(); inv.MulToOut(argScreen, argWorld); if (YFlip) { yFlipMatInv.MulToOut(argWorld, argWorld); } }
public void GetWorldToScreen(Vec2 argWorld, Vec2 argScreen) { argScreen.Set(argWorld); argScreen.SubLocal(Box.Center); Box.R.MulToOut(argScreen, argScreen); if (YFlip) { yFlipMat.MulToOut(argScreen, argScreen); } argScreen.AddLocal(Box.Extents); }
public void GetScreenToWorld(Vec2 argScreen, Vec2 argWorld) { argWorld.Set(argScreen); argWorld.SubLocal(Box.Extents); Box.R.InvertToOut(inv2); inv2.MulToOut(argWorld, argWorld); if (YFlip) { yFlipMatInv.MulToOut(argWorld, argWorld); } argWorld.AddLocal(Box.Center); }