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/PlaneCollisionShape.h

    r7601 r8422  
    4343namespace orxonox
    4444{
     45
     46    /**
     47    @brief
     48        Wrapper for the bullet plane collision shape class btStaticPlaneShape.
     49
     50    @author
     51        Martin Stypinski
     52
     53    @ingroup Collisionshapes
     54    */
    4555    class _ObjectsExport PlaneCollisionShape : public CollisionShape
    4656    {
     
    5161            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5262
    53             inline void setNormal(const Vector3& normal)
    54                 { this->normal_ = normal; updateShape(); }
    55             inline const Vector3& getNormal()
     63            /**
     64            @brief Set the normal of the PlaneCollisionShape.
     65                   If the normal changes, this causes the internal collision shape to be recreated.
     66            @param normal The normal vector to be set.
     67            @return Returns true if the normal has changed, false if not.
     68            */
     69            inline bool setNormal(const Vector3& normal)
     70                { if(this->normal_ == normal) return false; this->normal_ = normal; updateShape(); return true; }
     71            /**
     72            @brief Get the normal of the PlaneCollisionShape.
     73            @return Returns the normal vector of the PlaneCollisionShape.
     74            */
     75            inline const Vector3& getNormal() const
    5676                { return normal_;}
    5777
    58             inline void setOffset(float offset)
    59                 { this->offset_ = offset; updateShape(); }
    60             inline float getOffset()
     78            /**
     79            @brief Set the offset of the PlaneCollisionShape.
     80                   If the offset changes, this causes the internal collision shape to be recreated.
     81            @param offset The offset to be set.
     82            @return Returns true if the offset has changed, false if not.
     83            */
     84            inline bool setOffset(float offset)
     85                { if(this->offset_ == offset) return false; this->offset_ = offset; updateShape(); return true; }
     86            /**
     87            @brief Get the offset of the PlaneCollisionShape.
     88            @return Returns the offset of the PlaneCollisionShape.
     89            */
     90            inline float getOffset() const
    6191                { return this->offset_;}
     92
     93            virtual void changedScale(); // Is called when the scale of the PlaneCollisionShape has changed.
    6294
    6395        private:
    6496            void registerVariables();
    6597
    66             btCollisionShape* createNewShape()const;
     98            btCollisionShape* createNewShape() const; // Creates a new internal collision shape for the PlaneCollisionShape.
    6799
    68             Vector3 normal_;
    69             float   offset_;
     100            Vector3 normal_; //!< The normal vector of the PlaneCollisionShape.
     101            float   offset_; //!< The offset of the PlaneCollisionShape.
    70102     };
    71103}
Note: See TracChangeset for help on using the changeset viewer.