[Orxonox-commit 6482] r11128 - in code/branches/ogre1.9: data/levels src/modules/objects src/orxonox/graphics

landauf at orxonox.net landauf at orxonox.net
Sun Mar 6 13:56:27 CET 2016


Author: landauf
Date: 2016-03-06 13:56:26 +0100 (Sun, 06 Mar 2016)
New Revision: 11128

Modified:
   code/branches/ogre1.9/data/levels/Spacerace2.oxw
   code/branches/ogre1.9/data/levels/asteroidField.oxw
   code/branches/ogre1.9/data/levels/dockingToASpaceStation.oxw
   code/branches/ogre1.9/data/levels/dynamicMatch.oxw
   code/branches/ogre1.9/data/levels/earth.oxw
   code/branches/ogre1.9/data/levels/expeditionSector.oxw
   code/branches/ogre1.9/data/levels/iiJohnVane_Area51UnderFire.oxw
   code/branches/ogre1.9/data/levels/iiiJohnVane_EscapeTheBastards.oxw
   code/branches/ogre1.9/data/levels/kecks.oxw
   code/branches/ogre1.9/data/levels/levelTry.oxw
   code/branches/ogre1.9/data/levels/missionOne.oxw
   code/branches/ogre1.9/data/levels/planets.oxw
   code/branches/ogre1.9/data/levels/presentation09.oxw
   code/branches/ogre1.9/data/levels/presentationFS11.oxw
   code/branches/ogre1.9/data/levels/presentationHS09.oxw
   code/branches/ogre1.9/data/levels/presentationHS12.oxw
   code/branches/ogre1.9/data/levels/shadertest.oxw
   code/branches/ogre1.9/data/levels/shuttleAttack.oxw
   code/branches/ogre1.9/data/levels/shuttleRetaliation.oxw
   code/branches/ogre1.9/data/levels/spaceRace.oxw
   code/branches/ogre1.9/data/levels/testSwallow.oxw
   code/branches/ogre1.9/src/modules/objects/Planet.cc
   code/branches/ogre1.9/src/modules/objects/Planet.h
   code/branches/ogre1.9/src/orxonox/graphics/Model.h
Log:
let Planet inherit from Model to avoid code duplication (especially lod levels).
since model is a static entity, all planets with rotation and/or dynamic physics need to be attached to a movableentity now.

Modified: code/branches/ogre1.9/data/levels/Spacerace2.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/Spacerace2.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/Spacerace2.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -122,7 +122,11 @@
     <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true" />
 
     <!-- ------------------Planet----------------- -->
-    <Planet position="0,0,0" scale=300 pitch=-90 mesh="iceplanet.mesh" atmosphere="atmosphere1" rotationaxis="8,1,0" rotationrate="1" atmospheresize=224.0f imagesize=1024.0f />
+    <MovableEntity position="0,0,0" scale=300 pitch=-90 rotationaxis="8,1,0" rotationrate="1">
+      <attached>
+        <Planet mesh="iceplanet.mesh" atmosphere="atmosphere1" atmospheresize=224.0f imagesize=1024.0f />
+      </attached>
+    </MovableEntity>
     <StaticEntity position="0,0,0" collisionType=static>
         <collisionShapes>
             <SphereCollisionShape radius="399" />

Modified: code/branches/ogre1.9/data/levels/asteroidField.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/asteroidField.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/asteroidField.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -65,7 +65,7 @@
 
 
     <!-- Planet close to spawn point -->
-    <Planet
+    <MovableEntity
       position="15000,0,0"
       scale="5000"
       collisionType="dynamic"
@@ -73,22 +73,27 @@
       angularDamping="0"
       mass="10000000"
       pitch="0"
-      mesh="planets/muunilinst.mesh"
-      atmosphere="atmosphere1"
       rotationaxis="1,0,0"
       rotationrate="1.0"
-      atmospheresize="80.0f"
-      imagesize="1024.0f"
       collisiondamage = 2
       enablecollisiondamage = true
     >
       <attached>
-        <ForceField position="5000,0,0" mode="sphere" diameter="10000" velocity="-50" />
+        <Planet
+          mesh="planets/muunilinst.mesh"
+          atmosphere="atmosphere1"
+          atmospheresize="80.0f"
+          imagesize="1024.0f"
+        >
+          <attached>
+            <ForceField position="5000,0,0" mode="sphere" diameter="10000" velocity="-50" />
+          </attached>
+        </Planet>
       </attached>
       <collisionShapes>
         <SphereCollisionShape radius="5000" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
 
 
 

Modified: code/branches/ogre1.9/data/levels/dockingToASpaceStation.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/dockingToASpaceStation.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/dockingToASpaceStation.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -152,7 +152,7 @@
         asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 14000, 15000, 350, 1)
     ?>
 
-    <Planet
+    <MovableEntity
       position="15000,0,-1000"
       scale="5000"
       collisionType="dynamic"
@@ -160,22 +160,27 @@
       angularDamping="0"
       mass="10000000"
       pitch="0"
-      mesh="planets/ganymede.mesh"
-      atmosphere="atmosphere1"
       rotationaxis="1,0,0"
       rotationrate="1.0"
-      atmospheresize="80.0f"
-      imagesize="1024.0f"
       collisiondamage = 2
       enablecollisiondamage = true
     >
       <attached>
-        <ForceField position="5000,0,0" mode="sphere" diameter="10000" velocity="-50" />
+        <Planet
+          mesh="planets/ganymede.mesh"
+          atmosphere="atmosphere1"
+          atmospheresize="80.0f"
+          imagesize="1024.0f"
+        >
+          <attached>
+            <ForceField position="5000,0,0" mode="sphere" diameter="10000" velocity="-50" />
+          </attached>
+        </Planet>
       </attached>
       <collisionShapes>
         <SphereCollisionShape radius="5000" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
 
   </Scene>
 

Modified: code/branches/ogre1.9/data/levels/dynamicMatch.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/dynamicMatch.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/dynamicMatch.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -32,8 +32,12 @@
     <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" />
 
 <!-- ------------------Planet needs gravity----------------- -->
