Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 2, 2011, 10:30:40 PM (13 years ago)
Author:
youngk
Message:

Adding Collision Shapes to Planets. Doesn't currently work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/mac_osx2/src/modules/objects/Planet.cc

    r7401 r8389  
    3737#include "core/XMLPort.h"
    3838#include "Scene.h"
     39#include "objects/collisionshapes/SphereCollisionShape.h"
    3940#include "graphics/Camera.h"
    4041#include "CameraManager.h"
     
    5152        RegisterObject(Planet);
    5253        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        }
    5367    }
    5468
Note: See TracChangeset for help on using the changeset viewer.