- Timestamp:
- Jan 26, 2006, 7:15:22 PM (19 years ago)
- Location:
- branches/network/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/graphics/render2D/billboard.cc
r6779 r6781 62 62 63 63 this->setLayer(E2D_LAYER_TOP); 64 this->setRotationSpeed(5);65 64 this->setSize(GraphicsEngine::getInstance()->getResolutionX()/10.0, GraphicsEngine::getInstance()->getResolutionY()/10.0); 66 65 … … 68 67 this->material = new Material; 69 68 this->setTexture("pictures/error_texture.png"); 70 this->bBillboarding = false;71 69 } 72 70 … … 85 83 .describe("the Speed with which the Billboard should rotate"); 86 84 87 LoadParam(root, "billboarding", this, Billboard, toggleBillboard) 88 .describe("sets the Billboard to always look in the direction of the Player"); 85 89 86 } 90 87 … … 126 123 void Billboard::tick(float dt) 127 124 { 128 // let the crosshair rotate129 //this->shiftDir2D(dt * rotationSpeed);130 131 132 125 float z = 0.0f; 133 126 glReadPixels ((int)this->getAbsCoor2D().x, … … 138 131 GL_FLOAT, 139 132 &z); 140 141 133 142 134 GLdouble objX=.0, objY=.0, objZ=.0; … … 150 142 &objY, 151 143 &objZ ); 152 153 //this->setAbsCoor(objX, objY, objZ);154 144 } 155 145 156 146 157 147 /** 158 * draws the crosshair148 * draws the billboard 159 149 */ 160 150 void Billboard::draw() const -
branches/network/src/lib/graphics/render2D/billboard.h
r6779 r6781 4 4 */ 5 5 6 #ifndef _ IMAGE_ENTITY_H7 #define _ IMAGE_ENTITY_H6 #ifndef _BILLBOARD_H 7 #define _BILLBOARD_H 8 8 9 9 #include "p_node.h" … … 14 14 15 15 16 // FORWARD DECLARATION 16 17 17 class Model; 18 18 class Material; … … 20 20 21 21 //! A class that enables the 22 class Billboard : public PNode, public Element2D { 22 class Billboard : public Element2D 23 { 23 24 24 25 public: … … 38 39 virtual void draw() const; 39 40 41 40 42 private: 41 Material* material; //!< a material for the Aim.43 Material* material; //!< a material for the Billboard 42 44 float rotationSpeed; //!< Speed of the Rotation. 43 bool bBillboarding; //!< true if billboarding is on 45 46 PNode* source; //!< the source attached to it 47 44 48 }; 45 49 46 #endif /* _ IMAGE_ENTITY_H */50 #endif /* _BILLBOARD_H */ -
branches/network/src/world_entities/image_entity.cc
r6696 r6781 49 49 { 50 50 if (this->material) 51 delete this->material; 52 53 // delete what has to be deleted here 54 55 GraphicsEngine::showMouse(true); 56 GraphicsEngine::stealWMEvents(false); 51 delete this->material; 57 52 } 58 53 … … 90 85 .describe("the Speed with which the ImageEntity should rotate"); 91 86 92 LoadParam(root, "billboarding", this, ImageEntity, toggleBillboard )93 .describe("sets the ImageEntityto always look in the direction of the Player");87 LoadParam(root, "billboarding", this, ImageEntity, toggleBillboarding) 88 .describe("sets the Billboard to always look in the direction of the Player"); 94 89 } 95 90 … … 119 114 * This means that the image will always look in the direction of the Player 120 115 */ 121 void ImageEntity::toggleBillboard ()116 void ImageEntity::toggleBillboarding() 122 117 { 123 118 this->bBillboarding = !this->bBillboarding; -
branches/network/src/world_entities/image_entity.h
r6779 r6781 33 33 /** @param rotationSpeed the speed at what the crosshair should rotate */ 34 34 void setRotationSpeed(float rotationSpeed) { this->rotationSpeed = rotationSpeed; }; 35 void toggleBillboard ();35 void toggleBillboarding(); 36 36 37 37 virtual void tick(float dt);
Note: See TracChangeset
for help on using the changeset viewer.