Search Results for

    Show / Hide Table of Contents

    Class Transform3D

    Every entity must be a transform-derived component. It is used to store and manipulate the position, rotation, and scale of the entity.

    Inheritance
    object
    IdentifiableObject
    DependencyObject
    AttachableObject
    PrefabInstanceObject
    Component
    Transform3D
    Implements
    IDependencyObject
    Inherited Members
    Component.Owner
    Component.Managers
    Component.ShouldBeActivated
    Component.Clone()
    Component.Attach(Entity)
    Component.OnLoaded()
    Component.OnActivated()
    Component.Start()
    Component.OnDeactivated()
    Component.OnDestroy()
    PrefabInstanceObject.PrefabSource
    PrefabInstanceObject.RefreshPrefab(Prefab)
    PrefabInstanceObject.PrefabElementId
    PrefabInstanceObject.IsPrefabInstance
    PrefabInstanceObject.IsMissingPrefabSource
    AttachableObject.AttachableStateChanged
    AttachableObject.IsEnabled
    AttachableObject.State
    AttachableObject.IsLoaded
    AttachableObject.IsAttached
    AttachableObject.IsActivated
    AttachableObject.IsStarted
    AttachableObject.IsDestroyed
    AttachableObject.Destroy()
    AttachableObject.DependencyBroken()
    DependencyObject.Dependencies
    DependencyObject.OnDependencyRemoved
    IdentifiableObject.Id
    IdentifiableObject.IdHasChanged(Guid)
    Namespace: Evergine.Framework.Graphics
    Assembly: Evergine.Framework.dll
    Syntax
    public class Transform3D : Component, IDependencyObject

    Constructors

    Transform3D()

    Initializes a new instance of the Transform3D class.

    Declaration
    public Transform3D()

    Fields

    UpdateCounter

    The update counter.

    Declaration
    public int UpdateCounter
    Field Value
    Type Description
    int

    childrenTransform

    Transforms the child entities.

    Declaration
    protected List<Transform3D> childrenTransform
    Field Value
    Type Description
    List<Transform3D>

    localOrientation

    The entity's rotation in local space.

    Declaration
    protected Quaternion localOrientation
    Field Value
    Type Description
    Quaternion

    localPosition

    The entity's position in local space.

    Declaration
    protected Vector3 localPosition
    Field Value
    Type Description
    Vector3

    localScale

    The entity's scale in local space.

    Declaration
    protected Vector3 localScale
    Field Value
    Type Description
    Vector3

    parentTransform

    Gets the transform of the parent entity.

    Declaration
    [BindComponent(false, false, BindComponentSource.ParentsSkipOwner, null, true)]
    protected Transform3D parentTransform
    Field Value
    Type Description
    Transform3D

    Properties

    Backward

    Gets the entity's backward vector in world space.

    Declaration
    public Vector3 Backward { get; }
    Property Value
    Type Description
    Vector3

    ChildrenTransform

    Gets the transforms of the child entities.

    Declaration
    public IEnumerable<Transform3D> ChildrenTransform { get; }
    Property Value
    Type Description
    IEnumerable<Transform3D>

    Down

    Gets the entity's down vector in world space.

    Declaration
    public Vector3 Down { get; }
    Property Value
    Type Description
    Vector3

    Forward

    Gets the entity's forward vector in world space.

    Declaration
    public Vector3 Forward { get; }
    Property Value
    Type Description
    Vector3

    Left

    Gets the entity's left vector in world space.

    Declaration
    public Vector3 Left { get; }
    Property Value
    Type Description
    Vector3

    LocalBackward

    Gets the entity's backward vector in local space.

    Declaration
    public Vector3 LocalBackward { get; }
    Property Value
    Type Description
    Vector3

    LocalDown

    Gets the entity's down vector in local space.

    Declaration
    public Vector3 LocalDown { get; }
    Property Value
    Type Description
    Vector3

    LocalForward

    Gets the entity's forward vector in local space.

    Declaration
    public Vector3 LocalForward { get; }
    Property Value
    Type Description
    Vector3

    LocalLeft

    Gets the entity's left vector in local space.

    Declaration
    public Vector3 LocalLeft { get; }
    Property Value
    Type Description
    Vector3

    LocalOrientation

    Gets or sets the entity's rotation in local space.

    Declaration
    public Quaternion LocalOrientation { get; set; }
    Property Value
    Type Description
    Quaternion

    LocalPosition

    Gets or sets the entity's position in local space.

    Declaration
    [RenderProperty(CustomPropertyName = "Local Position", Tooltip = "The entity position in local space")]
    public Vector3 LocalPosition { get; set; }
    Property Value
    Type Description
    Vector3

    LocalRight

    Gets the entity's right vector in local space.

    Declaration
    public Vector3 LocalRight { get; }
    Property Value
    Type Description
    Vector3

    LocalRotation

    Gets or sets the global rotation expressed in Euler angles (yaw, pitch, and roll).

    Declaration
    [RenderProperty(typeof(Vector3RadianToDegreeConverter), CustomPropertyName = "Local Rotation", Tooltip = "The global rotation expressed in Euler angles (yaw, pitch, roll)")]
    public Vector3 LocalRotation { get; set; }
    Property Value
    Type Description
    Vector3

    LocalScale

    Gets or sets the entity's scale in local space.

    Declaration
    [RenderProperty(CustomPropertyName = "Local Scale", Tooltip = "The entity scale in local space")]
    public Vector3 LocalScale { get; set; }
    Property Value
    Type Description
    Vector3

    LocalTransform

    Gets or sets the matrix transformation relative to the parent transformation.

    Declaration
    public Matrix4x4 LocalTransform { get; set; }
    Property Value
    Type Description
    Matrix4x4

    LocalUp

    Gets the entity's up vector in local space.

    Declaration
    public Vector3 LocalUp { get; }
    Property Value
    Type Description
    Vector3

    Orientation

    Gets or sets the entity's rotation in world space.

    Declaration
    public Quaternion Orientation { get; set; }
    Property Value
    Type Description
    Quaternion

    ParentTransform

    Gets the transform of the parent entity.

    Declaration
    public Transform3D ParentTransform { get; }
    Property Value
    Type Description
    Transform3D

    Position

    Gets or sets the entity's position in world space.

    Declaration
    public Vector3 Position { get; set; }
    Property Value
    Type Description
    Vector3

    PreWorldTransform

    Gets or sets the pre-world matrix.

    Declaration
    public Matrix4x4 PreWorldTransform { get; set; }
    Property Value
    Type Description
    Matrix4x4

    Right

    Gets the entity's right vector in world space.

    Declaration
    public Vector3 Right { get; }
    Property Value
    Type Description
    Vector3

    Rotation

    Gets or sets the global rotation expressed in Euler angles (yaw, pitch, roll).

    Declaration
    public Vector3 Rotation { get; set; }
    Property Value
    Type Description
    Vector3

    Scale

    Gets or sets the entity's scale in world space.

    Declaration
    public Vector3 Scale { get; set; }
    Property Value
    Type Description
    Vector3

    Up

    Gets the entity's up vector in world space.

    Declaration
    public Vector3 Up { get; }
    Property Value
    Type Description
    Vector3

    WorldInverseTransform

    Gets the inverse of the matrix that transforms from local space to world space.

    Declaration
    public Matrix4x4 WorldInverseTransform { get; }
    Property Value
    Type Description
    Matrix4x4

    WorldToLocalTransform

    Gets the matrix that transforms from world space to local space.

    Declaration
    public Matrix4x4 WorldToLocalTransform { get; }
    Property Value
    Type Description
    Matrix4x4

    WorldTransform

    Gets or sets the matrix that transforms from local space to world space.

    Declaration
    public Matrix4x4 WorldTransform { get; set; }
    Property Value
    Type Description
    Matrix4x4

    Methods

    LocalLookAt(Vector3, Vector3, bool)

    Rotates the entity to point to the specified position and up vector (in local space).

    Declaration
    public void LocalLookAt(Vector3 targetPosition, Vector3 up, bool forward = true)
    Parameters
    Type Name Description
    Vector3 targetPosition

    The world position to look at.

    Vector3 up

    The up vector.

    bool forward

    If set to true, the entity points its forward to the target position. If false, it points its backward.

    LookAt(Vector3)

    Rotates the entity to point to the specified position and up vector.

    Declaration
    public void LookAt(Vector3 targetPosition)
    Parameters
    Type Name Description
    Vector3 targetPosition

    The world position to look towards.

    LookAt(Vector3, Vector3, bool)

    Rotates the entity to point to the specified position and up vector (in World space).

    Declaration
    public void LookAt(Vector3 targetPosition, Vector3 up, bool forward = true)
    Parameters
    Type Name Description
    Vector3 targetPosition

    The world position to look at.

    Vector3 up

    The up vector.

    bool forward

    If set to true the entity points its forward to the target position. If false it points backward.

    OnAttached()

    Invoked when the object is attached to the system.

    Declaration
    protected override bool OnAttached()
    Returns
    Type Description
    bool

    True if everything is OK.

    Overrides
    Component.OnAttached()

    OnDetach()

    Invoked when the object is detached.

    Declaration
    protected override void OnDetach()
    Overrides
    Component.OnDetach()

    ResetDirtyFlags()

    Resets the dirty flags.

    Declaration
    protected virtual void ResetDirtyFlags()

    RotateAround(Vector3, Quaternion)

    Rotates the entity with respect to the point using the quaternion.

    Declaration
    public void RotateAround(Vector3 point, Quaternion quaternion)
    Parameters
    Type Name Description
    Vector3 point

    The center of rotation.

    Quaternion quaternion

    The rotation specified as a quaternion.

    RotateAround(Vector3, Vector3, float)

    Rotates the entity with respect to the point using an axis and angle.

    Declaration
    public void RotateAround(Vector3 point, Vector3 axis, float angle)
    Parameters
    Type Name Description
    Vector3 point

    The center of rotation.

    Vector3 axis

    The axis of rotation.

    float angle

    The angle of rotation.

    RotateAround(ref Vector3, ref Quaternion)

    Rotates the entity with respect to the point using the quaternion.

    Declaration
    public void RotateAround(ref Vector3 point, ref Quaternion quaternion)
    Parameters
    Type Name Description
    Vector3 point

    The center of rotation.

    Quaternion quaternion

    The rotation specified as a quaternion.

    RotateAround(ref Vector3, ref Vector3, float)

    Rotates the entity with respect to the point using an axis and angle.

    Declaration
    public void RotateAround(ref Vector3 point, ref Vector3 axis, float angle)
    Parameters
    Type Name Description
    Vector3 point

    The center of rotation.

    Vector3 axis

    The axis of rotation.

    float angle

    The angle of rotation.

    SetLocalTransform(Vector3, Quaternion, Vector3)

    Sets the local transform.

    Declaration
    public void SetLocalTransform(Vector3 localPosition, Quaternion localOrientation, Vector3 localScale)
    Parameters
    Type Name Description
    Vector3 localPosition

    The local position.

    Quaternion localOrientation

    The local orientation.

    Vector3 localScale

    The local scale.

    SetLocalTransform(ref Vector3, ref Quaternion, ref Vector3)

    Sets the local transform.

    Declaration
    public void SetLocalTransform(ref Vector3 localPosition, ref Quaternion localOrientation, ref Vector3 localScale)
    Parameters
    Type Name Description
    Vector3 localPosition

    The local position.

    Quaternion localOrientation

    The local orientation.

    Vector3 localScale

    The local scale.

    UpdatedPreWorldMatrix()

    Updates the Pre World Matrix with the World Matrix value. This operation must happen at the end of each frame.

    Declaration
    public void UpdatedPreWorldMatrix()

    Events

    LocalOrientationChanged

    Event fires when this transform's local rotation is changed

    Declaration
    public event EventHandler LocalOrientationChanged
    Event Type
    Type Description
    EventHandler

    LocalPositionChanged

    Event fired when this transform's local position is changed

    Declaration
    public event EventHandler LocalPositionChanged
    Event Type
    Type Description
    EventHandler

    LocalScaleChanged

    Event fired when this transform's local scale is changed

    Declaration
    public event EventHandler LocalScaleChanged
    Event Type
    Type Description
    EventHandler

    LocalTransformChanged

    Event fired when this local transform is changed

    Declaration
    public event EventHandler LocalTransformChanged
    Event Type
    Type Description
    EventHandler

    OrientationChanged

    Event fired when this transform's rotation is changed

    Declaration
    public event EventHandler OrientationChanged
    Event Type
    Type Description
    EventHandler

    PositionChanged

    Event fired when this transform's position is changed

    Declaration
    public event EventHandler PositionChanged
    Event Type
    Type Description
    EventHandler

    ScaleChanged

    Event fired when this transform's scale is changed.

    Declaration
    public event EventHandler ScaleChanged
    Event Type
    Type Description
    EventHandler

    TransformChanged

    Event fired when this transformer is changed

    Declaration
    public event EventHandler TransformChanged
    Event Type
    Type Description
    EventHandler

    Implements

    IDependencyObject

    Extension Methods

    ReflectionHelper.GetMemberAssembly(object)
    ReflectionHelper.GetTypeName(object)
    In this article
    Back to top
    Generated by DocFX