- Timestamp:
- Aug 7, 2005, 10:32:23 AM (19 years ago)
- Location:
- orxonox/trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/orxonox.kdevelop
r4909 r4972 7 7 <projectmanagement>KDevCustomProject</projectmanagement> 8 8 <primarylanguage>C++</primarylanguage> 9 <ignoreparts> 10 <part>CvsService</part> 11 </ignoreparts> 9 <ignoreparts/> 12 10 <projectdirectory>.</projectdirectory> 13 11 <absoluteprojectpath>false</absoluteprojectpath> 14 <description />12 <description></description> 15 13 <secondaryLanguages> 16 14 <language>C</language> 17 15 </secondaryLanguages> 16 <versioncontrol></versioncontrol> 18 17 </general> 19 18 <kdevcustomproject> … … 22 21 <directoryradio>build</directoryradio> 23 22 <customdirectory>/</customdirectory> 24 <programargs />23 <programargs></programargs> 25 24 <terminal>false</terminal> 26 25 <autocompile>true</autocompile> … … 29 28 <build> 30 29 <buildtool>make</buildtool> 31 <builddir />30 <builddir></builddir> 32 31 </build> 33 32 <make> 34 33 <abortonerror>false</abortonerror> 35 <numberofjobs> 1</numberofjobs>34 <numberofjobs>3</numberofjobs> 36 35 <prio>0</prio> 37 36 <dontact>false</dontact> 38 <makebin />39 <makeoptions />37 <makebin></makebin> 38 <makeoptions></makeoptions> 40 39 <selectedenvironment>default</selectedenvironment> 41 40 <environments> 42 41 <default/> 43 42 </environments> 43 <defaulttarget></defaulttarget> 44 44 </make> 45 45 </kdevcustomproject> 46 46 <kdevdebugger> 47 47 <general> 48 <dbgshell />49 <programargs />50 <gdbpath />51 <configGdbScript />52 <runShellScript />53 <runGdbScript />48 <dbgshell></dbgshell> 49 <programargs></programargs> 50 <gdbpath></gdbpath> 51 <configGdbScript></configGdbScript> 52 <runShellScript></runShellScript> 53 <runGdbScript></runGdbScript> 54 54 <breakonloadinglibs>true</breakonloadinglibs> 55 55 <separatetty>false</separatetty> … … 130 130 <headerCompletionDelay>250</headerCompletionDelay> 131 131 </codecompletion> 132 <creategettersetter> 133 <prefixGet></prefixGet> 134 <prefixSet>set</prefixSet> 135 <prefixVariable>m_,_</prefixVariable> 136 <parameterName>theValue</parameterName> 137 <inlineGet>true</inlineGet> 138 <inlineSet>true</inlineSet> 139 </creategettersetter> 132 140 </kdevcppsupport> 133 141 <kdevfileview> … … 149 157 <kdevdocumentation> 150 158 <projectdoc> 151 <docsystem />152 <docurl />153 <usermanualurl />159 <docsystem></docsystem> 160 <docurl></docurl> 161 <usermanualurl></usermanualurl> 154 162 </projectdoc> 155 163 </kdevdocumentation> 164 <ctagspart> 165 <customArguments></customArguments> 166 <customTagfilePath></customTagfilePath> 167 </ctagspart> 156 168 </kdevelop> -
orxonox/trunk/src/util/loading/load_param.h
r4860 r4972 73 73 #define l_BOOL_FUNC isBool //!< The function to call to parse BOOL 74 74 #define l_BOOL_NAME "bool" //!< The name of an BOOL 75 #define l_BOOL_DEFAULT 0//!< a default Value for an BOOL75 #define l_BOOL_DEFAULT false //!< a default Value for an BOOL 76 76 77 77 … … 79 79 #define l_INT_FUNC isInt //!< The function to call to parse INT 80 80 #define l_INT_NAME "int" //!< The name of an INT 81 #define l_INT_DEFAULT true //!< a default Value for an INT 81 #define l_INT_DEFAULT 0 //!< a default Value for an INT 82 83 #define l_UINT_TYPE unsigned int //!< The type of an UINT 84 #define l_UINT_FUNC isInt //!< The function to call to parse UINT 85 #define l_UINT_NAME "unsigned int" //!< The name of an UINT 86 #define l_UINT_DEFAULT 0 //!< a default Value for an UINT 82 87 83 88 #define l_LONG_TYPE long //!< The type of a LONG … … 372 377 LoadParam4(l_INT, l_INT, l_INT, l_INT); 373 378 379 380 //! makes functions with one unsigned int loadable 381 LoadParam1(l_UINT); 382 //! makes functions with two unsigned ints loadable 383 LoadParam2(l_UINT, l_UINT); 384 //! makes functions with three unsigned ints loadable 385 LoadParam3(l_UINT, l_UINT, l_UINT); 386 //! makes functions with four unsigned ints loadable 387 LoadParam4(l_UINT, l_UINT, l_UINT, l_UINT); 388 374 389 //! makes functions with one float loadable 375 390 LoadParam1(l_FLOAT); … … 382 397 //! makes functions with four floats loadable 383 398 LoadParam5(l_FLOAT, l_FLOAT, l_FLOAT, l_FLOAT, l_FLOAT); 399 400 //! mixed values: 401 LoadParam2(l_STRING, l_FLOAT); 384 402 385 403 //! makes functions with one Vector loadable -
orxonox/trunk/src/world_entities/weapons/projectile.h
r4948 r4972 66 66 Vector velocity; //!< velocity of the projectile. 67 67 68 ParticleEmitter* emitter; //!< For special effects each Projectile consists ofan emitter.68 ParticleEmitter* emitter; //!< For special effects each Projectile has an emitter. 69 69 }; 70 70 -
orxonox/trunk/src/world_entities/weapons/test_gun.cc
r4966 r4972 39 39 using namespace std; 40 40 41 CREATE_FACTORY(TestGun); 41 42 42 43 /** … … 48 49 : Weapon(weaponManager) 49 50 { 50 this->setClassID(CL_TEST_GUN, "TestGun");51 52 this->model = (Model*)ResourceManager::getInstance()->load("models/test_gun.obj", OBJ, RP_CAMPAIGN);53 51 this->leftRight = leftRight; 54 52 … … 63 61 animation2->setInfinity(ANIM_INF_CONSTANT); 64 62 animation3->setInfinity(ANIM_INF_CONSTANT); 63 65 64 if( this->leftRight == W_LEFT) 66 67 68 69 70 71 72 73 74 75 76 77 78 65 { 66 this->setEmissionPoint(1.0, 0.0, -0.35); 67 68 animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 69 animation1->addKeyFrame(Vector(-0.4, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 70 animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_CONSTANT); 71 72 animation2->addKeyFrame(Vector(0.0, 0.0, -1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 73 animation2->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 74 75 animation3->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 76 animation3->addKeyFrame(Vector(0.0, 0.0, -1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 77 } 79 78 else if( this->leftRight == W_RIGHT) 80 { 81 this->setEmissionPoint(1.0, 0.0, 0.5); 82 83 this->objectComponent1->setRelCoor(Vector(0,0,0.35)); 84 animation1->addKeyFrame(Vector(0, 0, .5), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 85 animation1->addKeyFrame(Vector(-0.4, 0, .5), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 86 animation1->addKeyFrame(Vector(0, 0, .5), Quaternion(), 0.0, ANIM_LINEAR, ANIM_CONSTANT); 87 88 animation2->addKeyFrame(Vector(.0, .0, 1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 89 animation2->addKeyFrame(Vector(.0, .0, .0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 90 91 animation3->addKeyFrame(Vector(.0, .0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 92 animation3->addKeyFrame(Vector(.0, .0, 1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 93 } 94 /* 95 this->fireSound = (SoundBuffer*)ResourceManager::getInstance()->load("sound/shot1.wav", WAV); 96 this->weaponSource = new SoundSource(this->fireSound, this); 97 this->weaponSource->setRolloffFactor(.1);*/ 98 Projectile* p = new TestBullet(); 99 100 // ObjectManager::getInstance()->cache(CL_TEST_BULLET, 100, p); 101 //ObjectManager::getInstance()->debug(); 79 { 80 this->setEmissionPoint(1.0, 0.0, 0.5); 81 82 this->objectComponent1->setRelCoor(Vector(0,0,0.35)); 83 animation1->addKeyFrame(Vector(0, 0, .5), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 84 animation1->addKeyFrame(Vector(-0.4, 0, .5), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 85 animation1->addKeyFrame(Vector(0, 0, .5), Quaternion(), 0.0, ANIM_LINEAR, ANIM_CONSTANT); 86 87 animation2->addKeyFrame(Vector(.0, .0, 1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 88 animation2->addKeyFrame(Vector(.0, .0, .0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 89 90 animation3->addKeyFrame(Vector(.0, .0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 91 animation3->addKeyFrame(Vector(.0, .0, 1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 92 } 93 } 94 95 96 TestGun::TestGun(const TiXmlElement* root) 97 { 98 this->init(); 99 this->loadParams(root); 100 } 101 102 /** 103 * standard deconstructor 104 */ 105 TestGun::~TestGun () 106 { 107 // model will be deleted from WorldEntity-destructor 108 } 109 110 111 void TestGun::init() 112 { 113 this->setClassID(CL_TEST_GUN, "TestGun"); 114 115 this->model = (Model*)ResourceManager::getInstance()->load("models/test_gun.obj", OBJ, RP_CAMPAIGN); 102 116 103 117 this->setStateDuration(WS_SHOOTING, .4); … … 117 131 118 132 119 /** 120 * standard deconstructor 121 */ 122 TestGun::~TestGun () 123 { 124 // model will be deleted from WorldEntity-destructor 133 void TestGun::loadParams(const TiXmlElement* root) 134 { 135 136 125 137 } 126 138 -
orxonox/trunk/src/world_entities/weapons/test_gun.h
r4959 r4972 39 39 public: 40 40 TestGun (WeaponManager* weaponManager, int leftRight); 41 TestGun (const TiXmlElement* root); 41 42 virtual ~TestGun (); 43 44 void init(); 45 void loadParams(const TiXmlElement* root); 42 46 43 47 virtual void activate(); -
orxonox/trunk/src/world_entities/weapons/weapon.cc
r4967 r4972 96 96 } 97 97 98 void Weapon::loadParams(const TiXmlElement* root) 99 { 100 static_cast<WorldEntity*>(this)->loadParams(root); 101 102 LoadParam<Weapon>(root, "projectile", this, &Weapon::setProjectile) 103 .describe("Sets the name of the Projectile to load onto the Entity"); 104 105 LoadParam<Weapon>(root, "emission-point", this, &Weapon::setEmissionPoint) 106 .describe("Sets the Point of emission of this weapon"); 107 108 LoadParam<Weapon>(root, "state-duration", this, &Weapon::setStateDuration) 109 .describe("Sets the duration of a given state (1: state-Name; 2: duration in seconds)"); 110 111 LoadParam<Weapon>(root, "action-sound", this, &Weapon::setActionSound) 112 .describe("Sets a given sound to an action (1: action-Name; 2: name of the sound (relative to the Data-Path))"); 113 } 114 98 115 /** 99 116 * sets the Projectile to use for this weapon. … … 103 120 * be aware, that this function does not create Factories, as this is job of Bullet-classes. 104 121 */ 105 boolWeapon::setProjectile(ClassID projectile)122 void Weapon::setProjectile(ClassID projectile) 106 123 { 107 124 if (projectile == CL_NULL) 108 return false;125 return; 109 126 this->projectile = projectile; 110 127 this->projectileFactory = FastFactory::searchFastFactory(projectile); 111 128 if (this->projectileFactory == NULL) 112 return false;129 return; 113 130 else 114 131 { … … 125 142 * @see bool Weapon::setProjectile(ClassID projectile) 126 143 * @param projectile the Name of the Projectile. 127 * @return true if 128 */ 129 bool Weapon::setProjectile(const char* projectile) 144 */ 145 void Weapon::setProjectile(const char* projectile) 130 146 { 131 147 if (projectile == NULL) 132 return false;148 return; 133 149 FastFactory* tmpFac = FastFactory::searchFastFactory(projectile); 134 150 if (tmpFac != NULL) 135 151 { 136 152 this->setProjectile(tmpFac->getStoredID()); 153 } 154 else 155 { 156 PRINTF(2)("Projectile %s does not exist for weapon %s\n", projectile, this->getName()); 137 157 } 138 158 } -
orxonox/trunk/src/world_entities/weapons/weapon.h
r4959 r4972 77 77 // INITIALISATION // 78 78 Weapon (WeaponManager* weaponManager = NULL); 79 Weapon(const TiXmlElement* root);80 79 virtual ~Weapon (); 81 80 … … 89 88 /////////////////// 90 89 91 /** @param weaponManager sets the WeaponManager for this Weapon (NULL if free)) */90 /** @param weaponManager sets the WeaponManager for this Weapon (NULL if free)) */ 92 91 inline void setWeaponManager(WeaponManager* weaponManager) { this->weaponManager = weaponManager; }; 93 92 /** @returns the WeaponManager of this Weapon (or NULL if it is free) */ … … 102 101 103 102 // FUNCTIONS TO SET THE WEAPONS PROPERTIES. 104 boolsetProjectile(ClassID projectile);105 boolsetProjectile(const char* projectile);103 void setProjectile(ClassID projectile); 104 void setProjectile(const char* projectile); 106 105 /** @returns The projectile's classID */ 107 106 inline ClassID getProjectile() { return this->projectile; }; … … 112 111 void setEmissionPoint(const Vector& point); 113 112 /** @see void setEmissionPoint(const Vector& point); */ 114 inline void setEmissionPoint(float x, float y, float z) { this->setEmissionPoint(Vector(x, y,z)); };113 inline void setEmissionPoint(float x, float y, float z) { this->setEmissionPoint(Vector(x, y, z)); }; 115 114 /** @returns the absolute Position of the EmissionPoint */ 116 115 inline const Vector& getEmissionPoint() const { return this->emissionPoint.getAbsCoor(); }; -
orxonox/trunk/src/world_entities/weapons/weapon_manager.cc
r4969 r4972 103 103 { 104 104 static_cast<BaseObject*>(this)->loadParams(root); 105 /* 105 106 106 LoadParam<WeaponManager>(root, "slot-count", this, &WeaponManager::setSlotCount) 107 107 .describe("how many slots(cannons) the WeaponManager can handle"); … … 109 109 LOAD_PARAM_START_CYCLE; 110 110 111 LoadParam<WeaponManager>( root, "Weapons", this, &WeaponManager::loadWeapons)111 LoadParam<WeaponManager>(element, "weapons", this, &WeaponManager::loadWeapons) 112 112 .describe("loads Weapons"); 113 113 // LoadParam<WeaponManager>(root, "Weapon", this, &WeaponManager::addWeapon); 114 114 115 LOAD_PARAM_END_CYCLE; */115 LOAD_PARAM_END_CYCLE; 116 116 } 117 117 … … 141 141 this->parent->addChild(&this->currentSlotConfig[i].position); 142 142 } 143 144 143 } 145 144 … … 156 155 } 157 156 157 158 /** 159 * sets the position of the Slot relative to the parent 160 * @param slot the slot to set-up 161 * @param position the position of the given slot 162 */ 158 163 void WeaponManager::setSlotPosition(int slot, const Vector& position) 159 164 { … … 162 167 } 163 168 169 170 /** 171 * sets the relative rotation of the slot to its parent 172 * @param slot the slot to set-up 173 * @param rotation the relative rotation of the given slot 174 */ 164 175 void WeaponManager::setSlotDirection(int slot, const Quaternion& rotation) 165 176 { … … 171 182 /** 172 183 * adds a weapon to the selected weaponconfiguration into the selected slot 173 * @param the weapon to add174 * @param an identifier for the slot: number between 0..7 if not specified: slotID=next free slot175 * @param an identifier for the weapon configuration, number between 0..3184 * @param weapon the weapon to add 185 * @param configID an identifier for the slot: number between 0..7 if not specified: slotID=next free slot 186 * @param slotID an identifier for the weapon configuration, number between 0..3 176 187 * 177 188 * if you add explicitly a weapon at config:n, slot:m, the weapon placed at this location will be -
orxonox/trunk/src/world_entities/weapons/weapon_manager.h
r4969 r4972 41 41 * How to configure 42 42 * 1. set the default values. 43 * 2. define weapons. connect them to the WeaponManager's configurations 43 * 2. define weapons. connect them to the WeaponManager's configurations (have a look at "player.cc", to see how it works) 44 44 * 3. go on and run :).... 45 45 */ … … 78 78 79 79 /** @returns a fixed target namely the Crosshair's 3D position */ 80 inline PNode* getFixedTarget() { return this->crosshair; } 80 inline PNode* getFixedTarget() { return this->crosshair; }; 81 81 void fire(); 82 82
Note: See TracChangeset
for help on using the changeset viewer.