- Timestamp:
- Jul 25, 2006, 3:36:43 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/world_entities/space_ships/turbine_hover.cc
r8623 r9456 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 ) ); … … 298 299 299 300 // 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 } 301 //this->cameraNode.setAbsCoor(this->getAbsCoor() + Vector(0.0f, 5.0f, 0.0f));//, 30.0f); 302 //this->cameraNode.setAbsDir(this->getAbsDir());//, 30.0f); 303 } 304 305 306 #include "shared_network_data.h" 303 307 304 308 /** … … 349 353 350 354 this->velocity += (accelerationDir - damping)* dt; 351 this->shiftCoor (this->velocity * dt); 355 //if (this->getOwner() != SharedNetworkData::getInstance()->getHostID()) 356 this->shiftCoor (this->velocity * dt); 352 357 353 358 // limit the maximum rotation speed. … … 362 367 } 363 368 364 this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5); 369 //if (this->getOwner() != SharedNetworkData::getInstance()->getHostID()) 370 this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5); 365 371 366 372 this->wingNodeLeft.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5); … … 407 413 408 414 case Playable::Vertical: 409 {410 accel.z = 0;411 Vector accelerationDir = this->getAbsDir().apply(accel * this->acceleration);412 accelerationDir.z=0;415 { 416 accel.z = 0; 417 Vector accelerationDir = this->getAbsDir().apply(accel * this->acceleration); 418 accelerationDir.z=0; 413 419 414 420 // 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;421 Vector damping = (this->velocity * this->airFriction); 422 423 this->velocity += (accelerationDir - damping)* dt; 424 this->shiftCoor (this->velocity * dt); 425 426 this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5); 427 428 this->wingNodeLeft.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5); 429 this->rotorNodeLeft.setRelDirSoft(Quaternion(-accel.x * .07+this->rotation + cameraLook, Vector(0,0,1)), 5); 430 431 this->wingNodeRight.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5); 432 this->rotorNodeRight.setRelDirSoft(Quaternion(-accel.x*.07 -this->rotation + cameraLook, Vector(0,0,1)), 5); 433 } 434 break; 429 435 default: 430 436 PRINTF(2)("Playmode %s Not Implemented\n", Playable::playmodeToString(this->getPlaymode()).c_str());
Note: See TracChangeset
for help on using the changeset viewer.