refactor: monogame camera transform caching
This commit is contained in:
@@ -53,12 +53,6 @@ public class MonoGameCamera3D : Behaviour, ICamera3D, IFirstFrameUpdate, ILastFr
|
||||
}
|
||||
}
|
||||
|
||||
public Vector3D Position
|
||||
{
|
||||
get => Transform.Position;
|
||||
set => Transform.Position = value;
|
||||
}
|
||||
|
||||
public Viewport Viewport
|
||||
{
|
||||
get => _viewport;
|
||||
@@ -115,12 +109,6 @@ public class MonoGameCamera3D : Behaviour, ICamera3D, IFirstFrameUpdate, ILastFr
|
||||
}
|
||||
}
|
||||
|
||||
public Core.Quaternion Rotation
|
||||
{
|
||||
get => Transform.Rotation;
|
||||
set => Transform.Rotation = value;
|
||||
}
|
||||
|
||||
// TODO This causes delay since OnPreDraw calls assuming this is called in in Update
|
||||
public Ray3D ScreenToWorldRay(Vector2D screenPosition)
|
||||
{
|
||||
@@ -164,7 +152,7 @@ public class MonoGameCamera3D : Behaviour, ICamera3D, IFirstFrameUpdate, ILastFr
|
||||
Vector3 forward = Vector3.Normalize(Transform.Forward.ToVector3());
|
||||
Vector3 up = Vector3.Normalize(Transform.Up.ToVector3());
|
||||
Vector3 right = Vector3.Normalize(Transform.Right.ToVector3());
|
||||
Vector3 position = Position.ToVector3();
|
||||
Vector3 position = Transform.Position.ToVector3();
|
||||
|
||||
View = new Matrix(
|
||||
right.X, up.X, forward.X, 0,
|
||||
|
||||
Reference in New Issue
Block a user