Changeset 9742 for code/branches/radarDreiD/src/libraries
- Timestamp:
- Nov 4, 2013, 3:41:53 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/radarDreiD/src/libraries/util/Math.cc
r9740 r9742 223 223 224 224 xinvtransform.x = (myside.y * myorthonormal.z - myorthonormal.y * myside.z )*invdet; 225 xinvtransform.y= -(mydirection.y * myorthonormal.z - mydirection.z * myorthonormal.y)*invdet;226 xinvtransform.z= (mydirection.y * myside.z - mydirection.z * myside.y )*invdet;227 yinvtransform.x= -(myside.x * myorthonormal.z - myside.z * myorthonormal.x)*invdet;225 yinvtransform.x = -(mydirection.y * myorthonormal.z - mydirection.z * myorthonormal.y)*invdet; 226 zinvtransform.x = (mydirection.y * myside.z - mydirection.z * myside.y )*invdet; 227 xinvtransform.y = -(myside.x * myorthonormal.z - myside.z * myorthonormal.x)*invdet; 228 228 yinvtransform.y = (mydirection.x * myorthonormal.z - mydirection.z * myorthonormal.x)*invdet; 229 yinvtransform.z= -(mydirection.x * myside.z - myside.x * mydirection.z )*invdet;230 zinvtransform.x= (myside.x * myorthonormal.y - myorthonormal.x * myside.y )*invdet;231 zinvtransform.y= -(mydirection.x * myorthonormal.y - myorthonormal.x * mydirection.y )*invdet;229 zinvtransform.y = -(mydirection.x * myside.z - myside.x * mydirection.z )*invdet; 230 xinvtransform.z = (myside.x * myorthonormal.y - myorthonormal.x * myside.y )*invdet; 231 yinvtransform.z = -(mydirection.x * myorthonormal.y - myorthonormal.x * mydirection.y )*invdet; 232 232 zinvtransform.z = (mydirection.x * myside.y - myside.x * mydirection.x )*invdet; 233 233 … … 237 237 distance.z = (xinvtransform.z + yinvtransform.z + zinvtransform.z) * distance.z; 238 238 239 // cap vector for map 240 distance.x = clamp<float>(distance.x, -detectionlimit/5, detectionlimit/5); 241 distance.y = clamp<float>(distance.y, -detectionlimit/5, detectionlimit/5); 242 distance.z = clamp<float>(distance.z, -detectionlimit/5, detectionlimit/5); 243 float distancelength = distance.length(); 244 distance = distance / distancelength; 245 239 246 // project vector for the rotated 3DMap on screen 240 float xcoordinate = distance.y /(2*detectionlimit);241 float ycoordinate = (distance.x*sin(mapangle)+distance.z*cos(mapangle)) /(2*detectionlimit);247 float xcoordinate = distance.y; 248 float ycoordinate = (distance.x*sin(mapangle)+distance.z*cos(mapangle)); 242 249 return orxonox::Vector2(xcoordinate , ycoordinate); 243 250 }
Note: See TracChangeset
for help on using the changeset viewer.