How can i apply rotate to subNode of PhysicsControl?

I load a model from Blender. And this model have hierarchy structure like this.


Parent Node ("P")

SubNode1
SubNode2

---SubNode3
SubNode4

Parent Node is a parent to all Node.
And SubNode1 is a parent to SubNode3.....

I create VehicleControl, and apply to Parent Node("P").
When this VehicleControl run my gameWorld,
I want to apply rotation to SubNode1 or SubNode3. (e.g. helicopter --> When helicopter fly sky, their rotor is rotating!)
I know that 'setLocalRotate' can not be worked to PhysicsControl.
So i create some Rigidcontrol. and this control add to SubNode1. Then In Simpleupdate, I call 'setphysicsrotate' of Rigidcontrol..
But this is not working....;;;

…? Is my explain awful?

“awful” doesn’t even come close ^^

@normen said:
"awful" doesn't even come close ^^

I`m sorry... ;;My English skill is so awful. I explain again. ^^;
Here is my source code
[java]
node_Object = new Node("Object");
node_Object = (Node)assetManager.loadModel("Models/boat/boat.j3o");
node_Boat = (Node)node_Object.getChild("boatbody");
node_Sail = (Node)node_Object.getChild("sail");

// CreateCollisionShape
boatShape = new CompoundCollisionShape();
BoxCollisionShape box = new BoxCollisionShape(new Vector3f(0.9f,0.5f,2.7f));
boatShape .addChildShape(box, new Vector3f(0, 0, 0));
BoxCollisionShape sailShape = new BoxCollisionShape(new Vector3f(0.075f,2f,1.375f));
boatShape .addChildShape(sailShape,new Vector3f(0,2.0f,0.3f));
// Create Another CollisionShape
subBoatControl = new RigidBodyControl(0.0f);
node_Boat .addControl(subBoatControl );

// Create Vehiclecontrol
player = new MyVehiclecontrol(boatShape , mass, bulletAppState.getPhysicsSpace());
node_Object .addControl(player);
rootNode.attachChild(node_Object );
bulletAppState.getPhysicsSpace().add(subBoatControl );
bulletAppState.getPhysicsSpace().add(player);
public void simpleUpdate(float tpf) {
.......
j++;
Quaternion qua = new Quaternion(0, 0, 0.5f * j, 0);
yachtcontrol.setPhysicsRotation(qua);
}
[/java]
Here is hierarchy structure.
http://i.imgur.com/EmnEo.png

I want that 'node_Sail' and 'node_Boat ' rotate, when 'node_Object'(Vehicle control) run in PhysicsWorld.
But this source code doesn`t work. Any change is not occured...
1 Like

please… Let me know about this problem…

I updated my explain about this problem…

Are you playing with our faces? wtf is “yachtcontrol” ??? U didn’t show the moment you added it to anything. And you aren’t rotating your model, you are just setting its rotation. setPhysicsLocation() is not cumulative.

@glaucomardano said:
Are you playing with our faces? wtf is "yachtcontrol" ???? U didn't show the moment you added it to anything. And you aren't rotating your model, you are just setting its rotation. setPhysicsLocation() is not cumulative.

Physics node can applied any other rotation method like setlocalrotate...;; So i just call 'setPhysics....' Oh that's typographical error....
any other method doesn`t work.... .. i can`t find proper method to rotate subnode.

Does not your physics model rotate at all when calling the setPhysicsRotation() method? Neither for the first time? Make sure your don’t make your models kinematic.

Yes this doesnt rotate even in First time.<br /> My physics model can rotate because this thing have PhysicsControl. But my physics model's subnode doesnt rotate.

I want to rotate my subnode like ‘Setlocalrotate’. But this parent node is physcis model. so this is not worked…

I want to rotate my subnode like ‘Setlocalrotate’. But this parent node is physcis model. so this is not worked…..


It just work for kinematic objects!
@glaucomardano said:
It just work for kinematic objects!

But... my object is 'Dynamics' because my object add VehicleControl.

Set the parent kinematic, rotate the sub-node, and set the parent dynamic again.

@glaucomardano said:
Set the parent kinematic, rotate the sub-node, and set the parent dynamic again.

I`m sorry. I can`t understand what you mean.

http://hub.jmonkeyengine.org/javadoc/com/jme3/bullet/objects/PhysicsRigidBody.html#setKinematic(boolean)