[Orxonox-commit 4836] r9505 - in code/branches/presentationHS12: data/levels data/levels/includes data/levels/templates src/modules/weapons/weaponmodes
jo at orxonox.net
jo at orxonox.net
Mon Dec 10 16:51:44 CET 2012
Author: jo
Date: 2012-12-10 16:51:44 +0100 (Mon, 10 Dec 2012)
New Revision: 9505
Modified:
code/branches/presentationHS12/data/levels/gallery.oxw
code/branches/presentationHS12/data/levels/includes/weaponSettingsEscort.oxi
code/branches/presentationHS12/data/levels/templates/lodInformation.oxt
code/branches/presentationHS12/src/modules/weapons/weaponmodes/HsW01.cc
code/branches/presentationHS12/src/modules/weapons/weaponmodes/HsW01.h
Log:
Enabling more variable projectile behaviour for HSW01
Modified: code/branches/presentationHS12/data/levels/gallery.oxw
===================================================================
--- code/branches/presentationHS12/data/levels/gallery.oxw 2012-12-10 14:43:37 UTC (rev 9504)
+++ code/branches/presentationHS12/data/levels/gallery.oxw 2012-12-10 15:51:44 UTC (rev 9505)
@@ -67,7 +67,7 @@
<!--Model position="0,0,-40" yaw="90" pitch="-90" roll="0" scale="1" mesh="stunweapon.mesh" /-->
<Model position="0,20,-40" yaw="90" pitch="-90" roll="0" scale="2" mesh="LightningGun.mesh" />
<Model position="0,40,-40" yaw="90" pitch="-90" roll="0" scale="2" mesh="LightningGun-s.mesh" />
- <Model position="0,60,-40" yaw="90" pitch="-90" roll="0" scale="1.5" mesh="laserbeam.mesh" />
+ <Model position="0,60,-40" yaw="90" pitch="-90" roll="0" scale="1.5" mesh="LaserBeam.mesh" />
<Model position="0,80,-40" yaw="90" pitch="-90" roll="0" scale="2" mesh="rocket.mesh" />
<Model position="0,-20,-40" yaw="90" pitch="-90" roll="0" scale="5" mesh="hs-w01.mesh" />
<Model position="0,-40,-40" yaw="90" pitch="-90" roll="0" scale="5" mesh="hs-w01s.mesh" />
Modified: code/branches/presentationHS12/data/levels/includes/weaponSettingsEscort.oxi
===================================================================
--- code/branches/presentationHS12/data/levels/includes/weaponSettingsEscort.oxi 2012-12-10 14:43:37 UTC (rev 9504)
+++ code/branches/presentationHS12/data/levels/includes/weaponSettingsEscort.oxi 2012-12-10 15:51:44 UTC (rev 9505)
@@ -18,8 +18,8 @@
<Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,0" />
<Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-76" yaw="-90" position="-1.5,1,0.3" scale=0.6 /-->
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+ <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" projectileMesh="LaserBeam.mesh" />
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" projectileMesh="LaserBeam.mesh" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
</Weapon>
<Weapon>
@@ -28,8 +28,8 @@
<Model mesh="LightningGun-s.mesh" pitch="103" roll="90" yaw="90" position="0.2,-1.35,0" />
<Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-104" yaw="-90" position="0,1.3,0.3" scale=0.6 /-->
</attached>
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" projectileMesh="LaserBeam.mesh" />
+ <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" projectileMesh="LaserBeam.mesh" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
</Weapon>
</WeaponPack>
Modified: code/branches/presentationHS12/data/levels/templates/lodInformation.oxt
===================================================================
--- code/branches/presentationHS12/data/levels/templates/lodInformation.oxt 2012-12-10 14:43:37 UTC (rev 9504)
+++ code/branches/presentationHS12/data/levels/templates/lodInformation.oxt 2012-12-10 15:51:44 UTC (rev 9505)
@@ -15,6 +15,7 @@
<MeshLodInformation mesh=CuboidLandingZone.mesh enabled=false/>
<MeshLodInformation mesh=HydroHarvester.mesh enabled=false />
<MeshLodInformation mesh=turretHead.mesh enabled=false />
+ <MeshLodInformation mesh=LaserBeam.mesh enabled=false/>
<!-- disable LOD for some debris meshes which caused a crash (fixed in Ogre 1.7.3) -->
<MeshLodInformation mesh=BodyDebris1.mesh enabled=false/>
Modified: code/branches/presentationHS12/src/modules/weapons/weaponmodes/HsW01.cc
===================================================================
--- code/branches/presentationHS12/src/modules/weapons/weaponmodes/HsW01.cc 2012-12-10 14:43:37 UTC (rev 9504)
+++ code/branches/presentationHS12/src/modules/weapons/weaponmodes/HsW01.cc 2012-12-10 15:51:44 UTC (rev 9505)
@@ -60,11 +60,14 @@
this->speed_ = 2500.0f;
this->delay_ = 0.0f;
this->setMunitionName("LaserMunition");
+ this->mesh_ = "laserbeam.mesh";
+ this->sound_ = "sounds/Weapon_HsW01.ogg";
+
this->delayTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&HsW01::shot, this)));
this->delayTimer_.stopTimer();
- this->setDefaultSound("sounds/Weapon_HsW01.ogg");
+ this->setDefaultSound(this->sound_);
}
HsW01::~HsW01()
@@ -77,6 +80,8 @@
XMLPortParam(HsW01, "delay", setDelay, getDelay, xmlelement, mode);
XMLPortParam(HsW01, "material", setMaterial, getMaterial, xmlelement, mode);
+ XMLPortParam(HsW01, "projectileMesh", setMesh, getMesh, xmlelement, mode);
+ XMLPortParam(HsW01, "sound", setSound, getSound, xmlelement, mode);
}
/**
@@ -107,7 +112,7 @@
// Create the projectile.
Projectile* projectile = new Projectile(this);
Model* model = new Model(projectile);
- model->setMeshSource("laserbeam.mesh");
+ model->setMeshSource(mesh_);
model->setCastShadows(false);
projectile->attach(model);
model->setScale(5);
Modified: code/branches/presentationHS12/src/modules/weapons/weaponmodes/HsW01.h
===================================================================
--- code/branches/presentationHS12/src/modules/weapons/weaponmodes/HsW01.h 2012-12-10 14:43:37 UTC (rev 9504)
+++ code/branches/presentationHS12/src/modules/weapons/weaponmodes/HsW01.h 2012-12-10 15:51:44 UTC (rev 9505)
@@ -60,6 +60,34 @@
private:
/**
+ @brief Set the mesh.
+ @param mesh The mesh name.
+ */
+ void setMesh(const std::string& mesh)
+ { this->mesh_ = mesh; }
+
+ /**
+ @brief Get the mesh.
+ @return Returns the mesh name.
+ */
+ const std::string& getMesh() const
+ { return this->mesh_; }
+
+ /**
+ @brief Set the sound.
+ @param mesh The Sound name.
+ */
+ void setSound(const std::string& sound)
+ { this->sound_ = sound; }
+
+ /**
+ @brief Get the sound.
+ @return Returns the sound name.
+ */
+ const std::string& getSound() const
+ { return this->sound_; }
+
+ /**
@brief Set the material.
@param material The material name.
*/
@@ -84,6 +112,11 @@
void muzzleflash();
std::string material_; //!< The material.
+ std::string mesh_; //!< The mesh.
+ std::string sound_; //!< The sound.
+
+
+
float speed_; //!< The speed of the fired projectile.
float delay_; //!< The firing delay.
Timer delayTimer_; //!< A timer to delay the firing.
More information about the Orxonox-commit
mailing list