Changeset 3258
- Timestamp:
- Jun 30, 2009, 4:24:36 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/netp6/src/util/Math.cc
r3196 r3258 136 136 return orxonox::Vector2(0, 1); 137 137 } 138 139 float angle = acos(clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1)); 140 138 139 float cos_value = clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1); 140 float sin_value = sqrt( 1 - cos_value*cos_value ); 141 141 142 if ((mydirection.crossProduct(myorthonormal)).dotProduct(distance) > 0) 142 return orxonox::Vector2( sin(angle), cos(angle));143 else 144 return orxonox::Vector2( -sin(angle), cos(angle));143 return orxonox::Vector2( sin_value, cos_value ); 144 else 145 return orxonox::Vector2( -sin_value, cos_value ); 145 146 } 146 147
Note: See TracChangeset
for help on using the changeset viewer.