TransformManager

class TransformManager(nativeHandle: NativePointer)

TransformManager allows managing transforms (4x4 matrices) for entities.

Entities can have a transform component that defines their position, rotation, and scale in world space. Transforms can be organized in a hierarchy where each entity can have a parent, allowing relative transformations.

The TransformManager maintains the transform hierarchy and automatically computes world transforms from local transforms and parent transforms. Matrices are 16 values in column-major order.

See also

Constructors

Link copied to clipboard
constructor(nativeHandle: NativePointer)

Properties

Link copied to clipboard

The number of components in this manager.

Link copied to clipboard

All the entities managed by this manager, in no particular order.

Link copied to clipboard

Enables or disables the accurate translation mode (disabled by default).

Link copied to clipboard

The native object, for interop with code calling the Fila* C API directly. Read-only: this wrapper owns it.

Functions

Link copied to clipboard

Commits the local transform transaction and updates all world transforms.

Link copied to clipboard
fun create(entity: Entity, parent: EntityInstance = 0)

Creates a transform component and associates it with the given entity. If this component already exists on the entity, it is first destroyed as if destroy was called.

fun create(entity: Entity, parent: EntityInstance, localTransform: DoubleArray)

Double-precision create.

fun create(entity: Entity, parent: EntityInstance, localTransform: FloatArray)

Creates a transform component, initialized with localTransform (relative to the parent).

Link copied to clipboard
fun destroy(e: Entity)

Destroys this component from the given entity; its children are orphaned.

Link copied to clipboard
fun empty(): Boolean

Whether this manager has no components.

Link copied to clipboard

Returns the number of children of a transform component.

Link copied to clipboard

Gets up to children.size children of a transform component.

Link copied to clipboard

Retrieves the Entity of the component from its Instance i.

Link copied to clipboard

Gets an Instance representing the transform component associated with the given Entity.

Link copied to clipboard

Returns the parent of a transform component, or NULL_ENTITY if it has none.

Link copied to clipboard
fun getTransform(ci: EntityInstance, out: FloatArray = FloatArray(16)): FloatArray

Returns the local transform of a transform component (relative to the parent).

Link copied to clipboard

Double-precision getTransform.

Link copied to clipboard
fun getWorldTransform(ci: EntityInstance, out: FloatArray = FloatArray(16)): FloatArray

Returns the world transform of a transform component.

Link copied to clipboard

Double-precision getWorldTransform.

Link copied to clipboard

Returns whether a particular Entity is associated with a component of this TransformManager.

Link copied to clipboard

Opens a local transform transaction: setTransform then doesn't update world transforms until commitLocalTransformTransaction, which is faster when setting many of them.

Link copied to clipboard

Re-parents an entity to a new one. Re-parenting to a descendant is undefined behaviour.

Link copied to clipboard
fun setTransform(ci: EntityInstance, localTransform: DoubleArray)

Double-precision setTransform.

fun setTransform(ci: EntityInstance, localTransform: FloatArray)

Sets a local transform of a transform component (relative to the parent).