Vector GetRandomSpot() { CWorld *pEnt = GetWorldEntity(); if ( pEnt ) { Vector vMin, vMax; pEnt->GetWorldBounds( vMin, vMax ); return Vector( RandomFloat( vMin.x, vMax.x ), RandomFloat( vMin.y, vMax.y ), RandomFloat( vMin.z, vMax.z ) ); } else { return Vector( 0, 0, 0 ); } }
//----------------------------------------------------------------------------- //----------------------------------------------------------------------------- void CMapData_Server::GetMapBounds( Vector &vecMins, Vector &vecMaxs ) { CWorld *pWorld = static_cast<CWorld*>( GetWorldEntity() ); if ( pWorld ) { // Get the world bounds. pWorld->GetWorldBounds( vecMins, vecMaxs ); // Backward compatability... if ( ( vecMins.LengthSqr() == 0.0f ) && ( vecMaxs.LengthSqr() == 0.0f ) ) { vecMins.Init( -6500.0f, -6500.0f, -6500.0f ); vecMaxs.Init( 6500.0f, 6500.0f, 6500.0f ); } } else { Assert( 0 ); vecMins.Init( 0.0f, 0.0f, 0.0f ); vecMaxs.Init( 1.0f, 1.0f, 1.0f ); } }