Changeset 9494 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Jul 27, 2006, 10:44:28 AM (18 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/creatures/fps_player.cc
r9406 r9494 287 287 //dealing damage 288 288 289 if ( State::isOnline() && (SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer()))289 if ( State::isOnline() && (SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/)) 290 290 { 291 291 this->damageTicker -= time; -
trunk/src/world_entities/space_ships/space_ship.cc
r9406 r9494 310 310 void SpaceShip::collidesWith(WorldEntity* entity, const Vector& location) 311 311 { 312 Playable::collidesWith(entity, location); 313 314 if( entity->isA(CL_PROJECTILE) && entity != ref) 315 { 316 if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer()) 317 { 318 //TODO handle this 319 } 320 } 321 PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassCName(), entity->getClassCName(), location.x, location.y, location.z); 312 322 313 } 323 314 -
trunk/src/world_entities/space_ships/turbine_hover.cc
r8623 r9494 126 126 this->cameraNode.addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE); 127 127 //this->cameraNode.setParentMode(PNODE_ROTATE_MOVEMENT); 128 //this->cameraNode.setParent(this); 128 this->cameraNode.setParent(this); 129 this->cameraNode.setRelCoor(0,5,0); 129 130 130 131 // rotors … … 211 212 this->getWeaponManager().getFixedTarget()->setParent(&this->cameraNode); 212 213 this->getWeaponManager().getFixedTarget()->setRelCoor(1000,0,0); 213 214 214 215 registerVar( new SynchronizeableBool( &bForward, &bForward, "bForward", PERMISSION_OWNER ) ); 215 216 registerVar( new SynchronizeableBool( &bBackward, &bBackward, "bBackward", PERMISSION_OWNER ) ); … … 218 219 registerVar( new SynchronizeableBool( &bAscend, &bAscend, "bAscend", PERMISSION_OWNER ) ); 219 220 registerVar( new SynchronizeableBool( &bDescend, &bDescend, "bDescend", PERMISSION_OWNER ) ); 220 //registerVar( new SynchronizeableQuaternion( &direction, &direction, "direction", PERMISSION_OWNER ) );221 registerVar( new SynchronizeableQuaternion( &direction, &direction, "direction", PERMISSION_OWNER ) ); 221 222 registerVar( new SynchronizeableFloat( &cameraLook, &cameraLook, "cameraLook", PERMISSION_OWNER ) ); 222 223 registerVar( new SynchronizeableFloat( &rotation, &rotation, "rotation", PERMISSION_OWNER ) ); … … 294 295 295 296 // spaceship controlled movement 297 298 // TRYING TO FIX PNode. 299 //this->cameraNode.setRelCoor(Vector(0.0f, 5.0f, 0.0f));//, 30.0f); 300 //this->cameraNode.setRelDir(Quaternion(this->smoothRotator *10.0, Vector(0,1,0))); 301 296 302 this->movement(dt); 297 303 this->rotorCycle += this->rotorSpeed * dt; 298 299 // TRYING TO FIX PNode. 300 this->cameraNode.setAbsCoorSoft(this->getAbsCoor() + Vector(0.0f, 5.0f, 0.0f), 30.0f); 301 this->cameraNode.setRelDirSoft(this->getAbsDir(), 30.0f); 302 } 304 } 305 306 307 #include "shared_network_data.h" 303 308 304 309 /** … … 349 354 350 355 this->velocity += (accelerationDir - damping)* dt; 351 this->shiftCoor (this->velocity * dt); 356 //if (this->getOwner() != SharedNetworkData::getInstance()->getHostID()) 357 this->shiftCoor (this->velocity * dt); 352 358 353 359 // limit the maximum rotation speed. … … 362 368 } 363 369 364 this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5); 370 //if (this->getOwner() != SharedNetworkData::getInstance()->getHostID()) 371 this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5); 365 372 366 373 this->wingNodeLeft.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5); … … 407 414 408 415 case Playable::Vertical: 409 {410 accel.z = 0;411 Vector accelerationDir = this->getAbsDir().apply(accel * this->acceleration);412 accelerationDir.z=0;416 { 417 accel.z = 0; 418 Vector accelerationDir = this->getAbsDir().apply(accel * this->acceleration); 419 accelerationDir.z=0; 413 420 414 421 // this is the air friction (necessary for a smooth control) 415 Vector damping = (this->velocity * this->airFriction);416 417 this->velocity += (accelerationDir - damping)* dt;418 this->shiftCoor (this->velocity * dt);419 420 this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5);421 422 this->wingNodeLeft.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5);423 this->rotorNodeLeft.setRelDirSoft(Quaternion(-accel.x * .07+this->rotation + cameraLook, Vector(0,0,1)), 5);424 425 this->wingNodeRight.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5);426 this->rotorNodeRight.setRelDirSoft(Quaternion(-accel.x*.07 -this->rotation + cameraLook, Vector(0,0,1)), 5);427 }428 break;422 Vector damping = (this->velocity * this->airFriction); 423 424 this->velocity += (accelerationDir - damping)* dt; 425 this->shiftCoor (this->velocity * dt); 426 427 this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5); 428 429 this->wingNodeLeft.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5); 430 this->rotorNodeLeft.setRelDirSoft(Quaternion(-accel.x * .07+this->rotation + cameraLook, Vector(0,0,1)), 5); 431 432 this->wingNodeRight.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5); 433 this->rotorNodeRight.setRelDirSoft(Quaternion(-accel.x*.07 -this->rotation + cameraLook, Vector(0,0,1)), 5); 434 } 435 break; 429 436 default: 430 437 PRINTF(2)("Playmode %s Not Implemented\n", Playable::playmodeToString(this->getPlaymode()).c_str()); -
trunk/src/world_entities/spawning_point.cc
r9406 r9494 178 178 } 179 179 180 if ( found && SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer())180 if ( found && SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/) 181 181 this->sendRespawnMessage( it->entity->getUniqueID() ); 182 182 … … 201 201 * Just override this function with whatever you want to be drawn. 202 202 */ 203 void SpawningPoint::draw() 203 void SpawningPoint::draw() const 204 204 { 205 205 } … … 213 213 assert( Converter::intToByteArray( uniqueId, buf + INTSIZE, INTSIZE ) == INTSIZE ); 214 214 215 MessageManager::getInstance()->sendMessage( MSGID_RESPAWN, buf, 2*INTSIZE, RT_ALL_ NOT_ME, 0, MP_HIGHBANDWIDTH );215 MessageManager::getInstance()->sendMessage( MSGID_RESPAWN, buf, 2*INTSIZE, RT_ALL_BUT_ME, 0, MP_HIGHBANDWIDTH ); 216 216 } 217 217 218 218 bool SpawningPoint::respawnMessageHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId ) 219 219 { 220 if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer())220 if ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/) 221 221 { 222 222 PRINTF(2)("server received spawn message!\n"); -
trunk/src/world_entities/spawning_point.h
r9008 r9494 50 50 virtual void loadParams(const TiXmlElement* root); 51 51 52 inline int getTeamId() { return this->teamId; }53 inline void setTeamId( int teamId ) { this->teamId = teamId; }52 inline int getTeamId() const { return this->teamId; } 53 inline void setTeamId( int teamId ) { this->teamId = teamId; } 54 54 55 55 void pushEntity(Playable* entity, float delay = 0); … … 63 63 64 64 virtual void tick(float dt); 65 virtual void draw() ;65 virtual void draw() const; 66 66 67 67 68 68 private: 69 69 void spawn(Playable* entity); 70 70 71 71 void sendRespawnMessage( int uniqueId ); 72 72 static bool respawnMessageHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId ); -
trunk/src/world_entities/world_entity.cc
r9406 r9494 257 257 bool WorldEntity::buildObbTree(int depth) 258 258 { 259 if (this->obbTree) 259 if( this->obbTree != NULL) 260 { 260 261 delete this->obbTree; 262 this->obbTree = NULL; 263 } 261 264 262 265 if (this->models[0] != NULL) … … 280 283 this->aabbNode = new AABBTreeNode(); 281 284 this->aabbNode->spawnBVTree(this->models[0]); 285 } 286 else 287 { 288 PRINTF(1)("could not create aabb bounding box, because no model was loaded yet\n"); 289 this->aabbNode = NULL; 290 return false; 282 291 } 283 292 return true;
Note: See TracChangeset
for help on using the changeset viewer.