-<Planet position="0,0,0" scale=500 pitch=-90 mesh="iceplanet.mesh" atmosphere="atmosphere1" rotationaxis="8,1,0" rotationrate="1" atmospheresize=224.0f imagesize=1024.0f />
-<StaticEntity position="0,0,0" collisionType=static>
+    <MovableEntity position="0,0,0" scale=500 pitch=-90 rotationaxis="8,1,0" rotationrate="1">
+      <attached>
+        <Planet mesh="iceplanet.mesh" atmosphere="atmosphere1" atmospheresize=224.0f imagesize=1024.0f />
+      </attached>
+    </MovableEntity>
+    <StaticEntity position="0,0,0" collisionType=static>
       <collisionShapes>
         <SphereCollisionShape radius="499" />
       </collisionShapes>

Modified: code/branches/ogre1.9/data/levels/earth.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/earth.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/earth.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -55,56 +55,66 @@
     <PortalEndPoint position="70500,100,0" id="1" distance="40" target="MobileEntity" design="PortalDefault"/>
 
     <!-- This is a model of Earth: mass=EarthMass/1000 and radius=EarthRadius[km]*10 -->
-    <Planet
+    <MovableEntity
       position="0,0,0"
       scale="63000"
+      pitch="0"
       collisionType="dynamic"
       linearDamping="0.8"
       angularDamping="0"
       mass="5.9e21"
-      pitch="0"
-      mesh="planets/earth.mesh"
-      atmosphere="atmosphere1"
       rotationaxis="0,1,0"
       rotationrate="0.2"
-      atmospheresize="80.0f"
-      imagesize="1024.0f"
       collisiondamage = 2
       enablecollisiondamage = true
     >
       <attached>
-        <ForceField position="0,0,0" mode="newtonianGravity" diameter="140000" massDiameter="126000" mass="5.9e21" />
+        <Planet
+          mesh="planets/earth.mesh"
+          atmosphere="atmosphere1"
+          atmospheresize="80.0f"
+          imagesize="1024.0f"
+        >
+          <attached>
+            <ForceField position="0,0,0" mode="newtonianGravity" diameter="140000" massDiameter="126000" mass="5.9e21" />
+          </attached>
+        </Planet>
       </attached>
       <collisionShapes>
         <SphereCollisionShape radius="63000" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
 
     <!-- This is a model of our Moon: mass=MoonMass/1000 and radius=MoonRadius[km]*10 and position=DistanceFromEarth[km]*10 -->
-    <Planet
+    <MovableEntity
       position="3625700,0,0"
       scale="17370"
+      pitch="0"
       collisionType="dynamic"
       linearDamping="0.8"
       angularDamping="0"
       mass="7.36e19"
-      pitch="0"
-      mesh="planets/moon.mesh"
-      atmosphere="atmosphere1"
       rotationaxis="0,1,0"
       rotationrate="0.2"
-      atmospheresize="80.0f"
-      imagesize="1024.0f"
       collisiondamage = 2
       enablecollisiondamage = true
     >
       <attached>
-        <ForceField position="0,0,0" mode="newtonianGravity" diameter="40000" massDiameter="34740" mass="7.36e19" />
+        <Planet
+          mesh="planets/moon.mesh"
+          atmosphere="atmosphere1"
+          atmospheresize="80.0f"
+          imagesize="1024.0f"
+        >
+          <attached>
+            <ForceField position="0,0,0" mode="newtonianGravity" diameter="40000" massDiameter="34740" mass="7.36e19" />
+          </attached>
+        </Planet>
       </attached>
       <collisionShapes>
         <SphereCollisionShape radius="17370" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
     <PortalEndPoint position="3603330,100,0" id="2" distance="40" target="MobileEntity" design="PortalDefault"/>
 
     <!-- Create portals from Earth to the Moon -->

Modified: code/branches/ogre1.9/data/levels/expeditionSector.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/expeditionSector.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/expeditionSector.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -587,7 +587,7 @@
 
     <!-- Planets -->
 
-   <Planet
+    <MovableEntity
         position="<?lua printC(cPlanet1) ?>"
         scale="3000"
         collisionType="dynamic"
@@ -595,31 +595,36 @@
         angularDamping="0"
         mass="5000000"
         pitch="0"
-        mesh="planets/muunilinst.mesh"
-        atmosphere="atmosphere1"
         rotationaxis="1,0,0"
         rotationrate="1.0"
-        atmospheresize="80.0f"
-        imagesize="1024.0f"
         collisiondamage=2
         enablecollisiondamage=true
-	      visible=true
-	      active=ture
-      >
+    >
       <attached>
