Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6781 in orxonox.OLD for branches


Ignore:
Timestamp:
Jan 26, 2006, 7:15:22 PM (19 years ago)
Author:
patrick
Message:

network: billboard compiles again

Location:
branches/network/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/graphics/render2D/billboard.cc

    r6779 r6781  
    6262
    6363  this->setLayer(E2D_LAYER_TOP);
    64   this->setRotationSpeed(5);
    6564  this->setSize(GraphicsEngine::getInstance()->getResolutionX()/10.0, GraphicsEngine::getInstance()->getResolutionY()/10.0);
    6665
     
    6867  this->material = new Material;
    6968  this->setTexture("pictures/error_texture.png");
    70   this->bBillboarding = false;
    7169}
    7270
     
    8583      .describe("the Speed with which the Billboard should rotate");
    8684
    87   LoadParam(root, "billboarding", this, Billboard, toggleBillboard)
    88       .describe("sets the Billboard to always look in the direction of the Player");
     85
    8986}
    9087
     
    126123void Billboard::tick(float dt)
    127124{
    128   // let the crosshair rotate
    129   //this->shiftDir2D(dt * rotationSpeed);
    130 
    131 
    132125  float z = 0.0f;
    133126  glReadPixels ((int)this->getAbsCoor2D().x,
     
    138131                 GL_FLOAT,
    139132                 &z);
    140 
    141133
    142134  GLdouble objX=.0, objY=.0, objZ=.0;
     
    150142               &objY,
    151143               &objZ );
    152 
    153   //this->setAbsCoor(objX, objY, objZ);
    154144}
    155145
    156146
    157147/**
    158  * draws the crosshair
     148 * draws the billboard
    159149 */
    160150void Billboard::draw() const
  • branches/network/src/lib/graphics/render2D/billboard.h

    r6779 r6781  
    44 */
    55
    6 #ifndef _IMAGE_ENTITY_H
    7 #define _IMAGE_ENTITY_H
     6#ifndef _BILLBOARD_H
     7#define _BILLBOARD_H
    88
    99#include "p_node.h"
     
    1414
    1515
    16 // FORWARD DECLARATION
     16
    1717class Model;
    1818class Material;
     
    2020
    2121//! A class that enables the
    22 class Billboard : public PNode, public Element2D {
     22class Billboard :  public Element2D
     23{
    2324
    2425  public:
     
    3839    virtual void draw() const;
    3940
     41
    4042  private:
    41     Material*        material;             //!< a material for the Aim.
     43    Material*        material;             //!< a material for the Billboard
    4244    float            rotationSpeed;        //!< Speed of the Rotation.
    43     bool             bBillboarding;        //!< true if billboarding is on
     45
     46    PNode*           source;               //!< the source attached to it
     47
    4448};
    4549
    46 #endif /* _IMAGE_ENTITY_H */
     50#endif /* _BILLBOARD_H */
  • branches/network/src/world_entities/image_entity.cc

    r6696 r6781  
    4949{
    5050  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;
    5752}
    5853
     
    9085      .describe("the Speed with which the ImageEntity should rotate");
    9186
    92   LoadParam(root, "billboarding", this, ImageEntity, toggleBillboard)
    93       .describe("sets the ImageEntity to 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");
    9489}
    9590
     
    119114 * This means that the image will always look in the direction of the Player
    120115 */
    121 void ImageEntity::toggleBillboard()
     116void ImageEntity::toggleBillboarding()
    122117{
    123118  this->bBillboarding = !this->bBillboarding;
  • branches/network/src/world_entities/image_entity.h

    r6779 r6781  
    3333  /** @param rotationSpeed the speed at what the crosshair should rotate */
    3434  void setRotationSpeed(float rotationSpeed) { this->rotationSpeed = rotationSpeed; };
    35   void toggleBillboard();
     35  void toggleBillboarding();
    3636
    3737  virtual void tick(float dt);
Note: See TracChangeset for help on using the changeset viewer.