Changeset 68
- Timestamp:
- Dec 16, 2004, 5:56:02 PM (20 years ago)
- Location:
- Swollen
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Swollen/doc/contract2_hours.txt
r65 r68 3 3 ------------------ 4 4 5 6 16 Decomber, Thursday (10am-6pm) 7 - terrain manipulator added 8 - -version flag 9 - toggling between terrain manipulator and trackball for lighting 10 - experiments with cairns ubd map 5 11 6 12 15 December, Wednesday (4 hours) -
Swollen/doc/contract2_priorities.txt
r65 r68 33 33 - Optional height-dependent semi-transparent water surface [0] 34 34 - added -nosky command-line option to appease those who want a plain background [?] 35 - add -version command line flag synced with Subversion revision number (useful for debugging) [?] 35 36 36 37 … … 43 44 - Output coordinates defining camera position [?] 44 45 - Ability to handle scenes with a resolution of 500,000+ triangles [3] 46 - Interactive positioning of light(s) [0] 47 - Ability to have shading on bed-surface. This was the case with 48 distro31052004 and is very useful with large scale topographies. 49 Please have a look at the file Hobart_first_order_size77670.sww using 50 both swwviewer and swollen and let Ole know what you think. 51 Perhaps default to that standard background in the absence of bedslope.jpg 52 or perhaps tie in with the geotiff item by having such a default behaviour. 53 45 54 46 55 … … 74 83 - Scene augmentation with OSG models [2] 75 84 - Optional contour lines of water surface [1] 76 - Ability to have shading on bed-surface. This was the case with77 distro31052004 and is very useful with large scale topographies.78 Please have a look at the file Hobart_first_order_size77670.sww using79 both swwviewer and swollen and let Ole know what you think.80 Perhaps default to that standard background in the absence of bedslope.jpg81 or perhaps tie in with the geotiff item by having such a default behaviour.82 85 83 86 … … 93 96 - Ability to show earthquakes [0] 94 97 - Concept of 'buildings' and shaking them [0] 95 - Interactive positioning of light(s) [0]96 98 - user feedback should differentiate between "sww file not found" and 97 99 "sww file couldn't read" [1] 98 - add -version command line flag synced with Subversion revision number (useful for debugging) [?]99 100 - prune -help documentation removing irrelevant options [?] 100 101 -
Swollen/swollen/keyboardeventhandler.cpp
r48 r68 5 5 KeyboardEventHandler::KeyboardEventHandler( int nTimesteps, float tps) 6 6 { 7 _paused = DEF_PAUSED_START;8 _direction = 1;9 _ntimesteps = nTimesteps;10 _tps = tps;11 _tpsorig = tps;12 _timestepchanged = false;13 _timestep = 0;14 _prevtime = 0;15 _togglewireframe = false;7 _paused = DEF_PAUSED_START; 8 _direction = 1; 9 _ntimesteps = nTimesteps; 10 _tps = tps; 11 _tpsorig = tps; 12 _timestepchanged = false; 13 _timestep = 0; 14 _prevtime = 0; 15 _togglewireframe = false; 16 16 } 17 17 … … 23 23 if( ea.getEventType() == osgGA::GUIEventAdapter::KEYDOWN ) 24 24 { 25 switch( ea.getKey() ) 25 switch( ea.getKey() ) 26 { 27 case osgGA::GUIEventAdapter::KEY_Space: 28 _paused = _paused ? false : true; 29 handled = true; 30 break; 31 32 case osgGA::GUIEventAdapter::KEY_Up: 33 if( !_paused ) _tps *= 1.5; 34 handled = true; 35 break; 36 37 case osgGA::GUIEventAdapter::KEY_Down: 38 if( !_paused ) _tps /= 1.5; 39 handled = true; 40 break; 41 42 case 'r': 43 _paused = DEF_PAUSED_START; 44 _tps = _tpsorig; 45 _timestep = 0; 46 _timestepchanged = true; 47 handled = true; 48 break; 49 50 case osgGA::GUIEventAdapter::KEY_Right: 51 if( _paused ) 26 52 { 27 case osgGA::GUIEventAdapter::KEY_Space: 28 _paused = _paused ? false : true; 29 handled = true; 30 break; 53 _timestep = (_timestep+1) % _ntimesteps; 54 _timestepchanged = true; 55 } 56 else 57 _direction = +1; 58 handled = true; 59 break; 31 60 32 case osgGA::GUIEventAdapter::KEY_Up: 33 if( !_paused ) _tps *= 1.5; 34 handled = true; 35 break; 61 case osgGA::GUIEventAdapter::KEY_Left: 62 if( _paused ) 63 { 64 _timestep = _timestep-1; 65 if( _timestep < 0 ) _timestep = _ntimesteps-1; 66 _timestepchanged = true; 67 } 68 else 69 _direction = -1; 70 handled = true; 71 break; 36 72 37 case osgGA::GUIEventAdapter::KEY_Down: 38 if( !_paused ) _tps /= 1.5; 39 handled = true; 40 break; 73 case 'w': 74 _togglewireframe = true; 75 handled = true; 76 break; 77 } 41 78 42 case 'r': 43 _paused = DEF_PAUSED_START; 44 _tps = _tpsorig; 45 _timestep = 0; 46 _timestepchanged = true; 47 handled = true; 48 break; 49 50 case osgGA::GUIEventAdapter::KEY_Right: 51 if( _paused ) 52 { 53 _timestep = (_timestep+1) % _ntimesteps; 54 _timestepchanged = true; 55 } 56 else 57 _direction = +1; 58 handled = true; 59 break; 60 61 case osgGA::GUIEventAdapter::KEY_Left: 62 if( _paused ) 63 { 64 _timestep = _timestep-1; 65 if( _timestep < 0 ) _timestep = _ntimesteps-1; 66 _timestepchanged = true; 67 } 68 else 69 _direction = -1; 70 handled = true; 71 break; 72 73 case 'w': 74 _togglewireframe = true; 75 handled = true; 76 break; 77 } 78 79 } 79 } 80 80 return handled; 81 81 } … … 84 84 void KeyboardEventHandler::setTime( float time) 85 85 { 86 87 88 89 90 91 92 93 94 95 86 if( !isPaused() && time - _prevtime > 1.0/_tps ) 87 { 88 _prevtime = time; 89 _timestep = _timestep + _direction; 90 if( _timestep == _ntimesteps ) 91 _timestep = 0; 92 else if( _timestep < 0 ) 93 _timestep = _ntimesteps-1; 94 _timestepchanged = true; 95 } 96 96 } 97 97 … … 99 99 bool KeyboardEventHandler::timestepChanged() 100 100 { 101 102 103 104 105 106 101 if( _timestepchanged ) 102 { 103 _timestepchanged = false; 104 return true; 105 } 106 return false; 107 107 } 108 108 … … 110 110 bool KeyboardEventHandler::toggleWireframe() 111 111 { 112 113 114 115 116 117 112 if( _togglewireframe ) 113 { 114 _togglewireframe = false; 115 return true; 116 } 117 return false; 118 118 } 119 119 -
Swollen/swollen/main.cpp
r67 r68 219 219 // light position manipulator matrix 220 220 osg::Matrixd matrix = trackball->getInverseMatrix(); 221 std::cout << matrix << std::endl;221 //std::cout << matrix << std::endl; 222 222 223 223 }
Note: See TracChangeset
for help on using the changeset viewer.