[Orxonox-commit 5844] r10504 - in code/branches/presentationFS15: data/levels data/levels/templates src/modules/weapons/projectiles src/modules/weapons/weaponmodes

maxima at orxonox.net maxima at orxonox.net
Thu May 28 10:41:24 CEST 2015


Author: maxima
Date: 2015-05-28 10:41:23 +0200 (Thu, 28 May 2015)
New Revision: 10504

Added:
   code/branches/presentationFS15/data/levels/templates/orbStation.oxt
Modified:
   code/branches/presentationFS15/data/levels/presentationFS15.oxw
   code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBomb.cc
   code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBomb.h
   code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBombField.cc
   code/branches/presentationFS15/src/modules/weapons/weaponmodes/GravityBombFire.cc
Log:
Bugfix: See Commit 10502. New orbStation Template.

Modified: code/branches/presentationFS15/data/levels/presentationFS15.oxw
===================================================================
--- code/branches/presentationFS15/data/levels/presentationFS15.oxw	2015-05-27 14:26:20 UTC (rev 10503)
+++ code/branches/presentationFS15/data/levels/presentationFS15.oxw	2015-05-28 08:41:23 UTC (rev 10504)
@@ -14,6 +14,7 @@
 <?lua
   include("templates/spaceshipRing.oxt")
   include("templates/spaceshipFS15.oxt")
+  include("templates/orbStation.oxt")
 
 ?>
 
@@ -29,18 +30,7 @@
   >
 
     <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="-2000,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipfs15/>
-    
-    
-    <SpaceShip position="0,500,500" lookat="0,1000,0" >
-      <attached>
-        <DistanceTriggerBeacon name="bcnDestroyer" />
-        <DockingTarget name="destroyer" />
-      </attached>
-      <templates>
-        <Template link=spaceshipring />
-      </templates>
-    </SpaceShip>
+    <SpawnPoint team=0 position="-500,0,0" lookat="-1000,0,0" spawnclass=SpaceShip pawndesign=spaceshipfs15/>
 
     <!-- Docking  -->
     <Dock position="-1000,0,0" roll=0 yaw=0 >
@@ -60,6 +50,45 @@
         </execute>
       </events>
     </Dock>
+
+    <SpaceShip position="0,0,0" lookat="0,1000,1000" >
+      <attached>
+        <DistanceTriggerBeacon name="bcnDestroyer" />
+        <DockingTarget name="destroyer" />
+      </attached>
+      <templates>
+        <Template link=spaceshipring />
+      </templates>
+      <events>
+        <visibility>
+          <EventListener event="dockMe" />
+        </visibility>
+      </events>
+    </SpaceShip>
+
+    <Billboard position="0,500,500" material="Flares/ringflare2" colour="0.8,0.4,0.2" scale=1 />
+    <DistanceTrigger position="0,500,500" distance="200" target="Pawn" name="takeControl"/>
+
+    <MovableEntity position="0,1000,1000" >
+      <templates>
+        <Template link=orbStation/>
+      </templates>
+      <events>
+        <visibility>
+          <EventListener event="dockMe" />
+        </visibility>
+      </events>
+    </MovableEntity>
+
+    <ControllerDirector position="0,0,0" scriptname="presentation">
+      <events>
+        <takeControl>
+          <EventListener event="takeControl" />
+        </takeControl>
+      </events>
+    </ControllerDirector>
+
+
   </Scene>
 </Level>
 

