希望让刚体在碰撞的一瞬间静止
auto contactListener = EventListenerPhysicsContact::create();
contactListener->onContactBegin = =](PhysicsContact& contact) -> bool
{
return true;
};
contactListener->onContactPostSolve = =](PhysicsContact& contact, const PhysicsContactPostSolve& solve)
{
contact.getShapeA()->getBody()->setDynamic(false);
};
_eventDispatcher->addEventListenerWithSceneGraphPriority(contactListener, this);
```
最后出错信息:
Aborting due to Chipmunk error: This operation cannot be done safely during a call to cpSpaceStep() or during a query. Put these calls into a post-step callback.
Failed condition: !space->locked
有木有大神求解:3: