- Timestamp:
- Apr 19, 2006, 12:24:20 AM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/story_entities/multi_player_world_data.cc
r7193 r7337 213 213 playable->toList(OM_GROUP_00); 214 214 playable->setAbsCoor(213.37, 57.71, -47.98); 215 playable->set AbsDirPlay(Quaternion(M_PI, Vector(0.0, 1.0, 0.0)));215 playable->setStartDirection(Quaternion(M_PI, Vector(0.0, 1.0, 0.0))); 216 216 } 217 217 } -
trunk/src/world_entities/creatures/md2_creature.cc
r7221 r7337 88 88 cannon->setName("BFG"); 89 89 90 this->getWeaponManager() ->addWeapon(wpLeft, 1, 0);91 this->getWeaponManager() ->addWeapon(wpRight,1 ,1);92 // this->getWeaponManager() ->addWeapon(cannon, 0, 6);93 94 //this->getWeaponManager() ->addWeapon(turret, 3, 0);95 96 this->getWeaponManager() ->changeWeaponConfig(0);90 this->getWeaponManager().addWeapon(wpLeft, 1, 0); 91 this->getWeaponManager().addWeapon(wpRight,1 ,1); 92 // this->getWeaponManager().addWeapon(cannon, 0, 6); 93 94 //this->getWeaponManager().addWeapon(turret, 3, 0); 95 96 this->getWeaponManager().changeWeaponConfig(0); 97 97 } 98 98 … … 147 147 148 148 149 this->getWeaponManager() ->setSlotCount(7);150 151 this->getWeaponManager() ->setSlotPosition(0, Vector(-0.5, .2, -1.9));152 this->getWeaponManager() ->setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);153 154 this->getWeaponManager() ->setSlotPosition(1, Vector(-0.5, .2, 1.9));155 this->getWeaponManager() ->setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);156 157 this->getWeaponManager() ->setSlotPosition(2, Vector(-1.5, .5, -.5));158 this->getWeaponManager() ->setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));159 160 this->getWeaponManager() ->setSlotPosition(3, Vector(-1.5, .5, .5));161 this->getWeaponManager() ->setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));162 163 this->getWeaponManager() ->setSlotPosition(4, Vector(-1.5, -.5, .5));164 this->getWeaponManager() ->setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));165 166 this->getWeaponManager() ->setSlotPosition(5, Vector(-1.5, -.5, -.5));167 this->getWeaponManager() ->setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));149 this->getWeaponManager().setSlotCount(7); 150 151 this->getWeaponManager().setSlotPosition(0, Vector(-0.5, .2, -1.9)); 152 this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 153 154 this->getWeaponManager().setSlotPosition(1, Vector(-0.5, .2, 1.9)); 155 this->getWeaponManager().setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 156 157 this->getWeaponManager().setSlotPosition(2, Vector(-1.5, .5, -.5)); 158 this->getWeaponManager().setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0))); 159 160 this->getWeaponManager().setSlotPosition(3, Vector(-1.5, .5, .5)); 161 this->getWeaponManager().setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0))); 162 163 this->getWeaponManager().setSlotPosition(4, Vector(-1.5, -.5, .5)); 164 this->getWeaponManager().setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0))); 165 166 this->getWeaponManager().setSlotPosition(5, Vector(-1.5, -.5, -.5)); 167 this->getWeaponManager().setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0))); 168 168 // 169 this->getWeaponManager() ->setSlotPosition(6, Vector(-1, 0.0, 0));170 this->getWeaponManager() ->setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);169 this->getWeaponManager().setSlotPosition(6, Vector(-1, 0.0, 0)); 170 this->getWeaponManager().setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 171 171 // 172 172 173 this->cameraConnNode.addChild(this->getWeaponManager() ->getFixedTarget());174 dynamic_cast<Element2D*>(this->getWeaponManager() ->getFixedTarget())->setVisibility( false);175 176 this->getWeaponManager() ->getFixedTarget()->setRelCoor(10,0,0);173 this->cameraConnNode.addChild(this->getWeaponManager().getFixedTarget()); 174 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false); 175 176 this->getWeaponManager().getFixedTarget()->setRelCoor(10,0,0); 177 177 178 178 } … … 181 181 void MD2Creature::enter() 182 182 { 183 dynamic_cast<Element2D*>(this->getWeaponManager() ->getFixedTarget())->setVisibility( true);183 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( true); 184 184 this->attachCamera(); 185 185 … … 188 188 void MD2Creature::leave() 189 189 { 190 dynamic_cast<Element2D*>(this->getWeaponManager() ->getFixedTarget())->setVisibility( false);190 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false); 191 191 192 192 -
trunk/src/world_entities/creatures/md2_creature.h
r7221 r7337 24 24 25 25 virtual void loadParams(const TiXmlElement* root); 26 virtual void set AbsDirPlay(const Quaternion& rot) {/* FIXME */};26 virtual void setStartDirection(const Quaternion& rot) {/* FIXME */}; 27 27 28 28 virtual void enter(); -
trunk/src/world_entities/playable.cc
r7193 r7337 39 39 40 40 Playable::Playable() 41 : weaponMan(this) 41 42 { 42 43 this->setClassID(CL_PLAYABLE, "Playable"); … … 44 45 45 46 this->toList(OM_GROUP_01); 46 this->weaponMan = new WeaponManager(this);47 47 48 48 // the reference to the Current Player is NULL, because we dont have one at the beginning. … … 64 64 Playable::~Playable() 65 65 { 66 delete this->weaponMan;67 68 66 // THE DERIVED CLASS MUST UNSUBSCRIBE THE PLAYER THROUGH 69 67 // this->setPlayer(NULL); … … 77 75 WorldEntity::loadParams(root); 78 76 79 LoadParam(root, "abs-dir", this, Playable, set AbsDirPlay);77 LoadParam(root, "abs-dir", this, Playable, setStartDirection); 80 78 } 81 79 82 80 void Playable::addWeapon(Weapon* weapon, int configID, int slotID) 83 81 { 84 this->weaponMan ->addWeapon(weapon, configID, slotID);82 this->weaponMan.addWeapon(weapon, configID, slotID); 85 83 86 84 this->weaponConfigChanged(); … … 90 88 void Playable::removeWeapon(Weapon* weapon) 91 89 { 92 this->weaponMan ->removeWeapon(weapon);90 this->weaponMan.removeWeapon(weapon); 93 91 94 92 this->weaponConfigChanged(); … … 98 96 void Playable::nextWeaponConfig() 99 97 { 100 this->weaponMan ->nextWeaponConfig();98 this->weaponMan.nextWeaponConfig(); 101 99 this->weaponConfigChanged(); 102 100 } … … 105 103 void Playable::previousWeaponConfig() 106 104 { 107 this->weaponMan ->previousWeaponConfig();105 this->weaponMan.previousWeaponConfig(); 108 106 this->weaponConfigChanged(); 109 107 } … … 259 257 { 260 258 if(powerUp->isA(CL_WEAPON_POWER_UP)) { 261 return dynamic_cast<WeaponPowerUp*>(powerUp)->process( this->getWeaponManager());259 return dynamic_cast<WeaponPowerUp*>(powerUp)->process(&this->getWeaponManager()); 262 260 } 263 261 else if(powerUp->isA(CL_PARAM_POWER_UP)) { … … 305 303 void Playable::tick(float dt) 306 304 { 307 this->weaponMan ->tick(dt);305 this->weaponMan.tick(dt); 308 306 if (this->bFire) 309 weaponMan ->fire();307 weaponMan.fire(); 310 308 } 311 309 -
trunk/src/world_entities/playable.h
r7173 r7337 41 41 void previousWeaponConfig(); 42 42 43 inline WeaponManager * getWeaponManager() const{ return this->weaponMan; };43 inline WeaponManager& getWeaponManager() { return this->weaponMan; }; 44 44 void weaponConfigChanged(); 45 45 … … 65 65 66 66 67 virtual void setAbsDirPlay(const Quaternion& rot) = 0; 68 void setAbsDirPlay(float angle, float dirX, float dirY, float dirZ) { this->setAbsDirPlay(Quaternion(angle, Vector(dirX, dirY, dirZ))); } 67 // 68 virtual void setStartDirection(const Quaternion& rot) = 0; 69 void setStartDirection(float angle, float dirX, float dirY, float dirZ) { this->setStartDirection(Quaternion(angle, Vector(dirX, dirY, dirZ))); } 69 70 70 71 inline void setScore( int score ) { this->score = score; } … … 81 82 82 83 private: 83 WeaponManager *weaponMan; //!< the weapon manager: managing a list of weapon to wepaon-slot mapping84 WeaponManager weaponMan; //!< the weapon manager: managing a list of weapon to wepaon-slot mapping 84 85 std::list<int> events; //!< A list of Events, that are captured for this playable 85 86 -
trunk/src/world_entities/player.cc
r6998 r7337 76 76 this->playable = playable; 77 77 this->hud.setEnergyWidget(this->playable->getHealthWidget()); 78 this->hud.setWeaponManager( this->playable->getWeaponManager());78 this->hud.setWeaponManager(&this->playable->getWeaponManager()); 79 79 80 80 this->playable->setPlayer(this); -
trunk/src/world_entities/space_ships/helicopter.cc
r7221 r7337 94 94 this->addWeapon(cannon, 0, 6); 95 95 96 this->getWeaponManager() ->changeWeaponConfig(1);97 dynamic_cast<Element2D*>(this->getWeaponManager() ->getFixedTarget())->setVisibility( false);96 this->getWeaponManager().changeWeaponConfig(1); 97 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false); 98 98 } 99 99 … … 161 161 registerEvent(EV_MOUSE_MOTION); 162 162 163 this->getWeaponManager() ->setSlotCount(7);164 165 this->getWeaponManager() ->setSlotPosition(0, Vector(0.0, .1, -1.0));166 this->getWeaponManager() ->setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);167 168 this->getWeaponManager() ->setSlotPosition(1, Vector(0.0, .1, 1.0));169 this->getWeaponManager() ->setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);170 171 this->getWeaponManager() ->setSlotPosition(2, Vector(-1.5, .5, -.5));172 this->getWeaponManager() ->setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));173 174 this->getWeaponManager() ->setSlotPosition(3, Vector(-1.5, .5, .5));175 this->getWeaponManager() ->setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));176 177 this->getWeaponManager() ->setSlotPosition(4, Vector(-1.5, -.5, .5));178 this->getWeaponManager() ->setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));179 180 this->getWeaponManager() ->setSlotPosition(5, Vector(-1.5, -.5, -.5));181 this->getWeaponManager() ->setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));182 183 this->getWeaponManager() ->setSlotPosition(6, Vector(-1, 0.0, 0));184 this->getWeaponManager() ->setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);185 186 this->getWeaponManager() ->getFixedTarget()->setParent(&(this->cameraNode));187 this->getWeaponManager() ->getFixedTarget()->setRelCoor(0,0,0);188 189 dynamic_cast<Element2D*>(this->getWeaponManager() ->getFixedTarget())->setVisibility( false);163 this->getWeaponManager().setSlotCount(7); 164 165 this->getWeaponManager().setSlotPosition(0, Vector(0.0, .1, -1.0)); 166 this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 167 168 this->getWeaponManager().setSlotPosition(1, Vector(0.0, .1, 1.0)); 169 this->getWeaponManager().setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 170 171 this->getWeaponManager().setSlotPosition(2, Vector(-1.5, .5, -.5)); 172 this->getWeaponManager().setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0))); 173 174 this->getWeaponManager().setSlotPosition(3, Vector(-1.5, .5, .5)); 175 this->getWeaponManager().setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0))); 176 177 this->getWeaponManager().setSlotPosition(4, Vector(-1.5, -.5, .5)); 178 this->getWeaponManager().setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0))); 179 180 this->getWeaponManager().setSlotPosition(5, Vector(-1.5, -.5, -.5)); 181 this->getWeaponManager().setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0))); 182 183 this->getWeaponManager().setSlotPosition(6, Vector(-1, 0.0, 0)); 184 this->getWeaponManager().setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 185 186 this->getWeaponManager().getFixedTarget()->setParent(&(this->cameraNode)); 187 this->getWeaponManager().getFixedTarget()->setRelCoor(0,0,0); 188 189 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false); 190 190 191 191 } … … 202 202 void Helicopter::enter() 203 203 { 204 dynamic_cast<Element2D*>(this->getWeaponManager() ->getFixedTarget())->setVisibility( true);205 State::getCameraNode()->setParentSoft(this->getWeaponManager() ->getFixedTarget());206 State::getCameraTargetNode()->setParentSoft(this->getWeaponManager() ->getFixedTarget());204 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( true); 205 State::getCameraNode()->setParentSoft(this->getWeaponManager().getFixedTarget()); 206 State::getCameraTargetNode()->setParentSoft(this->getWeaponManager().getFixedTarget()); 207 207 } 208 208 209 209 void Helicopter::leave() 210 210 { 211 dynamic_cast<Element2D*>(this->getWeaponManager() ->getFixedTarget())->setVisibility( false);211 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false); 212 212 this->detachCamera(); 213 213 -
trunk/src/world_entities/space_ships/helicopter.h
r7221 r7337 22 22 23 23 virtual void loadParams(const TiXmlElement* root); 24 virtual void set AbsDirPlay(const Quaternion& rot){/* FIXME */};24 virtual void setStartDirection(const Quaternion& rot){/* FIXME */}; 25 25 26 26 virtual void enter(); -
trunk/src/world_entities/space_ships/hover.cc
r7327 r7337 86 86 this->addWeapon(cannon, 0, 2); 87 87 88 this->getWeaponManager() ->changeWeaponConfig(1);89 dynamic_cast<Element2D*>(this->getWeaponManager() ->getFixedTarget())->setVisibility( false);88 this->getWeaponManager().changeWeaponConfig(1); 89 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false); 90 90 91 91 this->loadModel("models/ships/hoverglider_mainbody.obj"); … … 138 138 this->rotorNodeRight.setRelCoor(0, 1.0, 2.3); 139 139 140 dynamic_cast<Element2D*>(this->getWeaponManager() ->getFixedTarget())->setVisibility( false);140 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false); 141 141 142 142 … … 155 155 156 156 // WEAPON_MANAGER configuration 157 this->getWeaponManager() ->setSlotCount(5);158 159 this->getWeaponManager() ->setSlotPosition(0, Vector(-0.28, 1.186, -2.750), &this->wingNodeLeft);160 this->getWeaponManager() ->setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);161 162 this->getWeaponManager() ->setSlotPosition(1, Vector(-0.28, 1.186, 2.750), &this->wingNodeRight);163 this->getWeaponManager() ->setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);164 165 this->getWeaponManager() ->setSlotPosition(2, Vector(-1.63, .809, -.003));166 this->getWeaponManager() ->setSlotCapability(2, WTYPE_HEAVY);157 this->getWeaponManager().setSlotCount(5); 158 159 this->getWeaponManager().setSlotPosition(0, Vector(-0.28, 1.186, -2.750), &this->wingNodeLeft); 160 this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 161 162 this->getWeaponManager().setSlotPosition(1, Vector(-0.28, 1.186, 2.750), &this->wingNodeRight); 163 this->getWeaponManager().setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 164 165 this->getWeaponManager().setSlotPosition(2, Vector(-1.63, .809, -.003)); 166 this->getWeaponManager().setSlotCapability(2, WTYPE_HEAVY); 167 167 168 168 /// TODO: THESE ARE TOO MUCH 169 this->getWeaponManager() ->setSlotPosition(3, Vector(-1.63, .678, -.652));170 this->getWeaponManager() ->setSlotDirection(3, Quaternion(-24/180 * M_PI, Vector(1,0,0)));171 172 this->getWeaponManager() ->setSlotPosition(4, Vector(-1.63, .678, .652));173 this->getWeaponManager() ->setSlotDirection(4, Quaternion(24/180 * M_PI, Vector(1,0,0)));169 this->getWeaponManager().setSlotPosition(3, Vector(-1.63, .678, -.652)); 170 this->getWeaponManager().setSlotDirection(3, Quaternion(-24/180 * M_PI, Vector(1,0,0))); 171 172 this->getWeaponManager().setSlotPosition(4, Vector(-1.63, .678, .652)); 173 this->getWeaponManager().setSlotDirection(4, Quaternion(24/180 * M_PI, Vector(1,0,0))); 174 174 175 175 this->cameraNode.setRelCoor(1,5,0); 176 this->getWeaponManager() ->getFixedTarget()->setParent(&this->cameraNode);177 this->getWeaponManager() ->getFixedTarget()->setRelCoor(1000,0,0);176 this->getWeaponManager().getFixedTarget()->setParent(&this->cameraNode); 177 this->getWeaponManager().getFixedTarget()->setRelCoor(1000,0,0); 178 178 } 179 179 … … 190 190 void Hover::enter() 191 191 { 192 dynamic_cast<Element2D*>(this->getWeaponManager() ->getFixedTarget())->setVisibility( true);192 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( true); 193 193 194 194 State::getCameraNode()->setParentSoft(&this->cameraNode); … … 199 199 void Hover::leave() 200 200 { 201 dynamic_cast<Element2D*>(this->getWeaponManager() ->getFixedTarget())->setVisibility( false);201 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false); 202 202 this->detachCamera(); 203 203 -
trunk/src/world_entities/space_ships/hover.h
r7221 r7337 19 19 20 20 virtual void loadParams(const TiXmlElement* root); 21 virtual void set AbsDirPlay(const Quaternion& rot) {/* FIXME */};21 virtual void setStartDirection(const Quaternion& rot) {/* FIXME */}; 22 22 23 23 virtual void enter(); -
trunk/src/world_entities/space_ships/space_ship.cc
r7221 r7337 136 136 //this->addWeapon(cannon, 0, 6); 137 137 138 this->getWeaponManager() ->changeWeaponConfig(1);138 this->getWeaponManager().changeWeaponConfig(1); 139 139 140 140 bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false; … … 183 183 registerEvent(EV_MOUSE_MOTION); 184 184 185 this->getWeaponManager() ->setSlotCount(7);186 187 this->getWeaponManager() ->setSlotPosition(0, Vector(-2.6, .1, -3.0));188 this->getWeaponManager() ->setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);189 190 this->getWeaponManager() ->setSlotPosition(1, Vector(-2.6, .1, 3.0));191 this->getWeaponManager() ->setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);192 193 this->getWeaponManager() ->setSlotPosition(2, Vector(-1.5, .5, -.5));194 this->getWeaponManager() ->setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));195 196 this->getWeaponManager() ->setSlotPosition(3, Vector(-1.5, .5, .5));197 this->getWeaponManager() ->setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));198 199 this->getWeaponManager() ->setSlotPosition(4, Vector(-1.5, -.5, .5));200 this->getWeaponManager() ->setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));201 202 this->getWeaponManager() ->setSlotPosition(5, Vector(-1.5, -.5, -.5));203 this->getWeaponManager() ->setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));185 this->getWeaponManager().setSlotCount(7); 186 187 this->getWeaponManager().setSlotPosition(0, Vector(-2.6, .1, -3.0)); 188 this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 189 190 this->getWeaponManager().setSlotPosition(1, Vector(-2.6, .1, 3.0)); 191 this->getWeaponManager().setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 192 193 this->getWeaponManager().setSlotPosition(2, Vector(-1.5, .5, -.5)); 194 this->getWeaponManager().setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0))); 195 196 this->getWeaponManager().setSlotPosition(3, Vector(-1.5, .5, .5)); 197 this->getWeaponManager().setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0))); 198 199 this->getWeaponManager().setSlotPosition(4, Vector(-1.5, -.5, .5)); 200 this->getWeaponManager().setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0))); 201 202 this->getWeaponManager().setSlotPosition(5, Vector(-1.5, -.5, -.5)); 203 this->getWeaponManager().setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0))); 204 204 // 205 this->getWeaponManager() ->setSlotPosition(6, Vector(-1, 0.0, 0));206 this->getWeaponManager() ->setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);205 this->getWeaponManager().setSlotPosition(6, Vector(-1, 0.0, 0)); 206 this->getWeaponManager().setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 207 207 // 208 // this->getWeaponManager() ->setSlotPosition(8, Vector(-2.5, -0.3, -2.0));209 // this->getWeaponManager() ->setSlotDirection(8, Quaternion(-M_PI, Vector(1,0,0)));208 // this->getWeaponManager().setSlotPosition(8, Vector(-2.5, -0.3, -2.0)); 209 // this->getWeaponManager().setSlotDirection(8, Quaternion(-M_PI, Vector(1,0,0))); 210 210 // 211 // this->getWeaponManager() ->setSlotPosition(9, Vector(-2.5, -0.3, 2.0));212 // this->getWeaponManager() ->setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));:213 214 this->getWeaponManager() ->getFixedTarget()->setParent(this);215 this->getWeaponManager() ->getFixedTarget()->setRelCoor(100000,0,0);216 217 dynamic_cast<Element2D*>(this->getWeaponManager() ->getFixedTarget())->setVisibility( false);211 // this->getWeaponManager().setSlotPosition(9, Vector(-2.5, -0.3, 2.0)); 212 // this->getWeaponManager().setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));: 213 214 this->getWeaponManager().getFixedTarget()->setParent(this); 215 this->getWeaponManager().getFixedTarget()->setRelCoor(100000,0,0); 216 217 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false); 218 218 219 219 this->burstEmitter = new DotEmitter(200, 0.0, .01); … … 248 248 } 249 249 250 void SpaceShip::set AbsDirPlay(const Quaternion& quat)250 void SpaceShip::setStartDirection(const Quaternion& quat) 251 251 { 252 252 this->mouseDir = quat; … … 267 267 void SpaceShip::enter() 268 268 { 269 dynamic_cast<Element2D*>(this->getWeaponManager() ->getFixedTarget())->setVisibility( true);269 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( true); 270 270 this->attachCamera(); 271 271 } … … 273 273 void SpaceShip::leave() 274 274 { 275 dynamic_cast<Element2D*>(this->getWeaponManager() ->getFixedTarget())->setVisibility( false);275 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false); 276 276 this->detachCamera(); 277 277 } … … 320 320 { 321 321 WorldEntity::draw(); 322 this->getWeaponManager()->draw();323 322 324 323 //this->debug(0); -
trunk/src/world_entities/space_ships/space_ship.h
r7221 r7337 27 27 virtual void loadParams(const TiXmlElement* root); 28 28 29 virtual void set AbsDirPlay(const Quaternion& rot);29 virtual void setStartDirection(const Quaternion& rot); 30 30 31 31 virtual void enter(); -
trunk/src/world_entities/space_ships/turbine_hover.cc
r7326 r7337 88 88 //this->addWeapon(cannon, 0, 2); 89 89 90 this->getWeaponManager() ->changeWeaponConfig(1);91 dynamic_cast<Element2D*>(this->getWeaponManager() ->getFixedTarget())->setVisibility( false);90 this->getWeaponManager().changeWeaponConfig(1); 91 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false); 92 92 93 93 this->loadModel("models/ships/hoverglider_mainbody.obj"); … … 186 186 registerEvent(EV_MOUSE_MOTION); 187 187 188 dynamic_cast<Element2D*>(this->getWeaponManager() ->getFixedTarget())->setVisibility( false);188 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false); 189 189 190 190 // WEAPON_MANAGER configuration 191 this->getWeaponManager() ->setSlotCount(5);192 193 this->getWeaponManager() ->setSlotPosition(0, Vector(-0.28, 1.186, -2.750), &this->wingNodeLeft);194 this->getWeaponManager() ->setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);195 196 this->getWeaponManager() ->setSlotPosition(1, Vector(-0.28, 1.186, 2.750), &this->wingNodeRight);197 this->getWeaponManager() ->setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);198 199 this->getWeaponManager() ->setSlotPosition(2, Vector(-1.63, .809, -.003));200 this->getWeaponManager() ->setSlotCapability(2, WTYPE_HEAVY);191 this->getWeaponManager().setSlotCount(5); 192 193 this->getWeaponManager().setSlotPosition(0, Vector(-0.28, 1.186, -2.750), &this->wingNodeLeft); 194 this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 195 196 this->getWeaponManager().setSlotPosition(1, Vector(-0.28, 1.186, 2.750), &this->wingNodeRight); 197 this->getWeaponManager().setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 198 199 this->getWeaponManager().setSlotPosition(2, Vector(-1.63, .809, -.003)); 200 this->getWeaponManager().setSlotCapability(2, WTYPE_HEAVY); 201 201 202 202 /// TODO: THESE ARE TOO MUCH 203 this->getWeaponManager() ->setSlotPosition(3, Vector(-1.63, .678, -.652));204 this->getWeaponManager() ->setSlotDirection(3, Quaternion(-24/180 * M_PI, Vector(1,0,0)));205 206 this->getWeaponManager() ->setSlotPosition(4, Vector(-1.63, .678, .652));207 this->getWeaponManager() ->setSlotDirection(4, Quaternion(24/180 * M_PI, Vector(1,0,0)));203 this->getWeaponManager().setSlotPosition(3, Vector(-1.63, .678, -.652)); 204 this->getWeaponManager().setSlotDirection(3, Quaternion(-24/180 * M_PI, Vector(1,0,0))); 205 206 this->getWeaponManager().setSlotPosition(4, Vector(-1.63, .678, .652)); 207 this->getWeaponManager().setSlotDirection(4, Quaternion(24/180 * M_PI, Vector(1,0,0))); 208 208 209 209 this->cameraNode.setRelCoor(1,5,0); 210 this->getWeaponManager() ->getFixedTarget()->setParent(&this->cameraNode);211 this->getWeaponManager() ->getFixedTarget()->setRelCoor(1000,0,0);210 this->getWeaponManager().getFixedTarget()->setParent(&this->cameraNode); 211 this->getWeaponManager().getFixedTarget()->setRelCoor(1000,0,0); 212 212 } 213 213 … … 224 224 void TurbineHover::enter() 225 225 { 226 dynamic_cast<Element2D*>(this->getWeaponManager() ->getFixedTarget())->setVisibility( true);226 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( true); 227 227 228 228 if (State::getCameraNode != NULL) … … 236 236 void TurbineHover::leave() 237 237 { 238 dynamic_cast<Element2D*>(this->getWeaponManager() ->getFixedTarget())->setVisibility( false);238 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false); 239 239 this->detachCamera(); 240 240 -
trunk/src/world_entities/space_ships/turbine_hover.h
r7221 r7337 23 23 24 24 virtual void loadParams(const TiXmlElement* root); 25 virtual void set AbsDirPlay(const Quaternion& rot) {/* FIXME */};25 virtual void setStartDirection(const Quaternion& rot) {/* FIXME */}; 26 26 virtual void enter(); 27 27 virtual void leave();
Note: See TracChangeset
for help on using the changeset viewer.