[Orxonox-commit 4820] r9489 - in code/branches/turret: data/levels data/levels/includes data/levels/templates src/modules/objects
moralelastix at orxonox.net
moralelastix at orxonox.net
Mon Dec 3 17:46:12 CET 2012
Author: moralelastix
Date: 2012-12-03 17:46:12 +0100 (Mon, 03 Dec 2012)
New Revision: 9489
Added:
code/branches/turret/data/levels/includes/weaponSettingsTurret.oxi
code/branches/turret/data/levels/templates/spaceshipTurret.oxt
Modified:
code/branches/turret/data/levels/templates/lodInformation.oxt
code/branches/turret/data/levels/turretTest.oxw
code/branches/turret/src/modules/objects/Turret.cc
code/branches/turret/src/modules/objects/Turret.h
Log:
What ever
Added: code/branches/turret/data/levels/includes/weaponSettingsTurret.oxi
===================================================================
--- code/branches/turret/data/levels/includes/weaponSettingsTurret.oxi (rev 0)
+++ code/branches/turret/data/levels/includes/weaponSettingsTurret.oxi 2012-12-03 16:46:12 UTC (rev 9489)
@@ -0,0 +1,22 @@
+ <weaponslots>
+ <WeaponSlot position="0,0,0" />
+ </weaponslots>
+ <weaponsets>
+ <WeaponSet firemode=0 />
+ </weaponsets>
+ <weapons>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
+ </links>
+ <Weapon>
+ <attached>
+ <Model mesh="sphere.mesh" position="3,3,-2.2" scale=0.6 />
+ </attached>
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 3, 3,-2.2" />
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 3,-3,-2.2" />
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-3, 3,-2.2" />
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-3,-3,-2.2" />
+ </Weapon>
+ </WeaponPack>
+ </weapons>
Modified: code/branches/turret/data/levels/templates/lodInformation.oxt
===================================================================
--- code/branches/turret/data/levels/templates/lodInformation.oxt 2012-12-03 16:44:08 UTC (rev 9488)
+++ code/branches/turret/data/levels/templates/lodInformation.oxt 2012-12-03 16:46:12 UTC (rev 9489)
@@ -14,6 +14,7 @@
<MeshLodInformation mesh=SolarPanel.mesh enabled=false/>
<MeshLodInformation mesh=CuboidLandingZone.mesh enabled=false/>
<MeshLodInformation mesh=HydroHarvester.mesh enabled=false />
+ <MeshLodInformation mesh=turretHead.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/>
Added: code/branches/turret/data/levels/templates/spaceshipTurret.oxt
===================================================================
--- code/branches/turret/data/levels/templates/spaceshipTurret.oxt (rev 0)
+++ code/branches/turret/data/levels/templates/spaceshipTurret.oxt 2012-12-03 16:46:12 UTC (rev 9489)
@@ -0,0 +1,50 @@
+<Template name=spaceshipturret>
+ <SpaceShip
+ hudtemplate = spaceshiphud
+ camerapositiontemplate = spaceshipassffcameras
+ spawnparticlesource = "Orxonox/fairytwirl"
+ spawnparticleduration = 3
+ explosionchunks = 6
+
+ health = 100
+ maxhealth = 200
+ initialhealth = 100
+
+ shieldhealth = 30
+ initialshieldhealth = 30
+ maxshieldhealth = 50
+ shieldabsorption = 0.8
+ reloadrate = 1
+ reloadwaittime = 1
+
+ primaryThrust = 100
+ auxilaryThrust = 30
+ rotationThrust = 50
+
+ lift = 1;
+ stallSpeed = 220;
+
+ boostPower = 15
+ boostPowerRate = 1
+ boostRate = 5
+ boostCooldownDuration = 10
+
+ shakeFrequency = 15
+ shakeAmplitude = 9
+
+ collisionType = "dynamic"
+ mass = 100
+ linearDamping = 0.7
+ angularDamping = 0.9999999
+ >
+ <attached>
+ <Model position="0,0,0" yaw="90" roll="-90" mesh="turretHead.mesh" scale3D="10,10,10"/>
+ </attached>
+ <collisionShapes>
+ <SphereCollisionShape radius="10" position = "0,0,0"/>
+ </collisionShapes>
+<?lua
+ include("../includes/weaponSettingsTurret.oxi")
+?>
+ </SpaceShip>
+</Template>
Modified: code/branches/turret/data/levels/turretTest.oxw
===================================================================
--- code/branches/turret/data/levels/turretTest.oxw 2012-12-03 16:44:08 UTC (rev 9488)
+++ code/branches/turret/data/levels/turretTest.oxw 2012-12-03 16:46:12 UTC (rev 9489)
@@ -1,6 +1,6 @@
<LevelInfo
name = "turret Test"
- description = "A level with absolutely nothing in it."
+ description = "A level with a turret in it."
tags = "test"
screenshot = "emptylevel.png"
/>
@@ -14,6 +14,7 @@
<?lua
include("templates/spaceshipAssff.oxt")
include("templates/spaceshipPirate.oxt")
+ include("templates/spaceshipTurret.oxt")
?>
<Level>
@@ -26,12 +27,31 @@
ambientlight = "0.8, 0.8, 0.8"
skybox = "Orxonox/Starbox"
>
+ <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+ <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
+<StaticEntity position="0,0,0" yaw=0 pitch=0>
+ <attached>
+ <Model position="0,0,0" mesh="turretSocketFront.mesh" scale3D="10,10,10" />
+ <Model position="0,0,0" mesh="turretSocketIn.mesh" scale3D="10,10,10" />
+ <Model position="0,0,0" mesh="turretSocketTop.mesh" scale3D="10,10,10" />
+ <Model position="0,0,0" mesh="turretSocketLeft.mesh" scale3D="10,10,10" />
+ <Model position="0,0,0" mesh="turretSocketRight.mesh" scale3D="10,10,10" />
+ </attached>
+</StaticEntity>
- <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
- <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
+
+<SpaceShip position="0,10,0" pitch="-45" yaw="225" roll="0">
+ <templates>
+ <Template link=spaceshipturret />
+ </templates>
+ <controller>
+ <WaypointPatrolController alertnessradius=100 team=10>
+ </WaypointPatrolController>
+ </controller>
+</SpaceShip>
</Scene>
</Level>
Modified: code/branches/turret/src/modules/objects/Turret.cc
===================================================================
--- code/branches/turret/src/modules/objects/Turret.cc 2012-12-03 16:44:08 UTC (rev 9488)
+++ code/branches/turret/src/modules/objects/Turret.cc 2012-12-03 16:46:12 UTC (rev 9489)
@@ -38,7 +38,7 @@
/**
* @brief Constructor
*/
- Turret::Turret(BaseObject* creator) : Pawn(creator)
+ Turret::Turret(BaseObject* creator) : SpaceShip(creator)
{
RegisterObject(Turret);
this->controller_ = new WaypointPatrolController(this);
@@ -52,22 +52,16 @@
}
- /*void Turret::rotateYaw(const Vector2& value)
- {
- }
-
-
void Turret::rotatePitch(const Vector2& value)
{
-
+ Vector2 pitch = value;
+ float nextPitch = this->localAngularAcceleration_.x() + pitch.x*0.8f;
+ // Einschraenken auf 0 bis 180
+ this->localAngularAcceleration_.setX(nextPitch);
}
- void Turret::rotateRoll(const Vector2& value)
- {
- }*/
-
void Turret::setAlertnessRadius(float value)
{
this->controller_->setAlertnessRadius(value);
Modified: code/branches/turret/src/modules/objects/Turret.h
===================================================================
--- code/branches/turret/src/modules/objects/Turret.h 2012-12-03 16:44:08 UTC (rev 9488)
+++ code/branches/turret/src/modules/objects/Turret.h 2012-12-03 16:46:12 UTC (rev 9489)
@@ -37,24 +37,19 @@
#include "objects/ObjectsPrereqs.h"
-#include "worldentities/pawns/Pawn.h"
+#include "worldentities/pawns/SpaceShip.h"
namespace orxonox
{
- class _ObjectsExport Turret : public Pawn
+ class _ObjectsExport Turret : public SpaceShip
{
public:
Turret(BaseObject* creator);
virtual ~Turret();
//virtual void tick(float dt);
- virtual void moveFrontBack(const Vector2& value) {}
- virtual void moveRightLeft(const Vector2& value) {}
- virtual void moveUpDown(const Vector2& value) {}
- /*virtual void rotateYaw(const Vector2& value);
virtual void rotatePitch(const Vector2& value);
- virtual void rotateRoll(const Vector2& value);*/
void setAlertnessRadius(float value);
float getAlertnessRadius();
More information about the Orxonox-commit
mailing list