Files
Syntriax.Engine/Engine.Core/Abstract/ITransform3D.cs
2025-10-19 00:24:56 +03:00

106 lines
3.6 KiB
C#

namespace Engine.Core;
/// <summary>
/// Represents the transformation properties of an object such as position, scale, and rotation in 3D space.
/// </summary>
public interface ITransform3D : IBehaviour
{
/// <summary>
/// Event triggered when the <see cref="Position"/> of the <see cref="ITransform3D"/> changes.
/// </summary>
Event<ITransform3D, PositionChangedArguments> OnPositionChanged { get; }
/// <summary>
/// Event triggered when the <see cref="Scale"/> of the <see cref="ITransform3D"/> changes.
/// </summary>
Event<ITransform3D, ScaleChangedArguments> OnScaleChanged { get; }
/// <summary>
/// Event triggered when the <see cref="Rotation"/> of the <see cref="ITransform3D"/> changes.
/// </summary>
Event<ITransform3D, RotationChangedArguments> OnRotationChanged { get; }
/// <summary>
/// Event triggered when any of the properties of the <see cref="ITransform3D"/> gets updated.
/// </summary>
Event<ITransform3D> OnTransformUpdated { get; }
/// <summary>
/// The <see cref="Vector3D"/> pointing upwards in world space.
/// </summary>
Vector3D Up { get; }
/// <summary>
/// The <see cref="Vector3D"/> pointing upwards in world space.
/// </summary>
Vector3D Down { get; }
/// <summary>
/// The <see cref="Vector3D"/> pointing upwards in world space.
/// </summary>
Vector3D Left { get; }
/// <summary>
/// The <see cref="Vector3D"/> pointing upwards in world space.
/// </summary>
Vector3D Right { get; }
/// <summary>
/// The <see cref="Vector3D"/> pointing forwards in world space.
/// </summary>
Vector3D Forward { get; }
/// <summary>
/// The <see cref="Vector3D"/> pointing backwards in world space.
/// </summary>
Vector3D Backward { get; }
/// <summary>
/// The world position of the <see cref="ITransform3D"/> in 3D space.
/// </summary>
Vector3D Position { get; set; }
/// <summary>
/// The world scale of the <see cref="ITransform3D"/>.
/// </summary>
Vector3D Scale { get; set; }
/// <summary>
/// The world rotation of the <see cref="ITransform3D"/> in degrees.
/// </summary>
Quaternion Rotation { get; set; }
/// <summary>
/// The local position of the <see cref="ITransform3D"/> in 3D space.
/// </summary>
Vector3D LocalPosition { get; set; }
/// <summary>
/// The local scale of the <see cref="ITransform3D"/>.
/// </summary>
Vector3D LocalScale { get; set; }
/// <summary>
/// The local rotation of the <see cref="ITransform3D"/> in degrees.
/// </summary>
Quaternion LocalRotation { get; set; }
/// <summary>
/// Arguments for the event triggered when the <see cref="ITransform3D"/>'s rotation changes.
/// </summary>
/// <param name="PreviousPosition">The previous <see cref="Position"/> of the <see cref="ITransform3D"/>.</param>
readonly record struct PositionChangedArguments(Vector3D PreviousPosition);
/// <summary>
/// Arguments for the event triggered when the <see cref="ITransform3D"/>'s rotation changes.
/// </summary>
/// <param name="PreviousScale">The previous <see cref="Scale"/> of the <see cref="ITransform3D"/>.</param>
readonly record struct ScaleChangedArguments(Vector3D PreviousScale);
/// <summary>
/// Arguments for the event triggered when the <see cref="ITransform3D"/>'s rotation changes.
/// </summary>
/// <param name="PreviousRotation">The previous <see cref="Rotation"/> of the <see cref="ITransform3D"/>.</param>
readonly record struct RotationChangedArguments(Quaternion PreviousRotation);
}