convertPositionFrom
Converts a position 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 position in that entity's local coordinate space. In this case, the proper baseEntity should be the parent of the entity that owns the source position. For example, if entityA and entityB are in different coordinate spaces, and positionA is relative to entityA, pass entityA as baseEntity when converting positionA into entityB's parent space.
entityB.components.get<TransformComponent>()?.position = entityB.getParent()
?.convertPositionFrom(positionA, entityA)Return
The converted position relative to the current entity, or from the current entity's SpatialContainer when baseEntity is null.
Parameters
The position relative to baseEntity.
The base entity from which the position will be converted. If null, the position is converted from the SpatialContainer where the current entity is placed.