Chipmunk zero gravity?

Chipmunk zero gravity?
0.0 0



I have spent all night trying to figure out how to convert this c++ code to javascript. The trouble I think it that I can’t have kinematic style physics objects in chipmunk within javascript.

Can anyone advise on how this could be done? I just want to spin some circles.

Here is the c++ code, yellowFlower is my sprite. It’s a simple circle object.

    auto spriteBody = PhysicsBody::createCircle(yellowFlower->getContentSize().width/2, PhysicsMaterial(0.0f, 0.0f, 0.3f));
    spriteBody->setAngularDamping(0.2f);.0f, 0.3f));

// then later when I want it to spin around it’s center but not move I call:

  yellowFlower->getPhysicsBody()->setAngularVelocity(15 + rand() % 10 + 1);

Which makes it spin. I can’t find a way in cocos2d-js to have a physics body that’s in the space but not affected by gravity that I can apply angular velocity too?

If anyone can help that would be great.