[Orxonox-commit 6993] r11614 - in code/branches/Asteroid_HS17: data/levels data/levels/templates src/modules/asteroids2D

vyang at orxonox.net vyang at orxonox.net
Fri Dec 1 18:38:00 CET 2017


Author: vyang
Date: 2017-12-01 18:38:00 +0100 (Fri, 01 Dec 2017)
New Revision: 11614

Added:
   code/branches/Asteroid_HS17/data/levels/templates/asteroidsAsteroids2D.oxt
Modified:
   code/branches/Asteroid_HS17/data/levels/Asteroids2D.oxw
   code/branches/Asteroid_HS17/data/levels/templates/spaceshipAsteroids2D.oxt
   code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCube.cc
   code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCube.h
   code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.h
Log:
Asteroids werden random geladen-> collisionShape und Bewegung einstellen

Modified: code/branches/Asteroid_HS17/data/levels/Asteroids2D.oxw
===================================================================
--- code/branches/Asteroid_HS17/data/levels/Asteroids2D.oxw	2017-11-30 17:34:56 UTC (rev 11613)
+++ code/branches/Asteroid_HS17/data/levels/Asteroids2D.oxw	2017-12-01 17:38:00 UTC (rev 11614)
@@ -44,7 +44,37 @@
     <Light type=directional position="-100, 10000, -700" lookat="0.2, -1, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
     <SpawnPoint team=0 position="0,0,0" lookat="0,0,0" spawnclass= Asteroids2DShip pawndesign=spaceshipasteroids2d />
 
-    <Model mesh="axes.mesh" scale=10 position="0,0,0" />
+    <!--<Model mesh="axes.mesh" scale=10 position="0,0,0" /> -->
+
+
+    <?lua
+      for i = 1, 250, 1
+      do
+      j = math.random()
+    ?>
+
+    <MovableEntity
+      position = "<?lua print(math.random()* 15000 - 1000) ?>,<?lua print(math.random() * 12000 - 4000) ?>,<?lua print(math.random() * 12000 - 4000) ?>"
+      collisionType = dynamic
+      linearDamping = 0.8
+      angularDamping = 0
+      scale = "<?lua print(j * 150)?>"
+      collisiondamage = 1
+      enablecollisiondamage = true
+    >
+      <attached>
+        <Model mass="<?lua print(j * 1000) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" />
+      </attached>
+      <collisionShapes>
+        <SphereCollisionShape radius="<?lua print(j * 350) ?>" />
+      </collisionShapes>
+    </MovableEntity>
+
+    <?lua
+      end
+    ?>
+
+
     <Asteroids2DCenterPoint name=asteroids2Dcenter />
   
     

Added: code/branches/Asteroid_HS17/data/levels/templates/asteroidsAsteroids2D.oxt
===================================================================
Modified: code/branches/Asteroid_HS17/data/levels/templates/spaceshipAsteroids2D.oxt
===================================================================
--- code/branches/Asteroid_HS17/data/levels/templates/spaceshipAsteroids2D.oxt	2017-11-30 17:34:56 UTC (rev 11613)
+++ code/branches/Asteroid_HS17/data/levels/templates/spaceshipAsteroids2D.oxt	2017-12-01 17:38:00 UTC (rev 11614)
@@ -19,7 +19,7 @@
 
    primaryThrust     = 150
    auxilaryThrust    = 30
-   rotationThrust    = 500
+   rotationThrust    = 100
 
    lift = 1;
    stallSpeed = 220;
@@ -84,7 +84,7 @@
     <CameraPosition position="0,30,150" direction="0, 0, -1" drag=false mouselook=true />
     <CameraPosition position="0,1300,-100" direction="0, -1, 0" drag=false mouselook=true />
 -->
-    <CameraPosition position="0,600,0" pitch=-90 absolute=true />
+    <CameraPosition position="0,600,0" pitch=-90 absolute=true drag = false mouselook=true/>
     <CameraPosition position="0,50,160" drag=true mouselook=true />
     <CameraPosition position="0,40,125" drag=true mouselook=true />
     <CameraPosition position="0,30, 90" drag=true mouselook=true />

Modified: code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCube.cc
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCube.cc	2017-11-30 17:34:56 UTC (rev 11613)
+++ code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCube.cc	2017-12-01 17:38:00 UTC (rev 11614)
@@ -33,15 +33,28 @@
 #include "Asteroids2DCube.h"
 #include "Asteroids2D.h"
 #include "core/CoreIncludes.h"
+#include "util/Math.h"
 
 namespace orxonox
 {
     RegisterClass(Asteroids2DCube);
 
-    Asteroids2DCube::Asteroids2DCube(Context* context) : MovableEntity(context)
+    Asteroids2DCube::Asteroids2DCube(Context* context) : Pawn(context)
     {
         RegisterObject(Asteroids2DCube);
+        this->size = 1;
+        this->width = 1043;
+        this->height = 646;
+        //this->setPosition();
+        //this->setVelocity(Vector3 )
     }
 
+    void Asteroids2DCube::tick(float dt)
+    {
+    	SUPER(Asteroids2DCube, tick, dt);
+    	
 
+    }
+
+
 }

Modified: code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCube.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCube.h	2017-11-30 17:34:56 UTC (rev 11613)
+++ code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCube.h	2017-12-01 17:38:00 UTC (rev 11614)
@@ -37,17 +37,20 @@
 
 #include "asteroids2D/Asteroids2DPrereqs.h"
 
-#include "worldentities/MovableEntity.h"
+#include "worldentities/pawns/Pawn.h"
 
 
 namespace orxonox
 {
-    class _Asteroids2DExport Asteroids2DCube : public MovableEntity
+    class _Asteroids2DExport Asteroids2DCube : public Pawn
     {
        public:
             Asteroids2DCube(Context* context);
+            virtual void tick(float dt) override;
 
        private:
+       		int size;				// three sizes, 3-> two 2s, 2-> two 1s, 1-> die
+       		float width, height;	//field
     };
 }
 

Modified: code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.h	2017-11-30 17:34:56 UTC (rev 11613)
+++ code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.h	2017-12-01 17:38:00 UTC (rev 11614)
@@ -64,7 +64,7 @@
             virtual void boost(bool bBoost) override;
 
             //no rotation in x and z direction!
-            virtual void rotateYaw(const Vector2& value) override{}; // Rotate in yaw direction.
+            //virtual void rotateYaw(const Vector2& value) override{}; // Rotate in yaw direction.
             virtual void rotatePitch(const Vector2& value) override{}; // Rotate in pitch direction.
             virtual void rotateRoll(const Vector2& value) override{}; // Rotate in roll direction.
 



More information about the Orxonox-commit mailing list