本文整理汇总了C++中SimGroup::end方法的典型用法代码示例。如果您正苦于以下问题:C++ SimGroup::end方法的具体用法?C++ SimGroup::end怎么用?C++ SimGroup::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimGroup
的用法示例。
在下文中一共展示了SimGroup::end方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: preRender
void playDelegate::preRender(void)
{
if(!gameActive)
return;
// try to find a new palette to set in the game:
if(!currentPalette)
{
SimGroup *group = (SimGroup *) manager->findObject("GhostGroup");
if(group)
{
SimGroup::iterator i;
for(i = group->begin(); i != group->end(); i++)
{
SimPalette *pal = dynamic_cast<SimPalette *>(*i);
if(pal)
{
currentPalette = pal;
deleteNotify(pal);
hPal = pal->getPalette();
pal->setInGame();
break;
}
}
}
}
}
示例2: VSoundEffectNetEvent
VTorque::SoundSourceType *VTorque::playSound( SoundEffectType *pSoundProfile, SceneObjectType *pObject, const U32 &pPosition, const F32 &pPitch )
{
if ( !pSoundProfile )
{
// Sanity!
return NULL;
}
#ifdef VT_EDITOR
// Fetch Reference Transform.
const MatrixF &transform = pObject->getTransform();
// Play Sound.
SFXSound *source = ( SFXSound* )SFX->playOnce( pSoundProfile, &transform );
if ( source )
{
// Set Position.
source->setPosition( pPosition );
// Set Pitch.
source->setPitch( pPitch );
}
// Return Source.
return source;
#else
// Fetch Client Group.
SimGroup* clientGroup = Sim::getClientGroup();
for ( SimGroup::iterator itr = clientGroup->begin(); itr != clientGroup->end(); itr++ )
{
NetConnection *connection = static_cast<NetConnection*>( *itr );
if ( connection )
{
// Create Event.
VSoundEffectNetEvent *event = new VSoundEffectNetEvent();
// Setup Event.
event->mProfile = pSoundProfile;
event->mPosition = pPosition;
event->mPitch = pPitch;
event->mIs3D = true;
event->mTransform = pObject->getTransform();
// Post Event.
connection->postNetEvent( event );
}
}
return NULL;
#endif
}
示例3: setPostEffectOn
void VTorque::setPostEffectOn( PostEffectType *pPostEffect, const bool &pStatus )
{
if ( !pPostEffect )
{
// Sanity!
return;
}
#ifdef VT_EDITOR
if ( pStatus )
{
// Enable Effect.
pPostEffect->enable();
}
else
{
// Disable Effect.
pPostEffect->disable();
}
#else
// Fetch Name.
StringTableEntry name = pPostEffect->getName();
if ( !name || name == StringTable->insert( "" ) )
{
Con::warnf( "VTorque::setPostEffectOn() - Invalid Object Name." );
return;
}
// Fetch Client Group.
SimGroup* clientGroup = Sim::getClientGroup();
for ( SimGroup::iterator itr = clientGroup->begin(); itr != clientGroup->end(); itr++ )
{
NetConnection *connection = static_cast<NetConnection*>( *itr );
if ( connection )
{
// Create Event.
VPostEffectNetEvent *event = new VPostEffectNetEvent();
// Setup Event.
event->mPostEffect = name;
event->mEnabled = pStatus;
// Post Event.
connection->postNetEvent( event );
}
}
#endif
}
示例4: warningFlashes
void Lightning::warningFlashes()
{
AssertFatal(isServerObject(), "Error, client objects may not initiate lightning!");
SimGroup* pClientGroup = Sim::getClientGroup();
for (SimGroup::iterator itr = pClientGroup->begin(); itr != pClientGroup->end(); itr++) {
NetConnection* nc = static_cast<NetConnection*>(*itr);
if (nc != NULL)
{
LightningStrikeEvent* pEvent = new LightningStrikeEvent;
pEvent->mLightning = this;
nc->postNetEvent(pEvent);
}
}
}
示例5: setCamera
void VTorque::setCamera( SceneObjectType *pObject )
{
// Fetch Game Base.
GameBase *object = dynamic_cast<GameBase*>( pObject );
// Fetch Client Group.
SimGroup* clientGroup = Sim::getClientGroup();
for ( SimGroup::iterator itr = clientGroup->begin(); itr != clientGroup->end(); itr++ )
{
GameConnection *connection = dynamic_cast<GameConnection*>( *itr );
if ( connection )
{
// Set Camera Object.
connection->setCameraObject( object );
}
}
}
示例6: advanceObjects
void StdServerProcessList::advanceObjects()
{
#ifdef TORQUE_DEBUG_NET_MOVES
Con::printf("Advance server time...");
#endif
Parent::advanceObjects();
// Credit all connections with the elapsed tick
SimGroup *clientGroup = Sim::getClientGroup();
for(SimGroup::iterator i = clientGroup->begin(); i != clientGroup->end(); i++)
{
if (GameConnection *con = dynamic_cast<GameConnection *>(*i))
{
con->mMoveList->advanceMove();
}
}
#ifdef TORQUE_DEBUG_NET_MOVES
Con::printf("---------");
#endif
}
示例7: strikeRandomPoint
void Lightning::strikeRandomPoint()
{
AssertFatal(isServerObject(), "Error, client objects may not initiate lightning!");
Point3F strikePoint( gRandGen.randF( 0.0f, 1.0f ), gRandGen.randF( 0.0f, 1.0f ), 0.0f );
// check if an object is within target range
strikePoint *= mObjScale;
strikePoint += getPosition();
strikePoint += Point3F( -mObjScale.x * 0.5f, -mObjScale.y * 0.5f, 0.0f );
Box3F queryBox;
F32 boxWidth = strikeRadius * 2.0f;
queryBox.minExtents.set( -boxWidth * 0.5f, -boxWidth * 0.5f, -mObjScale.z * 0.5f );
queryBox.maxExtents.set( boxWidth * 0.5f, boxWidth * 0.5f, mObjScale.z * 0.5f );
queryBox.minExtents += strikePoint;
queryBox.maxExtents += strikePoint;
SimpleQueryList sql;
getContainer()->findObjects(queryBox, DAMAGEABLE_TYPEMASK,
SimpleQueryList::insertionCallback, &sql);
SceneObject *highestObj = NULL;
F32 highestPnt = 0.0f;
for( U32 i = 0; i < sql.mList.size(); i++ )
{
Point3F objectCenter;
sql.mList[i]->getObjBox().getCenter(&objectCenter);
objectCenter.convolve(sql.mList[i]->getScale());
sql.mList[i]->getTransform().mulP(objectCenter);
// check if object can be struck
RayInfo rayInfo;
Point3F start = objectCenter;
start.z = mObjScale.z * 0.5f + getPosition().z;
Point3F end = objectCenter;
end.z = -mObjScale.z * 0.5f + getPosition().z;
bool rayHit = gServerContainer.castRay( start, end,
(0xFFFFFFFF),
&rayInfo);
if( rayHit && rayInfo.object == sql.mList[i] )
{
if( !highestObj )
{
highestObj = sql.mList[i];
highestPnt = objectCenter.z;
continue;
}
if( objectCenter.z > highestPnt )
{
highestObj = sql.mList[i];
highestPnt = objectCenter.z;
}
}
}
// hah haaaaa, we have a target!
SceneObject *targetObj = NULL;
if( highestObj )
{
F32 chance = gRandGen.randF();
if( chance <= chanceToHitTarget )
{
Point3F objectCenter;
highestObj->getObjBox().getCenter(&objectCenter);
objectCenter.convolve(highestObj->getScale());
highestObj->getTransform().mulP(objectCenter);
bool playerInWarmup = false;
Player *playerObj = dynamic_cast< Player * >(highestObj);
if( playerObj )
{
if( !playerObj->getControllingClient() )
{
playerInWarmup = true;
}
}
if( !playerInWarmup )
{
applyDamage_callback( objectCenter, VectorF( 0.0f, 0.0f, 1.0f ), highestObj );
targetObj = highestObj;
}
}
}
SimGroup* pClientGroup = Sim::getClientGroup();
for (SimGroup::iterator itr = pClientGroup->begin(); itr != pClientGroup->end(); itr++)
{
NetConnection* nc = static_cast<NetConnection*>(*itr);
//.........这里部分代码省略.........