Changeset 10600 in orxonox.OLD for branches/cleanup/src/world_entities
- Timestamp:
- Mar 5, 2007, 11:37:52 AM (18 years ago)
- Location:
- branches/cleanup/src/world_entities
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cleanup/src/world_entities/elements/glgui_energywidgetvertical.cc
r10516 r10600 66 66 this->_image->setBackgroundTexture(Texture()); 67 67 this->_image->setBackgroundColor(Color(1,1,1,0)); 68 this->_image->loadImageFromFile("textures/evil-flower.png");68 // this->_image->loadImageFromFile("textures/evil-flower.png"); 69 69 //this->_image.setRelCoor2D(borderLeft(), borderTop() + this->_bar.getSizeX2D()); 70 70 this->_image->setRelCoor2D(0,0); -
branches/cleanup/src/world_entities/projectiles/hbolt.cc
r10545 r10600 49 49 50 50 this->angle = 0; 51 this->rotationSpeed = 600;51 // this->rotationSpeed = 600; 52 52 53 53 this->emitter = new DotEmitter(100, 5, M_2_PI); … … 146 146 this->deactivate(); 147 147 148 this->angle += this->rotationSpeed * dt;148 this->angle += HBolt::rotationSpeed * dt; 149 149 150 150 for( ObjectList<NPC>::const_iterator eIterator = NPC::objectList().begin(); eIterator !=NPC::objectList().end(); eIterator++) … … 177 177 glPushAttrib(GL_ENABLE_BIT); 178 178 glDisable(GL_LIGHTING); 179 glDisable(GL_FOG);179 // glDisable(GL_FOG); 180 180 181 181 glMatrixMode(GL_MODELVIEW); 182 182 glPushMatrix(); 183 183 184 185 glTranslatef (this->getAbsCoor ().x, 186 this->getAbsCoor ().y, 187 this->getAbsCoor ().z); 188 189 this->halo->draw(); 190 191 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 192 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 193 glRotatef(this->angle, 0.0, 0.0, 1.0); 194 195 this->getModel()->draw(); 184 // float matrix[4][4]; 185 glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); 186 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 187 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 188 glRotatef(this->angle, 0.0, 0.0, 1.0); 189 // glMultMatrixf((float*)matrix); 190 this->getModel()->draw(); 191 this->halo->draw(); 196 192 197 193 glPopMatrix(); -
branches/cleanup/src/world_entities/projectiles/hbolt.h
r10368 r10600 42 42 43 43 float angle; 44 float rotationSpeed;44 static const float rotationSpeed = 600; 45 45 46 46 Billboard* halo; -
branches/cleanup/src/world_entities/projectiles/lbolt.cc
r10545 r10600 59 59 60 60 this->angle = 0; 61 this->rotationSpeed = 130;62 61 63 62 this->halo = new Billboard(); … … 148 147 this->deactivate(); 149 148 150 angle += rotationSpeed * dt;149 angle += LBolt::rotationSpeed * dt; 151 150 152 151 for( ObjectList<NPC>::const_iterator eIterator = NPC::objectList().begin(); eIterator !=NPC::objectList().end(); eIterator++) … … 182 181 glPushMatrix(); 183 182 184 float matrix[4][4]; 185 glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); 183 float matrix[4][4]; 184 glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); 185 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 186 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 187 glRotatef(this->angle, 1.0, 0.0, 0.0); 188 this->getAbsDir().matrix (matrix); 189 glMultMatrixf((float*)matrix); 190 this->getModel()->draw(); 186 191 187 glRotatef(angle, 1.0, 0.0, 0.0); 188 this->getAbsDir().matrix (matrix); 189 glMultMatrixf((float*)matrix); 190 this->getModel()->draw(); 191 192 this->halo->draw(); 192 this->halo->draw(); 193 193 194 194 glPopMatrix(); 195 196 195 glPopAttrib(); 197 196 } -
branches/cleanup/src/world_entities/projectiles/lbolt.h
r10368 r10600 43 43 44 44 float angle; 45 float rotationSpeed;45 static const float rotationSpeed = 1080; 46 46 47 47 Billboard* halo; -
branches/cleanup/src/world_entities/weapons/acid_launcher.cc
r10579 r10600 37 37 using namespace std; 38 38 39 ObjectListDefinition (AcidLauncher);40 CREATE_FACTORY (AcidLauncher);39 ObjectListDefinition ( AcidLauncher ); 40 CREATE_FACTORY ( AcidLauncher ); 41 41 42 42 /** … … 46 46 */ 47 47 AcidLauncher::AcidLauncher() 48 : Weapon()48 : Weapon() 49 49 { 50 50 this->init(); … … 54 54 * creates a new AcidLauncher from a TiXmlElement 55 55 */ 56 AcidLauncher::AcidLauncher (const TiXmlElement* root)56 AcidLauncher::AcidLauncher ( const TiXmlElement* root ) 57 57 { 58 58 this->init(); 59 if ( root != NULL)60 this->loadParams (root);59 if ( root != NULL ) 60 this->loadParams ( root ); 61 61 } 62 62 … … 71 71 void AcidLauncher::init() 72 72 { 73 this->registerObject (this, AcidLauncher::_objectList);74 /*75 Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);76 Animation3D* animation2 = this->getAnimation(WS_DEACTIVATING, this);73 this->registerObject ( this, AcidLauncher::_objectList ); 74 /* 75 Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this); 76 Animation3D* animation2 = this->getAnimation(WS_DEACTIVATING, this); 77 77 78 animation1->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);79 animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);80 animation2->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);81 animation2->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);78 animation1->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 79 animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 80 animation2->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 81 animation2->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 82 82 83 animation1->setInfinity(ANIM_INF_CONSTANT);84 animation2->setInfinity(ANIM_INF_CONSTANT);85 */86 this->setStateDuration (WS_SHOOTING, 1.0f);83 animation1->setInfinity(ANIM_INF_CONSTANT); 84 animation2->setInfinity(ANIM_INF_CONSTANT); 85 */ 86 this->setStateDuration ( WS_SHOOTING, 1.0f ); 87 87 88 this->setStateDuration (WS_RELOADING, 1.0f);89 this->setStateDuration (WS_ACTIVATING, .4);90 this->setStateDuration (WS_DEACTIVATING, .4);88 this->setStateDuration ( WS_RELOADING, 1.0f ); 89 this->setStateDuration ( WS_ACTIVATING, .4 ); 90 this->setStateDuration ( WS_DEACTIVATING, .4 ); 91 91 92 this->setEnergyMax (100);93 this->increaseEnergy (100);92 this->setEnergyMax ( 100 ); 93 this->increaseEnergy ( 100 ); 94 94 //this->minCharge = 2; 95 95 96 this->setCapability (WTYPE_ALLDIRS | WTYPE_TURRET | WTYPE_DIRECTIONAL | WTYPE_LIGHT);97 this->setProjectileTypeC ("AcidSplash");96 this->setCapability ( WTYPE_ALLDIRS | WTYPE_TURRET | WTYPE_DIRECTIONAL | WTYPE_LIGHT ); 97 this->setProjectileTypeC ( "AcidSplash" ); 98 98 // this->loadModel("models/guns/turret1.obj", 1.0); 99 99 100 this->setEmissionPoint (2.0, 0, 0);101 this->getProjectileFactory()->prepare (10);100 this->setEmissionPoint ( 2.0, 0, 0 ); 101 this->getProjectileFactory()->prepare ( 10 ); 102 102 103 this->setActionSound (WA_SHOOT, "sounds/explosions/explosion_1.wav");104 this->setActionSound (WA_ACTIVATE, "sounds/voices/rockets.wav");103 this->setActionSound ( WA_SHOOT, "sounds/explosions/explosion_1.wav" ); 104 this->setActionSound ( WA_ACTIVATE, "sounds/voices/rockets.wav" ); 105 105 // this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav"); 106 106 107 107 } 108 108 109 void AcidLauncher::loadParams (const TiXmlElement* root)109 void AcidLauncher::loadParams ( const TiXmlElement* root ) 110 110 { 111 Weapon::loadParams (root);111 Weapon::loadParams ( root ); 112 112 } 113 113 114 114 void AcidLauncher::activate() 115 { 116 } 115 {} 117 116 118 117 void AcidLauncher::deactivate() 118 {} 119 120 void AcidLauncher::tick ( float dt ) 119 121 { 120 } 121 122 void AcidLauncher::tick(float dt) 123 { 124 if (!Weapon::tickW(dt)) 122 if ( !Weapon::tickW ( dt ) ) 125 123 return; 126 if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized) 127 { 128 this->energyWidget->setDisplayedImage("textures/gui/gui_acid.png"); 124 if ( this->energyWidget != NULL && !this->isEnergyWidgetInitialized ) { 125 this->energyWidget->setDisplayedImage ( "textures/gui/gui_acid.png" ); 129 126 this->isEnergyWidgetInitialized = true; 130 127 } … … 155 152 156 153 Projectile* pj = NULL; 157 for( int i=0; i < 1; i++) 158 { 159 pj = this->getProjectile(); 160 if (pj == NULL) 161 return; 154 for ( int i=0; i < 1; i++ ) { 155 pj = this->getProjectile(); 156 if ( pj == NULL ) 157 return; 162 158 163 164 pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*165.0 + VECTOR_RAND(10)));159 fired = true; 160 pj->setVelocity ( this->getVelocity() + ( this->getAbsDir().apply ( Vector ( 1,0,0 ) ) *165.0 + VECTOR_RAND ( 10 ) ) ); 165 161 166 pj->setParent(PNode::getNullParent());167 pj->setAbsCoor(this->getEmissionPoint() + VECTOR_RAND(.1));168 pj->setAbsDir(this->getAbsDir()+Quaternion(0,VECTOR_RAND(5)));169 162 pj->setParent ( PNode::getNullParent() ); 163 pj->setAbsCoor ( this->getEmissionPoint() + VECTOR_RAND ( .1 ) ); 164 pj->setAbsDir ( this->getAbsDir() +Quaternion ( 0,VECTOR_RAND ( 5 ) ) ); 165 pj->activate(); 170 166 } 171 167 } -
branches/cleanup/src/world_entities/weapons/acid_launcher.h
r10368 r10600 12 12 13 13 class AcidLauncher : public Weapon 14 15 ObjectListDeclaration(AcidLauncher);14 { 15 ObjectListDeclaration ( AcidLauncher ); 16 16 public: 17 17 AcidLauncher (); 18 AcidLauncher (const TiXmlElement* root);18 AcidLauncher ( const TiXmlElement* root ); 19 19 virtual ~AcidLauncher (); 20 20 21 21 void init(); 22 virtual void loadParams (const TiXmlElement* root);22 virtual void loadParams ( const TiXmlElement* root ); 23 23 24 24 virtual void activate(); 25 25 virtual void deactivate(); 26 26 27 virtual void tick (float dt);27 virtual void tick ( float dt ); 28 28 virtual void fire(); 29 29 30 30 31 31 private: 32 32 }; 33 33 34 34 #endif /* _ACID_LAUNCHER_H */ -
branches/cleanup/src/world_entities/weapons/light_blaster.cc
r10579 r10600 98 98 this->objComp = new PNode**[this->getBarrels()]; 99 99 this->emissionPoint = new PNode*[this->getBarrels()]; 100 this->shootAnim = new Animation3D**[this->getBarrels()];100 // this->shootAnim = new Animation3D**[this->getBarrels()]; 101 101 for (int i = 0; i < this->getBarrels(); i++) 102 102 { 103 103 this->objComp[i] = new PNode* [this->getSegs()]; 104 104 this->emissionPoint[i] = new PNode; 105 this->emissionPoint[i]->setParent(this); //< One EmissionPoint, that is a PNode connected to the weapon. You can set this to the exitting point of the Projectiles105 this->emissionPoint[i]->setParent(this); 106 106 this->emissionPoint[i]->setName("EmissionPoint"); 107 107 this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT); 108 this->shootAnim[i] = new Animation3D* [this->getSegs()];108 // this->shootAnim[i] = new Animation3D* [this->getSegs()]; 109 109 for(int j = 0; j < this->getSegs(); j++) 110 110 { 111 111 this->objComp[i][j] = new PNode; 112 this->shootAnim[i][j] = new Animation3D(this->objComp[i][j]);113 this->shootAnim[i][j]->setInfinity(ANIM_INF_CONSTANT);112 // this->shootAnim[i][j] = new Animation3D(this->objComp[i][j]); 113 // this->shootAnim[i][j]->setInfinity(ANIM_INF_CONSTANT); 114 114 } 115 115 } 116 117 for (int i = 0; i < this->getBarrels(); i++ ) 118 this->emissionPoint[i]->setRelCoor(Vector(1.19, 0.0, 0.1)); 116 /* 117 this->emissionPoint[0]->setRelCoor(Vector(1.19, 0.0, 0.1)); 118 this->emissionPoint[1]->setRelCoor(Vector(1.19, -0.07, -0.05)); 119 this->emissionPoint[2]->setRelCoor(Vector(1.19, 0.07, -0.05));*/ 120 121 this->emissionPoint[0]->setRelCoor(Vector(2.2, 0.0, 0.1)); 122 this->emissionPoint[1]->setRelCoor(Vector(2.2, -0.07, -0.05)); 123 this->emissionPoint[2]->setRelCoor(Vector(2.2, 0.07, -0.05)); 119 124 120 125 // Animation3D* animation1 = this->getAnimation(WS_SHOOTING, this); … … 128 133 // this->setEmissionPoint(3.8, 1.2, 0); 129 134 130 for (int i = 0; i < this->getBarrels(); i++){131 this->shootAnim[i][0]->addKeyFrame(Vector(), Quaternion(i * 120, Vector(1.0, 0.0, 0.0)), 0.049, ANIM_NULL, ANIM_LINEAR);132 this->shootAnim[i][0]->addKeyFrame(Vector(), Quaternion((i+1)*120, Vector(1.0, 0.0, 0.0)), 0.001, ANIM_NULL, ANIM_LINEAR);133 }135 // for (int i = 0; i < this->getBarrels(); i++){ 136 // this->shootAnim[i][0]->addKeyFrame(Vector(), Quaternion(i * 120, Vector(1.0, 0.0, 0.0)), 0.049, ANIM_NULL, ANIM_LINEAR); 137 // this->shootAnim[i][0]->addKeyFrame(Vector(), Quaternion((i+1)*120, Vector(1.0, 0.0, 0.0)), 0.001, ANIM_NULL, ANIM_LINEAR); 138 // } 134 139 135 140 … … 160 165 pj->activate(); 161 166 162 for (int i = 0; i < this->getSegs(); i++)163 this->shootAnim[this->activeBarrel][i]->replay();167 // for (int i = 0; i < this->getSegs(); i++) 168 // this->shootAnim[this->activeBarrel][i]->replay(); 164 169 165 170 // switch barrel
Note: See TracChangeset
for help on using the changeset viewer.