Open lucasw opened 7 years ago
The first thing to do is make it possible to define the initial position and any of the other bodies in a tf frame - the frames need to exist at spawn time though.
An complementary system would be to be able to define a buffer core transform hierarchy and then hang the other bodies off of it, though this increases the frame definition workload in some ways (not really if every Body position is then 0, 0, 0 relative to that new frame). The point to having these frames exist only in BufferCore would be to avoid a cluttered tf tree during run time (and the spawning tree would become invalid anyhow as Bodies move around in the simulation.
Also want to be able to construct bodies to have a tf relative to another tf- so a lookup would have to be done to turn bullet coords in world space to that tf.
Currently have to define relationship with other attached bodies through constraints, and set the initial world position, and if those don't match up well then the assembly parts will try to fly to the right positions after spawning, which isn't always possible (parts may be trapped by obstacles).
In some cases that extra control may be desirable, but make the default attach the new body inside a BufferCore instance and then query that to get the world position. Circular linkages will throw an exception, so handle those and just move on without making that circular attachment.
The complication is that the conventional method is to define all the bodies in world space, then go through all the constraints and attach those- if a body has no constraint attaching it to other bodies it needs to use the world space position.