# [SOLVED] What is wrong with this conejoint?

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);
``````

``````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() );

// Destiny will have a determined shape
RigidBodyControl rigidbody = new RigidBodyControl(bshape, 1);
rigidbody.setPhysicsLocation( b.getLocalTranslation() );

// 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;
}``````

Ok, I found out the problem, its the thisconejoint.setLimit(0f, 0f, 0);
How this function works ? I could not find any info on javadoc.
When I removed this call, everything is working. I know its to limit the rotation in a cone, but what is the default and how do I fill the variables ?

I haven’t used that contraint so I can’t give a good answer but maybe this can help you on the way: http://bulletphysics.org/mediawiki-1.5.8/index.php/Constraints#Cone_Twist

Ooo ! Very good, it has even examples.
Never thought to look at bullet docs, how dumb I am…
Thanks for sharing Jmaasing !