Copied: code/branches/presentationFS15/data/levels/templates/orbStation.oxt (from rev 10500, code/branches/formationFS15/data/levels/templates/orbStation.oxt)
===================================================================
--- code/branches/presentationFS15/data/levels/templates/orbStation.oxt	                        (rev 0)
+++ code/branches/presentationFS15/data/levels/templates/orbStation.oxt	2015-05-28 08:41:23 UTC (rev 10504)
@@ -0,0 +1,66 @@
+<Template name=orbStation>
+	<MovableEntity>
+		<attached>
+			
+
+			<MovableEntity rotationaxis = "0,1,0" rotationrate="50,0,0">
+				<attached>
+					<Model position=“0,0,0“ yaw = 0 mesh="OrbStation_Sphere.mesh" scale="40"/>
+				</attached>
+			</MovableEntity>
+
+			<MovableEntity rotationaxis = "1,1,1" rotationrate="50,0,0">
+				<attached>
+					<Model position=“0,0,0“ mesh="OrbStation_Ring_2.mesh" scale="40" />
+				</attached>
+			</MovableEntity>
+
+			<MovableEntity rotationaxis = "1,1,-1" rotationrate="50,0,0">
+				<attached>
+					 <Model position=“0,0,0“ mesh="OrbStation_Ring_3.mesh" scale="40" />
+				</attached>
+			</MovableEntity>
+
+			<MovableEntity rotationaxis = "-1,1,1" rotationrate="50,0,0">
+				<attached>
+					<Model position=“0,0,0“ mesh="OrbStation_Ring_4.mesh" scale="40" />
+				</attached>
+			</MovableEntity>
+
+			<MovableEntity rotationaxis = "-1,1,-1" rotationrate="50,0,0">
+				<attached>
+					<Model position=“0,0,0“ mesh="OrbStation_Ring_5.mesh" scale="40"/>
+				</attached>
+			</MovableEntity>
+
+			<MovableEntity rotationaxis = "0,1,0" rotationrate="1,0,0">
+				<attached>
+					
+					
+					<Model position=“0,0,0“ mesh="OrbStation_Ring_1.mesh" scale="40" />
+
+					<Model position= "180,0,0" yaw = 0 mesh="OrbStation_Platform.mesh" scale="40"/>
+					<Model position= "0,0,180" yaw = -90 mesh="OrbStation_Platform.mesh" scale="40"/>
+					<Model position= "0,0,-180" yaw = -90 mesh="OrbStation_OpenPlat.mesh" scale="40"/>
+					
+					<Model position= "-200,0,0" yaw = 90 mesh="OrbStation_Antenna.mesh" scale="40"/>					
+					<MovableEntity position= "-305,0,0" rotationaxis = "1,0,0" rotationrate="50,0,0">
+						<attached>
+							<Model position= "0,0,0" yaw = 90 mesh="OrbStation_Parabola.mesh" scale="40"/>
+						</attached>
+					</MovableEntity>
+					
+
+				</attached>
+			</MovableEntity>
+
+
+	      		<Backlight position="0,0,0" scale=10 colour="0.2, 0.4, 0.8" width=100 length=500 lifetime=0.3 elements=20 trailmaterial="Trail/backlighttrail" material="Examples/Flare" loop=1 />
+
+
+
+		</attached>
+	</MovableEntity>
+</Template>
+	
+

Modified: code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBomb.cc
===================================================================
--- code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBomb.cc	2015-05-27 14:26:20 UTC (rev 10503)
+++ code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBomb.cc	2015-05-28 08:41:23 UTC (rev 10504)
@@ -11,7 +11,7 @@
 namespace orxonox{
 	RegisterClass(GravityBomb);
 
-	const float GravityBomb::LIFETIME = 5;  ///< The gravity bomb lifetime in seconds.
+	const float GravityBomb::LIFETIME = 2.5;  ///< The gravity bomb lifetime in seconds.
 
 	GravityBomb::GravityBomb(Context* context):
 				BasicProjectile(),
@@ -21,7 +21,7 @@
 			RegisterObject(GravityBomb);
 
 			this->setMass(10.0);
-			this->isDetonated_ = false;
+			this->hasCollided_ = false;
 			if (GameMode::isMaster())
 			{
 				//Define CollisionType of the bomb
@@ -66,35 +66,26 @@
 
 	void GravityBomb::tick(float dt)
 	{
-			timeToLife_ -= dt;
-			if(timeToLife_ < 0)
-			{
-				//orxout(debug_output) << "bomb has stoped moving" <<endl;
-				setVelocity(Vector3::ZERO); //Stop the bomb.
-				isDetonated_ = true;
-			}
-			else
-			{
-				//orxout(debug_output)<< "Time to live:" << timeToLife_ <<endl;
-				destroyCheck(); //Every BasicProjectil has to call this method in each tick.
-			}
-			if(isDetonated_) detonate();
-			else SUPER(GravityBomb, tick, dt);
+		SUPER(GravityBomb, tick, dt);
+		timeToLife_ -= dt;
+		if (timeToLife_ < 0)
+		{
+			//orxout(debug_output) << "bomb has stoped moving" <<endl;
+			setVelocity(Vector3::ZERO); //Stop the bomb.
+			detonate();
+			this->destroy();
+		}
+		else 
+		{
+			if (hasCollided_) detonate();
+			destroyCheck(); //Bomb is going to be destroyed by destroyCheck(). As written in BasicProectile, this Method should be called by every Projectile.
+		}
 	}
 
 	bool GravityBomb::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint)
 	{
-		if(otherObject != getShooter()) //Ensure that the bomb cannot collide with its shooter.
-		{
-			orxout(debug_output) << "collides" << endl;
-			processCollision(otherObject, contactPoint,cs);
-			isDetonated_ = true;
-			return true;
-		}
-		else{
-			//orxout(debug_output) << "collided with shooter. Has no effect..." << endl;
-			return false;
-		}
+		hasCollided_ = processCollision(otherObject, contactPoint, cs);
+		return hasCollided_;
 	}
 
 	void GravityBomb::detonate()
@@ -105,7 +96,6 @@
 		field->setPosition(getPosition());
 		//orxout(debug_output) << "detonating. Creating GravityBombField." <<endl;
 		//orxout(debug_output) << "Field is at Position: " << getPosition() << endl;
-		this->destroy();
 	}
 }
 

