Changeset 10728 in orxonox.OLD for branches/presentation
- Timestamp:
- Jun 20, 2007, 11:39:18 AM (17 years ago)
- Location:
- branches/presentation/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/lib/graphics/importer/static_model.cc
r10714 r10728 101 101 void StaticModel::extractMountPoints() 102 102 { 103 printf("extracting MP...");103 // printf("extracting MP..."); 104 104 // go through all groups and check if they are mounts 105 105 std::vector<StaticModelData::Group>::iterator groupIt = this->data->getGroups().begin(); 106 for( ; groupIt != this->data->getGroups().end(); )106 for( ; groupIt != this->data->getGroups().end(); groupIt++) 107 107 { 108 108 //PRINTF(0)("Found a MountPoint: %s\n", groupName.c_str()); … … 114 114 // check if the name has a "MP" prefix or else it won't work 115 115 if( groupName.find("MP.", 0) == std::string::npos){ 116 groupIt++;116 // groupIt++; 117 117 // printf("Found MP: "); 118 118 continue; … … 129 129 groupName.c_str(), (*groupIt)._faces.size()); 130 130 // printf("wrong number of faces\n\n"); 131 groupIt++;131 // groupIt++; 132 132 continue; 133 133 } … … 226 226 // printf("removing item..."); 227 227 // remove the group from the model list (mount points do not need to be drawn) 228 //std::vector<StaticModelData::Group>::iterator tmpIt = groupIt;229 groupIt++;228 std::vector<StaticModelData::Group>::iterator tmpIt = groupIt; 229 // groupIt++; 230 230 // printf(" removing..."); 231 //this->data->getGroups().erase(tmpIt);231 this->data->getGroups().erase(tmpIt); 232 232 // printf(" REMOVED\n"); 233 233 } -
branches/presentation/src/util/track/action_box.cc
r10698 r10728 98 98 assert( _track ); 99 99 assert( State::getActionBox() == NULL ); 100 100 101 101 State::setActionBox( this ); 102 102 103 103 this->width_2 = width_2; 104 104 this->height_2 = height_2; … … 106 106 this->stretch = stretch; 107 107 this->track = _track; 108 108 109 109 setParent( _track->getTrackNode() ); 110 110 111 111 toList( OM_COMMON ); 112 112 } -
branches/presentation/src/util/track/action_box.h
r10698 r10728 16 16 virtual void tick (float time); 17 17 virtual void draw () const; 18 18 19 19 ActionBox( Track* _track, float width_2, float height_2, float depth, float stretch ); 20 20 ~ActionBox(); 21 22 21 22 23 23 bool isPointInBox( const Vector& pos ); 24 24 25 25 float getWidth_2(){ return width_2; } 26 26 float getHeight_2(){ return height_2; } 27 27 float getDepth(){ return depth; } 28 28 float getStretch(){ return stretch; } 29 29 30 30 private: 31 31 void updatePlanes(); 32 32 33 33 float width_2; //! width/2 of near plane 34 34 float height_2; //! height/2 of near plane 35 35 float depth; //! distance between near and far plane 36 36 float stretch; //! far plane will be stretched by this factor 37 37 38 38 Track* track; 39 39 40 40 Plane planes[6]; //! planes for collision. normale must point towards middle 41 41 }; -
branches/presentation/src/world_entities/projectiles/nadion_blast.cc
r10722 r10728 213 213 float matrix[4][4]; 214 214 glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); 215 glRotatef(this->angle, 1.0f, 0.0f, 0.0f); //spinning missile 216 // glRotatef(this->angle, this->flightDirection.x, this->flightDirection.y, this->flightDirection.z); 215 // glRotatef(this->angle, 1.0f, 0.0f, 0.0f); //spinning missile 216 // HACK, need to be removed, once the AbsDir is correct, replace with the one above 217 glRotatef(this->angle, this->flightDirection.x, this->flightDirection.y, this->flightDirection.z); 217 218 this->getAbsDir().matrix (matrix); 218 219 glMultMatrixf((float*)matrix); -
branches/presentation/src/world_entities/space_ships/space_ship.cc
r10721 r10728 453 453 { 454 454 455 //if( !this->bInit)456 //{457 //// now get slots from the mount points458 //std::map<int, MountPoint*>::iterator it = this->mountPointMap.begin();459 //for( ;it != this->mountPointMap.end(); it++)460 //{461 //WeaponSlot* ws = dynamic_cast<WeaponSlot*>((*it).second->getMount());462 //if( ws != NULL && ws->isA(WeaponSlot::staticClassID()))463 //{464 //int slot = ws->getWeaponSlot();465 // //int side = ws->getWeaponSide(); //FIXME / REMOVE: is not used// HACK needed for some weapons (left/right)466 //this->getWeaponManager().setSlotPosition(slot, (*it).second->getCenter());467 //this->getWeaponManager().setSlotDirection(slot, ws->getRelDir());468 // //PRINTF(0)("setting slot %i\n", slot);469 // //(*it).second->getCenter().debug();470 //}471 //}472 //this->bInit = true;473 //}455 if( !this->bInit) 456 { 457 // now get slots from the mount points 458 std::map<int, MountPoint*>::iterator it = this->mountPointMap.begin(); 459 for( ;it != this->mountPointMap.end(); it++) 460 { 461 WeaponSlot* ws = dynamic_cast<WeaponSlot*>((*it).second->getMount()); 462 if( ws != NULL && ws->isA(WeaponSlot::staticClassID())) 463 { 464 int slot = ws->getWeaponSlot(); 465 // int side = ws->getWeaponSide(); //FIXME / REMOVE: is not used// HACK needed for some weapons (left/right) 466 this->getWeaponManager().setSlotPosition(slot, (*it).second->getCenter()); 467 this->getWeaponManager().setSlotDirection(slot, ws->getRelDir()); 468 // PRINTF(0)("setting slot %i\n", slot); 469 // (*it).second->getCenter().debug(); 470 } 471 } 472 this->bInit = true; 473 } 474 474 475 475 // Playable::tick(time); -
branches/presentation/src/world_entities/weapons/disruptor.cc
r10722 r10728 125 125 126 126 127 this->shootAnim[0][0]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.0333, ANIM_LINEAR, ANIM_NULL); 128 this->shootAnim[0][0]->addKeyFrame(Vector(-0.5, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL); 127 129 this->shootAnim[0][0]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL); 128 this->shootAnim[0][0]->addKeyFrame(Vector(-0.5, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL);129 // this->shootAnim[0][0]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL);130 130 131 131 Animation3D* animation2 = this->getAnimation(WS_ACTIVATING, this); -
branches/presentation/src/world_entities/weapons/nadion_laser.cc
r10722 r10728 148 148 pj->setAbsCoor(this->getEmissionPoint()); 149 149 // pj->setAbsDir(Quaternion(this->getDefaultTarget()->getAbsCoor() - this->getAbsCoor(), Vector(0,0,0))); 150 // pj->setAbsDir(Quaternion(tmp.getNormalized(), this->getParent()->getAbsDir().apply(Vector(0,1,0)))); 151 150 152 pj->setAbsDir(this->getAbsDir()); 151 153 pj->activate(); -
branches/presentation/src/world_entities/weapons/rf_cannon.cc
r10722 r10728 142 142 pj->setAbsCoor(this->emissionPoint[this->activeBarrel]->getAbsCoor()); 143 143 // pj->setAbsDir(this->getAbsDir()); 144 // pj->setAbsDir(Quaternion(tmp.getNormalized(), this->getParent()->getAbsDir().apply(Vector(0,1,0)))); 144 145 145 146 pj->activate(); -
branches/presentation/src/world_entities/weapons/weapon_manager.h
r10721 r10728 55 55 void hideCrosshair(); 56 56 void setRotationSpeed(float speed); 57 // Crosshair* getCrosshair() {return this->crosshair; };58 57 59 // virtual void process(const Event &event);60 58 61 59 void setSlotCount(unsigned int slotCount); … … 63 61 // setting up the WeaponManager with the following functions 64 62 void setSlotPosition(int slot, const Vector& position, PNode* parent = NULL); 65 // inline void setSlotPosition(float slot, float x, float y,float z) {setSlotPosition((int)slot, Vector(x,y,z));};66 63 void setSlotDirection(int slot, const Quaternion& rotation); 67 64 /** @param slot the slot to get the relative position from @returns the relative position of the Carrier to the Slot */ … … 104 101 105 102 void fire(); 106 //! @TODO: implement this function (maybe also in Weapon itself)107 103 void releaseFire(); 108 //inline void setFire() { this->bFire = true; };109 104 110 105 void tick(float dt); … … 113 108 void debug() const; 114 109 115 // private: 110 116 111 int getNextFreeSlot(int configID, long capability = WTYPE_ALL); 117 112 CountPointer<AmmoContainer>& getAmmoContainer(const ClassID& projectileType);
Note: See TracChangeset
for help on using the changeset viewer.