本文整理汇总了C++中MoverPtr::isDestroyed方法的典型用法代码示例。如果您正苦于以下问题:C++ MoverPtr::isDestroyed方法的具体用法?C++ MoverPtr::isDestroyed怎么用?C++ MoverPtr::isDestroyed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MoverPtr
的用法示例。
在下文中一共展示了MoverPtr::isDestroyed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: render
//.........这里部分代码省略.........
gos_SetRenderState( gos_State_TextureAddress, gos_TextureWrap );
gos_SetRenderState( gos_State_ZCompare, 0);
gos_SetRenderState( gos_State_ZWrite, 0);
DWORD gosTextureHandle = mcTextureManager->get_gosTextureHandle(viewRectHandle);
gos_SetRenderState( gos_State_Texture, gosTextureHandle );
gos_DrawQuads( &corners[0], 4 );
unsigned long colors[MAX_MOVERS];
unsigned long ringColors[MAX_MOVERS];
Stuff::Vector3D positions[MAX_MOVERS];
unsigned long ranges[MAX_MOVERS];
bool selected[MAX_MOVERS];
count = 0;
//------------------------------------------------------------
// draw non-movers, must do separate check for vehicles, I'm not sure they
// have sensors
for ( i = 0; i < MAX_TEAMS; ++i )
{
TeamSensorSystem* pSys = SensorManager->getTeamSensor( i );
if ( pSys )
{
for ( int j = 0; j < pSys->numSensors; ++j )
{
SensorSystem* pSensor = pSys->sensors[j];
if ( !pSensor )
continue;
if ( pSensor->owner->isDestroyed() || pSensor->owner->isDisabled() || pSensor->owner->getStatus() == OBJECT_STATUS_SHUTDOWN )
continue;
if ( pSensor->getRange() < 1.1 || pSensor->broken)
continue;
if (!pSensor->owner->getTeam())
continue;
ObjectClass objClass = pSensor->owner->getObjectClass();
unsigned long colorBlip = pSensor->owner->getSelected() ? 0xff4bff4b : 0xff00cc00;
unsigned long colorRing = 0xff00cc00;
if ( pSensor->owner->getTeam()->isNeutral( Team::home ) )
{
colorBlip = pSensor->owner->getSelected() ? 0xff4c4cff : 0xff0000ff;
colorRing = 0xff0000ff;
}
else if ( pSensor->owner->getTeam()->isEnemy( Team::home ) ) // enemy
{
{
colorBlip = pSensor->owner->getSelected() ? 0xffff3f3f : 0xffff0000;
colorRing = 0xffff0000;
}
}
if ( objClass != BATTLEMECH && objClass != GROUNDVEHICLE)
{
if ( objClass == ARTILLERY )
{
示例2: teamLineOfSight
//---------------------------------------------------------------------------
bool Team::teamLineOfSight(Stuff::Vector3D tPos, float extRad)
{
//-----------------------------------------------------------
// For each member of the team, check LOS to point provided.
for(size_t i = 0; i < rosterSize; i++)
{
MoverPtr obj = (MoverPtr)ObjectManager->getByWatchID(roster[i]);
if(!obj->isDisabled() && !obj->isDestroyed() && (obj->getStatus() != OBJECT_STATUS_SHUTDOWN))
{
Stuff::Vector3D distance;
distance.Subtract(tPos, obj->getPosition());
float dist = distance.GetApproximateLength();
//Figure out altitude above minimum terrain altitude and look up in table.
float baseElevation = MapData::waterDepth;
if(MapData::waterDepth < Terrain::userMin)
baseElevation = Terrain::userMin;
float altitude = obj->getPosition().z - baseElevation;
float altitudeIntegerRange = (Terrain::userMax - baseElevation) * 0.00390625f;
int32_t altLevel = 0;
if(altitudeIntegerRange > Stuff::SMALL)
altLevel = altitude / altitudeIntegerRange;
if(altLevel < 0)
altLevel = 0;
if(altLevel > 255)
altLevel = 255;
float radius = visualRangeTable[altLevel];
//Scouting specialty skill.
if(obj->isMover())
{
MoverPtr mover = (MoverPtr)obj;
if(mover->pilot && mover->pilot->isScout())
radius += (radius * 0.2f);
radius *= mover->getLOSFactor();
}
if(dist <= (radius * 25.0f * worldUnitsPerMeter))
{
if(lineOfSight(obj->getLOSPosition(), tPos, id, extRad, 0.0f, false))
return true;
}
}
}
//-------------------------------------------------------------------------
// Check the lookout towers now. You can find them in special Buildings!!
for(size_t spBuilding = 0; spBuilding < ObjectManager->numSpecialBuildings; spBuilding++)
{
if(ObjectManager->specialBuildings[spBuilding] &&
ObjectManager->specialBuildings[spBuilding]->getExists() &&
ObjectManager->specialBuildings[spBuilding]->isLookoutTower() &&
(ObjectManager->specialBuildings[spBuilding]->getTeamId() == id))
{
GameObjectPtr obj = ObjectManager->specialBuildings[spBuilding];
if(!obj->isDisabled() && !obj->isDestroyed() && (obj->getStatus() != OBJECT_STATUS_SHUTDOWN))
{
Stuff::Vector3D distance;
distance.Subtract(tPos, obj->getPosition());
float dist = distance.GetApproximateLength();
//Figure out altitude above minimum terrain altitude and look up in table.
float baseElevation = MapData::waterDepth;
if(MapData::waterDepth < Terrain::userMin)
baseElevation = Terrain::userMin;
float altitude = obj->getPosition().z - baseElevation;
float altitudeIntegerRange = (Terrain::userMax - baseElevation) * 0.00390625f;
int32_t altLevel = 0;
if(altitudeIntegerRange > Stuff::SMALL)
altLevel = altitude / altitudeIntegerRange;
if(altLevel < 0)
altLevel = 0;
if(altLevel > 255)
altLevel = 255;
float radius = visualRangeTable[altLevel];
//Scouting specialty skill.
if(obj->isMover())
{
MoverPtr mover = (MoverPtr)obj;
if(mover->pilot && mover->pilot->isScout())
radius += (radius * 0.2f);
radius *= mover->getLOSFactor();
}
if(dist <= (radius * 25.0f * worldUnitsPerMeter))
{
if(lineOfSight(obj->getLOSPosition(), tPos, id, 0.0f, obj->getAppearRadius(), false))
return true;
}
}
}
}
return false;
}