Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 23, 2011, 11:40:58 PM (13 years ago)
Author:
dafrick
Message:

Merging pickup branch into presentation branch.

Location:
code/branches/presentation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation

  • code/branches/presentation/src/modules/objects/collisionshapes/SphereCollisionShape.cc

    r5781 r8556  
    2727 */
    2828
     29/**
     30    @file SphereCollisionShape.cc
     31    @brief Implementation of the SphereCollisionShape class.
     32*/
     33
    2934#include "SphereCollisionShape.h"
    3035
     
    3338#include "core/CoreIncludes.h"
    3439#include "core/XMLPort.h"
     40#include "tools/BulletConversions.h"
    3541
    3642namespace orxonox
     
    3844    CreateFactory(SphereCollisionShape);
    3945
     46    /**
     47    @brief
     48        Constructor. registers and initializes the object.
     49    */
    4050    SphereCollisionShape::SphereCollisionShape(BaseObject* creator) : CollisionShape(creator)
    4151    {
     
    6676    }
    6777
     78    /**
     79    @brief
     80        Is called when the scale of the SphereCollisionShape has changed.
     81    */
     82    void SphereCollisionShape::changedScale()
     83    {
     84        CollisionShape::changedScale();
     85
     86        // Resize the internal collision shape
     87        // TODO: Assuming setLocalScaling works.
     88        //this->collisionShape_->setLocalScaling(multi_cast<btVector3>(this->getScale3D()));
     89        if(!this->hasUniformScaling())
     90        {
     91            CCOUT(1) << "Error: Non-uniform scaling is not yet supported." << endl;
     92            return;
     93        }
     94
     95        this->setRadius(this->radius_*this->getScale());
     96    }
     97
     98    /**
     99    @brief
     100        Creates a new internal collision shape for the SphereCollisionShape.
     101    @return
     102        Returns a pointer to the newly created btSphereShape.
     103    */
    68104    btCollisionShape* SphereCollisionShape::createNewShape() const
    69105    {
Note: See TracChangeset for help on using the changeset viewer.