feat: transform up, down, left & right properties added
This commit is contained in:
parent
eee3056614
commit
29a7f5880f
@ -20,6 +20,26 @@ public interface ITransform2D : IBehaviour
|
||||
/// </summary>
|
||||
Event<ITransform2D, RotationChangedArguments> OnRotationChanged { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="Vector2D"/> pointing upwards in world space.
|
||||
/// </summary>
|
||||
Vector2D Up { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="Vector2D"/> pointing upwards in world space.
|
||||
/// </summary>
|
||||
Vector2D Down { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="Vector2D"/> pointing upwards in world space.
|
||||
/// </summary>
|
||||
Vector2D Left { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="Vector2D"/> pointing upwards in world space.
|
||||
/// </summary>
|
||||
Vector2D Right { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The world position of the <see cref="ITransform2D"/> in 2D space.
|
||||
/// </summary>
|
||||
|
@ -19,6 +19,11 @@ public class Transform2D : Behaviour, ITransform2D
|
||||
|
||||
private ITransform2D? parentTransform = null;
|
||||
|
||||
public Vector2D Up => Vector2D.Up.Rotate(Rotation * Math.DegreeToRadian);
|
||||
public Vector2D Down => Vector2D.Down.Rotate(Rotation * Math.DegreeToRadian);
|
||||
public Vector2D Left => Vector2D.Left.Rotate(Rotation * Math.DegreeToRadian);
|
||||
public Vector2D Right => Vector2D.Right.Rotate(Rotation * Math.DegreeToRadian);
|
||||
|
||||
public Vector2D Position
|
||||
{
|
||||
get => _position;
|
||||
|
Loading…
x
Reference in New Issue
Block a user