Changeset 3049 for code/trunk/src/util
- Timestamp:
- May 25, 2009, 3:26:43 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/util/Math.cc
r2171 r3049 129 129 130 130 float projectionlength = projection.length(); 131 if (projectionlength == 0) return orxonox::Vector2(0, 0); 131 if (projectionlength == 0) 132 { 133 if (myposition.dotProduct(otherposition) >= 0) 134 return orxonox::Vector2(0, 0); 135 else 136 return orxonox::Vector2(0, 1); 137 } 138 132 139 float angle = acos(clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1)); 133 140 … … 161 168 162 169 float projectionlength = projection.length(); 163 if (projectionlength == 0) return orxonox::Vector2(0, 0); 170 if (projectionlength == 0) 171 { 172 if (myposition.dotProduct(otherposition) >= 0) 173 return orxonox::Vector2(0, 0); 174 else 175 return orxonox::Vector2(0, 1); 176 } 164 177 float angle = acos(clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1)); 165 178
Note: See TracChangeset
for help on using the changeset viewer.