Changeset 6803 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Jan 28, 2006, 11:14:40 AM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/environments/water.cc
r6780 r6803 185 185 if (State::getSkyBox()) 186 186 { 187 glBindTexture(GL_TEXTURE_2D, State::getSkyBox()->getTexture(SKY_ TOP));187 glBindTexture(GL_TEXTURE_2D, State::getSkyBox()->getTexture(SKY_RIGHT)); 188 188 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 189 189 … … 199 199 //Shader::deactivateShader(); 200 200 201 SkyBox::disableCubeMap(); 201 //SkyBox::disableCubeMap(); 202 glDisable(GL_TEXTURE_GEN_S); 203 glDisable(GL_TEXTURE_GEN_T); 204 202 205 glPopMatrix(); 203 206 } -
trunk/src/world_entities/space_ships/hover.cc
r6801 r6803 34 34 35 35 CREATE_FACTORY(Hover, CL_HOVER); 36 37 /**38 * creates the controlable Hover39 */40 Hover::Hover()41 {42 this->init();43 }44 36 45 37 /** … … 91 83 this->addWeapon(wpLeft, 1, 0); 92 84 this->addWeapon(wpRight,1 ,1); 93 this->addWeapon(cannon, 0, 6); 94 95 //this->addWeapon(turret, 3, 0); 85 this->addWeapon(cannon, 0, 2); 96 86 97 87 this->getWeaponManager()->changeWeaponConfig(1); … … 134 124 135 125 // rotors 136 this->wingNodeLeft.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT); 126 this->wingNodeLeft.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT ); 127 this->wingNodeLeft.addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE); 137 128 this->wingNodeLeft.setParent(this); 138 129 this->wingNodeLeft.setRelCoor(-1.5, -.3, -1.0); … … 142 133 143 134 this->wingNodeRight.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT); 135 this->wingNodeRight.addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE); 144 136 this->wingNodeRight.setParent(this); 145 137 this->wingNodeRight.setRelCoor(-1.5, -0.3, 1.0); … … 148 140 this->rotorNodeRight.setRelCoor(0, 1.0, 2.3); 149 141 142 dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false); 143 150 144 this->loadModel("models/ships/hoverglider_wing.obj", 1.0f, 3); 151 145 this->loadModel("models/ships/hoverglider_rotor.obj", 1.0f, 4); … … 155 149 this->velocity = Vector(0.0,0.0,0.0); 156 150 this->velocityDir = Vector(1.0,0.0,0.0); 157 // GLGuiButton* button = new GLGuiPushButton();158 // button->show();159 // button->setLabel("orxonox");160 // button->setBindNode(this);161 151 162 152 //add events to the eventlist … … 175 165 registerEvent(EV_MOUSE_MOTION); 176 166 177 this->getWeaponManager()->setSlotCount(7); 178 179 this->getWeaponManager()->setSlotPosition(0, Vector(-2.6, .1, -3.0)); 167 168 // WEAPON_MANAGER configuration 169 this->getWeaponManager()->setSlotCount(5); 170 171 this->getWeaponManager()->setSlotPosition(0, Vector(-0.28, 1.186, -2.750), &this->wingNodeLeft); 180 172 this->getWeaponManager()->setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 181 173 182 this->getWeaponManager()->setSlotPosition(1, Vector(- 2.6, .1, 3.0));174 this->getWeaponManager()->setSlotPosition(1, Vector(-0.28, 1.186, 2.750), &this->wingNodeRight); 183 175 this->getWeaponManager()->setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 184 176 185 this->getWeaponManager()->setSlotPosition(2, Vector(-1.5, .5, -.5)); 186 this->getWeaponManager()->setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0))); 187 188 this->getWeaponManager()->setSlotPosition(3, Vector(-1.5, .5, .5)); 189 this->getWeaponManager()->setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0))); 190 191 this->getWeaponManager()->setSlotPosition(4, Vector(-1.5, -.5, .5)); 192 this->getWeaponManager()->setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0))); 193 194 this->getWeaponManager()->setSlotPosition(5, Vector(-1.5, -.5, -.5)); 195 this->getWeaponManager()->setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0))); 196 // 197 this->getWeaponManager()->setSlotPosition(6, Vector(-1, 0.0, 0)); 198 this->getWeaponManager()->setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 199 // 200 // this->getWeaponManager()->setSlotPosition(8, Vector(-2.5, -0.3, -2.0)); 201 // this->getWeaponManager()->setSlotDirection(8, Quaternion(-M_PI, Vector(1,0,0))); 202 // 203 // this->getWeaponManager()->setSlotPosition(9, Vector(-2.5, -0.3, 2.0)); 204 // this->getWeaponManager()->setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));: 177 this->getWeaponManager()->setSlotPosition(2, Vector(-1.63, .809, -.003)); 178 this->getWeaponManager()->setSlotCapability(2, WTYPE_HEAVY); 179 180 /// TODO: THESE ARE TOO MUCH 181 this->getWeaponManager()->setSlotPosition(3, Vector(-1.63, .678, -.652)); 182 this->getWeaponManager()->setSlotDirection(3, Quaternion(-24/180 * M_PI, Vector(1,0,0))); 183 184 this->getWeaponManager()->setSlotPosition(4, Vector(-1.63, .678, .652)); 185 this->getWeaponManager()->setSlotDirection(4, Quaternion(24/180 * M_PI, Vector(1,0,0))); 205 186 206 187 this->getWeaponManager()->getFixedTarget()->setParent(&(this->cameraNode)); 207 this->getWeaponManager()->getFixedTarget()->setRelCoor(0,0,0);208 209 dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);210 211 188 } 212 189 … … 222 199 void Hover::attachCamera() 223 200 { 224 State::getCamera()->setParentSoft( this->getWeaponManager()->getFixedTarget());201 State::getCamera()->setParentSoft(&this->cameraNode); 225 202 State::getCameraTarget()->setParentSoft(this->getWeaponManager()->getFixedTarget()); 226 203 … … 285 262 } 286 263 287 // rotorrotation288 // this->topRotor.shiftDir(Quaternion(time*10, Vector(0,1,0)));289 // this->tailRotor.shiftDir(Quaternion(time*10, Vector(0,1,0)));290 291 264 // spaceship controlled movement 292 265 this->calculateVelocity(time); … … 296 269 // this is the air friction (necessary for a smooth control) 297 270 if(velocity.len() != 0) velocity -= velocity*0.1; 298 299 //travelSpeed = velocity.len();300 301 //physics: Gravity302 /*this->shiftCoor(Vector(0,-1,0));303 304 this->shiftCoor(getAbsDirY()*rotorspeed);305 */306 307 /*308 //hoover effect309 cycle += time;310 this->shiftCoor(Vector(0,1,0)*cos(this->cycle*2.0)*0.02);311 */312 313 //readjust314 // if (this->getAbsDirZ().y > 0.1) this->shiftDir(Quaternion(time*0.3, Vector(1,0,0)));315 //else if (this->getAbsDirZ().y < -0.1) this->shiftDir(Quaternion(-time*0.3, Vector(1,0,0)));316 317 //SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2);318 319 271 this->shiftCoor (move); 320 //this->shiftDir(Quaternion(-M_PI/4*tailrotorspeed, Vector(0,1,0)));321 272 322 273 this->getWeaponManager()->tick(time); -
trunk/src/world_entities/space_ships/hover.h
r6800 r6803 14 14 public: 15 15 16 Hover();17 16 Hover(const char* fileName); 18 Hover(const TiXmlElement* root );17 Hover(const TiXmlElement* root = NULL); 19 18 virtual ~Hover(); 20 19 21 void init();22 20 virtual void loadParams(const TiXmlElement* root); 23 21 … … 34 32 35 33 virtual void process(const Event &event); 34 35 private: 36 void init(); 36 37 37 38 private: -
trunk/src/world_entities/space_ships/space_ship.cc
r6764 r6803 132 132 133 133 this->getWeaponManager()->changeWeaponConfig(1); 134 135 EventHandler::getInstance()->grabEvents(true);136 134 137 135 bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false; … … 143 141 controlVelocityX = 25; 144 142 controlVelocityY = 150; 145 shipInertia = 1.5 143 shipInertia = 1.5; 146 144 // cycle = 0.0; 147 145 -
trunk/src/world_entities/weapons/cannon.cc
r6799 r6803 74 74 // this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN); 75 75 76 this->loadModel("models/guns/plasmadriver_#.obj" );76 this->loadModel("models/guns/plasmadriver_#.obj", 2.0); 77 77 78 78 this->setStateDuration(WS_SHOOTING, 2.0); … … 88 88 this->setActionSound(WA_ACTIVATE, "sound/voices/cannon.wav"); 89 89 90 this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL );90 this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_HEAVY); 91 91 this->setProjectileType(CL_BOMB); 92 92 this->prepareProjectiles(5); -
trunk/src/world_entities/weapons/weapon.h
r6756 r6803 60 60 WTYPE_DIRECTIONAL = 0x00000001, //!< Weapon is directional/Slot is able to carry directional weapons 61 61 WTYPE_TURRET = 0x00000002, //!< Weapon is a turret/slot is able to carry turrets 62 WTYPE_LIGHT = 0x00000004, //!< For light Armament. 63 WTYPE_HEAVY = 0x00000008, //!< The heavy Armament (Cannons). 62 64 WTYPE_ALLKINDS = 0x0000000f, //!< Weapon is all types/Slot is able to carry all kinds of weapons 63 65 -
trunk/src/world_entities/weapons/weapon_manager.cc
r6778 r6803 185 185 * @param position the position of the given slot 186 186 */ 187 void WeaponManager::setSlotPosition(int slot, const Vector& position )187 void WeaponManager::setSlotPosition(int slot, const Vector& position, PNode* parent) 188 188 { 189 189 if (slot < this->slotCount) 190 { 190 191 this->currentSlotConfig[slot].position.setRelCoor(position); 192 193 if (parent != NULL) 194 this->currentSlotConfig[slot].position.setParent(parent); 195 } 191 196 } 192 197 -
trunk/src/world_entities/weapons/weapon_manager.h
r6679 r6803 62 62 unsigned int getSlotCount() const { return this->slotCount; }; 63 63 // setting up the WeaponManager with the following functions 64 void setSlotPosition(int slot, const Vector& position );64 void setSlotPosition(int slot, const Vector& position, PNode* parent = NULL); 65 65 void setSlotDirection(int slot, const Quaternion& rotation); 66 66 /** @param slot the slot to get the relative position from @returns the relative position of the Carrier to the Slot */
Note: See TracChangeset
for help on using the changeset viewer.