Changeset 4842 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Jul 12, 2005, 10:55:44 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/graphics/spatial_separation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.cc
r4841 r4842 105 105 * @param playerModel the model that this measurement is based on 106 106 \return the dimension of the AbstractModel as a Rectangle 107 108 The rectangle is x-z axis aligned. ATTENTION: if there are any vertices in the model, that exceed the 109 size of 999999.0, there probably will be some errors in the dimensions calculations. 107 110 */ 108 111 Rectangle* SpatialSeparation::getDimension(AbstractModel* playerModel) 109 112 { 113 float maxX, maxY; //!< the maximal coordinates axis 114 float minX, minY; //!< minimal axis coorindates 115 const float* pVertices; //!< pointer to the current vertices 110 116 117 maxX = -999999; maxY = -999999; 118 minX = 999999; minY = 999999; 119 /* get maximal/minimal x/y */ 120 for( int i = 0; i < playerModel->getModelInfo()->numVertices; ++i) 121 { 122 pVertices = &playerModel->getModelInfo()->pVertices[i * 3]; 123 if( pVertices[0] > maxX) 124 maxX = pVertices[0]; 125 if( pVertices[2] > maxY) 126 maxY = pVertices[2]; 127 128 if( pVertices[0] < minX) 129 minX = pVertices[0]; 130 if( pVertices[2] < minY) 131 minY = pVertices[2]; 132 133 PRINTF(0)("Dimension Informationation: X: min/max %f/%f Y: min/max %f/%f\n", minX, maxX, minY, maxY); 134 } 111 135 } 112 136 113 137 114 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 -
orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.h
r4841 r4842 1 1 /*! 2 \file spatial_separation.h 3 * Definition of the generic spatial separation process of model data 4 2 \file spatial_separation.h Definition of the generic spatial separation process of model data 5 3 */ 6 4 … … 40 38 Vector center; 41 39 float axis[2]; 40 }; 42 41 43 };44 42 45 43 //! A class for spatial separation of vertices based arrays
Note: See TracChangeset
for help on using the changeset viewer.