Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 11, 2015, 3:40:41 PM (9 years ago)
Author:
landauf
Message:

added new collision shape (cylinder)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.h

    r9667 r10189  
    3737
    3838#include "objects/ObjectsPrereqs.h"
    39 #include "collisionshapes/CollisionShape.h"
     39#include "AbstractRadiusHeightCollisionShape.h"
    4040
    4141namespace orxonox
     
    5252    @ingroup Collisionshapes
    5353    */
    54     class _ObjectsExport ConeCollisionShape : public CollisionShape
     54    class _ObjectsExport ConeCollisionShape : public AbstractRadiusHeightCollisionShape
    5555    {
    5656        public:
     
    5858            virtual ~ConeCollisionShape();
    5959
    60             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    61 
    62             /**
    63             @brief Set the radius of the ConeCollisionShape.
    64                    If the radius changes, this causes the internal collision shape to be recreated.
    65             @param value The radius to be set.
    66             @return Returns true if the radius has changed, false if not.
    67             */
    68             inline bool setRadius(float value)
    69                 { if(this->radius_ == value) return false; this->radius_ = value; updateShape(); return true; }
    70             /**
    71             @brief Get the radius of the ConeCollisionShape.
    72             @return Returns the radius of the ConeCollisionShape.
    73             */
    74             inline float getRadius() const
    75                 { return radius_; }
    76 
    77             /**
    78             @brief Set the height of the ConeCollisionShape.
    79                    If the height changes, this causes the internal collision shape to be recreated.
    80             @param value The height to be set.
    81             @return Returns true if the height has changed, false if not.
    82             */
    83             inline bool setHeight(float value)
    84                 { if(this->height_ == value) return false; this->height_ = value; updateShape(); return true; }
    85             /**
    86             @brief Get the height of the ConeCollisionShape.
    87             @return Returns the height of the ConeCollisionShape.
    88             */
    89             inline float getHeight() const
    90                 { return this->height_; }
    91 
    92             virtual void changedScale(); // Is called when the scale of the ConeCollisionShape has changed.
    93 
    9460        private:
    95             void registerVariables();
    96 
    9761            btCollisionShape* createNewShape() const; // Creates a new internal collision shape for the ConeCollisionShape.
    98 
    99             float radius_; //!< The radius of the ConeCollisionShape.
    100             float height_; //!< The height of the ConeCollisionShape.
    10162     };
    10263}
Note: See TracChangeset for help on using the changeset viewer.