-        <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
-        </attached>
-          <collisionShapes>
-            <SphereCollisionShape radius="3000" position="0,0,0" />
+        <Planet
+            mesh="planets/muunilinst.mesh"
+            atmosphere="atmosphere1"
+            atmospheresize="80.0f"
+            imagesize="1024.0f"
+            visible=true
+            active=ture
+        >
+          <attached>
+            <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
+          </attached>
+        </Planet>
+      </attached>
+      <collisionShapes>
+        <SphereCollisionShape radius="3000" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
 
     <?lua
         dofile("includes/asteroidField.lua")
         asteroidBelt(cPlanet1[1], cPlanet1[2], cPlanet1[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
     ?>
 
-    <Planet
+    <MovableEntity
         position="<?lua printC(cPlanet2) ?>"
         scale="2000"
         collisionType="dynamic"
@@ -627,24 +632,29 @@
         angularDamping="0"
         mass="5000000"
         pitch="0"
-        mesh="planets/ganymede.mesh"
-        atmosphere="atmosphere1"
         rotationaxis="1,0,0"
         rotationrate="1.0"
-        atmospheresize="80.0f"
-        imagesize="1024.0f"
         collisiondamage=2
         enablecollisiondamage=true
-	      visible=true
-	      active=true
-      >
+    >
       <attached>
-        <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
-        </attached>
-          <collisionShapes>
-            <SphereCollisionShape radius="2000" position="0,0,0" />
+          <Planet
+            mesh="planets/ganymede.mesh"
+            atmosphere="atmosphere1"
+            atmospheresize="80.0f"
+            imagesize="1024.0f"
+            visible=true
+            active=true
+          >
+            <attached>
+              <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
+            </attached>
+          </Planet>
+      </attached>
+      <collisionShapes>
+        <SphereCollisionShape radius="2000" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
 
     <?lua
         dofile("includes/asteroidField.lua")
@@ -653,7 +663,7 @@
 
     <!-- EnemyPlanet(s) -->
 
-    <Planet
+    <MovableEntity
         position="<?lua printC(cEnemyBasePlanet) ?>"
         scale="5000"
         collisionType="dynamic"
@@ -661,24 +671,29 @@
         angularDamping="0"
         mass="5000000"
         pitch="0"
-        mesh="planets/jupiter.mesh"
-        atmosphere="atmosphere1"
         rotationaxis="1,0,0"
         rotationrate="1.0"
-        atmospheresize="80.0f"
-        imagesize="1024.0f"
         collisiondamage=2
         enablecollisiondamage=true
-	      visible=false
-	      active=false
-      >
+    >
       <attached>
-        <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-500" />
-        </attached>
-          <collisionShapes>
-            <SphereCollisionShape radius="5000" position="0,0,0" />
+        <Planet
+            mesh="planets/jupiter.mesh"
+            atmosphere="atmosphere1"
+            atmospheresize="80.0f"
+            imagesize="1024.0f"
+            visible=false
+            active=false
+          >
+          <attached>
+            <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-500" />
+          </attached>
+        </Planet>
+      </attached>
+      <collisionShapes>
+        <SphereCollisionShape radius="5000" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
 
     <?lua
       xi = 5

Modified: code/branches/ogre1.9/data/levels/iiJohnVane_Area51UnderFire.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/iiJohnVane_Area51UnderFire.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/iiJohnVane_Area51UnderFire.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -2003,21 +2003,26 @@
         ?>
 
     <!-- PLANETS -->
-      <Planet
-            position="2000,-250,9000" 
-            scale=5000 
-            pitch=1 
+    <MovableEntity
+        position="2000,-250,9000" 
+        scale=5000 
+        pitch=1 
+        rotationaxis="1,1,0" 
+        rotationrate="0.5" 
+        mass="10000000"
+        angularDamping=0
+        collisiondamage=2
+        enablecollisiondamage=true
+        collisionType="dynamic"
+    >
+      <attached>
+        <Planet
             mesh="iceplanet.mesh" 
             atmosphere="atmosphere1" 
-            rotationaxis="1,1,0" 
-            rotationrate="0.5" 
             atmospheresize=224.0f 
-            imagesize=1024.0f
-            mass="10000000"
-            angularDamping=0
-            collisiondamage=2
-            enablecollisiondamage=true
-            collisionType="dynamic" />
+            imagesize=1024.0f />
+      </attached>
+    </MovableEntity>
 
 <!--  PICKUPS to make travelling faster  -->
     <PickupSpawner pickup=hugespeedpickup position="11473,1275,7689" triggerDistance="400" respawnTime="10" maxSpawnedItems="5" />

Modified: code/branches/ogre1.9/data/levels/iiiJohnVane_EscapeTheBastards.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/iiiJohnVane_EscapeTheBastards.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/iiiJohnVane_EscapeTheBastards.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -777,7 +777,11 @@
 <!--Asteroid Elipse end-->
 
 <!--Planet sun-->
-    <Planet position="15000,0,0" scale=1500 pitch=-90 mesh="planets/sol.mesh" atmosphere="atmosphere1" rotationaxis="8,1,0" rotationrate="1" atmospheresize=0 imagesize=1024.0f />
+    <MovableEntity position="15000,0,0" scale=1500 pitch=-90 rotationaxis="8,1,0" rotationrate="1">
+      <attached>
+        <Planet mesh="planets/sol.mesh" atmosphere="atmosphere1" atmospheresize=0 imagesize=1024.0f />
+      </attached>
+    </MovableEntity>
     <StaticEntity position="2600,0,0" collisionType=static>
         <collisionShapes>
             <SphereCollisionShape radius="399" />
@@ -789,7 +793,7 @@
 <!--Planet END-->
 
 <!--Planet with Ally-->
-    <Planet
+    <MovableEntity
       position="0,0,0"
       scale="100"
       collisionType="dynamic"
@@ -797,26 +801,31 @@
       angularDamping="0"
       mass="5000000"
       pitch="0"
-      mesh="iceplanet.mesh"
-      atmosphere="atmosphere1"
       rotationaxis="1,0,0"
       rotationrate="1.0"
-      atmospheresize="80.0f"
-      imagesize="1024.0f"
     >
       <attached>
-        <ForceField position="0,0,0" mode="sphere" diameter="1000" velocity="-500" />
-                    <ParticleEmitter position="0,0,0" source="Orxonox/fire3" />
+        <Planet
+          mesh="iceplanet.mesh"
+          atmosphere="atmosphere1"
+          atmospheresize="80.0f"
+          imagesize="1024.0f"
+        >
+          <attached>
+            <ForceField position="0,0,0" mode="sphere" diameter="1000" velocity="-500" />
+                        <ParticleEmitter position="0,0,0" source="Orxonox/fire3" />
+          </attached>
+        </Planet>
       </attached>
       <collisionShapes>
         <SphereCollisionShape radius="100" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
 <!-- Planet with Ally END-->
 
 
 <!-- Homeplanet -->
-    <Planet
+    <MovableEntity
       position="-3000,12000,-10000"
       scale="3000"
       collisionType="dynamic"
@@ -824,30 +833,39 @@
       angularDamping="0"
       mass="5000000000000"
       pitch="0"
-      mesh="planets/muunilinst.mesh"
-      atmosphere="atmosphere1"
       rotationaxis="0,0,0"
       rotationrate="0.0"
-      atmospheresize="80.0f"
-      imagesize="1024.0f"
     >
       <attached>
-        <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-900" />
+        <Planet
+          mesh="planets/muunilinst.mesh"
+          atmosphere="atmosphere1"
+          atmospheresize="80.0f"
+          imagesize="1024.0f"
+        >
+          <attached>
+            <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-900" />
+          </attached>
+        </Planet>
       </attached>
       <collisionShapes>
         <SphereCollisionShape radius="3000" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
 <!-- Homeplanet  END-->
 
 <!-- Planet around the cave-->
 
-<Planet position="-43500,-30000,31900" scale=5000 pitch=-90 mesh="planets/moon.mesh" atmosphere="atmosphere1" rotationaxis="8,1,0" rotationrate="1" atmospheresize=0 imagesize=1024.0f />
+    <MovableEntity position="-43500,-30000,31900" scale=5000 pitch=-90 rotationaxis="8,1,0" rotationrate="1">
+      <attached>
+        <Planet mesh="planets/moon.mesh" atmosphere="atmosphere1" atmospheresize=0 imagesize=1024.0f />
+      </attached>
+    </MovableEntity>
 
 <!-- Planet around the cave END-->
 
 <!-- Anotherplanet -->
-    <Planet
+    <MovableEntity
       position="-20000,6000,7000"
       scale="3000"
       collisionType="dynamic"
@@ -855,17 +873,21 @@
       angularDamping="0"
       mass="5000000000000"
       pitch="0"
-      mesh="planets/ganymede.mesh"
-      atmosphere="atmosphere1"
       rotationaxis="0,0,0"
       rotationrate="0.0"
-      atmospheresize="80.0f"
-      imagesize="1024.0f"
     >
+      <attached>
+        <Planet
+          mesh="planets/ganymede.mesh"
+          atmosphere="atmosphere1"
+          atmospheresize="80.0f"
+          imagesize="1024.0f"
+        />
+      </attached>
       <collisionShapes>
         <SphereCollisionShape radius="3000" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
 <!-- LAAAGS :-(
 
                 "The game lags, when you're flying far away"

Modified: code/branches/ogre1.9/data/levels/kecks.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/kecks.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/kecks.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -422,32 +422,37 @@
 	<!--ENDE Portal-->
 	   
 	<!--Heimatplanet-->
+    <MovableEntity
+      position="0,100000,0"
+      scale="10000"
+      collisionType="dynamic"
+      linearDamping="0.8"
+      angularDamping="0"
+      mass="5000000"
+      pitch="180"
+      yaw="0"
+      roll="0"
+      rotationaxis="0,0,1"
+      rotationrate="5.0"
+      collisiondamage = 1
+      enablecollisiondamage = true
+    >
+      <attached>
 		<Planet
-		  position="0,100000,0"
-		  scale="10000"
-		  collisionType="dynamic"
-		  linearDamping="0.8"
-		  angularDamping="0"
-		  mass="5000000"
-		  pitch="180"
-		  yaw="0"
-		  roll="0"
 		  mesh="planets/earth.mesh"
 		  atmosphere="atmosphere1"
-		  rotationaxis="0,0,1"
-		  rotationrate="5.0"
 		  atmospheresize="80.0f"
 		  imagesize="1024.0f"
-		  collisiondamage = 1
-		  enablecollisiondamage = true
 		  >
 		  <attached>
-			  <ForceField position="0,0,0" mode="sphere" diameter="1000" velocity="-500" />
-			</attached>
-			<collisionShapes>
-			  <SphereCollisionShape radius="10000" position="0,0,0" />
-			</collisionShapes>
-		  </Planet>	 
+			<ForceField position="0,0,0" mode="sphere" diameter="1000" velocity="-500" />
+		  </attached>
+		</Planet>	 
+      </attached>
+      <collisionShapes>
+        <SphereCollisionShape radius="10000" position="0,0,0" />
+      </collisionShapes>
+    </MovableEntity>
 	<!--ENDE Heimatplanet-->	
 
   </Scene>

Modified: code/branches/ogre1.9/data/levels/levelTry.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/levelTry.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/levelTry.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -148,7 +148,7 @@
         asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 14000, 15000, 350, 1)
     ?>
 
-    <Planet
+    <MovableEntity
       position="15000,0,-1000"
       scale="5000"
       collisionType="dynamic"
@@ -156,22 +156,27 @@
       angularDamping="0"
       mass="10000000"
       pitch="0"
-      mesh="planets/ganymede.mesh"
-      atmosphere="atmosphere1"
       rotationaxis="1,0,0"
       rotationrate="1.0"
-      atmospheresize="80.0f"
-      imagesize="1024.0f"
       collisiondamage = 2
       enablecollisiondamage = true
     >
       <attached>
-        <ForceField position="5000,0,0" mode="sphere" diameter="10000" velocity="-50" />
+        <Planet
+          mesh="planets/ganymede.mesh"
+          atmosphere="atmosphere1"
+          atmospheresize="80.0f"
+          imagesize="1024.0f"
+        >
+          <attached>
+            <ForceField position="5000,0,0" mode="sphere" diameter="10000" velocity="-50" />
+          </attached>
+        </Planet>
       </attached>
       <collisionShapes>
         <SphereCollisionShape radius="5000" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
 
   </Scene>
 

Modified: code/branches/ogre1.9/data/levels/missionOne.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/missionOne.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/missionOne.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -1204,7 +1204,7 @@
 
 
 <!-- @Objects: planet && spaceboundaries  -->
-    <Planet
+    <MovableEntity
       position="-44000,0,0"
       scale="2500"
       collisionType="dynamic"
@@ -1212,22 +1212,27 @@
       angularDamping="0"
       mass="10000000"
       pitch="0"
-      mesh="planets/muunilinst.mesh"
-      atmosphere="atmosphere1"
       rotationaxis="1,0,0"
       rotationrate="1.0"
-      atmospheresize="80.0f"
-      imagesize="1024.0f"
       collisiondamage = "2"
       enablecollisiondamage = "false"
     >
-      <!--attached>
-        <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-50" />
-      </attached-->  <!-- Forcefield kills HYDROGEN FARMER-->
+      <attached>
+        <Planet
+          mesh="planets/muunilinst.mesh"
+          atmosphere="atmosphere1"
+          atmospheresize="80.0f"
+          imagesize="1024.0f"
+        >
+          <!--attached>
+            <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-50" />
+          </attached-->  <!-- Forcefield kills HYDROGEN FARMER-->
+        </Planet>
+      </attached>
       <collisionShapes>
         <SphereCollisionShape radius="2500" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
 
 
 <!-------------------------------------- The attack --------------------------------------->

Modified: code/branches/ogre1.9/data/levels/planets.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/planets.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/planets.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -44,7 +44,7 @@
       pawndesign="spaceshipHXY"
     />
 
-    <Planet
+    <MovableEntity
       position="0,0,0"
       scale="1000"
       collisionType="dynamic"
@@ -52,24 +52,29 @@
       angularDamping="0"
       mass="10000000"
       pitch="0"
-      mesh="planets/muunilinst.mesh"
-      atmosphere="atmosphere1"
       rotationaxis="1,0,0"
       rotationrate="1.0"
-      atmospheresize="80.0f"
-      imagesize="1024.0f"
       collisiondamage = 2
       enablecollisiondamage = true
     >
       <attached>
-        <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-50" />
+        <Planet
+          mesh="planets/muunilinst.mesh"
+          atmosphere="atmosphere1"
+          atmospheresize="80.0f"
+          imagesize="1024.0f"
+        >
+          <attached>
+            <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-50" />
+          </attached>
+        </Planet>
       </attached>
       <collisionShapes>
         <SphereCollisionShape radius="1000" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
 
-    <Planet
+    <MovableEntity
       position="10000,0,0"
       scale="100"
       collisionType="dynamic"
@@ -77,21 +82,26 @@
       angularDamping="0"
       mass="5000000"
       pitch="0"
-      mesh="planets/muunilinst.mesh"
-      atmosphere="atmosphere1"
       rotationaxis="1,0,0"
       rotationrate="1.0"
-      atmospheresize="80.0f"
-      imagesize="1024.0f"
       collisiondamage = 2
       enablecollisiondamage = true
     >
       <attached>
-        <ForceField position="0,0,0" mode="sphere" diameter="1000" velocity="-500" />
+        <Planet
+          mesh="planets/muunilinst.mesh"
+          atmosphere="atmosphere1"
+          atmospheresize="80.0f"
+          imagesize="1024.0f"
+        >
+          <attached>
+            <ForceField position="0,0,0" mode="sphere" diameter="1000" velocity="-500" />
+          </attached>
+        </Planet>
       </attached>
       <collisionShapes>
         <SphereCollisionShape radius="100" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
   </Scene>
 </Level>

Modified: code/branches/ogre1.9/data/levels/presentation09.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/presentation09.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/presentation09.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -56,7 +56,11 @@
       <?lua end ?>
     <?lua end ?>
     
-    <Planet position="0,0,0" scale=10000 pitch=-90 mesh="iceplanet.mesh" atmosphere="atmosphere1" rotationaxis="1,1,0" rotationrate="1" atmospheresize=224.0f imagesize=1024.0f />
+    <MovableEntity position="0,0,0" scale=10000 pitch=-90 rotationaxis="1,1,0" rotationrate="1">
+      <attached>
+        <Planet mesh="iceplanet.mesh" atmosphere="atmosphere1" atmospheresize=224.0f imagesize=1024.0f />
+      </attached>
+    </MovableEntity>
 
   </Scene>
 </Level>

Modified: code/branches/ogre1.9/data/levels/presentationFS11.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/presentationFS11.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/presentationFS11.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -110,7 +110,7 @@
     </SimpleNotification>
 
     <!-- EARTH -->
-    <Planet
+    <MovableEntity
       position="80500,0,0"
       scale="63000"
       collisionType="dynamic"
@@ -119,22 +119,27 @@
       mass="5.9e21"
       pitch="-90"
       yaw="50"
-      mesh="planets/earth.mesh"
-      atmosphere="atmosphere1"
       rotationaxis="0,1,0"
       rotationrate="0.2"
-      atmospheresize="80.0f"
-      imagesize="1024.0f"
       collisiondamage = 2
       enablecollisiondamage = true
     >
       <attached>
-        <ForceField position="0,0,0" mode="newtonianGravity" diameter="140000" massDiameter="126000" mass="5.9e21" />
+        <Planet
+          mesh="planets/earth.mesh"
+          atmosphere="atmosphere1"
+          atmospheresize="80.0f"
+          imagesize="1024.0f"
+        >
+          <attached>
+            <ForceField position="0,0,0" mode="newtonianGravity" diameter="140000" massDiameter="126000" mass="5.9e21" />
+          </attached>
+        </Planet>
       </attached>
       <collisionShapes>
         <SphereCollisionShape radius="63000" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
 
     <!-- PARTICLE EFFECT -->
 
@@ -328,7 +333,7 @@
     <!-- MOON AREA -->
     
     <!-- MOON -->
-    <Planet
+    <MovableEntity
       position="-80000,0,0"
       scale="4000"
       collisionType="dynamic"
@@ -336,22 +341,27 @@
       angularDamping="0"
       mass="7.36e19"
       pitch="0"
-      mesh="planets/moon.mesh"
-      atmosphere="atmosphere1"
       rotationaxis="0,1,0"
       rotationrate="0.2"
-      atmospheresize="0.0f"
-      imagesize="1024.0f"
       collisiondamage = 2
       enablecollisiondamage = true
     >
       <attached>
-        <ForceField position="0,0,0" mode="newtonianGravity" diameter="40000" massDiameter="34740" mass="7.36e19" />
+        <Planet
+          mesh="planets/moon.mesh"
+          atmosphere="atmosphere1"
+          atmospheresize="0.0f"
+          imagesize="1024.0f"
+        >
+          <attached>
+            <ForceField position="0,0,0" mode="newtonianGravity" diameter="40000" massDiameter="34740" mass="7.36e19" />
+          </attached>
+        </Planet>
       </attached>
       <collisionShapes>
         <SphereCollisionShape radius="4000" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
 
     <SimpleNotification message="Hydrogen farmer/space station by Hans" >
         <events>

Modified: code/branches/ogre1.9/data/levels/presentationHS09.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/presentationHS09.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/presentationHS09.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -392,10 +392,6 @@
         </attached>
       </MovableEntity>
     <?lua end ?>
-    
-<!--
-    <Planet position="1000,0,0" mass=900000 scale=1000 pitch=-90 mesh="iceplanet.mesh" atmosphere="atmosphere1" rotationaxis="1,1,0" rotationrate="1" atmospheresize=224.0f imagesize=1024.0f />
--->
 
   </Scene>
 </Level>

Modified: code/branches/ogre1.9/data/levels/presentationHS12.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/presentationHS12.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/presentationHS12.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -352,7 +352,7 @@
         asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 14000, 15000, 350, 1)
     ?>
 
-    <Planet
+    <MovableEntity
       position="15000,0,-1000"
       scale="5000"
       collisionType="dynamic"
@@ -360,22 +360,27 @@
       angularDamping="0"
       mass="10000000"
       pitch="0"
-      mesh="planets/ganymede.mesh"
-      atmosphere="atmosphere1"
       rotationaxis="1,0,0"
       rotationrate="1.0"
-      atmospheresize="80.0f"
-      imagesize="1024.0f"
       collisiondamage = 2
       enablecollisiondamage = true
     >
       <attached>
-        <ForceField position="5000,0,0" mode="sphere" diameter="10000" velocity="-50" />
+        <Planet
+          mesh="planets/ganymede.mesh"
+          atmosphere="atmosphere1"
+          atmospheresize="80.0f"
+          imagesize="1024.0f"
+        >
+          <attached>
+            <ForceField position="5000,0,0" mode="sphere" diameter="10000" velocity="-50" />
+          </attached>
+        </Planet>
       </attached>
       <collisionShapes>
         <SphereCollisionShape radius="5000" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
 
 <StaticEntity position="6750,-750,2000" yaw=0 pitch=0>
     <attached>

Modified: code/branches/ogre1.9/data/levels/shadertest.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/shadertest.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/shadertest.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -77,7 +77,7 @@
 
     <!-- Planet close to spawn point -->
 
-    <Planet
+    <MovableEntity
       position="15000,0,-1000"
       scale="5000"
       collisionType="dynamic"
@@ -85,22 +85,27 @@
       angularDamping="0"
       mass="10000000"
       pitch="0"
-      mesh="planets/muunilinst.mesh"
-      atmosphere="atmosphere1"
       rotationaxis="1,0,0"
       rotationrate="1.0"
-      atmospheresize="80.0f"
-      imagesize="1024.0f"
       collisiondamage = 2
       enablecollisiondamage = true
     >
       <attached>
-        <ForceField position="5000,0,0" mode="sphere" diameter="10000" velocity="-50" />
+        <Planet
+          mesh="planets/muunilinst.mesh"
+          atmosphere="atmosphere1"
+          atmospheresize="80.0f"
+          imagesize="1024.0f"
+        >
+          <attached>
+            <ForceField position="5000,0,0" mode="sphere" diameter="10000" velocity="-50" />
+          </attached>
+        </Planet>
       </attached>
       <collisionShapes>
         <SphereCollisionShape radius="5000" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
 
 
 

Modified: code/branches/ogre1.9/data/levels/shuttleAttack.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/shuttleAttack.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/shuttleAttack.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -929,7 +929,7 @@
        asteroidField(cField2[1], cField2[2], cField2[3], 20, 30, 2000, 250, 0)
     ?>
 
-    <Planet
+    <MovableEntity
         position="<?lua printC(cPlanet1) ?>"
         scale="2000"
         collisionType="dynamic"
@@ -937,29 +937,34 @@
         angularDamping="0"
         mass="5000000"
         pitch="0"
-        mesh="planets/muunilinst.mesh"
-        atmosphere="atmosphere1"
         rotationaxis="1,0,0"
         rotationrate="1.0"
-        atmospheresize="80.0f"
-        imagesize="1024.0f"
         collisiondamage = 2
         enablecollisiondamage = true
-      >
+    >
       <attached>
-        <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
-        </attached>
-          <collisionShapes>
-            <SphereCollisionShape radius="2000" position="0,0,0" />
+        <Planet
+            mesh="planets/muunilinst.mesh"
+            atmosphere="atmosphere1"
+            atmospheresize="80.0f"
+            imagesize="1024.0f"
+        >
+          <attached>
+            <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
+          </attached>
+        </Planet>
+      </attached>
+      <collisionShapes>
+        <SphereCollisionShape radius="2000" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
 
     <?lua
         dofile("includes/asteroidField.lua")
         asteroidBelt(cPlanet1[1], cPlanet1[2], cPlanet1[3], 30, 0, 30, 20, 40, 2800, 3000, 200, 1)
     ?>
 
-    <Planet
+    <MovableEntity
         position="<?lua printC(cPlanet2) ?>"
         scale="3000"
         collisionType="dynamic"
@@ -967,22 +972,27 @@
         angularDamping="0"
         mass="5000000"
         pitch="0"
-        mesh="planets/planet3.mesh"
-        atmosphere="atmosphere1"
         rotationaxis="1,0,0"
         rotationrate="1.0"
-        atmospheresize="80.0f"
-        imagesize="1024.0f"
         collisiondamage = 2
         enablecollisiondamage = true
-      >
+    >
       <attached>
-        <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
-        </attached>
-          <collisionShapes>
-            <SphereCollisionShape radius="3000" position="0,0,0" />
+        <Planet
+            mesh="planets/planet3.mesh"
+            atmosphere="atmosphere1"
+            atmospheresize="80.0f"
+            imagesize="1024.0f"
+          >
+          <attached>
+            <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
+          </attached>
+        </Planet>
+      </attached>
+      <collisionShapes>
+        <SphereCollisionShape radius="3000" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
 
     <?lua
         dofile("includes/asteroidField.lua")

Modified: code/branches/ogre1.9/data/levels/shuttleRetaliation.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/shuttleRetaliation.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/shuttleRetaliation.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -879,7 +879,7 @@
 
     <!-- Planets -->
 
-   <Planet
+    <MovableEntity
         position="<?lua printC(cPlanet1) ?>"
         scale="3000"
         collisionType="dynamic"
@@ -887,31 +887,36 @@
         angularDamping="0"
         mass="5000000"
         pitch="0"
-        mesh="planets/muunilinst.mesh"
-        atmosphere="atmosphere1"
         rotationaxis="1,0,0"
         rotationrate="1.0"
-        atmospheresize="80.0f"
-        imagesize="1024.0f"
         collisiondamage = 2
         enablecollisiondamage = true
-    visible=true
-    active=true
-      >
+    >
       <attached>
-        <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
-        </attached>
-        <collisionShapes>
-            <SphereCollisionShape radius="3000" position="0,0,0" />
+        <Planet
+            mesh="planets/muunilinst.mesh"
+            atmosphere="atmosphere1"
+            atmospheresize="80.0f"
+            imagesize="1024.0f"
+            visible=true
+            active=true
+        >
+          <attached>
+            <ForceField position="0,0,0" mode="sphere" diameter="6000" velocity="-500" />
+          </attached>
+        </Planet>
+      </attached>
+      <collisionShapes>
+        <SphereCollisionShape radius="3000" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
 
     <?lua
         dofile("includes/asteroidField.lua")
         asteroidBelt(cPlanet1[1], cPlanet1[2], cPlanet1[3], 30, 20, 100, 20, 40, 3400, 3700, 400, 1)
     ?>
 
-    <Planet
+    <MovableEntity
         position="<?lua printC(cPlanet2) ?>"
         scale="2000"
         collisionType="dynamic"
@@ -919,24 +924,29 @@
         angularDamping="0"
         mass="5000000"
         pitch="0"
-        mesh="planets/ganymede.mesh"
-        atmosphere="atmosphere1"
         rotationaxis="1,0,0"
         rotationrate="1.0"
-        atmospheresize="80.0f"
-        imagesize="1024.0f"
         collisiondamage = 2
         enablecollisiondamage = true
-        visible=true
-        active=true
-      >
+    >
       <attached>
-        <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
-        </attached>
-          <collisionShapes>
-            <SphereCollisionShape radius="2000" position="0,0,0" />
+        <Planet
+            mesh="planets/ganymede.mesh"
+            atmosphere="atmosphere1"
+            atmospheresize="80.0f"
+            imagesize="1024.0f"
+            visible=true
+            active=true
+        >
+          <attached>
+            <ForceField position="0,0,0" mode="sphere" diameter="4000" velocity="-500" />
+          </attached>
+        </Planet>
+      </attached>
+      <collisionShapes>
+        <SphereCollisionShape radius="2000" position="0,0,0" />
       </collisionShapes>
-    </Planet>
+    </MovableEntity>
 
     <?lua
         dofile("includes/asteroidField.lua")
@@ -945,7 +955,7 @@
 
     <!-- EnemyPlanet -->
 
-    <Planet
+    <MovableEntity
         position="<?lua printC(cEnemyBasePlanet) ?>"
         scale="5000"
         collisionType="dynamic"
@@ -953,21 +963,24 @@
         angularDamping="0"
         mass="5000000"
         pitch="0"
-        mesh="planets/jupiter.mesh"
-        atmosphere="atmosphere1"
         rotationaxis="1,0,0"
         rotationrate="1.0"
-        atmospheresize="80.0f"
-        imagesize="1024.0f"
         collisiondamage = 2
         enablecollisiondamage = true
-        visible=false
-        active=false
     >
-        <attached>
+      <attached>
+        <Planet
+            mesh="planets/jupiter.mesh"
+            atmosphere="atmosphere1"
+            atmospheresize="80.0f"
+            imagesize="1024.0f"
+            visible=false
+            active=false
+        >
+          <attached>
            <ForceField position="0,0,0" rotationaxis="0.1,1,0.1"mode="sphere" diameter="10000" velocity="-500" />
-        </attached>
-        <events>
+          </attached>
+          <events>
             <activity>
                 <Trigger  name="enemyPlanetVisible" mode=and>
                    <EventTrigger>
@@ -1004,11 +1017,13 @@
                      </EventTrigger>
                  </Trigger>
             </visibility>
-        </events>
-        <collisionShapes>
-          <SphereCollisionShape position="0,0,0" radius=5000/>
-        </collisionShapes>
-    </Planet>
+          </events>
+        </Planet>
+      </attached>
+      <collisionShapes>
+        <SphereCollisionShape position="0,0,0" radius=5000/>
+      </collisionShapes>
+    </MovableEntity>
 
     <!-- Pawn that represents the planet during destruction -->
 

Modified: code/branches/ogre1.9/data/levels/spaceRace.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/spaceRace.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/spaceRace.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -359,7 +359,11 @@
     </OldRaceCheckPoint>
 
     <!-- ------------------Planet----------------- -->
-    <Planet position="0,0,0" scale=300 pitch=-90 mesh="iceplanet.mesh" atmosphere="atmosphere1" rotationaxis="8,1,0" rotationrate="1" atmospheresize=224.0f imagesize=1024.0f />
+    <MovableEntity position="0,0,0" scale=300 pitch=-90 rotationaxis="8,1,0" rotationrate="1">
+      <attached>
+        <Planet mesh="iceplanet.mesh" atmosphere="atmosphere1" atmospheresize=224.0f imagesize=1024.0f />
+      </attached>
+    </MovableEntity>
     <StaticEntity position="0,0,0" collisionType=static>
         <collisionShapes>
             <SphereCollisionShape radius="399" />

Modified: code/branches/ogre1.9/data/levels/testSwallow.oxw
===================================================================
--- code/branches/ogre1.9/data/levels/testSwallow.oxw	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/data/levels/testSwallow.oxw	2016-03-06 12:56:26 UTC (rev 11128)
@@ -55,7 +55,11 @@
 end
 ?>
 <?lua end ?>
-    <Planet position="0,0,0" scale=10000 pitch=-90 mesh="iceplanet.mesh" atmosphere="atmosphere1" rotationaxis="1,1,0" rotationrate="1" atmospheresize=224.0f imagesize=1024.0f />
+    <MovableEntity position="0,0,0" scale=10000 pitch=-90 rotationaxis="1,1,0" rotationrate="1" >
+      <attached>
+        <Planet mesh="iceplanet.mesh" atmosphere="atmosphere1" atmospheresize=224.0f imagesize=1024.0f />
+      </attached>
+    </MovableEntity>
 
   </Scene>
 </Level>

Modified: code/branches/ogre1.9/src/modules/objects/Planet.cc
===================================================================
--- code/branches/ogre1.9/src/modules/objects/Planet.cc	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/src/modules/objects/Planet.cc	2016-03-06 12:56:26 UTC (rev 11128)
@@ -46,9 +46,10 @@
     /**
      * @brief Constructor
      */
-    Planet::Planet(Context* context) : MovableEntity(context)
+    Planet::Planet(Context* context) : Model(context)
     {
         RegisterObject(Planet);
+        this->setLodEnabled(false);
         this->registerVariables();
     }
 
@@ -57,8 +58,6 @@
      */
     Planet::~Planet()
     {
-        if (this->isInitialized() && this->mesh_.getEntity())
-            this->detachOgreObject(this->mesh_.getEntity());
     }
 
     void Planet::tick(float dt)
@@ -86,66 +85,21 @@
         SUPER(Planet, tick, dt);
     }
 
