#How to translate this parent-child transform structure to DOTS

1 messages · Page 1 of 1 (latest)

wind igloo
#

Hi, I'm trying to figure out the most efficient approach to translating a specific gameobject setup to DOTS. Basically I have an airplane object, with child transforms for its control surfaces that should are rotated based on the state of the airplane.

In Monobehaviour-land this is quite straightforward: the root Plane Monobehaviour has a list of transforms that it sets the rotation on every Update call, based on its state.

I've already translated all the Plane physics simulation into IComponentData and do work on it using a system that schedules a bunch of jobs. That's all handled on the root object though. What would be the most efficient way to animate the control surface transforms of all the Plane Entities in parallel? Is it more efficient to loop over all control surface entities and somehow query the component of their parents, or to loop over the parent objects and query the transforms of their respective control surface transforms? I've seen some discussion around whether it's better to use SharedComponents or DynamicBuffers for this. I'd greatly appreciate some examples because I haven't fully internalized the API yet.

mint cosmos
#

Looping over the control surface entities would probably be faster, if you have a reference to the parent entity.