Modified: code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBomb.h
===================================================================
--- code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBomb.h	2015-05-27 14:26:20 UTC (rev 10503)
+++ code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBomb.h	2015-05-28 08:41:23 UTC (rev 10504)
@@ -47,7 +47,7 @@
 		private:
 		static const float LIFETIME;
 
-		bool isDetonated_; //Used to check whether the Bomb has to be destroyed during next tick.
+		bool hasCollided_;
 		float timeToLife_; //Time the bomb flies before it explodes.
 		WorldSound* bombSound_;
 	};

Modified: code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBombField.cc
===================================================================
--- code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBombField.cc	2015-05-27 14:26:20 UTC (rev 10503)
+++ code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBombField.cc	2015-05-28 08:41:23 UTC (rev 10504)
@@ -15,7 +15,7 @@
 	
 	const float GravityBombField::FORCE_FIELD_LIFETIME = 15;
 	const float GravityBombField::FORCE_SPHERE_START_RADIUS = 250;
-	const float GravityBombField::FORCE_SPHERE_START_STRENGTH = -500;
+	const float GravityBombField::FORCE_SPHERE_START_STRENGTH = -700;
 	const float GravityBombField::PEAK_EXPLOSION_FORCE = 5e4;
 	const float GravityBombField::FORCE_FIELD_EXPLOSION_DAMMAGE = 100;
 	const float GravityBombField::EXPLOSION_DURATION = 1;
@@ -39,9 +39,9 @@
 		setCollisionResponse(false);
 
 		//Make the Field visible on Radar and minimap.
-		this->setRadarObjectColour(ColourValue(0.2, 0.2, 1.0,1)); // Blue
+		this->setRadarObjectColour(ColourValue(1.0, 0.0, 0.2,1)); // Red
 		this->setRadarObjectShape(RadarViewable::Dot);
-		this->setRadarObjectScale(0.5f);
+		this->setRadarObjectScale(1.0f);
 		
 
 		//Attach Model

Modified: code/branches/presentationFS15/src/modules/weapons/weaponmodes/GravityBombFire.cc
===================================================================
--- code/branches/presentationFS15/src/modules/weapons/weaponmodes/GravityBombFire.cc	2015-05-27 14:26:20 UTC (rev 10503)
+++ code/branches/presentationFS15/src/modules/weapons/weaponmodes/GravityBombFire.cc	2015-05-28 08:41:23 UTC (rev 10504)
@@ -18,7 +18,7 @@
 {
 	RegisterClass(GravityBombFire);
 
-	const float GravityBombFire::BOMB_VELOCITY = 400.0; ///< The velocity of the bomb after launch
+	const float GravityBombFire::BOMB_VELOCITY = 600.0; ///< The velocity of the bomb after launch
 
 	GravityBombFire::GravityBombFire(Context* context) : WeaponMode(context)
 	{




More information about the Orxonox-commit mailing list