Changeset 5621 in orxonox.OLD for branches/world_entities
- Timestamp:
- Nov 17, 2005, 12:31:14 AM (19 years ago)
- Location:
- branches/world_entities/src
- Files:
-
- 6 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/world_entities/src/Makefile.am
r5593 r5621 63 63 world_entities/weapons/turret.cc \ 64 64 world_entities/weapons/aiming_turret.cc \ 65 world_entities/weapons/cannon.cc \ 65 66 world_entities/weapons/test_bullet.cc \ 66 67 world_entities/weapons/rocket.cc \ … … 97 98 world_entities/weapons/projectile.h \ 98 99 world_entities/weapons/test_gun.h \ 100 world_entities/weapons/cannon.h \ 99 101 world_entities/weapons/turret.h \ 100 102 world_entities/weapons/aiming_turret.h \ -
branches/world_entities/src/Makefile.in
r5597 r5621 65 65 orxonox-weapon.$(OBJEXT) orxonox-projectile.$(OBJEXT) \ 66 66 orxonox-test_gun.$(OBJEXT) orxonox-turret.$(OBJEXT) \ 67 orxonox-aiming_turret.$(OBJEXT) orxonox- test_bullet.$(OBJEXT) \68 orxonox- rocket.$(OBJEXT) orxonox-laser.$(OBJEXT) \69 orxonox- aim.$(OBJEXT) orxonox-bomb.$(OBJEXT) \70 orxonox- crosshair.$(OBJEXT) orxonox-power_up.$(OBJEXT) \71 orxonox- turret_power_up.$(OBJEXT) \67 orxonox-aiming_turret.$(OBJEXT) orxonox-cannon.$(OBJEXT) \ 68 orxonox-test_bullet.$(OBJEXT) orxonox-rocket.$(OBJEXT) \ 69 orxonox-laser.$(OBJEXT) orxonox-aim.$(OBJEXT) \ 70 orxonox-bomb.$(OBJEXT) orxonox-crosshair.$(OBJEXT) \ 71 orxonox-power_up.$(OBJEXT) orxonox-turret_power_up.$(OBJEXT) \ 72 72 orxonox-laser_power_up.$(OBJEXT) orxonox-benchmark.$(OBJEXT) 73 73 orxonox_OBJECTS = $(am_orxonox_OBJECTS) … … 259 259 world_entities/weapons/turret.cc \ 260 260 world_entities/weapons/aiming_turret.cc \ 261 world_entities/weapons/cannon.cc \ 261 262 world_entities/weapons/test_bullet.cc \ 262 263 world_entities/weapons/rocket.cc \ … … 293 294 world_entities/weapons/projectile.h \ 294 295 world_entities/weapons/test_gun.h \ 296 world_entities/weapons/cannon.h \ 295 297 world_entities/weapons/turret.h \ 296 298 world_entities/weapons/aiming_turret.h \ … … 406 408 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-camera.Po@am__quote@ 407 409 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-campaign.Po@am__quote@ 410 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-cannon.Po@am__quote@ 408 411 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-character_attributes.Po@am__quote@ 409 412 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-crosshair.Po@am__quote@ … … 754 757 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 755 758 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-aiming_turret.obj `if test -f 'world_entities/weapons/aiming_turret.cc'; then $(CYGPATH_W) 'world_entities/weapons/aiming_turret.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/weapons/aiming_turret.cc'; fi` 759 760 orxonox-cannon.o: world_entities/weapons/cannon.cc 761 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-cannon.o -MD -MP -MF "$(DEPDIR)/orxonox-cannon.Tpo" -c -o orxonox-cannon.o `test -f 'world_entities/weapons/cannon.cc' || echo '$(srcdir)/'`world_entities/weapons/cannon.cc; \ 762 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/orxonox-cannon.Tpo" "$(DEPDIR)/orxonox-cannon.Po"; else rm -f "$(DEPDIR)/orxonox-cannon.Tpo"; exit 1; fi 763 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='world_entities/weapons/cannon.cc' object='orxonox-cannon.o' libtool=no @AMDEPBACKSLASH@ 764 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 765 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-cannon.o `test -f 'world_entities/weapons/cannon.cc' || echo '$(srcdir)/'`world_entities/weapons/cannon.cc 766 767 orxonox-cannon.obj: world_entities/weapons/cannon.cc 768 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-cannon.obj -MD -MP -MF "$(DEPDIR)/orxonox-cannon.Tpo" -c -o orxonox-cannon.obj `if test -f 'world_entities/weapons/cannon.cc'; then $(CYGPATH_W) 'world_entities/weapons/cannon.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/weapons/cannon.cc'; fi`; \ 769 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/orxonox-cannon.Tpo" "$(DEPDIR)/orxonox-cannon.Po"; else rm -f "$(DEPDIR)/orxonox-cannon.Tpo"; exit 1; fi 770 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='world_entities/weapons/cannon.cc' object='orxonox-cannon.obj' libtool=no @AMDEPBACKSLASH@ 771 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 772 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-cannon.obj `if test -f 'world_entities/weapons/cannon.cc'; then $(CYGPATH_W) 'world_entities/weapons/cannon.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/weapons/cannon.cc'; fi` 756 773 757 774 orxonox-test_bullet.o: world_entities/weapons/test_bullet.cc -
branches/world_entities/src/defs/class_id.h
r5603 r5621 136 136 CL_TURRET = 0x00000231, 137 137 CL_AIMING_TURRET = 0x00000232, 138 138 CL_CANNON = 0x00000233, 139 139 140 140 CL_TEST_BULLET = 0x00000240, -
branches/world_entities/src/world_entities/npc.cc
r5499 r5621 34 34 this->setClassID(CL_NPC, "NPC"); 35 35 36 this->loadModel("models/ships/bolido.obj", 2); 36 if ((float)rand()/RAND_MAX > .5f) 37 this->loadModel("models/ships/bolido.obj", 2); 38 else 39 this->loadModel("models/ships/gobblin.obj", 2); 37 40 38 41 this->randomRotAxis = VECTOR_RAND(1); -
branches/world_entities/src/world_entities/npc2.cc
r5511 r5621 35 35 this->setClassID(CL_NPC, "NPC"); 36 36 37 this->loadModel("models/ships/bolido.obj", 3); 37 if ((float)rand()/RAND_MAX > .5f) 38 this->loadModel("models/ships/bolido.obj", 3); 39 else 40 this->loadModel("models/ships/gobblin.obj", 3); 41 38 42 this->shader = NULL; 39 43 if (likely(Shader::checkShaderAbility())) -
branches/world_entities/src/world_entities/player.cc
r5576 r5621 26 26 #include "weapons/test_gun.h" 27 27 #include "weapons/turret.h" 28 #include "weapons/cannon.h" 28 29 29 30 #include "list.h" … … 45 46 { 46 47 this->init(); 47 48 //weapons:49 Weapon* wpRight = new TestGun(this->weaponMan, 0);50 Weapon* wpLeft = new TestGun(this->weaponMan, 1);51 52 this->weaponMan->addWeapon(wpRight);53 // this->weaponMan->addWeapon(wpLeft, WM_CONFIG1, WM_SLOT1);54 // this->weaponMan->addWeapon(wpRight, WM_CONFIG2);55 // this->weaponMan->addWeapon(wpLeft, WM_CONFIG2);56 48 } 57 49 … … 91 83 Weapon* wpLeft = new TestGun(this->weaponMan, 1); 92 84 wpLeft->setName("testGun Left"); 85 Weapon* cannon = new Cannon(this->weaponMan); 86 cannon->setName("BFG"); 93 87 94 88 this->weaponMan->addWeapon(wpLeft, 1, 0); 95 89 this->weaponMan->addWeapon(wpRight,1 ,1); 90 this->weaponMan->addWeapon(cannon, 0, 6); 91 96 92 //this->weaponMan->addWeapon(turret, 3, 0); 97 93 … … 133 129 134 130 this->weaponMan = new WeaponManager(this); 135 this->weaponMan->setSlotCount( 6);131 this->weaponMan->setSlotCount(7); 136 132 137 133 this->weaponMan->setSlotPosition(0, Vector(-2.6, .1, -3.0)); … … 153 149 this->weaponMan->setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0))); 154 150 // 155 // this->weaponMan->setSlotPosition(6, Vector(-2.0, 0.1, -2.0));156 // this->weaponMan->setSlotPosition(7, Vector(-2.0, 0.1, 2.0));157 //151 this->weaponMan->setSlotPosition(6, Vector(-1, 0.0, 0)); 152 this->weaponMan->setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 153 // 158 154 // this->weaponMan->setSlotPosition(8, Vector(-2.5, -0.3, -2.0)); 159 155 // this->weaponMan->setSlotDirection(8, Quaternion(-M_PI, Vector(1,0,0))); -
branches/world_entities/src/world_entities/weapons/cannon.cc
r5619 r5621 21 21 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON 22 22 23 #include " test_gun.h"23 #include "cannon.h" 24 24 25 25 #include "world_entity.h" … … 41 41 using namespace std; 42 42 43 CREATE_FACTORY( TestGun);43 CREATE_FACTORY(Cannon); 44 44 45 45 /** … … 48 48 creates a new weapon 49 49 */ 50 TestGun::TestGun (WeaponManager* weaponManager, int leftRight)50 Cannon::Cannon (WeaponManager* weaponManager) 51 51 : Weapon(weaponManager) 52 52 { 53 53 this->init(); 54 54 55 56 this->leftRight = leftRight; 57 58 this->objectComponent1 = new PNode(); 59 Animation3D* animation1 = this->getAnimation(WS_SHOOTING, this->objectComponent1); 55 // this->objectComponent1 = new PNode(); 56 // Animation3D* animation1 = this->getAnimation(WS_SHOOTING, this->objectComponent1); 60 57 Animation3D* animation2 = this->getAnimation(WS_ACTIVATING, this); 61 58 Animation3D* animation3 = this->getAnimation(WS_DEACTIVATING, this); 62 59 //parent->addChild(this->objectComponent1, PNODE_ALL); 63 this->addChild(this->objectComponent1);64 65 animation1->setInfinity(ANIM_INF_CONSTANT);60 // this->addChild(this->objectComponent1); 61 62 // animation1->setInfinity(ANIM_INF_CONSTANT); 66 63 animation2->setInfinity(ANIM_INF_CONSTANT); 67 64 animation3->setInfinity(ANIM_INF_CONSTANT); 68 65 69 if( this->leftRight == W_LEFT) 70 { 71 this->setEmissionPoint(1.0, -0.6, -0.2); 72 73 animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL); 74 animation1->addKeyFrame(Vector(-0.4, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL); 75 animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_NULL); 76 77 animation2->addKeyFrame(Vector(0.0, 0.0, -1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 66 this->setEmissionPoint(3.8, 1.2, 0); 67 68 // animation1->addKeyFrame(Vector(0, -1.5, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL); 69 // animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL); 70 // animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_NULL); 71 72 animation2->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 78 73 animation2->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 79 74 80 75 animation3->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 81 animation3->addKeyFrame(Vector(0.0, 0.0, -1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 82 } 83 else if( this->leftRight == W_RIGHT) 84 { 85 this->setEmissionPoint(1.0, -0.6, 0.3); 86 87 this->objectComponent1->setRelCoor(Vector(0,0,0.35)); 88 animation1->addKeyFrame(Vector(0, 0, .5), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL); 89 animation1->addKeyFrame(Vector(-0.4, 0, .5), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL); 90 animation1->addKeyFrame(Vector(0, 0, .5), Quaternion(), 0.0, ANIM_LINEAR, ANIM_NULL); 91 92 animation2->addKeyFrame(Vector(.0, .0, 1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 93 animation2->addKeyFrame(Vector(.0, .0, .0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 94 95 animation3->addKeyFrame(Vector(.0, .0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 96 animation3->addKeyFrame(Vector(.0, .0, 1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 97 } 98 } 99 100 101 TestGun::TestGun(const TiXmlElement* root) 76 animation3->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 77 } 78 79 80 Cannon::Cannon(const TiXmlElement* root) 102 81 { 103 82 this->init(); … … 108 87 * standard deconstructor 109 88 */ 110 TestGun::~TestGun ()89 Cannon::~Cannon () 111 90 { 112 91 // model will be deleted from WorldEntity-destructor … … 114 93 115 94 116 void TestGun::init()117 { 118 this->setClassID(CL_ TEST_GUN, "TestGun");95 void Cannon::init() 96 { 97 this->setClassID(CL_CANNON, "Cannon"); 119 98 120 99 // this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN); 121 100 122 this->loadModel("models/guns/ test_gun.obj");101 this->loadModel("models/guns/cannon.obj"); 123 102 124 103 this->setStateDuration(WS_SHOOTING, .1); … … 140 119 141 120 142 void TestGun::loadParams(const TiXmlElement* root)121 void Cannon::loadParams(const TiXmlElement* root) 143 122 { 144 123 … … 154 133 been armed out. 155 134 */ 156 void TestGun::activate()135 void Cannon::activate() 157 136 { 158 137 } … … 166 145 been armed out. 167 146 */ 168 void TestGun::deactivate()147 void Cannon::deactivate() 169 148 { 170 149 } … … 177 156 @todo: the ObjectManager deliveres Projectiles not TestBullets! this should be diffrent 178 157 */ 179 void TestGun::fire()158 void Cannon::fire() 180 159 { 181 160 Projectile* pj = this->getProjectile(); … … 198 177 * hit, it can also be destoryed. 199 178 */ 200 void TestGun::destroy ()179 void Cannon::destroy () 201 180 {} 202 181 … … 204 183 * this will draw the weapon 205 184 */ 206 void TestGun::draw () const185 void Cannon::draw () const 207 186 { 208 187 /* draw gun body */ … … 216 195 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 217 196 218 if( this->leftRight == W_RIGHT) 219 glScalef(1.0, 1.0, -1.0); 220 this->model->draw(1); 197 this->model->draw(); 221 198 glPopMatrix(); 222 199 223 200 /* draw objectComponent1: gun coil - animated stuff */ 224 glMatrixMode(GL_MODELVIEW);201 /* glMatrixMode(GL_MODELVIEW); 225 202 glPushMatrix(); 226 203 glTranslatef (this->objectComponent1->getAbsCoor ().x, … … 230 207 glRotatef (this->objectComponent1->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 231 208 this->model->draw(0); 232 glPopMatrix(); 233 } 234 209 210 glPopMatrix();*/ 211 } 212 -
branches/world_entities/src/world_entities/weapons/cannon.h
r5619 r5621 1 1 /*! 2 @file weapon.h 3 * a weapon that a player can use 4 5 A Player has a list of weapons, that can be choosen to shoot projectiles 6 (projectiles.{cc,h}) at enemies. These weapons can be shooted sequentially 7 or (if able) combined. Therefore you can choose the weapon mode = choose 8 a weapon. 9 10 A weapon is characterized by: 11 o firing-rate: the initial firing rate of a weapon (1/s = Herz) 12 o slowdown-factor: this is a factor d: exp(-d*x), d is element of all positive R. it determines how fast the firing-rate will slow down. if no slowdown: d=0, the bigger d is, the faster the weapon will slow down! 13 o energy-consumption: this determines the energy that has to be used to produce this projectile = costs per projectile 14 15 Furthermore there are some other attributes, that will help to represent a firing 16 weapon in this world: 17 o sound file/ressource: this is a pointer to the sound-file/ressource. however it may be represented 18 o shooting animation 19 2 * @file cannon.h 3 * a weapon that is fix on top of the player to fire heavy weaponary. 20 4 */ 21 5 22 6 23 #ifndef _ TEST_GUN_H24 #define _ TEST_GUN_H7 #ifndef _CANNON_H 8 #define _CANNON_H 25 9 26 10 #include "weapon.h" 27 11 28 29 //! a weapon can be left or right sided 30 /** 31 * @todo this will be reset with mirror X/Y/Z 32 */ 33 #define W_LEFT 0 34 #define W_RIGHT 1 35 36 37 class TestGun : public Weapon 12 class Cannon : public Weapon 38 13 { 39 14 public: 40 TestGun (WeaponManager* weaponManager, int leftRight);41 TestGun (const TiXmlElement* root);42 virtual ~ TestGun ();15 Cannon (WeaponManager* weaponManager); 16 Cannon (const TiXmlElement* root); 17 virtual ~Cannon (); 43 18 44 19 void init(); … … 54 29 55 30 private: 56 PNode* objectComponent1; //<! the gun is made of multiple parts, these PNodes represent their location and orientation 57 58 int leftRight; // this will become an enum 31 // PNode* objectComponent1; //<! the gun is made of multiple parts, these PNodes represent their location and orientation 59 32 }; 60 #endif /* _ TEST_GUN_H */33 #endif /* _CANNON_H */
Note: See TracChangeset
for help on using the changeset viewer.