Changeset 7116 in orxonox.OLD
- Timestamp:
- Feb 8, 2006, 9:39:53 AM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/multiplayer_team_deathmatch.cc
r7101 r7116 28 28 #include "space_ships/space_ship.h" 29 29 30 30 31 #include "shared_network_data.h" 31 32 #include <list> 32 #include "terrain.h" 33 #include "class_list.h" 34 #include "space_ships/space_ship.h" 35 33 36 34 37 using namespace std; … … 181 184 } 182 185 183 184 185 186 187 if ( SharedNetworkData::getInstance()->isGameServer() ) 188 { 189 float offsetx = 500.0f; 190 float offsety = 323.0f; 191 float offsetz = 200.0f; 192 193 offsetz += 10; 194 195 Terrain * terrain = dynamic_cast<Terrain*>(*(ClassList::getList( CL_TERRAIN )->begin())); 196 const std::list<BaseObject*> * list = ClassList::getList( CL_SPACE_SHIP ); 197 for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++) 198 { 199 SpaceShip * ss = dynamic_cast<SpaceShip*>(*it); 200 float terrx = ss->getAbsCoor().x + offsetx; 201 float terry = ss->getAbsCoor().z + offsetz; 202 float terrz = ss->getAbsCoor().y + offsety; 203 if ( terrz < terrain->getHeight( terrx, terry ) && ss->getAbsCoor().x > -1000 ) 204 { 205 //PRINTF(0)("COLLLLLLIIIIIDDDDEEEE\n"); 206 ss->networkCollisionList.push_back( 1234567890 ); 207 ss->doCollideNetwork( 1234567890 ); 208 } 209 //PRINTF(0)("x = %f, y = %f, z = %f, height = %f\n", terrx, terry, terrz, terrain->getHeight( terrx, terry )); 210 //ss->setRelCoorSoft( ss->getAbsCoor().x, terrain->getHeight( terrx, terry )-offsety, ss->getAbsCoor().z ); 211 212 float dist = (dynamic_cast<Playable*>(*it)->getAbsCoor() - big_left).len(); 213 if( (dynamic_cast<Playable*>(*it)->getAbsCoor() - big_left).len() > rBig && 214 (dynamic_cast<Playable*>(*it)->getAbsCoor() - big_right).len() > rBig && 215 (dynamic_cast<Playable*>(*it)->getAbsCoor() - small_left).len() > rSmall && 216 (dynamic_cast<Playable*>(*it)->getAbsCoor() - small_middle).len() > rSmall && 217 (dynamic_cast<Playable*>(*it)->getAbsCoor() - small_right).len() > rSmall) 218 { 219 PRINTF(0)("KILLLLLLLL\n"); 220 221 if((*it)->isA(CL_SPACE_SHIP)) 222 { 223 dynamic_cast<SpaceShip*>(*it)->networkCollisionList.push_back(116369220.33434f); 224 dynamic_cast<SpaceShip*>(*it)->doCollideNetwork(116369220.33434f); 225 } 226 } 227 } 228 } 229 230 231 #if 0 186 232 std::list<BaseObject*>::const_iterator it; 187 233 const std::list<BaseObject*>* list = ClassList::getList(CL_PLAYABLE); … … 205 251 } 206 252 } 207 208 209 } 210 211 212 213 214 215 253 #endif 254 255 } 256 257 258 259 260 261 -
trunk/src/world_entities/space_ships/space_ship.h
r7101 r7116 46 46 virtual int readBytes(byte* data, int maxLength, int * reciever); 47 47 48 49 //HACK HACK HACK make this private or remove it 48 //HACK HACK HACK HACK make this private or remove it 50 49 void doCollideNetwork( float energy ); 50 std::list<float> networkCollisionList; 51 51 52 52 private: … … 54 54 55 55 void calculateVelocity(float time); 56 57 58 56 59 57 bool bUp; //!< up button pressed. … … 91 89 ParticleEmitter* burstEmitter; 92 90 ParticleSystem* burstSystem; 93 94 std::list<float> networkCollisionList;95 91 }; 96 92
Note: See TracChangeset
for help on using the changeset viewer.