Changeset 2371 for OpenSceneGraph/trunk/examples/osgcluster/osgcluster.cpp
- Timestamp:
- 10/10/03 11:41:04 (10 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgcluster/osgcluster.cpp
r1960 r2371 38 38 39 39 CameraPacket():_masterKilled(false) 40 {41 _byte_order = 0x12345678;42 }40 { 41 _byte_order = 0x12345678; 42 } 43 43 44 44 void setPacket(const osg::Matrix& matrix,const osg::FrameStamp* frameStamp) … … 54 54 { 55 55 56 matrix = _matrix * osg::Matrix::rotate( angle_offset,0.0f,1.0f,0.0f);57 } 58 59 void checkByteOrder( void )60 {61 if( _byte_order == 0x78563412 ) // We're backwards62 {63 swapBytes( _byte_order );64 swapBytes( _masterKilled );65 for( int i = 0; i < 16; i++ )66 swapBytes( _matrix.ptr()[i] );67 68 // umm.. we should byte swap _frameStamp too...69 }70 }56 matrix = _matrix * osg::Matrix::rotate(osg::DegreesToRadians(angle_offset),0.0f,1.0f,0.0f); 57 } 58 59 void checkByteOrder( void ) 60 { 61 if( _byte_order == 0x78563412 ) // We're backwards 62 { 63 swapBytes( _byte_order ); 64 swapBytes( _masterKilled ); 65 for( int i = 0; i < 16; i++ ) 66 swapBytes( _matrix.ptr()[i] ); 67 68 // umm.. we should byte swap _frameStamp too... 69 } 70 } 71 71 72 72 … … 128 128 129 129 float camera_fov=45.0f; 130 while (arguments.read("-f",camera_fov)) ; 130 while (arguments.read("-f",camera_fov)) 131 { 132 std::cout << "setting lens perspective : original "<<viewer.getLensHorizontalFov()<<" "<<viewer.getLensVerticalFov()<<std::endl; 133 viewer.setLensPerspective(camera_fov,camera_fov*viewer.getLensVerticalFov()/viewer.getLensHorizontalFov(),1.0f,1000.0f); 134 std::cout << "setting lens perspective : new "<<viewer.getLensHorizontalFov()<<" "<<viewer.getLensVerticalFov()<<std::endl; 135 } 131 136 132 137 float camera_offset=45.0f;
