-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
What problem does this solve or what need does it fill?
Say I have a child entity from an entity with a non zero translation.
If I call look_at on the child's transform, then it will no correctly look at the position since it wouldn't consider the parent offset.
Maybe it's just me that's bad at math but I couldn't figure a way to make that look_at work easily.
What solution would you like?
I think therefore a good feature would be adding math methods similar to the ones available on the Transform component to the GlobalTransform.
Example (adding a look_at equivalent to GlobalTransform):
child_transform.rotation = child_global_transform.looking_at(target);
What alternative(s) have you considered?
A more ambitious resolution would be to just get rid of this weird and confusing "Global transform can't be changed and also it doesn't update in real time" to what engines like Unity do where it just works for both global_transforms and local_transform seamlessly.
I think this solution is less likely to happen because:
- I'm sure there are valid reasons for this system being that way, probably some ECS shenanigans or smth.
- Transforms are a very central aspect of the engine and changing that would probably require a lot of change.
Additional context
I don't know much about anything so I may be partly or totally wrong.