-    void Planet::changedMesh()
+    void Planet::changedAtmosphere()
     {
         if( GameMode::showsGraphics() )
         {
-            if (this->mesh_.getEntity())
-                this->detachOgreObject(this->mesh_.getEntity());
-
-            this->mesh_.setMeshSource(this->getScene()->getSceneManager(), this->meshSrc_);
-
-            if (this->mesh_.getEntity())
+            if (this->getMesh().getEntity())
             {
-                this->attachOgreObject(this->mesh_.getEntity());
-                this->mesh_.getEntity()->setCastShadows(this->bCastShadows_);
-                this->mesh_.setVisible(this->isVisible());
+                this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->atmosphere_, Vector3(0,0,0));
 
-                float scaleFactor = this->getScale();
-
-#if OGRE_VERSION >= 0x010800
-                Ogre::ProgressiveMesh::LodValueList distList;
-#elif OGRE_VERSION >= 0x010700
-                Ogre::Mesh::LodValueList distList;
-#else
-                Ogre::Mesh::LodDistanceList distList;
-#endif
-
-                distList.push_back(10.0f*scaleFactor);
-                distList.push_back(19.0f*scaleFactor);
-                distList.push_back(27.0f*scaleFactor);
-                distList.push_back(34.0f*scaleFactor);
-                distList.push_back(40.0f*scaleFactor);
-                distList.push_back(45.0f*scaleFactor);
-                distList.push_back(49.0f*scaleFactor);
-                distList.push_back(52.0f*scaleFactor);
-                distList.push_back(54.0f*scaleFactor);
-                distList.push_back(55.0f*scaleFactor);
-
-                float reductionValue = 0.2f;
-
-#if OGRE_VERSION >= 0x010800
-                Ogre::ProgressiveMesh::generateLodLevels(this->mesh_.getEntity()->getMesh().get(), distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL,
-                    reductionValue);
-#else
-                this->mesh_.getEntity()->getMesh()->generateLodLevels(distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL, reductionValue);
-#endif
-                billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->atmosphere_, Vector3(0,0,0));
-
                 this->attachOgreObject(this->billboard_.getBillboardSet());
                 this->billboard_.getBillboardSet()->setUseAccurateFacing(true);
-                this->setCastShadows(true);
-                this->billboard_.getBillboardSet()->setRenderQueueGroup(this->mesh_.getEntity()->getRenderQueueGroup());
-                this->mesh_.setCastShadows(true);
+                this->billboard_.getBillboardSet()->setRenderQueueGroup(this->getMesh().getEntity()->getRenderQueueGroup());
             }
         }
     }
 
