- Timestamp:
- May 2, 2011, 10:30:40 PM (14 years ago)
- Location:
- code/branches/mac_osx2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/mac_osx2/data/levels/planets.oxw
r8351 r8389 1 <LevelInfo 2 name = "Planet Demonstration" 3 description = "Demonstration of Planets" 4 tags = "planets" 5 /> 6 1 7 <?lua 8 include("stats.oxo") 2 9 include("HUDTemplates3.oxo") 3 include("stats.oxo")4 10 include("templates/lodInformation.oxt") 5 include("templates/spaceshipSwallow.oxt") 6 include("templates/spaceshipPirate.oxt") 11 include("templates/spaceshipHXY.oxt") 7 12 ?> 8 13 9 10 11 14 <Level 12 name = "Planet_Demo" 13 description = "Demonstration of planets with high resolution." 14 15 name = "Planet" 16 description = "Demonstration of Planets" 15 17 > 16 18 <templates> 17 <Template link=lodtemplate_default/>19 <Template link="lodtemplate_default" /> 18 20 </templates> 19 21 20 22 <Scene 21 ambientlight = "0.5, 0.5, 0.5"22 skybox = "Orxonox/skypanoramagen1"23 ambientlight = "0.8, 0.8, 0.8" 24 skybox = "Orxonox/skypanoramagen1" 23 25 > 26 27 <WorldAmbientSound 28 ambientSource="AlphaCentauri.ogg" 29 looping="true" 30 playOnLoad="true" 31 /> 24 32 25 <WorldAmbientSound ambientSource="AlphaCentauri.ogg" looping="true" playOnLoad="true" /> 26 <Light type=directional position="-10000,-10000,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" /> 33 <Light 34 type="directional" 35 position="-10000,-10000,0" 36 direction="0.253, 0.593, -0.765" 37 diffuse="1.0, 0.9, 0.9, 1.0" 38 specular="1.0, 0.9, 0.9, 1.0" 39 /> 27 40 28 <?lua 29 planetsize=40000 30 ?> 41 <SpawnPoint 42 position="1500,0,0" 43 lookat="0,0,0" 44 spawnclass="SpaceShip" 45 pawndesign="spaceshipHXY" 46 /> 31 47 32 <SpawnPoint position="<?lua print(math.sin(1.5) *(3)*planetsize) ?>,<?lua print(math.cos(1.5) *3*planetsize) ?>,<?lua print(500) ?>" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipswallow /> 48 <Planet 49 position="0,0,0" 50 scale="1000" 51 collisionType="dynamic" 52 linearDamping="0.8" 53 angularDamping="0" 54 mass="200" 55 pitch="0" 56 mesh="jupiter.mesh" 57 atmosphere="atmosphere1" 58 rotationaxis="1,0,0" 59 rotationrate="1.0" 60 atmospheresize="300.0f" 61 imagesize="1024.0f" 62 > 63 <collisionShapes> 64 <SphereCollisionShape radius="1000" position="0,0,0" /> 65 </collisionShapes> 66 </Planet> 33 67 34 35 <?lua 36 max = 50 37 38 for i = 1, max, 1 39 do 40 x = math.sin(i/max*6)*(1.5)*planetsize 41 y = i*100 42 z = math.cos(i/max*6)*(1.5)*planetsize 43 ?> 44 <?lua 45 for k = 1, 25, 1 46 do 47 j = math.random() 48 ?> 49 50 <MovableEntity position="<?lua print(x + math.random() * 10000-2500) ?>,<?lua print(y + math.random() * 5000-2500) ?>,<?lua print(z + math.random() * 1000-500) ?>" <?lua if i == 5 then ?> collisionType=dynamic linearDamping=0.8 angularDamping=0 mass=<?lua print(j * 50) ?> <?lua end ?> scale=<?lua print(j * 5) ?> rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>"> 51 <attached> 52 <Model position="0,0,0" scale="<?lua print(j * 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" /> 53 </attached> 54 <?lua if i == 5 then ?><collisionShapes> 55 <SphereCollisionShape radius="<?lua print(j * 70) ?>" /> 56 </collisionShapes> <?lua end ?> 57 </MovableEntity> 58 <?lua 59 end 60 ?> 61 <?lua end ?> 62 <Planet position="0,0,0" scale="<?lua print(planetsize) ?>" pitch=-90 mesh="jupiter.mesh" atmosphere="atmosphere1" rotationaxis="0,1,0" rotationrate="0.2" atmospheresize=300.0f imagesize=1024.0f /> 63 <Planet position="<?lua print(5*planetsize) ?>,0,0" scale=10000 pitch=30 mesh="ganymede.mesh" atmosphere="atmosphere1" rotationaxis="1,0,1" rotationrate="1.5" atmospheresize=224.0f imagesize=1024.0f /> 68 <Planet 69 position="10000,0,0" 70 scale="100" 71 pitch="0" 72 mesh="ganymede.mesh" 73 atmosphere="atmosphere1" 74 rotationaxis="1,0,0" 75 rotationrate="1.0" 76 atmospheresize="224.0f" 77 imagesize="1024.0f" 78 /> 64 79 </Scene> 65 80 </Level> -
code/branches/mac_osx2/src/modules/objects/Planet.cc
r7401 r8389 37 37 #include "core/XMLPort.h" 38 38 #include "Scene.h" 39 #include "objects/collisionshapes/SphereCollisionShape.h" 39 40 #include "graphics/Camera.h" 40 41 #include "CameraManager.h" … … 51 52 RegisterObject(Planet); 52 53 this->registerVariables(); 54 55 // Get notification about collisions 56 if (GameMode::isMaster()) 57 { 58 //this->setMass(1.0); 59 this->enableCollisionCallback(); 60 this->setCollisionResponse(false); 61 this->setCollisionType(Static); 62 63 SphereCollisionShape* shape = new SphereCollisionShape(this); 64 //shape->setRadius(20); 65 this->attachCollisionShape(shape); 66 } 53 67 } 54 68
Note: See TracChangeset
for help on using the changeset viewer.