Page 1 of 1

Pivot Joint cocos2d-x

Posted: Mon Mar 17, 2014 10:21 am
by Njits4
I want to rotate a object when hit by an other object.
After the impact the object has to settle back to his origonal position. (damping)
At the moment the object is bugging : strange rotation, shoots away from the screen.
I'm using cocos2d-x.


Image

This is what I tried for the moment
cpConstraint* pivotJoint = cpPivotJointNew(_space->staticBody, _body, _body->p);
pivotJoint->maxBias =100.0f;
pivotJoint->maxForce = 100.0f;

cpSpaceAddConstraint(_space, pivotJoint);

Re: Pivot Joint cocos2d-x

Posted: Tue Mar 18, 2014 8:48 am
by Njits4
I've found the solution myself .

I just added a damped spring joint