本文整理汇总了C++中NxScene::flushStream方法的典型用法代码示例。如果您正苦于以下问题:C++ NxScene::flushStream方法的具体用法?C++ NxScene::flushStream怎么用?C++ NxScene::flushStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NxScene
的用法示例。
在下文中一共展示了NxScene::flushStream方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FlushStream
/// Flush the scene's command queue for processing.
virtual void FlushStream () { m_pScene->flushStream(); }
示例2: Advance
void plSimulationMgr::Advance(float delSecs)
{
if (fSuspended)
return;
plProfile_IncCount(StepLen, (int)(delSecs*1000));
#ifndef PLASMA_EXTERNAL_RELASE
uint32_t stepTime = hsTimer::GetPrecTickCount();
#endif
plProfile_BeginTiming(Step);
plPXPhysicalControllerCore::UpdatePrestep(delSecs);
plPXPhysicalControllerCore::UpdatePoststep( delSecs);
for (SceneMap::iterator it = fScenes.begin(); it != fScenes.end(); it++)
{
NxScene* scene = it->second;
bool do_advance = true;
if (fSubworldOptimization)
{
plKey world = (plKey)it->first;
if (world == GetKey())
world = nil;
do_advance = plPXPhysicalControllerCore::AnyControllersInThisWorld(world);
}
if (do_advance)
{
scene->simulate(delSecs);
scene->flushStream();
scene->fetchResults(NX_RIGID_BODY_FINISHED, true);
}
}
plPXPhysicalControllerCore::UpdatePostSimStep(delSecs);
plProfile_EndTiming(Step);
#ifndef PLASMA_EXTERNAL_RELEASE
if(plSimulationMgr::fDisplayAwakeActors)IDrawActiveActorList();
#endif
if (fExtraProfile)
{
int contacts = 0, dynActors = 0, dynShapes = 0, awake = 0, stShapes=0, actors=0, scenes=0, controllers=0 ;
for (SceneMap::iterator it = fScenes.begin(); it != fScenes.end(); it++)
{
bool do_advance = true;
if (fSubworldOptimization)
{
plKey world = (plKey)it->first;
if (world == GetKey())
world = nil;
do_advance = plPXPhysicalControllerCore::AnyControllersInThisWorld(world);
}
if (do_advance)
{
NxScene* scene = it->second;
NxSceneStats stats;
scene->getStats(stats);
contacts += stats.numContacts;
dynActors += stats.numDynamicActors;
dynShapes += stats.numDynamicShapes;
awake += stats.numDynamicActorsInAwakeGroups;
stShapes += stats.numStaticShapes;
actors += stats.numActors;
scenes += 1;
controllers += plPXPhysicalControllerCore::NumControllers();
}
}
plProfile_IncCount(Awake, awake);
plProfile_IncCount(Contacts, contacts);
plProfile_IncCount(DynActors, dynActors);
plProfile_IncCount(DynShapes, dynShapes);
plProfile_IncCount(StaticShapes, stShapes);
plProfile_IncCount(Actors, actors);
plProfile_IncCount(Scenes, scenes);
plProfile_IncCount(Controllers, controllers);
}
plProfile_IncCount(AnimatedPhysicals, plPXPhysical::fNumberAnimatedPhysicals);
plProfile_IncCount(AnimatedActivators, plPXPhysical::fNumberAnimatedActivators);
fSoundMgr->Update();
plProfile_BeginTiming(ProcessSyncs);
IProcessSynchs();
plProfile_EndTiming(ProcessSyncs);
plProfile_BeginTiming(UpdateContexts);
ISendUpdates();
plProfile_EndTiming(UpdateContexts);
}
示例3: Advance
void plSimulationMgr::Advance(float delSecs)
{
if (fSuspended)
return;
fAccumulator += delSecs;
if (fAccumulator < kDefaultStepSize)
{
// Not enough time has passed to perform a substep.
plPXPhysicalControllerCore::UpdateNonPhysical(fAccumulator / kDefaultStepSize);
return;
}
else if (fAccumulator > kDefaultMaxDelta)
{
if (fExtraProfile)
Log("Step clamped from %f to limit of %f", fAccumulator, kDefaultMaxDelta);
fAccumulator = kDefaultMaxDelta;
}
++fStepCount;
// Perform as many whole substeps as possible saving the remainder in our accumulator.
int numSubSteps = (int)(fAccumulator / kDefaultStepSize + 0.000001f);
float delta = numSubSteps * kDefaultStepSize;
fAccumulator -= delta;
plProfile_IncCount(StepLen, (int)(delta*1000));
plProfile_BeginTiming(Step);
plPXPhysicalControllerCore::Apply(delta);
for (SceneMap::iterator it = fScenes.begin(); it != fScenes.end(); it++)
{
NxScene* scene = it->second;
bool do_advance = true;
if (fSubworldOptimization)
{
plKey world = (plKey)it->first;
if (world == GetKey())
world = nil;
do_advance = plPXPhysicalControllerCore::AnyControllersInThisWorld(world);
}
if (do_advance)
{
scene->simulate(delta);
scene->flushStream();
scene->fetchResults(NX_RIGID_BODY_FINISHED, true);
}
}
plPXPhysicalControllerCore::Update(numSubSteps, fAccumulator / kDefaultStepSize);
plProfile_EndTiming(Step);
#ifndef PLASMA_EXTERNAL_RELEASE
if(plSimulationMgr::fDisplayAwakeActors)IDrawActiveActorList();
#endif
if (fExtraProfile)
{
int contacts = 0, dynActors = 0, dynShapes = 0, awake = 0, stShapes=0, actors=0, scenes=0, controllers=0 ;
for (SceneMap::iterator it = fScenes.begin(); it != fScenes.end(); it++)
{
bool do_advance = true;
if (fSubworldOptimization)
{
plKey world = (plKey)it->first;
if (world == GetKey())
world = nil;
do_advance = plPXPhysicalControllerCore::AnyControllersInThisWorld(world);
}
if (do_advance)
{
NxScene* scene = it->second;
NxSceneStats stats;
scene->getStats(stats);
contacts += stats.numContacts;
dynActors += stats.numDynamicActors;
dynShapes += stats.numDynamicShapes;
awake += stats.numDynamicActorsInAwakeGroups;
stShapes += stats.numStaticShapes;
actors += stats.numActors;
scenes += 1;
controllers += plPXPhysicalControllerCore::NumControllers();
}
}
plProfile_IncCount(Awake, awake);
plProfile_IncCount(Contacts, contacts);
plProfile_IncCount(DynActors, dynActors);
plProfile_IncCount(DynShapes, dynShapes);
plProfile_IncCount(StaticShapes, stShapes);
plProfile_IncCount(Actors, actors);
plProfile_IncCount(Scenes, scenes);
plProfile_IncCount(Controllers, controllers);
}
plProfile_IncCount(AnimatedPhysicals, plPXPhysical::fNumberAnimatedPhysicals);
plProfile_IncCount(AnimatedActivators, plPXPhysical::fNumberAnimatedActivators);
fSoundMgr->Update();
//.........这里部分代码省略.........