- Timestamp:
- Jan 31, 2006, 2:27:02 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/space_ships/hover.cc
r6879 r6880 115 115 this->cameraNode.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT); 116 116 this->cameraNode.addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE); 117 //this->cameraNode.setParentMode(PNODE_ROTATE_MOVEMENT); 117 118 this->cameraNode.setParent(this); 118 119 … … 142 143 registerEvent(KeyMapper::PEV_LEFT); 143 144 registerEvent(KeyMapper::PEV_RIGHT); 144 //registerEvent(SDLK_q); 145 registerEvent(SDLK_e); 146 registerEvent(SDLK_c); 145 registerEvent(SDLK_e); /// FIXME 146 registerEvent(SDLK_c); /// FIXME 147 147 registerEvent(KeyMapper::PEV_FIRE1); 148 148 registerEvent(KeyMapper::PEV_NEXT_WEAPON); 149 149 registerEvent(KeyMapper::PEV_PREVIOUS_WEAPON); 150 //registerEvent(SDLK_PAGEUP);151 //registerEvent(SDLK_PAGEDOWN);152 150 registerEvent(EV_MOUSE_MOTION); 153 151 … … 280 278 281 279 Vector tmp = this->getAbsDir().apply(accel * 500.0); 282 tmp.y = accel.y * 500.0 ;280 //tmp.y = accel.y * 500.0 ; 283 281 velocity += tmp * dt; 284 282 … … 290 288 this->rotation = 0.0f; 291 289 292 accel *=.5; 293 this->setRelDirSoft(this->direction * Quaternion(-accel.x, Vector(0,0,1)) * Quaternion(accel.z, Vector(1,0,0)), 5); 290 this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5); 294 291 295 292 this->wingNodeLeft.setRelDirSoft(Quaternion(accel.z+this->rotation, Vector(1,0,0)), 5); 296 this->rotorNodeLeft.setRelDirSoft(Quaternion(-2.0*accel.x+this->rotation , Vector(0,0,1)), 5);293 this->rotorNodeLeft.setRelDirSoft(Quaternion(-2.0*accel.x+this->rotation + cameraLook, Vector(0,0,1)), 5); 297 294 298 295 this->wingNodeRight.setRelDirSoft(Quaternion(accel.z+this->rotation, Vector(1,0,0)), 5); 299 this->rotorNodeRight.setRelDirSoft(Quaternion(-2.0*accel.x-this->rotation , Vector(0,0,1)), 5);296 this->rotorNodeRight.setRelDirSoft(Quaternion(-2.0*accel.x-this->rotation + cameraLook, Vector(0,0,1)), 5); 300 297 } 301 298 … … 386 383 if (cameraLook > M_PI_4) 387 384 cameraLook = M_PI_4; 388 else if (cameraLook < -M_PI_ 2)389 cameraLook = -M_PI_ 2;390 this->cameraNode.setRelDirSoft(Quaternion(-cameraLook, Vector(0,0,1)),10);391 } 392 } 385 else if (cameraLook < -M_PI_4) 386 cameraLook = -M_PI_4; 387 //this->cameraNode.setRelDirSoft(this->direction,10); 388 } 389 }
Note: See TracChangeset
for help on using the changeset viewer.