Transform
- Namespace: Turian.Engine.Core
- Source File: Transform.cs
Represents a transformation in 3D space consisting of position, orientation, and scale.
Properties
Position
(Vector3) { get; set }: Gets or sets the position of the transformation.
Orientation
(Quaternion) { get; set }: Gets or sets the orientation of the transformation as a quaternion.
Rotation
(Vector3) { get; set }: Gets or sets the rotation of the transformation in Euler angles (in degrees). Its not save internally, it's calculated. More expensive to use than Orientation
Scale
(Vector3) { get; set }: Gets or sets the scale of the transformation.
IsIdentity
(bool): Gets a value indicating whether this transformation is the identity transformation.
Forward
(Vector3): Gets the forward vector in the local space of this transformation.
Backward
(Vector3): Gets the backward vector in the local space of this transformation.
Up
(Vector3): Gets the up vector in the local space of this transformation.
Down
(Vector3): Gets the down vector in the local space of this transformation.
Left
(Vector3): Gets the left vector in the local space of this transformation.
Right
(Vector3): Gets the right vector in the local space of this transformation.
Public Methods
AddParent
public Transform AddParent(Transform? parent)
Adds a parent transformation to this transformation, resulting in a new global transformation.
Parameters:
parent(Transform?): The parent transformation to add.
Returns: Transform
- A new
Transformrepresenting the global transformation.
RemoveParent
public Transform RemoveParent(Transform? parent)
Removes a parent transformation from this transformation, resulting in a new local transformation.
Parameters:
parent(Transform?): The parent transformation to remove.
Returns: Transform
- A new
Transformrepresenting the local transformation.
Matrix4X4
public Matrix4x4 Matrix4X4()
Gets the 4x4 transformation matrix representing this transformation.
Returns: Matrix4x4
- The 4x4 transformation matrix.
NormalMatrix
public Matrix4x4 NormalMatrix()
Gets the 4x4 normal matrix representing this transformation.
Returns: Matrix4x4
- The 4x4 normal matrix.
Equals
public bool Equals(Transform? other)
Compares this Transform to another Transform for equality.
Parameters:
other(Transform?): TheTransformto compare to.
Returns: bool
- True if the two transformations are equal; otherwise, false.
ToString
public override string ToString()
Converts this Transform to its string representation.
Returns: string
- A string representation of the transformation.
ToString
public string ToString(string? format, IFormatProvider? formatProvider)
Converts this Transform to its string representation using the specified format and format provider.
Parameters:
format(string?): A format string (not used in this implementation).formatProvider(IFormatProvider?): AnIFormatProvider(not used in this implementation).
Returns: string
- A string representation of the transformation.
SetPositionX
public void SetPositionX(float x)
Sets the X-coordinate of the position.
Parameters:
x(float): The new X-coordinate value.
SetPositionY
public void SetPositionY(float y)
Sets the Y-coordinate of the position.
Parameters:
y(float): The new Y-coordinate value.
SetPositionZ
public void SetPositionZ(float z)
Sets the Z-coordinate of the position.
Parameters:
z(float): The new Z-coordinate value.
SetOrientationX
public void SetOrientationX(float x)
Sets the X component of the orientation quaternion.
Parameters:
x(float): The new value for the X component.
SetOrientationY
public void SetOrientationY(float y)
Sets the Y component of the orientation quaternion.
Parameters:
y(float): The new value for the Y component.
SetOrientationZ
public void SetOrientationZ(float z)
Sets the Z component of the orientation quaternion.
Parameters:
z(float): The new value for the Z component.
SetRotationX
public void SetRotationX(float x)
Sets the X component of the rotation in degrees.
Parameters:
x(float): The new value for the X component of rotation.
SetRotationY
public void SetRotationY(float y)
Sets the Y component of the rotation in degrees.
Parameters:
y(float): The new value for the Y component of rotation.
SetRotationZ
public void SetRotationZ(float z)
Sets the Z component of the rotation in degrees.
Parameters:
z(float): The new value for the Z component of rotation.
SetScaleX
public void SetScaleX(float x)
Sets the X component of the scale.
Parameters:
x(float): The new value for the X component of scale.
SetScaleY
public void SetScaleY(float y)
Sets the Y component of the scale.
Parameters:
y(float): The new value for the Y component of scale.
SetScaleZ
public void SetScaleZ(float z)
Sets the Z component of the scale.
Parameters:
z(float): The new value for the Z component of scale.