本文整理汇总了C++中Planet::SetOwner方法的典型用法代码示例。如果您正苦于以下问题:C++ Planet::SetOwner方法的具体用法?C++ Planet::SetOwner怎么用?C++ Planet::SetOwner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Planet
的用法示例。
在下文中一共展示了Planet::SetOwner方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: beginElement
Unit* Planet::beginElement( QVector x,
QVector y,
float vely,
const Vector &rotvel,
float pos,
float gravity,
float radius,
const string &filename,
const string &technique,
const string &unitname,
BLENDFUNC blendSrc,
BLENDFUNC blendDst,
const vector< string > &dest,
int level,
const GFXMaterial &ourmat,
const vector< GFXLightLocal > &ligh,
bool isunit,
int faction,
string fullname,
bool inside_out )
{
//this function is OBSOLETE
Unit *un = NULL;
if (level > 2) {
un_iter satiterator = satellites.createIterator();
assert( *satiterator );
if ( (*satiterator)->isUnit() == PLANETPTR ) {
un = ( (Planet*) (*satiterator) )->beginElement( x, y, vely, rotvel, pos,
gravity, radius,
filename, technique, unitname,
blendSrc, blendDst,
dest,
level-1,
ourmat, ligh,
isunit,
faction, fullname,
inside_out );
} else {
VSFileSystem::vs_fprintf( stderr, "Planets are unable to orbit around units" );
}
} else {
if (isunit == true) {
Unit *sat_unit = NULL;
Flightgroup *fg = getStaticBaseFlightgroup( faction );
satellites.prepend( sat_unit = UnitFactory::createUnit( filename.c_str(), false, faction, "", fg, fg->nr_ships-1 ) );
sat_unit->setFullname( fullname );
un = sat_unit;
un_iter satiterator( satellites.createIterator() );
(*satiterator)->SetAI( new PlanetaryOrbit( *satiterator, vely, pos, x, y, QVector( 0, 0, 0 ), this ) );
(*satiterator)->SetOwner( this );
} else {
Planet *p;
if (dest.size() != 0)
radius = ScaleJumpRadius( radius );
satellites.prepend( p = UnitFactory::createPlanet( x, y, vely, rotvel, pos, gravity, radius,
filename, technique, unitname,
blendSrc, blendDst, dest,
QVector( 0, 0, 0 ), this, ourmat, ligh, faction, fullname, inside_out ) );
un = p;
p->SetOwner( this );
}
}
return un;
}