Pivot Joint cocos2d-x

Official forum for the Chipmunk2D Physics Library.
Post Reply
Njits4
Posts: 2
Joined: Mon Mar 17, 2014 10:08 am
Contact:

Pivot Joint cocos2d-x

Post 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);
Njits4
Posts: 2
Joined: Mon Mar 17, 2014 10:08 am
Contact:

Re: Pivot Joint cocos2d-x

Post by Njits4 »

I've found the solution myself .

I just added a damped spring joint
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests