Ignore:
Timestamp:
10/11/05 19:25:27 (19 years ago)
Author:
mattausch
Message:

VisibilityInfo?: query sort operators as templates
X3dExporter: Fixed polygon wire frame, bsp splits, and bsp split planes visualization
ViewCellBsp?: Added rays to split criteria (not finished yet)
OgreOctreeSceneManager?: fixed error (mNumOctants instead of mNumOctrees)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/Vector3.h

    r176 r318  
    299299} 
    300300 
     301// angle between two vectors with respect to a surface normal in the 
     302// range [0 .. 2 * pi] 
     303inline float 
     304Angle(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 
    301321inline Vector3 
    302322Vector3::operator+() const 
Note: See TracChangeset for help on using the changeset viewer.