Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 8, 2005, 12:54:23 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches: added new branche convention for some showing stuff at the convention

Location:
orxonox/branches/convention
Files:
2 copied

Legend:

Unmodified
Added
Removed
  • orxonox/branches/convention/src/world_entities/test_mat.cc

    r3752 r3756  
    1818#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
    1919
    20 #include "proto_class.h"
    21 
    22 #include "stdincl.h" // maybe
    23 
     20#include "test_mat.h"
     21#include "resource_manager.h"
     22#include "material.h"
     23#include "model.h"
     24#include "primitive_model.h"
     25#include "light.h"
    2426using namespace std;
    2527
     
    2931   \todo this constructor is not jet implemented - do it
    3032*/
    31 ProtoClass::ProtoClass ()
     33TestMat::TestMat ()
    3234{
    33    this->setClassName ("ProtoClass");
     35   this->setClassName ("TestMat");
     36
     37   /*   this->model1 = (Model*)ResourceManager::getInstance()->load("cube", PRIM, RP_LEVEL);
     38        this->model2 = (Model*)ResourceManager::getInstance()->load("sphere", PRIM, RP_LEVEL);
     39        this->model3 = (Model*)ResourceManager::getInstance()->load("cylinder", PRIM, RP_LEVEL);
     40        this->model4 = (Model*)ResourceManager::getInstance()->load("cone", PRIM, RP_LEVEL);
     41   */
     42   this->model1 = new PrimitiveModel(SPHERE);
     43   this->model2 = new PrimitiveModel(CUBE);
     44   this->model3 = new PrimitiveModel(CONE);
     45   this->model4 = new PrimitiveModel(CYLINDER);
     46   this->mat1 = new Material();
     47   this->mat2 = new Material();
     48   this->mat3 = new Material();
     49   this->mat4 = new Material();
     50   
     51   this->enabled = false;
    3452}
    3553
     54void TestMat::enable()
     55{
     56  this->enabled = true;
     57}
    3658
    3759/**
     
    3961
    4062*/
    41 ProtoClass::~ProtoClass ()
     63TestMat::~TestMat ()
    4264{
    4365  // delete what has to be deleted here
    4466}
    4567
    46 /**
    47    \brief nonsense - delete this method
    48    \param realy nothing to give
    49    \returns true or false - probably nothing?
    5068
    51    this is just to show the doxygen abilities (this for example is an extension for a long comment)
    52 */
    53 bool ProtoClass::doNonSense (int nothing) {}
     69void TestMat::draw()
     70{
     71  if (this->enabled)
     72    {
     73      glPushMatrix();
     74      this->mat1->select();
     75      this->model1->draw();
     76     
     77      glTranslatef(0,0,2);
     78      this->mat2->select();
     79      this->model2->draw();
     80     
     81      glTranslatef(0,2,-2);
     82      this->mat3->select();
     83      this->model3->draw();
     84     
     85      glTranslatef(0,0,2);
     86      this->mat4->select();
     87      this->model4->draw();
     88      glPopMatrix();
     89    }
     90}
Note: See TracChangeset for help on using the changeset viewer.