Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10404 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Jan 27, 2007, 2:20:24 PM (18 years ago)
Author:
patrick
Message:

correct fading

Location:
trunk/src/world_entities
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/blackscreen.cc

    r10403 r10404  
    2323#include "material.h"
    2424#include "state.h"
    25 #include "camera.h"
    26 #include "static_model.h"
     25// #include "camera.h"
     26#include "primitive_model.h"
    2727
    2828ObjectListDefinition(BlackScreen);
     
    7474  this->material->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    7575
    76   this->build();
     76  PrimitiveModel* model = new PrimitiveModel(PRIM_SPHERE, 6., 10);
     77  this->setModel(model);
    7778
    7879  i=0;
     
    101102  glEnable(GL_BLEND);   // Turn Blending On
    102103
    103   glMatrixMode(GL_MODELVIEW);
    104   glPushMatrix();
    105   /* translate */
    106   glTranslatef (this->getAbsCoor ().x,
    107                 this->getAbsCoor ().y,
    108                 this->getAbsCoor ().z);
    109   Vector tmpRot = this->getAbsDir().getSpacialAxis();
    110   glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
     104//   glMatrixMode(GL_MODELVIEW);
     105//   glPushMatrix();
     106//   /* translate */
     107//   glTranslatef (this->getAbsCoor ().x,
     108//                 this->getAbsCoor ().y,
     109//                 this->getAbsCoor ().z);
     110//   Vector tmpRot = this->getAbsDir().getSpacialAxis();
     111//   glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    111112
    112113  this->material->select();
     
    139140
    140141  this->material->setTransparency(i);
    141   Camera* cam = State::getCamera();
    142   if( cam != NULL)
    143     this->setParent(cam);
     142//   Camera* cam = State::getCamera();
     143//   if( cam != NULL)
     144//     this->setParent(cam);
    144145}
    145146
     
    188189    return 0;
    189190}
    190 
    191 
    192 void BlackScreen::build()
    193 {
    194   StaticModel* model = new StaticModel();
    195 
    196   float size = 10.;
    197 
    198   model->addVertex (-size, -size, size);
    199   model->addVertex (size, -size, size);
    200   model->addVertex (-size, size, size);
    201   model->addVertex (size, size, size);
    202   model->addVertex (-size, size, -size);
    203   model->addVertex (size, size, -size);
    204   model->addVertex (-size, -size, -size);
    205   model->addVertex (size, -size, -size);
    206 
    207 
    208   model->addVertexNormal (0.0, 0.0, 1.0);
    209   model->addVertexNormal (0.0, 1.0, 0.0);
    210   model->addVertexNormal (0.0, 0.0, -1.0);
    211   model->addVertexNormal (0.0, -1.0, 0.0);
    212   model->addVertexNormal (1.0, 0.0, 0.0);
    213   model->addVertexNormal (-1.0, 0.0, 0.0);
    214 
    215   model->addVertexTexture (0.0, 1.0);
    216   model->addVertexTexture (1.0, 1.0);
    217   model->addVertexTexture (1.0, 0.0);
    218   model->addVertexTexture (0.0, 0.0);
    219 
    220   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,4, 0,1,4, 2,2,4, 4,3,4); // back
    221   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,0,5, 7,1,5, 5,2,5, 3,3,5); // front
    222   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,1, 7,1,1, 1,2,1, 0,3,1); // bottom
    223   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,0,3, 3,1,3, 5,2,3, 4,3,3); // top
    224   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 4,2,2, 5,3,2, 7,0,2, 6,1,2); // left
    225   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 0,0,0, 1,1,0, 3,2,0, 2,3,0); // right
    226 
    227   model->finalize();
    228 
    229   this->setModel(model);
    230 }
  • trunk/src/world_entities/blackscreen.h

    r10403 r10404  
    3636    virtual void draw() const;
    3737
    38   private:
    39     void build();
    4038
    4139};
  • trunk/src/world_entities/cameraman.cc

    r10403 r10404  
    2222#include "script_class.h"
    2323#include "loading/load_param_xml.h"
     24#include "blackscreen.h"
     25#include "p_node.h"
     26#include "camera.h"
    2427
    2528ObjectListDefinition(CameraMan);
     29
     30SHELL_COMMAND(camerainfo, CameraMan, cameraInfo);
    2631
    2732
     
    207212
    208213
     214void CameraMan::cameraInfo()
     215{
     216  bool sameCam = (this->currentCam == State::getCamera());
     217
     218
     219  PRINT(0)("==== CameraMan::cameraInfo ===\n");
     220  PRINT(0)("=  Camera Name: %s\n", this->currentCam->getName().c_str());
     221  PRINT(0)("=  Tests:\n");
     222  PRINT(0)("==  State::Cam == this::Cam  %i\n", sameCam);
     223  PRINT(0)("==  Parenting Informations:\n");
     224  this->currentCam->debugNode(10);
     225  PRINT(0)("==============================\n");
     226}
     227
     228
     229float CameraMan::getCurrCameraCoorX()
     230{ return this->currentCam->getAbsCoorX(); }
     231
     232float CameraMan::getCurrCameraCoorY()
     233{ return this->currentCam->getAbsCoorY(); }
     234
     235float CameraMan::getCurrCameraCoorZ()
     236{ return this->currentCam->getAbsCoorZ(); }
     237
     238
     239
    209240//how to get a class fkt pointer
    210241
  • trunk/src/world_entities/cameraman.h

    r10403 r10404  
    22#define _CAMERAMAN_H
    33
    4 #include "p_node.h"
    5 #include "camera.h"
     4
    65#include <vector>
    76#include "base_object.h"
    8 #include "blackscreen.h"
     7
     8class BlackScreen;
     9class Camera;
     10class PNode;
    911
    1012class CameraMan : public BaseObject {
     
    3739    void togglFade();
    3840
     41    void cameraInfo();
     42
    3943    /// LOADING
    4044    virtual void loadParams(const TiXmlElement* root);
    4145
    4246    /// POLLING
    43     float getCurrCameraCoorX(){ return this->currentCam->getAbsCoorX(); }
    44     float getCurrCameraCoorY(){ return this->currentCam->getAbsCoorY(); }
    45     float getCurrCameraCoorZ(){ return this->currentCam->getAbsCoorZ(); }
     47    float getCurrCameraCoorX();
     48    float getCurrCameraCoorY();
     49    float getCurrCameraCoorZ();
    4650    bool cameraIsInVector(Camera* camera);
    4751
  • trunk/src/world_entities/sound_entity.cc

    r10403 r10404  
    2222
    2323#include "sound/resource_sound_buffer.h"
     24
    2425
    2526
Note: See TracChangeset for help on using the changeset viewer.