Im trying to create a super simple collision shape basically just two boxes one trailing after the other. The problem is that when i connect the boxes to the physics only one of them follow the physical body. Im guessing that a RigidBodyControl only can control one spatial?
Anyways here is parts of my code:
CompoundCollisionShape ccs = new CompoundCollisionShape();
BoxCollisionShape box = new BoxCollisionShape(new Vector3f(0.5f, 0.5f, 0.5f));
ccs.addChildShape(box, new Vector3f(0,0,0));
ccs.addChildShape(box, new Vector3f(0,0,1));
RigidBodyControl rbc = new RigidBodyControl(ccs,4f);
ALL controls can only be on one spatial at a time. It’s not even really logical to put them on more than one as they would get the exact same position in this case… and if that’s what you want then put them as child to a node that gets the control.
What i want is for multiple spatials to follow a single physics object. My thought is that the physicsal object (cube or such) will act much as a hitbox while the other spatials will be the arms, legs etc. But for this to happen i want them to always follow the physical object. I could just put a setLocalTranslation in the update loop but i thought that there was a better way to accomplish this.
I created a simple scetch of what im trying to accomplish.scetch
@c.r.raschke said:
What i want is for multiple spatials to follow a single physics object. My thought is that the physicsal object (cube or such) will act much as a hitbox while the other spatials will be the arms, legs etc. But for this to happen i want them to always follow the physical object. I could just put a setLocalTranslation in the update loop but i thought that there was a better way to accomplish this.
I created a simple scetch of what im trying to accomplish.scetch
@pspeed said:
ALL controls can only be on one spatial at a time. It's not even really logical to put them on more than one as they would get the exact same position in this case... and if that's what you want then put them as child to a node that gets the control.
Note: where I talk about making a node and attaching things as children.