I am trying to do this : jME3 joint Test - YouTube
I think I am doing something wrong… If I dont translate the origem, it works on 0,0,0… If I translate, the origem gets diferent then the joint origem…
Maybe its the translate ? Should I use SixDofJoint ? If so, whatis the diference between SixDofJoint and ConeJoint with setLimit(0f, 0f, 0) ?
Code
Node centerConeNode=new Node(); centerConeNode.setLocalTranslation(-3f, -0, 0f);
coneObjNode=new Node(); coneObjNode.setLocalTranslation(-3f,-1f,0f);
BoxCollisionShape collisionShape = new BoxCollisionShape(new Vector3f( .3f, .3f, .3f));
conejoint = createFreeJoint(centerConeNode, coneObjNode, collisionShape );
rootNode.attachChild(centerConeNode); rootNode.attachChild(coneObjNode);
bulletAppState.getPhysicsSpace().add(conejoint);
…
private ConeJoint createFreeJoint(Node a, Node b, CollisionShape bshape ) {
// As its a simple free joint, origem shape is a simple stoped box
RigidBodyControl rigidbox = new RigidBodyControl(new BoxCollisionShape(new Vector3f( .1f, .1f, .1f)), 0);
rigidbox.setPhysicsLocation( a.getLocalTranslation() );
a.addControl(rigidbox); bulletAppState.getPhysicsSpace().add(a);
// Destiny will have a determined shape
RigidBodyControl rigidbody = new RigidBodyControl(bshape, 1);
rigidbody.setPhysicsLocation( b.getLocalTranslation() );
b.addControl(rigidbody); bulletAppState.getPhysicsSpace().add(b);
// Returni this conejoint, control point is the origem Node center of mass
ConeJoint thisconejoint = join(a, b, a.getLocalTranslation());
thisconejoint.setLimit(0f, 0f, 0);
return thisconejoint;
}