本文整理汇总了C++中PhysicsBody::removeJoint方法的典型用法代码示例。如果您正苦于以下问题:C++ PhysicsBody::removeJoint方法的具体用法?C++ PhysicsBody::removeJoint怎么用?C++ PhysicsBody::removeJoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhysicsBody
的用法示例。
在下文中一共展示了PhysicsBody::removeJoint方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeBody
void PhysicsWorld::removeBody(PhysicsBody* body)
{
if (body->getWorld() != this)
{
CCLOG("Physics Warnning: this body doesn't belong to this world");
return;
}
// destory the body's joints
for (auto joint : body->_joints)
{
// set destroy param to false to keep the iterator available
removeJoint(joint, false);
PhysicsBody* other = (joint->getBodyA() == body ? joint->getBodyB() : body);
other->removeJoint(joint);
// test the distraction is delaied or not
if (_delayRemoveJoints.size() > 0 && _delayRemoveJoints.back() == joint)
{
joint->_destoryMark = true;
}
else
{
delete joint;
}
}
body->_joints.clear();
removeBodyOrDelay(body);
_bodies.eraseObject(body);
body->_world = nullptr;
}
示例2:
PhysicsBody::~PhysicsBody()
{
for (auto it = _joints.begin(); it != _joints.end(); ++it)
{
PhysicsJoint* joint = *it;
PhysicsBody* other = joint->getBodyA() == this ? joint->getBodyB() : joint->getBodyA();
other->removeJoint(joint);
delete joint;
}
CC_SAFE_DELETE(_info);
}
示例3: cpBodyFree
PhysicsBody::~PhysicsBody()
{
for (auto& joint : _joints)
{
PhysicsBody* other = joint->getBodyA() == this ? joint->getBodyB() : joint->getBodyA();
other->removeJoint(joint);
delete joint;
}
if (_cpBody)
{
cpBodyFree(_cpBody);
}
}
示例4: cpBodyFree
PhysicsBody::~PhysicsBody()
{
for (auto it = _joints.begin(); it != _joints.end(); ++it)
{
PhysicsJoint* joint = *it;
PhysicsBody* other = joint->getBodyA() == this ? joint->getBodyB() : joint->getBodyA();
other->removeJoint(joint);
delete joint;
}
if (_cpBody)
{
cpBodyFree(_cpBody);
}
}