Changeset 7584 in orxonox.OLD for branches/cd/src
- Timestamp:
- May 11, 2006, 12:21:46 AM (19 years ago)
- Location:
- branches/cd/src/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cd/src/lib/collision_detection/obb_tree_node.cc
r7583 r7584 158 158 Vector t1, t2; //!< temporary values 159 159 float covariance[3][3] = {0,0,0, 0,0,0, 0,0,0};//!< the covariance matrix 160 sVec3D* tmpVec = NULL; //!< a temp saving place for sVec3Ds160 const float* tmpVec = NULL; //!< a temp saving place for sVec3Ds 161 161 162 162 /* fist compute all the convex hull face/facelets and centroids */ 163 163 for( int i = 0; i < length ; ++i) 164 164 { 165 tmpVec = ( sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[0]]);166 p = *tmpVec;167 tmpVec = ( sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[1]]);168 q = *tmpVec;169 tmpVec = ( sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[2]]);170 r = *tmpVec;165 tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[0]]); 166 p = tmpVec; 167 tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[1]]); 168 q = tmpVec; 169 tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[2]]); 170 r = tmpVec; 171 171 172 172 /* finding the facelet surface via cross-product */ … … 195 195 for( int i = 0; i < length; ++i) 196 196 { 197 tmpVec = ( sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[0]]);198 p = *tmpVec;199 tmpVec = ( sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[1]]);200 q = *tmpVec;201 tmpVec = ( sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[2]]);202 r = *tmpVec;197 tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[0]]); 198 p = tmpVec; 199 tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[1]]); 200 q = tmpVec; 201 tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[2]]); 202 r = tmpVec; 203 203 204 204 covariance[j][k] = facelet[i] * (9.0f * centroid[i][j] * centroid[i][k] + p[j] * p[k] + … … 291 291 PRINTF(3)("Calculate Box Axis\n"); 292 292 /* now get the axis length */ 293 Line ax[3]; //!< the axis294 293 float halfLength[3]; //!< half length of the axis 295 294 float tmpLength; //!< tmp save point for the length … … 299 298 float maxLength[3]; //!< maximal lenth of the axis 300 299 float minLength[3]; //!< minimal length of the axis 301 const float* tmpVec; //!< variable taking tmp vectors300 const float* tmpVec; //!< variable taking tmp vectors 302 301 303 302 … … 313 312 tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]]); 314 313 tmpLength = p0.distancePoint(tmpVec); 315 PRINTF(0)("point[%i][%i]: %f, %f, %f with distance to plane: %f\n", j, i, tmpVec[0], tmpVec[1], tmpVec[2], tmpLength);316 314 if( tmpLength > maxLength[0]) 317 315 maxLength[0] = tmpLength; -
branches/cd/src/lib/math/vector.h
r7191 r7584 85 85 /** copy constructor* @param v the sVec3D to assign to this vector. @returns the vector v */ 86 86 inline const Vector& operator= (const sVec3D& v) { this->x = v[0]; this->y = v[1]; this->z = v[2]; } 87 inline const Vector& operator= (const float* v) { this->x = v[0]; this->y = v[1]; this->z = v[2]; } 87 88 /** @param v: the other vector \return the dot product of the vectors */ 88 89 float dot (const Vector& v) const { return x*v.x+y*v.y+z*v.z; };
Note: See TracChangeset
for help on using the changeset viewer.