Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 25, 2006, 11:30:59 AM (18 years ago)
Author:
ponder
Message:
  • Applied a small change to sounrd_buffer and ogg_player in order to load the buffers correctly on big endian systems.
  • Did a lot of cleanup for the terrain rendering system. Added destructors and constructors.
  • The cameras clip-space has to be set to a very large range to display the skybox. The maximum clip distance for the terrain needs to be smaller.
File:
1 edited

Legend:

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

    r8697 r8775  
    1818#include "glincl.h"
    1919#include <stdio.h>
     20
     21
     22#define MAX_CLIP_DISTANCE 400.0f
    2023#define m( _row,_col )  _m[_col*4+_row-5]
    2124
     
    9598                                                         m( 3, 3 ) + m( 4, 3 ),
    9699                                                         m( 3, 4 ) + m( 4, 4 ) );
     100                                                       
    97101                        planes[FAR].setCoefficients(
    98102                                                        -m( 3, 1 ) + m( 4, 1 ),
     
    100104                                                        -m( 3, 3 ) + m( 4, 3 ),
    101105                                                        -m( 3, 4 ) + m( 4, 4 ) );
     106                                                       
    102107                        planes[BOTTOM].setCoefficients(
    103108                                                         m( 2, 1 ) + m( 4, 1 ),
     
    105110                                                         m( 2, 3 ) + m( 4, 3 ),
    106111                                                         m( 2, 4 ) + m( 4, 4 ) );
     112                                                       
    107113                        planes[TOP].setCoefficients( 
    108114                                                        -m( 2, 1 ) + m( 4, 1 ),
     
    110116                                                        -m( 2, 3 ) + m( 4, 3 ),
    111117                                                        -m( 2, 4 ) + m( 4, 4 ) );
     118                                                       
    112119                        planes[LEFT].setCoefficients( 
    113120                                                         m( 1, 1 ) + m( 4, 1 ),
     
    115122                                                         m( 1, 3 ) + m( 4, 3 ),
    116123                                                         m( 1, 4 ) + m( 4, 4 ) );
     124                                                       
    117125                        planes[RIGHT].setCoefficients(
    118126                                                        -m( 1, 1 ) + m( 4, 1 ),
     
    120128                                                        -m( 1, 3 ) + m( 4, 3 ),
    121129                                                        -m( 1, 4 ) + m( 4, 4 ) );
     130                                                       
     131                        if ( planes[NEAR].d +planes[FAR].d  > MAX_CLIP_DISTANCE ) {
     132                                planes[FAR].d = -planes[NEAR].d+MAX_CLIP_DISTANCE;
     133                        }
    122134                }
    123135               
Note: See TracChangeset for help on using the changeset viewer.