Skip to content

Transform Component

Eldar Muradov edited this page Jan 10, 2024 · 2 revisions

Transform Component

This component represents EEntity position, rotation and scale. It contains 2 Vector3 and 1 Quaternion (or it can be created from row-major Matrix4x4). It's located in EraScriptingCore.Domain.Components namespace.

Position, Scale and Rotations are System.Numerics structs, which are SIMD-accelerated numeric types.

TransformComponent has different methods to manupulate with entities transform:

// This methods are used to get current transform matrix components
Vector3 GetPosition()
Quaternion GetRotation()
Vector3 GetScale()

// This method is used to set current position from basis coordinates
void SetPosition(Vector3 position, bool sync = true)

// This method is used to set current rotation from basis coordinates
void SetRotation(Quaternion rotation, bool sync = true)

// This method is used to set current scalefrom basis coordinates
void SetScale(Vector3 scale, bool sync = true)

// This method is used to set current transformation matrix from basis coordinates
void SetTransformMatrix(Matrix4x4 transform, bool sync = true)

Trigger bool sync = true used to synchronize .NET dll with C++ engine core. That's why we don't recommend to set it to false.

Clone this wiki locally