Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 8, 2011, 11:45:32 PM (14 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/ConeCollisionShape.h

    r7601 r8422  
    4141namespace orxonox
    4242{
     43
     44    /**
     45    @brief
     46        Wrapper for the bullet cone collision shape class btConeShape.
     47
     48    @author
     49        Reto Grieder
     50
     51    @ingroup Collisionshapes.
     52    */
    4353    class _ObjectsExport ConeCollisionShape : public CollisionShape
    4454    {
     
    4959            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5060
    51             inline void setRadius(float value)
    52                 { this->radius_ = value; updateShape(); }
     61            /**
     62            @brief Set the radius of the ConeCollisionShape.
     63                   If the radius changes, this causes the internal collision shape to be recreated.
     64            @param value The radius to be set.
     65            @return Returns true if the radius has changed, false if not.
     66            */
     67            inline bool setRadius(float value)
     68                { if(this->radius_ == value) return false; this->radius_ = value; updateShape(); return true; }
     69            /**
     70            @brief Get the radius of the ConeCollisionShape.
     71            @return Returns the radius of the ConeCollisionShape.
     72            */
    5373            inline float getRadius() const
    5474                { return radius_; }
    5575
    56             inline void setHeight(float value)
    57                 { this->height_ = value; updateShape(); }
     76            /**
     77            @brief Set the height of the ConeCollisionShape.
     78                   If the height changes, this causes the internal collision shape to be recreated.
     79            @param value The height to be set.
     80            @return Returns true if the height has changed, false if not.
     81            */
     82            inline bool setHeight(float value)
     83                { if(this->height_ == value) return false; this->height_ = value; updateShape(); return true; }
     84            /**
     85            @brief Get the height of the ConeCollisionShape.
     86            @return Returns the height of the ConeCollisionShape.
     87            */
    5888            inline float getHeight() const
    5989                { return this->height_; }
     90
     91            virtual void changedScale(); // Is called when the scale of the ConeCollisionShape has changed.
    6092
    6193        private:
    6294            void registerVariables();
    6395
    64             btCollisionShape* createNewShape() const;
     96            btCollisionShape* createNewShape() const; // Creates a new internal collision shape for the ConeCollisionShape.
    6597
    66             float radius_;
    67             float height_;
     98            float radius_; //!< The radius of the ConeCollisionShape.
     99            float height_; //!< The height of the ConeCollisionShape.
    68100     };
    69101}
Note: See TracChangeset for help on using the changeset viewer.