convertScaleFrom

@MainThread
fun convertScaleFrom(scale: Vector3, baseEntity: Entity?): Vector3

Converts a scale relative to a baseEntity to the current entity.

Attention: "relative to" an Entity is different from "in the local coordinate system/space of" the Entity. You may use the converted result to place an entity when you need a scale in that entity's local coordinate space. In this case, the proper baseEntity should be the parent of the entity that owns the source scale. For example, if entityA and entityB are in different coordinate spaces, and scaleA is relative to entityA, pass entityA as baseEntity when converting scaleA into entityB's parent space.

entityB.components.get<TransformComponent>()?.scale = entityA.convertScaleFrom(scaleA,
entityA)

Return

The converted scale relative to the current entity, or from the current entity's SpatialContainer when baseEntity is null.

Parameters

scale

The scale relative to baseEntity.

baseEntity

The base entity from which the scale will be converted. If null, the scale is converted from the SpatialContainer where the current entity is placed.