Changeset 9494 in orxonox.OLD for trunk/src/world_entities/space_ships
- Timestamp:
- Jul 27, 2006, 10:44:28 AM (18 years ago)
- Location:
- trunk/src/world_entities/space_ships
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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());
Note: See TracChangeset
for help on using the changeset viewer.