Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 10, 2008, 1:38:17 PM (17 years ago)
Author:
rgrieder
Message:

Trying to synchronise phyiscs over the network.

  • Removed derivation of CollisionShape from WorldEntity (BaseObject instead).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/physics/src/orxonox/objects/worldentities/collisionshapes/SphereCollisionShape.cc

    r2304 r2374  
    4646        this->sphereShape_ = new btSphereShape(1.0f);
    4747        this->collisionShape_ = this->sphereShape_;
     48
     49        this->registerVariables();
    4850    }
    4951
     
    5254        if (this->isInitialized())
    5355            delete this->collisionShape_;
     56    }
     57
     58    void SphereCollisionShape::registerVariables()
     59    {
     60        REGISTERDATA(this->radius_, network::direction::toclient, new network::NetworkCallback<SphereCollisionShape>(this, &SphereCollisionShape::radiusChanged));
    5461    }
    5562
     
    6168    }
    6269
    63     btVector3 SphereCollisionShape::getTotalScaling()
     70    void SphereCollisionShape::setRadius(float radius)
    6471    {
    65         return omni_cast<btVector3>(this->node_->getScale()) * this->radius_;
     72        // TODO: Think about where this could be referenced already.
     73        this->radius_ = radius;
     74        delete this->sphereShape_;
     75        this->sphereShape_ = new btSphereShape(radius);
    6676    }
    6777}
Note: See TracChangeset for help on using the changeset viewer.