本文整理汇总了C++中EntityItemPointer::removeAction方法的典型用法代码示例。如果您正苦于以下问题:C++ EntityItemPointer::removeAction方法的具体用法?C++ EntityItemPointer::removeAction怎么用?C++ EntityItemPointer::removeAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EntityItemPointer
的用法示例。
在下文中一共展示了EntityItemPointer::removeAction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateAction
void ObjectAction::updateAction(btCollisionWorld* collisionWorld, btScalar deltaTimeStep) {
if (_ownerEntity.expired()) {
qDebug() << "warning -- action with no entity removing self from btCollisionWorld.";
btDynamicsWorld* dynamicsWorld = static_cast<btDynamicsWorld*>(collisionWorld);
dynamicsWorld->removeAction(this);
return;
}
if (_expires > 0) {
quint64 now = usecTimestampNow();
if (now > _expires) {
EntityItemPointer ownerEntity = _ownerEntity.lock();
_active = false;
if (ownerEntity) {
ownerEntity->removeAction(nullptr, getID());
}
}
}
if (!_active) {
return;
}
updateActionWorker(deltaTimeStep);
}
示例2: updateAction
void ObjectAction::updateAction(btCollisionWorld* collisionWorld, btScalar deltaTimeStep) {
quint64 expiresWhen = 0;
EntityItemPointer ownerEntity = nullptr;
withReadLock([&]{
ownerEntity = _ownerEntity.lock();
expiresWhen = _expires;
});
if (!ownerEntity) {
qCDebug(physics) << "warning -- action [" << _tag << "] with no entity removing self from btCollisionWorld.";
btDynamicsWorld* dynamicsWorld = static_cast<btDynamicsWorld*>(collisionWorld);
if (dynamicsWorld) {
dynamicsWorld->removeAction(this);
}
return;
}
if (expiresWhen > 0) {
quint64 now = usecTimestampNow();
if (now > expiresWhen) {
QUuid myID;
withWriteLock([&]{
_active = false;
myID = getID();
});
if (ownerEntity) {
ownerEntity->removeAction(nullptr, myID);
}
}
}
if (!_active) {
return;
}
if (ownerEntity->getLocked()) {
return;
}
updateActionWorker(deltaTimeStep);
}