Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 24, 2006, 12:59:44 PM (18 years ago)
Author:
bensch
Message:

some newlines

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/terrain/src/lib/graphics/importer/terrain/frustum.h

    r9414 r9415  
    11/*
    22        orxonox - the future of 3D-vertical-scrollers
    3  
     3
    44        Copyright (C) 2006 orx
    5  
     5
    66        This program is free software; you can redistribute it and/or modify
    77        it under the terms of the GNU General Public License as published by
    88        the Free Software Foundation; either version 2, or (at your option)
    99        any later version.
    10  
     10
    1111        ### File Specific:
    1212        main programmer: Marco Biasini
    13  
     13
    1414 */
    1515#ifndef _FRUSTUM_H
     
    3131        }\
    3232        while ( 0 )
    33        
    34 /** 
     33
     34/**
    3535 * Code borrowed from Lighthouse 3D. Its a very good tutorial on culling.
    3636 */
     
    4040
    4141        public:
    42                
     42
    4343                enum { NEAR = 0 , FAR = 1, TOP = 2, BOTTOM = 3, LEFT = 4, RIGHT = 5 };
    44                 enum { OUTSIDE, INTERSECT, INSIDE };           
    45                
     44                enum { OUTSIDE, INTERSECT, INSIDE };
     45
    4646                Frustum()
    4747                {
     
    6565                        setFrustum( combined );
    6666                }
    67                
     67
    6868                inline int boxInFrustum( const ABox& _box )
    6969                {
     
    7575                                if ( planes[i].distancePoint( _box.vertexP( planes[i].n ) ) < 0 )
    7676                                        return OUTSIDE;
    77                                 // is the negative vertex outside?     
     77                                // is the negative vertex outside?
    7878                                else if ( planes[i].distancePoint( _box.vertexN( planes[i].n ) ) < 0 )
    7979                                        result = INTERSECT;
     
    8181                        return result;
    8282                }
    83                
     83
    8484                inline int pointInFrustum( const Vector& _point)
    8585                {
     
    8989                                        return OUTSIDE;
    9090                        }
    91                         return result;         
     91                        return result;
    9292                }
    93                
     93
    9494                inline Plane getPlane( int _plane ) { return planes[_plane]; }
    95                
     95
    9696                inline void setFrustum( float *_m )
    9797                {
    98                         planes[NEAR] =  Plane( Vector( 
    99                                 m(2,0) + m(3,0), 
    100                                 m(2,1) + m(3,1), 
    101                                 m(2,2) + m(3,2) ), 
     98                        planes[NEAR] =  Plane( Vector(
     99                                m(2,0) + m(3,0),
     100                                m(2,1) + m(3,1),
     101                                m(2,2) + m(3,2) ),
    102102                                m(2,3) + m(3,3) );
    103                                
    104                         planes[FAR] = Plane( Vector( 
     103
     104                        planes[FAR] = Plane( Vector(
    105105                                -m(2,0) + m(3,0),
    106106                                -m(2,1) + m(3,1),
    107107                                -m(2,2) + m(3,2) ),
    108108                                -m(2,3) + m(3,3) );
    109                                                                        
    110                         planes[BOTTOM] = Plane( Vector( 
    111                                 m(1,0) + m(3,0), 
    112                                 m(1,1) + m(3,1), 
    113                                 m(1,2) + m(3,2) ), 
     109
     110                        planes[BOTTOM] = Plane( Vector(
     111                                m(1,0) + m(3,0),
     112                                m(1,1) + m(3,1),
     113                                m(1,2) + m(3,2) ),
    114114                                m(1,3) + m(3,3) );
    115                         planes[TOP] = Plane( Vector( 
     115                        planes[TOP] = Plane( Vector(
    116116                                -m(1,0) + m(3,0),
    117117                                -m(1,1) + m(3,1),
    118118                                -m(1,2) + m(3,2) ),
    119119                                -m(1,3) + m(3,3) );
    120                         planes[LEFT] = Plane( Vector( 
     120                        planes[LEFT] = Plane( Vector(
    121121                                m(0,0) + m(3,0),
    122122                                m(0,1) + m(3,1),
    123123                                m(0,2) + m(3,2) ),
    124124                                m(0,3) + m(3,3) );
    125                         planes[RIGHT] =  Plane( Vector( 
     125                        planes[RIGHT] =  Plane( Vector(
    126126                                -m(0,0) + m(3,0),
    127127                                -m(0,1) + m(3,1),
    128128                                -m(0,2) + m(3,2) ),
    129129                                -m(0,3) + m(3,3) );
    130                                                        
     130
    131131                        if ( planes[NEAR].k +planes[FAR].k  > MAX_CLIP_DISTANCE ) {
    132132                                planes[FAR].k = -planes[NEAR].k+MAX_CLIP_DISTANCE;
    133133                        }
    134134                }
    135                
     135
    136136        protected:
    137137                Plane           *planes;
Note: See TracChangeset for help on using the changeset viewer.