Class TransformComponent
Defines Position, Rotation and Scale of its Entity.
[DataContract("TransformComponent")]
[DataSerializerGlobal(null, typeof(FastCollection<TransformComponent>), DataSerializerGenericMode.None, false, false)]
[DefaultEntityComponentProcessor(typeof(TransformProcessor))]
[Display("Transform", null, Expand = ExpandRule.Once)]
[ComponentOrder(0)]
public sealed class TransformComponent : EntityComponent, IIdentifiable
- Inheritance
-
Transform
Component
- Implements
- Inherited Members
- Extension Methods
-
Entity
Transform Extensions. Local ToWorld(Transform Component, ref Vector3, ref Quaternion, ref Vector3)
Constructors
TransformComponent()
Initializes a new instance of the Transform
Fields
LocalMatrix
The local matrix.
Its value is automatically recomputed at each frame from the position, rotation and scale.
One can use Update
Field Value
Remarks
The setter should not be used and is accessible only for performance purposes.
Position
The translation relative to the parent transformation.
Field Value
PostOperations
This is where we can register some custom work to be done after world matrix has been computed, such as updating model node hierarchy or physics for local node.
Field Value
Rotation
The rotation relative to the parent transformation.
Field Value
Scale
The scaling relative to the parent transformation.
Field Value
TransformLink
Field Value
WorldMatrix
The world matrix.
Its value is automatically recomputed at each frame from the local and the parent matrices.
One can use Update
Field Value
Remarks
The setter should not be used and is accessible only for performance purposes.
Properties
Children
Gets the children of this Transform
Property Value
Parent
Gets or sets the parent of this Transform
Property Value
- Transform
Component The parent.
RotationEulerXYZ
Gets or sets the euler rotation, with XYZ order. Not stable: setting value and getting it again might return different value as it is internally encoded as a Quaternion in Rotation.
Property Value
- Vector3
The euler rotation.
UseTRS
Gets or sets a value indicating whether to use the Translation/Rotation/Scale.
Property Value
- bool
true
if [use TRS]; otherwise,false
.
Methods
UpdateLocalFromWorld()
Updates the local matrix based on the world matrix and the parent entity's or containing scene's world matrix.
UpdateLocalMatrix()
Updates the local matrix.
If UseTRS is true, Local
UpdateWorldMatrix()
Updates the world matrix.
It will first call Update