Changeset 9046 in orxonox.OLD for branches/single_player_map/src
- Timestamp:
- Jul 3, 2006, 4:05:28 PM (19 years ago)
- Location:
- branches/single_player_map/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/single_player_map/src/defs/class_id.h
r9039 r9046 199 199 CL_HOVER = 0x0000035e, 200 200 CL_TURBINE_HOVER = 0x0000035f, 201 CL_CRUIZER = 0x00000360, 201 CL_SPACECRAFT_2D = 0x00000360, 202 CL_CRUIZER = 0x00000361, 202 203 CL_SPECTATOR = 0x0000036a, 203 204 CL_COLLISION_PROBE = 0x0000036b, -
branches/single_player_map/src/world_entities/WorldEntities.am
r9039 r9046 44 44 world_entities/space_ships/hover.cc \ 45 45 world_entities/space_ships/turbine_hover.cc \ 46 world_entities/space_ships/spacecraft_2d.cc \ 46 47 world_entities/space_ships/collision_probe.cc \ 47 48 world_entities/space_ships/cruizer.cc \ … … 108 109 space_ships/hover.h \ 109 110 space_ships/turbine_hover.h \ 111 space_ships/spacecraft_2d.h \ 110 112 space_ships/collision_probe.h \ 111 113 space_ships/cruizer.h \ -
branches/single_player_map/src/world_entities/space_ships/cruizer.cc
r9044 r9046 91 91 this->setClassID(CL_CRUIZER, "Cruizer"); 92 92 93 this->setSupportedPlaymodes(Playable::Full3D | Playable::Horizontal | Playable::Vertical);93 this->setSupportedPlaymodes(Playable::Full3D); 94 94 95 95 bForward = bBackward = bLeft = bRight = bAscend = bDescend = false; -
branches/single_player_map/src/world_entities/space_ships/spacecraft_2d.cc
r9045 r9046 102 102 this->setClassID(CL_SPACECRAFT_2D, "Spacecraft2D"); 103 103 104 this->setSupportedPlaymodes(Playable::Full3D | Playable::Horizontal | Playable::Vertical); 105 106 this->loadModel("models/ships/hoverglider_wing.obj", 1.0f, 3); 107 this->loadModel("models/ships/hoverglider_turbine.obj", 1.0f, 4); 108 this->loadModel("models/ships/hoverglider_turbine_rotors.obj", 1.0f, 5); 109 110 bForward = bBackward = bLeft = bRight = bAscend = bDescend = false; 104 this->setSupportedPlaymodes(Playable::Full3D | Playable::Horizontal); 105 106 107 bForward = bBackward = bLeft = bRight = false; 111 108 mouseSensitivity = 0.005; 112 109 … … 123 120 124 121 // camera - issue 125 this->cameraNode.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);126 122 this->cameraNode.addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE); 127 123 //this->cameraNode.setParentMode(PNODE_ROTATE_MOVEMENT); … … 129 125 130 126 // rotors 131 this->wingNodeLeft.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT );132 this->wingNodeLeft.addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE);133 this->wingNodeLeft.setParent(this);134 this->wingNodeLeft.setRelCoor(-1.5, -.3, -1.0);135 this->rotorNodeLeft.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);136 this->rotorNodeLeft.setParent(&this->wingNodeLeft);137 this->rotorNodeLeft.setRelCoor(0, 1.0, -2.3);138 139 this->wingNodeRight.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);140 this->wingNodeRight.addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE);141 this->wingNodeRight.setParent(this);142 this->wingNodeRight.setRelCoor(-1.5, -0.3, 1.0);143 this->rotorNodeRight.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);144 this->rotorNodeRight.setParent(&this->wingNodeRight);145 this->rotorNodeRight.setRelCoor(0, 1.0, 2.3);146 147 127 // PARTICLES 148 this->burstEmitter[0] = new DotEmitter(200, 5.0, .01); 149 this->burstEmitter[0]->setParent(&this->rotorNodeLeft); 150 this->burstEmitter[0]->setRelCoor(0, -0.7, 0); 151 this->burstEmitter[0]->setRelDir(Quaternion(-M_PI_2, Vector(0,0,1))); 152 this->burstEmitter[0]->setName("Spacecraft2D_Burst_emitter_Left"); 153 154 this->burstEmitter[1] = new DotEmitter(200, 5.0, .01); 155 this->burstEmitter[1]->setParent(&this->rotorNodeRight); 156 this->burstEmitter[1]->setRelCoor(0, -0.7, 0); 157 this->burstEmitter[1]->setRelDir(Quaternion(-M_PI_2, Vector(0,0,1))); 158 this->burstEmitter[1]->setName("Spacecraft2D_Burst_emitter_Right"); 128 this->burstEmitter = new DotEmitter(200, 5.0, .01); 129 this->burstEmitter->setParent(this); 130 this->burstEmitter->setRelCoor(0, -0.7, 0); 131 this->burstEmitter->setRelDir(Quaternion(-M_PI_2, Vector(0,0,1))); 132 this->burstEmitter->setName("Spacecraft2D_Burst_emitter_Left"); 159 133 160 134 161 135 this->burstSystem = new SpriteParticles(1000); 162 this->burstSystem->addEmitter(this->burstEmitter[0]); 163 this->burstSystem->addEmitter(this->burstEmitter[1]); 136 this->burstSystem->addEmitter(this->burstEmitter); 164 137 this->burstSystem->setName("SpaceShip_Burst_System"); 165 138 ((SpriteParticles*)this->burstSystem)->setMaterialTexture("maps/radial-trans-noise.png"); … … 192 165 this->getWeaponManager().setSlotCount(5); 193 166 194 this->getWeaponManager().setSlotPosition(0, Vector(-0.28, 1.186, -2.750) , &this->wingNodeLeft);167 this->getWeaponManager().setSlotPosition(0, Vector(-0.28, 1.186, -2.750)); 195 168 this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 196 169 197 this->getWeaponManager().setSlotPosition(1, Vector(-0.28, 1.186, 2.750) , &this->wingNodeRight);170 this->getWeaponManager().setSlotPosition(1, Vector(-0.28, 1.186, 2.750)); 198 171 this->getWeaponManager().setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 199 172 … … 216 189 registerVar( new SynchronizeableBool( &bLeft, &bLeft, "bLeft", PERMISSION_OWNER ) ); 217 190 registerVar( new SynchronizeableBool( &bRight, &bRight, "bRight", PERMISSION_OWNER ) ); 218 registerVar( new SynchronizeableBool( &bAscend, &bAscend, "bAscend", PERMISSION_OWNER ) );219 registerVar( new SynchronizeableBool( &bDescend, &bDescend, "bDescend", PERMISSION_OWNER ) );220 191 //registerVar( new SynchronizeableQuaternion( &direction, &direction, "direction", PERMISSION_OWNER ) ); 221 192 registerVar( new SynchronizeableFloat( &cameraLook, &cameraLook, "cameraLook", PERMISSION_OWNER ) ); … … 327 298 { 328 299 accel += Vector(0, 0, this->acceleration); 329 }330 331 if (this->bAscend )332 {333 accel += Vector(0, this->acceleration, 0);334 }335 if (this->bDescend )336 {337 accel -= Vector(0, this->acceleration, 0);338 300 } 339 301 … … 364 326 this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5); 365 327 366 this->wingNodeLeft.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5);367 this->rotorNodeLeft.setRelDirSoft(Quaternion(-accel.x * .07+this->rotation + cameraLook, Vector(0,0,1)), 5);368 369 this->wingNodeRight.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5);370 this->rotorNodeRight.setRelDirSoft(Quaternion(-accel.x*.07 -this->rotation + cameraLook, Vector(0,0,1)), 5);371 328 } 372 329 break; … … 397 354 398 355 this->setRelDirSoft(this->direction, 5); 399 400 this->wingNodeLeft.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5);401 this->rotorNodeLeft.setRelDirSoft(Quaternion(-accel.x * .07+this->rotation, Vector(0,0,1)), 5);402 403 this->wingNodeRight.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5);404 this->rotorNodeRight.setRelDirSoft(Quaternion(-accel.x*.07 -this->rotation, Vector(0,0,1)), 5);405 356 } 406 357 break; … … 419 370 420 371 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 372 } 428 373 break; … … 435 380 void Spacecraft2D::draw() const 436 381 { 437 Vector tmpRot;438 382 WorldEntity::draw(); 439 440 glPushMatrix();441 /// LEFT SIDE442 glTranslatef (this->wingNodeLeft.getAbsCoor ().x,443 this->wingNodeLeft.getAbsCoor ().y,444 this->wingNodeLeft.getAbsCoor ().z);445 tmpRot = this->wingNodeLeft.getAbsDir().getSpacialAxis();446 glRotatef (this->wingNodeLeft.getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );447 this->getModel(3)->draw();448 glPopMatrix ();449 450 glPushMatrix();451 glTranslatef (this->rotorNodeLeft.getAbsCoor ().x,452 this->rotorNodeLeft.getAbsCoor ().y,453 this->rotorNodeLeft.getAbsCoor ().z);454 tmpRot = this->rotorNodeLeft.getAbsDir().getSpacialAxis();455 glRotatef (this->rotorNodeLeft.getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );456 this->getModel(4)->draw();457 glRotatef(this->rotorCycle, 0,1,0);458 this->getModel(5)->draw();459 glPopMatrix ();460 461 /// RIGHT SIDE462 glPushMatrix();463 glTranslatef (this->wingNodeRight.getAbsCoor ().x,464 this->wingNodeRight.getAbsCoor ().y,465 this->wingNodeRight.getAbsCoor ().z);466 tmpRot = this->wingNodeRight.getAbsDir().getSpacialAxis();467 glRotatef (this->wingNodeRight.getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );468 glScalef(1,1,-1);469 this->getModel(3)->draw();470 glPopMatrix ();471 472 glPushMatrix();473 glTranslatef (this->rotorNodeRight.getAbsCoor ().x,474 this->rotorNodeRight.getAbsCoor ().y,475 this->rotorNodeRight.getAbsCoor ().z);476 tmpRot = this->rotorNodeRight.getAbsDir().getSpacialAxis();477 glRotatef (this->rotorNodeRight.getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );478 glScalef(1,1,-1);479 this->getModel(4)->draw();480 glRotatef(this->rotorCycle, 0,1,0);481 this->getModel(5)->draw();482 glPopMatrix ();483 383 } 484 384 … … 494 394 else if( event.type == KeyMapper::PEV_RIGHT) 495 395 this->bRight = event.bPressed; 496 else if( event.type == KeyMapper::PEV_UP)497 this->bAscend = event.bPressed; //this->shiftCoor(0,.1,0);498 else if( event.type == KeyMapper::PEV_DOWN)499 this->bDescend = event.bPressed; //this->shiftCoor(0,-.1,0);500 396 else if( event.type == KeyMapper::PEV_FORWARD) 501 397 this->bForward = event.bPressed; //this->shiftCoor(0,.1,0); -
branches/single_player_map/src/world_entities/space_ships/spacecraft_2d.h
r9045 r9046 44 44 bool bLeft; //!< left button pressed. 45 45 bool bRight; //!< right button pressed. 46 bool bAscend; //!< ascend button pressed.47 bool bDescend; //!< descend button presses.48 46 49 47 int yInvert; 50 48 float mouseSensitivity; //!< the mouse sensitivity 51 52 PNode wingNodeLeft;53 PNode wingNodeRight;54 PNode rotorNodeLeft;55 PNode rotorNodeRight;56 49 57 50 PNode cameraNode; … … 70 63 float airViscosity; 71 64 72 ParticleEmitter* burstEmitter [2];65 ParticleEmitter* burstEmitter; 73 66 ParticleSystem* burstSystem; 74 67 };
Note: See TracChangeset
for help on using the changeset viewer.