I am trying to find the right way, to move and transform a positional and directional AudioNode together with e.g. a Sphere which is controlled by a RigidBodyControl. I could put both, the AudioNode and the Sphere, into a new parent Node and move the RigidBodyControl from the Sphere to this Node. Or is there a better way?
Yeah the way you described would work perfectly fine.
Not necessarily better, but there is another way that could be more or less useful depending on the situation.
You can do it the way you mentioned by attaching the AudioNode to the RigidBodyControl’s node so it automatically follows that node.
Or you could attach the audioNode directly to the rootNode and call audioNode.setLocalTranslation(rigidBodyControl.getPhysicsLocation()); in the update loop every frame.
The only difference here is that the audioNode would not be affected by the rigidBodyControl’s rotation or scale if you do it the second way since its no longer directly attached to it.
The reason for my question was, that there is some logic in RigidBodyControl which selects the correct collision shape automatically based on the spatial. So I was not sure, whether moving the RigidBodyControl from a Sphere (Geometry) to a Node would influence the collision shape.
If not specified in the constructor, the collision shape for a RigidBodyControl is auto-generated when the control is added to a Spatial.
Moving the control up one level in the scene-graph does change the auto-generated collision shape in some cases: for instance, if the child has a non-identity local transform. There is also a special case when the Spatial is a geometry with a spherical mesh, in which case the control auto-generates a SphereCollisionShape instead of a mesh or hull shape.
If you specifically want a SphereCollisionShape for the rigid body, then the workaround would be to explicitly construct the shape you want and pass it to the RigidBodyControl constructor.