Changeset 3756 in orxonox.OLD for orxonox/branches/convention/src/world_entities
- Timestamp:
- Apr 8, 2005, 12:54:23 AM (20 years ago)
- Location:
- orxonox/branches/convention
- Files:
-
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/convention/src/world_entities/test_mat.cc
r3752 r3756 18 18 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY 19 19 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" 24 26 using namespace std; 25 27 … … 29 31 \todo this constructor is not jet implemented - do it 30 32 */ 31 ProtoClass::ProtoClass()33 TestMat::TestMat () 32 34 { 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; 34 52 } 35 53 54 void TestMat::enable() 55 { 56 this->enabled = true; 57 } 36 58 37 59 /** … … 39 61 40 62 */ 41 ProtoClass::~ProtoClass()63 TestMat::~TestMat () 42 64 { 43 65 // delete what has to be deleted here 44 66 } 45 67 46 /**47 \brief nonsense - delete this method48 \param realy nothing to give49 \returns true or false - probably nothing?50 68 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) {} 69 void 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 } -
orxonox/branches/convention/src/world_entities/test_mat.h
r3752 r3756 1 1 /*! 2 \file proto_class.h2 \file test_mat.h 3 3 \brief Definition of the proto class template, used quickly start work 4 4 \todo Example: this shows how to use simply add a Marker that here has to be done something. … … 8 8 */ 9 9 10 #ifndef _ PROTO_CLASS_H11 #define _ PROTO_CLASS_H10 #ifndef _TEST_MAT_H 11 #define _TEST_MAT_H 12 12 13 #include "what realy has to be included" 14 #include "base_object.h" 13 #include "world_entity.h" 15 14 16 // FORWARD DEFINITION \\17 class someClassWeNeed;18 15 // FORWARD DEFINITION 16 class Model; 17 class Material; 19 18 20 19 /*class Test;*/ /* forward definition of class Test (without including it here!)*/ … … 24 23 here can be some longer description of this class 25 24 */ 26 class ProtoClass : public BaseObject { 25 class TestMat : public WorldEntity 26 { 27 27 28 28 public: 29 ProtoClass();30 virtual ~ ProtoClass();29 TestMat(); 30 virtual ~TestMat(); 31 31 32 bool doNonSense (int nothing); 32 void enable(); 33 34 virtual void draw(); 35 33 36 34 37 private: 35 int nonSense; //!< doxygen tag here like this for all the variables - delete this variable if you use this 38 Model* model1,* model2,* model3,* model4; 39 Material* mat1, *mat2, *mat3, *mat4; 40 41 bool enabled; 36 42 37 43 }; 38 44 39 #endif /* _ PROTO_CLASS_H */45 #endif /* _TEST_MAT_H */
Note: See TracChangeset
for help on using the changeset viewer.