Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 26, 2011, 5:40:16 PM (13 years ago)
Author:
dafrick
Message:

Merging spaceboundaries2 branch into presentation branch.

Location:
code/branches/presentation
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation

  • code/branches/presentation/src/orxonox/graphics/Billboard.cc

    r7492 r8614  
    2323 *      Fabian 'x3n' Landau
    2424 *   Co-authors:
     25 *      Maurus Kaufmann
    2526 *      ...
    2627 *
     
    3031
    3132#include "OgreBillboard.h"
    32 #include "OgreBillboardSet.h"
    3333
    3434#include "core/CoreIncludes.h"
     
    4646
    4747        this->colour_ = ColourValue::White;
    48         //this->rotation_ = 0;
     48        this->rotation_ = 0;
    4949
    5050        this->registerVariables();
     
    6666        XMLPortParam(Billboard, "material", setMaterial, getMaterial, xmlelement, mode);
    6767        XMLPortParam(Billboard, "colour",   setColour,   getColour,   xmlelement, mode).defaultValues(ColourValue::White);
    68         //XMLPortParam(Billboard, "rotation", setRotation, getRotation, xmlelement, mode).defaultValues(0);
     68        XMLPortParam(Billboard, "rotation", setRotation, getRotation, xmlelement, mode).defaultValues(0);
    6969    }
    7070
     
    7373        registerVariable(this->material_, VariableDirection::ToClient, new NetworkCallback<Billboard>(this, &Billboard::changedMaterial));
    7474        registerVariable(this->colour_,   VariableDirection::ToClient, new NetworkCallback<Billboard>(this, &Billboard::changedColour));
    75         //registerVariable(this->rotation_, VariableDirection::ToClient, new NetworkCallback<Billboard>(this, &Billboard::changedRotation));
     75        registerVariable(this->rotation_, VariableDirection::ToClient, new NetworkCallback<Billboard>(this, &Billboard::changedRotation));
    7676    }
    7777
     
    8989                     this->attachOgreObject(this->billboard_.getBillboardSet());
    9090                this->billboard_.setVisible(this->isVisible());
    91                 //this->changedRotation();
     91                this->changedRotation();
    9292            }
    9393        }
     
    114114    }
    115115
    116 /*
     116
    117117    void Billboard::changedRotation()
    118118    {
     
    128128        }
    129129    }
    130 */
     130
    131131
    132132    void Billboard::changedVisibility()
     
    136136        this->billboard_.setVisible(this->isVisible());
    137137    }
     138   
     139    void Billboard::setBillboardType(Ogre::BillboardType bbt)
     140    {
     141        Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet();
     142        if( bSet != NULL )
     143        {
     144            bSet->setBillboardType(bbt);
     145        }
     146    }
     147   
     148    void Billboard::setCommonDirection(Vector3 vec)
     149    {
     150        Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet();
     151        if( bSet != NULL )
     152        {
     153            bSet->setCommonDirection( vec );
     154        }
     155    }
     156           
     157    void Billboard::setCommonUpVector(Vector3 vec)
     158    {
     159        Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet();
     160        if( bSet != NULL )
     161        {
     162            bSet->setCommonUpVector( vec );
     163        }
     164    }
     165   
     166    void Billboard::setDefaultDimensions(float width, float height)
     167    {
     168        Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet();
     169        if( bSet != NULL )
     170        {
     171            bSet->setDefaultDimensions(width, height);
     172        }
     173    }
    138174}
  • code/branches/presentation/src/orxonox/graphics/Billboard.h

    r7492 r8614  
    2323 *      Fabian 'x3n' Landau
    2424 *   Co-authors:
     25 *      Maurus Kaufmann
    2526 *      ...
    2627 *
     
    3132
    3233#include "OrxonoxPrereqs.h"
     34
     35#include "OgreBillboardSet.h"
    3336
    3437#include "util/Math.h"
     
    6265                { return this->colour_; }
    6366
    64 /*
     67
    6568            inline void setRotation(const Radian& rotation)
    6669                { this->rotation_ = rotation; this->changedRotation(); }
    6770            inline const Radian& getRotation() const
    6871                { return this->rotation_; }
    69 */
     72
    7073
    7174            virtual void setTeamColour(const ColourValue& colour)
    7275                { this->setColour(colour); }
     76               
     77            void setBillboardType(Ogre::BillboardType bbt);
     78           
     79            void setCommonDirection(Vector3 vec); //!< normalised Vector vec as argument
     80           
     81            void setCommonUpVector(Vector3 vec); //!< normalised Vector vec as argument
     82           
     83            void setDefaultDimensions(float width, float height);
     84
    7385
    7486        protected:
     
    8193            void registerVariables();
    8294            void changedMaterial();
    83             //void changedRotation();
     95            void changedRotation();
    8496
    8597            BillboardSet billboard_;
    8698            std::string material_;
    8799            ColourValue colour_;
    88             //Radian rotation_;
     100            Radian rotation_;
    89101    };
    90102}
Note: See TracChangeset for help on using the changeset viewer.