Changeset 1781 for code/trunk/src/orxonox/objects
- Timestamp:
- Sep 15, 2008, 12:42:18 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/objects/SpaceShip.cc
r1772 r1781 169 169 } 170 170 171 bool SpaceShip::create(){ 172 if(!myShip_){ 173 if(network::Host::running()) 174 // COUT(3) << "this id: " << this->objectID << " myShipID: " << network::Host::getShipID() << std::endl; 175 if(network::Host::running() && objectID == network::Host::getShipID()){ 176 if(!network::Host::isServer()) 177 setObjectMode(0x3); 178 myShip_=true; 171 bool SpaceShip::create() 172 { 173 if (!myShip_) 174 { 175 if (network::Host::running()) 176 //COUT(3) << "this id: " << this->objectID << " myShipID: " << network::Host::getShipID() << std::endl; 177 if (network::Host::running() && objectID == network::Host::getShipID()) 178 { 179 if (!network::Host::isServer()) 180 setObjectMode(0x3); 181 myShip_ = true; 182 } 179 183 } 180 184 else 181 this->setRadarObjectColour(this->getProjectileColour()); 182 } 183 assert(Model::create()); 184 this->init(); 185 return true; 186 } 187 188 void SpaceShip::registerAllVariables(){ 189 registerVar( &camName_, camName_.length()+1, network::STRING, 0x1 ); 190 registerVar( &maxSpeed_, sizeof(maxSpeed_), network::DATA, 0x1); 191 registerVar( &maxSideAndBackSpeed_, sizeof(maxSideAndBackSpeed_), network::DATA, 0x1); 192 registerVar( &maxRotation_, sizeof(maxRotation_), network::DATA, 0x1); 193 registerVar( &translationAcceleration_, sizeof(translationAcceleration_), network::DATA, 0x1); 194 registerVar( &rotationAcceleration_, sizeof(rotationAcceleration_), network::DATA, 0x1); 195 registerVar( &rotationAccelerationRadian_, sizeof(rotationAccelerationRadian_), network::DATA, 0x1); 196 registerVar( &translationDamping_, sizeof(translationDamping_), network::DATA, 0x1); 197 registerVar( &rotationDamping_, sizeof(rotationDamping_), network::DATA, 0x1); 198 registerVar( &rotationDampingRadian_, sizeof(rotationDampingRadian_), network::DATA, 0x1); 199 185 this->setRadarObjectColour(this->getProjectileColour()); 186 assert(Model::create()); 187 this->init(); 188 return true; 189 } 190 191 void SpaceShip::registerAllVariables() 192 { 193 registerVar( &camName_, camName_.length()+1, network::STRING, 0x1 ); 194 registerVar( &maxSpeed_, sizeof(maxSpeed_), network::DATA, 0x1); 195 registerVar( &maxSideAndBackSpeed_, sizeof(maxSideAndBackSpeed_), network::DATA, 0x1); 196 registerVar( &maxRotation_, sizeof(maxRotation_), network::DATA, 0x1); 197 registerVar( &translationAcceleration_, sizeof(translationAcceleration_), network::DATA, 0x1); 198 registerVar( &rotationAcceleration_, sizeof(rotationAcceleration_), network::DATA, 0x1); 199 registerVar( &rotationAccelerationRadian_, sizeof(rotationAccelerationRadian_), network::DATA, 0x1); 200 registerVar( &translationDamping_, sizeof(translationDamping_), network::DATA, 0x1); 201 registerVar( &rotationDamping_, sizeof(rotationDamping_), network::DATA, 0x1); 202 registerVar( &rotationDampingRadian_, sizeof(rotationDampingRadian_), network::DATA, 0x1); 200 203 } 201 204
Note: See TracChangeset
for help on using the changeset viewer.