Changeset 3259 for code/branches/netp6
- Timestamp:
- Jun 30, 2009, 4:34:48 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/netp6/src/util/Math.cc
r3258 r3259 136 136 return orxonox::Vector2(0, 1); 137 137 } 138 138 139 139 float cos_value = clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1); 140 140 float sin_value = sqrt( 1 - cos_value*cos_value ); 141 141 142 142 if ((mydirection.crossProduct(myorthonormal)).dotProduct(distance) > 0) 143 143 return orxonox::Vector2( sin_value, cos_value ); … … 176 176 return orxonox::Vector2(0, 1); 177 177 } 178 float angle = acos(clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1)); 178 //float angle = acos(clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1)); 179 180 float cos_value = clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1); 181 float sin_value = sqrt( 1 - cos_value*cos_value ); 179 182 180 183 float distancelength = distance.length(); … … 183 186 184 187 if ((mydirection.crossProduct(myorthonormal)).dotProduct(distance) > 0) 185 return orxonox::Vector2( sin(angle) * radius, cos(angle)* radius);186 else 187 return orxonox::Vector2( -sin(angle) * radius, cos(angle)* radius);188 return orxonox::Vector2( sin_value * radius, cos_value * radius); 189 else 190 return orxonox::Vector2( -sin_value * radius, cos_value * radius); 188 191 } 189 192
Note: See TracChangeset
for help on using the changeset viewer.