[Orxonox-commit 3710] r8390 - in code/branches/mac_osx2: data/levels src/modules/objects
youngk at orxonox.net
youngk at orxonox.net
Mon May 2 22:54:01 CEST 2011
Author: youngk
Date: 2011-05-02 22:54:01 +0200 (Mon, 02 May 2011)
New Revision: 8390
Modified:
code/branches/mac_osx2/data/levels/planets.oxw
code/branches/mac_osx2/src/modules/objects/Planet.cc
Log:
Yess-a-doo! Okay, planets now have collision shapes. Follow the example in planets.oxw
Modified: code/branches/mac_osx2/data/levels/planets.oxw
===================================================================
--- code/branches/mac_osx2/data/levels/planets.oxw 2011-05-02 20:30:40 UTC (rev 8389)
+++ code/branches/mac_osx2/data/levels/planets.oxw 2011-05-02 20:54:01 UTC (rev 8390)
@@ -68,6 +68,10 @@
<Planet
position="10000,0,0"
scale="100"
+ collisionType="dynamic"
+ linearDamping="0.8"
+ angularDamping="0"
+ mass="200"
pitch="0"
mesh="ganymede.mesh"
atmosphere="atmosphere1"
@@ -75,6 +79,10 @@
rotationrate="1.0"
atmospheresize="224.0f"
imagesize="1024.0f"
- />
+ >
+ <collisionShapes>
+ <SphereCollisionShape radius="100" position="0,0,0" />
+ </collisionShapes>
+ </Planet>
</Scene>
</Level>
Modified: code/branches/mac_osx2/src/modules/objects/Planet.cc
===================================================================
--- code/branches/mac_osx2/src/modules/objects/Planet.cc 2011-05-02 20:30:40 UTC (rev 8389)
+++ code/branches/mac_osx2/src/modules/objects/Planet.cc 2011-05-02 20:54:01 UTC (rev 8390)
@@ -36,7 +36,6 @@
#include "core/GameMode.h"
#include "core/XMLPort.h"
#include "Scene.h"
-#include "objects/collisionshapes/SphereCollisionShape.h"
#include "graphics/Camera.h"
#include "CameraManager.h"
@@ -51,19 +50,6 @@
{
RegisterObject(Planet);
this->registerVariables();
-
- // Get notification about collisions
- if (GameMode::isMaster())
- {
- //this->setMass(1.0);
- this->enableCollisionCallback();
- this->setCollisionResponse(false);
- this->setCollisionType(Static);
-
- SphereCollisionShape* shape = new SphereCollisionShape(this);
- //shape->setRadius(20);
- this->attachCollisionShape(shape);
- }
}
/**
More information about the Orxonox-commit
mailing list