Changeset 3615 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- Mar 21, 2005, 2:37:43 PM (20 years ago)
- Location:
- orxonox/trunk/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/primitive.cc
r3614 r3615 34 34 { 35 35 this->form = form; 36 this->size = 0.2f; 37 this->segments = 6; 36 38 this->object = gluNewQuadric(); 37 39 … … 81 83 82 84 /** 85 \brief set number of segments 86 \param segment count 87 88 the more segments the body has, the smoother it seems. This function makes only 89 sense with speres and cylinders, cubes have constant number of segments :) 90 */ 91 void Primitive::setSegments(int segments) 92 { 93 if( segments <= 0) 94 { 95 PRINTF(1)("number of segments must be more than 0! not setting segment number\n"); 96 } 97 this->segments = segments; 98 } 99 100 /** 83 101 \brief stets the material 84 102 \param material to be set … … 156 174 { 157 175 case P_SPHERE: 158 gluSphere(this->object, 0.2, 6, 6);176 gluSphere(this->object, this->size, this->segments, this->segments); 159 177 break; 160 178 case P_CUBE: … … 162 180 break; 163 181 case P_CYLINDER: 164 gluCylinder(this->object, 1, 1, 2, 6, 6);182 gluCylinder(this->object, this->size, this->size, this->size * 2, this->segments, this->segments); 165 183 break; 166 184 case P_DISK: 167 gluDisk(this->object, 1, 2, 6, 6);185 gluDisk(this->object, this->size, 2, this->segments, this->segments); 168 186 break; 169 187 default: -
orxonox/trunk/src/world_entities/primitive.h
r3614 r3615 19 19 void setForm(pForm form); 20 20 void setSize(float size); 21 void setSegments(int segments); 21 22 void setMaterial(Material* material); 22 23 void setTexture(char* name); … … 36 37 char* textureName; 37 38 float size; 39 float segments; 38 40 39 41 void glDrawCube();
Note: See TracChangeset
for help on using the changeset viewer.