本文整理汇总了C++中Timing::restart方法的典型用法代码示例。如果您正苦于以下问题:C++ Timing::restart方法的具体用法?C++ Timing::restart怎么用?C++ Timing::restart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timing
的用法示例。
在下文中一共展示了Timing::restart方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calculateAllCollisions
//.........这里部分代码省略.........
if (mDetectorDeformManager) {
// note: once this is called, internal job collections of the
// DetectorDeformAlgorithm objects will add their jobs to the
// pipeline - but the _pipeline_ will actually start the jobs
mDetectorDeformManager->notifyPipelineStarted();
}
// add deformable self-collision jobs
if (mDetectorDeformManager) {
const std::list<Proxy*>& selfCollisionProxies = mWorld->getSelfcollisionProxies();
for (std::list<Proxy*>::const_iterator it = selfCollisionProxies.begin(); it != selfCollisionProxies.end(); ++it) {
if (!((*it)->getProxyType() & PROXYTYPE_DEFORMABLE)) {
continue;
}
if (mWorld->getUseCollisionCaching()) {
bool cacheApplied = mWorld->getCollisionCache()->applyCacheIfAvailable(*it, *it);
if (cacheApplied) {
continue;
}
}
DetectorDeformAlgorithm* algorithm = mDetectorDeformManager->pickAlgorithmFor(*it, *it);
if (algorithm) {
CollisionPair pair;
// FIXME: make CollisionPair store Proxy pointers, not
// BoundingVolume pointers.
pair.bvol1 = (*it)->getBvHierarchyNode()->getBoundingVolume();
pair.bvol2 = pair.bvol1;
algorithm->createCollisionJobFor(pair);
}
}
}
}
if (!getUsePipelining()) {
completeCurrentPhase();
time.stop();
mWorld->getCurrentDebugLogEntry()->addTiming("BroadPhase", time);
time.restart();
mCurrentPhase = PHASE_MIDDLEPHASE;
completeCurrentPhase();
time.stop();
mWorld->getCurrentDebugLogEntry()->addTiming("MiddlePhase", time);
time.restart();
mCurrentPhase = PHASE_NARROWPHASE;
completeCurrentPhase();
time.stop();
mWorld->getCurrentDebugLogEntry()->addTiming("NarrowPhase", time);
} else {
completeCurrentPhase();
time.stop();
// in a pipelined run we cannot differ between phases
// AB: note: "BroadPhase", "MiddlePhase" and "NarrowPhase" timings
// can still be retrieved from the log - since we havent added
// them, they will be nullified Timing objects.
mWorld->getCurrentDebugLogEntry()->addTiming("Pipeline", time);
}
if (mDetectorDeformManager) {
// reset the job collections of the algorithms
// note: at this point all jobs must already be completed!
mDetectorDeformManager->notifyPipelineCompleted();
}
// pipeline has been completed at this point. add results to
// worldCollisions.
worldCollisions->setRigidBoundingVolumeCollisions(&mMiddlePhaseRigidResults);
worldCollisions->addNarrowPhaseCollisions(&mCollisionInfos);
// post-pipeline algorithms
time.restart();
startCompletelyUnthreadedAlgorithms(worldCollisions);
time.stop();
mWorld->getCurrentDebugLogEntry()->addTiming("UnthreadedPhase", time);
mWorld->getCurrentDebugLogEntry()->setUIntVariable("BroadPhase job count", mWorld->getBroadPhase()->getJobCollection()->getJobsInCollectionCount());
mWorld->getCurrentDebugLogEntry()->setUIntVariable("BroadPhase min collisions per job", mMinCollisionsPerBroadPhaseJob);
mWorld->getCurrentDebugLogEntry()->setUIntVariable("BroadPhase max collisions per job", mMaxCollisionsPerBroadPhaseJob);
mWorld->getCurrentDebugLogEntry()->setUIntVariable("BroadPhase collisions", mTotalBroadPhaseCollisions);
// sanity check
mWorkerPool->waitForCompletion();
if (mWorkerPool->hasCompletedJobs()) {
std::cerr << dc_funcinfo << "ERROR: completed jobs left" << std::endl;
while (mWorkerPool->hasCompletedJobs()) {
delete mWorkerPool->retrieveCompletedJob();
}
}
mCurrentPhase = PHASE_INVALID;
if (!mBroadPhaseJobs->empty() || !mMiddlePhaseJobs->empty() || !mNarrowPhaseJobs->empty()) {
throw Exception("Pipeline: internal error: not all job lists empty at end of collision detection");
}
}