Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8390


Ignore:
Timestamp:
May 2, 2011, 10:54:01 PM (14 years ago)
Author:
youngk
Message:

Yess-a-doo! Okay, planets now have collision shapes. Follow the example in planets.oxw

Location:
code/branches/mac_osx2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/mac_osx2/data/levels/planets.oxw

    r8389 r8390  
    6969      position="10000,0,0"
    7070      scale="100"
     71      collisionType="dynamic"
     72      linearDamping="0.8"
     73      angularDamping="0"
     74      mass="200"
    7175      pitch="0"
    7276      mesh="ganymede.mesh"
     
    7680      atmospheresize="224.0f"
    7781      imagesize="1024.0f"
    78     />
     82    >
     83      <collisionShapes>
     84        <SphereCollisionShape radius="100" position="0,0,0" />
     85      </collisionShapes>
     86    </Planet>
    7987  </Scene>
    8088</Level>
  • code/branches/mac_osx2/src/modules/objects/Planet.cc

    r8389 r8390  
    3737#include "core/XMLPort.h"
    3838#include "Scene.h"
    39 #include "objects/collisionshapes/SphereCollisionShape.h"
    4039#include "graphics/Camera.h"
    4140#include "CameraManager.h"
     
    5251        RegisterObject(Planet);
    5352        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         }
    6753    }
    6854
Note: See TracChangeset for help on using the changeset viewer.