Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 8, 2011, 11:45:32 PM (13 years ago)
Author:
dafrick
Message:

Documenting collision shapes in an effort to understand them and implement scaling.
Scaling is however not working yet, and thus not yet enabled.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup/src/modules/objects/collisionshapes/SphereCollisionShape.h

    r7601 r8422  
    4141namespace orxonox
    4242{
     43
     44    /**
     45    @brief
     46        Wrapper for the bullet sphere collision shape class btSphereShape.
     47
     48    @author
     49        Reto Grieder
     50
     51    @ingroup Collisionshapes
     52    */
    4353    class _ObjectsExport SphereCollisionShape : public CollisionShape
    4454    {
     
    4959            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5060
    51             inline void setRadius(float radius)
    52                 { this->radius_ = radius; updateShape(); }
     61            /**
     62            @brief Set the radius of the SphereCollisionShape.
     63                   If the radius changes, this causes the internal collision shape to be recreated.
     64            @param radius The radius to be set.
     65            @return Returns true if the radius has changed, false if not.
     66            */
     67            inline bool setRadius(float radius)
     68                { if(this->radius_ == radius) return false; this->radius_ = radius; updateShape(); return true; }
     69            /**
     70            @brief Get the radius of the SphereCollisionShape.
     71            @return Returns the radius of the SphereCollisionShape.
     72            */
    5373            inline float getRadius() const
    5474                { return this->radius_; }
     75
     76            virtual void changedScale(); // Is called when the scale of the SphereCollisionShape has changed.
    5577
    5678        private:
     
    5981            btCollisionShape* createNewShape() const;
    6082
    61             float radius_;
     83            float radius_; //!< The radius of the SphereCollisionShape.
    6284    };
    6385}
Note: See TracChangeset for help on using the changeset viewer.