MissingDeadlines / iolite

A highly flexible, voxel-powered game engine with an embedded editor. Create games using Lua, the native C/C++ API, and assets authored in voxel editors like MagicaVoxel or Avoyd.
https://iolite-engine.com
MIT License
188 stars 13 forks source link

[Feature request] API function to set parent for node #52

Closed trsh closed 5 months ago

trsh commented 5 months ago

It should have an option keep_transforms, what means, that new transforms will be calculated, so the parented child node stays exactly the same. We could also add keep_transforms to create_with_parent.

begla commented 5 months ago

That's a great suggestion; I'll add that. It's already internally available and not exposed via the API.

begla commented 5 months ago

I've added a new "attach" function to the node interface (which can be used to reattach an existing node) and extended the existing "create_with_parent" function. Both support the new "ignore_parent" parameter, which keeps the current transform without considering (and undoing) the parent transform.

This will be available in the next build. 👍