Changeset 7337 in orxonox.OLD for trunk/src/world_entities/space_ships
- Timestamp:
- Apr 19, 2006, 12:24:20 AM (19 years ago)
- Location:
- trunk/src/world_entities/space_ships
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
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.