-    void Planet::changedShadows()
-    {
-        this->mesh_.setCastShadows(this->bCastShadows_);
-    }
-
     void Planet::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
         SUPER(Planet, XMLPort, xmlelement, mode);
@@ -153,27 +107,19 @@
         XMLPortParam(Planet, "atmosphere", setAtmosphere, getAtmosphere, xmlelement, mode).defaultValues("planet/Atmosphere");
         XMLPortParam(Planet, "atmospheresize", setAtmosphereSize, getAtmosphereSize, xmlelement,mode);
         XMLPortParam(Planet, "imagesize", setImageSize, getImageSize, xmlelement,mode);
-        XMLPortParam(Planet, "mesh", setMeshSource, getMeshSource, xmlelement, mode);
-        XMLPortParam(Planet, "shadow", setCastShadows, getCastShadows, xmlelement, mode).defaultValues(true);
     }
 
     void Planet::registerVariables()
     {
-        registerVariable(this->atmosphere_, VariableDirection::ToClient);
+        registerVariable(this->atmosphere_, VariableDirection::ToClient, new NetworkCallback<Planet>(this, &Planet::changedAtmosphere));
         registerVariable(this->atmosphereSize, VariableDirection::ToClient);
         registerVariable(this->imageSize, VariableDirection::ToClient);
-        // Note: the meshSrc should be synchronised after atmosphere and other values, because the meshSrc callback setts the atmosphere billboards
-        registerVariable(this->meshSrc_, VariableDirection::ToClient, new NetworkCallback<Planet>(this, &Planet::changedMesh));
-        registerVariable(this->bCastShadows_, VariableDirection::ToClient, new NetworkCallback<Planet>(this, &Planet::changedShadows));
     }
 
     void Planet::changedVisibility()
     {
         SUPER(Planet, changedVisibility);
-        if (this->isInitialized())
-        {
-            this->mesh_.setVisible(this->isVisible());
-            this->billboard_.setVisible(this->isVisible());
-        }
+
+        this->billboard_.setVisible(this->isVisible());
     }
 }

