Changeset 318 for trunk/VUT/GtpVisibilityPreprocessor/src/Vector3.h
- Timestamp:
- 10/11/05 19:25:27 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/Vector3.h
r176 r318 299 299 } 300 300 301 // angle between two vectors with respect to a surface normal in the 302 // range [0 .. 2 * pi] 303 inline float 304 Angle(const Vector3 &A, const Vector3 &B, const Vector3 &norm) 305 { 306 Vector3 cross = CrossProd(A, B); 307 308 float signedAngle; 309 310 if (DotProd(cross, norm) > 0) 311 signedAngle = atan2(-Magnitude(CrossProd(A, B)), DotProd(A, B)); 312 else 313 signedAngle = atan2(Magnitude(CrossProd(A, B)), DotProd(A, B)); 314 315 if (signedAngle < 0) 316 return 2 * PI + signedAngle; 317 318 return signedAngle; 319 } 320 301 321 inline Vector3 302 322 Vector3::operator+() const
Note: See TracChangeset
for help on using the changeset viewer.