Changeset 6782 in orxonox.OLD for branches/network/src/lib
- Timestamp:
- Jan 26, 2006, 7:43:44 PM (19 years ago)
- Location:
- branches/network/src/lib/graphics
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/graphics/Makefile.am
r6779 r6782 9 9 render2D/render_2d.cc \ 10 10 render2D/element_2d.cc \ 11 render2D/billboard.cc \ 11 12 text_engine/text_engine.cc \ 12 13 text_engine/text.cc \ … … 21 22 render2D/render_2d.h \ 22 23 render2D/element_2d.h \ 24 render2D/billboard.h \ 23 25 text_engine/text_engine.h \ 24 26 text_engine/text.h \ -
branches/network/src/lib/graphics/effects/lense_flare.cc
r6779 r6782 25 25 #include "texture.h" 26 26 27 #include "render2D/billboard.h" 27 28 28 29 using namespace std; … … 38 39 LenseFlare::LenseFlare(const TiXmlElement* root) 39 40 { 40 41 41 if (root != NULL) 42 42 this->loadParams(root); … … 60 60 LoadParam(root, "add-flare-texture", this, LenseFlare, addFlare) 61 61 .describe("adds a lensflare texture to the engine"); 62 63 62 } 64 63 … … 68 67 */ 69 68 bool LenseFlare::init() 70 { 71 72 } 69 {} 73 70 74 71 … … 78 75 bool LenseFlare::activate() 79 76 { 80 77 this->bActivated = true; 81 78 } 82 79 … … 87 84 bool LenseFlare::deactivate() 88 85 { 89 86 this->bActivated = false; 90 87 } 91 88 … … 103 100 * @param textureName the name of the flare texture 104 101 */ 105 void addFlare(const char* textureName)102 void LenseFlare::addFlare(const char* textureName) 106 103 { 107 Texture* texture = new Texture (textureName, GL_TEXTURE); 108 109 104 Billboard* bb = new Billboard(NULL); 105 bb->setTexture(textureName); 110 106 } 111 107 112 108 109 /** 110 * draws the LenseFlares 111 */ 112 void LenseFlare::draw() const 113 { 114 if( !this->bActivated) 115 return; 116 117 } -
branches/network/src/lib/graphics/effects/lense_flare.h
r6779 r6782 14 14 class TiXmlElement; 15 15 class Light; 16 class Element2D;16 class Billboard; 17 17 18 18 //! A class that handles LenseFlares. The LenseFlareManager operates on this. … … 41 41 private: 42 42 Light* lightSource; //!< reference to the sun (or primary light source) 43 std::vector< Element2D*> flares; //!< the flares array43 std::vector<Billboard*> flares; //!< the flares array 44 44 }; 45 45 -
branches/network/src/lib/graphics/render2D/billboard.cc
r6781 r6782 11 11 ### File Specific: 12 12 main-programmer: Patrick Boenzli 13 co-programmer: ...14 13 */ 15 14 16 15 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON 17 16 18 #include " image_entity.h"17 #include "billboard.h" 19 18 20 19 #include "load_param.h" … … 25 24 #include "glincl.h" 26 25 #include "state.h" 26 #include "p_node.h" 27 27 28 28 … … 39 39 { 40 40 this->init(); 41 this->loadParams(root); 41 42 if( root) 43 this->loadParams(root); 42 44 } 43 45 … … 64 66 this->setSize(GraphicsEngine::getInstance()->getResolutionX()/10.0, GraphicsEngine::getInstance()->getResolutionY()/10.0); 65 67 66 this->setBindNode(this);67 this->material = new Material ;68 //this->setBindNode(this); 69 this->material = new Material(); 68 70 this->setTexture("pictures/error_texture.png"); 69 71 } 70 72 71 73 74 /** 75 * load params 76 * @param root TiXmlElement object 77 */ 72 78 void Billboard::loadParams(const TiXmlElement* root) 73 79 { 74 PNode::loadParams(root);75 76 80 LoadParam(root, "texture", this, Billboard, setTexture) 77 81 .describe("the texture-file to load onto the Billboard"); … … 79 83 LoadParam(root, "size", this, Billboard, setSize) 80 84 .describe("the size of the Billboard in Pixels"); 81 82 LoadParam(root, "rotation-speed", this, Billboard, setRotationSpeed)83 .describe("the Speed with which the Billboard should rotate");84 85 86 85 } 87 86 … … 107 106 108 107 109 /** this turns on/off the billboarding of this WorldEntity110 * 111 * This means that the image will always look in the direction of the Player108 /** 109 * attaches this billboard to a parent 110 * @param pNode node to attach to 112 111 */ 113 void Billboard:: toggleBillboard()112 void Billboard::attachTo(PNode* pNode) 114 113 { 115 this-> bBillboarding = !this->bBillboarding;114 this->source->setParent(pNode); 116 115 } 117 116 … … 151 150 { 152 151 glPushMatrix(); 152 153 153 glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0); 154 this->material->select(); 154 155 155 //glRotatef(this->getAbsDir2D(), 0,0,1);156 this->material->select();157 156 glBegin(GL_TRIANGLE_STRIP); 158 157 glTexCoord2f(0, 0); … … 165 164 glVertex2f(this->getSizeX2D(), this->getSizeY2D()); 166 165 glEnd(); 166 167 167 glPopMatrix(); 168 169 168 } -
branches/network/src/lib/graphics/render2D/billboard.h
r6781 r6782 7 7 #define _BILLBOARD_H 8 8 9 #include "p_node.h" 9 10 10 #include "element_2d.h" 11 #include "event_listener.h"12 11 13 12 #include "vector.h" … … 32 31 void setSize(float sizeX, float sizeY); 33 32 void setTexture(const char* textureFile); 34 /** @param rotationSpeed the speed at what the crosshair should rotate */ 35 void setRotationSpeed(float rotationSpeed) { this->rotationSpeed = rotationSpeed; }; 36 void toggleBillboard(); 33 void attachTo(PNode* pnode); 37 34 38 35 virtual void tick(float dt);
Note: See TracChangeset
for help on using the changeset viewer.