Modified: code/branches/ogre1.9/src/modules/objects/Planet.h
===================================================================
--- code/branches/ogre1.9/src/modules/objects/Planet.h	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/src/modules/objects/Planet.h	2016-03-06 12:56:26 UTC (rev 11128)
@@ -40,11 +40,12 @@
 #include <string>
 #include "tools/BillboardSet.h"
 #include "tools/Mesh.h"
-#include "worldentities/MovableEntity.h"
+#include "tools/interfaces/Tickable.h"
+#include "graphics/Model.h"
 
 namespace orxonox
 {
-    class _ObjectsExport Planet : public MovableEntity
+    class _ObjectsExport Planet : public Model, public Tickable
     {
         public:
             Planet(Context* context);
@@ -57,22 +58,6 @@
 
             virtual void changedVisibility() override;
 
-            inline void setMeshSource(const std::string& meshname)
-                { this->meshSrc_ = meshname; this->changedMesh(); }
-
-            inline const std::string& getMeshSource() const
-                { return this->meshSrc_; }
-
-            inline void setCastShadows(bool bCastShadows)
-                { this->bCastShadows_ = bCastShadows; this->changedShadows(); }
-
-            inline bool getCastShadows() const
-                { return this->bCastShadows_; }
-
-            inline const std::string& getMesh() const{
-                return this->meshSrc_;
-            }
-
             inline void setAtmosphereSize(float size){
                 this->atmosphereSize = size;
             }
@@ -83,6 +68,7 @@
 
             inline void setAtmosphere(const std::string& atmosphere){
                 this->atmosphere_ = atmosphere;
+                this->changedAtmosphere();
             }
 
             inline const std::string& getAtmosphere(){
@@ -102,16 +88,12 @@
         private:
             void registerVariables();
 
-            void changedMesh();
-            void changedShadows();
+            void changedAtmosphere();
 
-            std::string meshSrc_;
             std::string atmosphere_;
-            Mesh mesh_;
             float atmosphereSize;
             float imageSize;
             BillboardSet billboard_;
-            bool bCastShadows_;
 
     };
 }

Modified: code/branches/ogre1.9/src/orxonox/graphics/Model.h
===================================================================
--- code/branches/ogre1.9/src/orxonox/graphics/Model.h	2016-02-21 22:15:03 UTC (rev 11127)
+++ code/branches/ogre1.9/src/orxonox/graphics/Model.h	2016-03-06 12:56:26 UTC (rev 11128)
@@ -89,6 +89,9 @@
             inline Mesh& getMesh()
                 { return this->mesh_; }
 
+            inline void setLodEnabled(bool bLodEnabled)
+                { this->bLodEnabled_ = bLodEnabled; }
+
         private:
             /**
             @brief




More information about the Orxonox-commit mailing list