1
0
Fork 0
Commit graph

31 commits

Author SHA1 Message Date
Torsten Dreyer
1e43675f61 Expose some OSG DisplaySettings to the property tree 2010-09-05 11:56:38 +02:00
Tim Moore
b692a165fb Remove osgGA/MatrixManipulator include
From AndersG; the file is gone from recent OSG.
2010-06-06 23:31:47 +02:00
fredb
00e9ad3055 MINGW patch from Benoît Laniel 2010-01-25 17:12:04 +01:00
frohlich
d9d725f28d Remove obsolete version test.
Modified Files:
	src/Main/fg_os_osgviewer.cxx
2009-09-09 08:56:31 +02:00
Tim Moore
0a64405cad fix warnings in Main 2009-08-24 18:03:49 +02:00
timoore
f0bfb4d137 Realize viewer explicitly
The osgViewer needs to be "realized" so that, among other things, threading
will start. This is normally done by osgViewer::run, but we don't call
that.
Don't realize graphics contexts; Let osgViewer code do it. This way
osgViewer::isRealized returns the correct answer.
2009-06-15 11:25:06 +02:00
mfranz
1382c81dca add support for resizing mouse cursors
(except on OSX, where OSG uses a default)
2009-01-12 13:04:33 +01:00
timoore
d43e0b83f7 Expose the CameraGroup near, far, and near/far boundry as properties
The near/far boundary, called "near-field", can be set to 0 which
disables the far camera and renders the whole scene using only one
camera. I'm hoping that this may be useful in resolving some
system-specific rendering bugs.

Various fixes were made to correctly render the scene using only the
near camera.
2009-01-03 23:53:04 +01:00
timoore
4f4434787f Cleanup of camera code in preperation for shadows
Partition depth in CameraGroup:
Remove the ViewPartionNode scenegraph node. The split rendering of the
scene, done to avoid Z buffer precision problems, is now done by two
slave cameras of the viewer.

Rename FGManipulator to FGEventHandler.

Remove virtual member functions that aren't required for event handlers.

Begin using camera group properties to update cameras at runtime;
Initially only the viewport properties are used.

When no camera group is found in the property tree (the default),
create the properties for one. Expose the default window by name.

Add a test for Boost headers to configure.ac. Boost is now a
dependency.

Remove GLUT and SDL versions of the OSG graphics.
2008-11-18 22:45:57 +00:00
fredb
e5201fbb70 MSVC 7.1 fix 2008-08-02 10:01:08 +00:00
timoore
6f802959ce CameraGroup class for managing multiple cameras.
CameraGroup supports cameras opened in different windows or in the
same window, with flexible view and perspective specification.

Clean up mouse click handling via osgViewer. Don't let any camera
"have focus;" this forces events to be reported in window coordinates
and simplifies life. Don't use the osgViewer::View::requestWarpPointer
method; instead use our own code which only deals with window
coordinates.

Make glut and sdl versions work with CameraGroup too.
2008-08-01 15:57:29 +00:00
frohlich
61dc8df110 Implement rotation offsets for cameras. 2008-05-26 20:34:26 +00:00
timoore
580ebf637b Clean up OSG camera setup and interface to plib PUI
Switch to defining PU_USE_NONE and providing our own callback
functions to pui for "get window" and "get window size." A new
WindowSystemAdapter class assigns ID numbers to windows for the
purpose of identifying them to plib; the window size can be extracted
from the osg::GraphicsContext class in all the different
implementations (osgViewer, glut, sdl).

Implement a GraphicsContextOperation that runs code in a particular
graphics context, perhaps in another thread, and provides an
isFinished() method to test if the operation has finished. This allows
us to initialize plib PUI properly if there are multiple graphics
contexts without using fgMakeCurrent(). fgMakeCurrent() can't work in
multi-threaded OSG configurations.

Eliminate fgMakeCurrent() and all its uses, either by using
GraphicsContextOperation or by seeing that it is not necessary.

Attach the GUI camera as a slave camera.

Don't manipulate the OSG state in the drawImplementation() functions
for SGHUDAndPanelDrawable and SGPuDrawable; it's not needed.
2008-05-19 21:21:03 +00:00
mfranz
b61cc37e30 - let the OSG on-screen-statistics function no longer be hard-coded
on the '*'-key, but allow to cycle it by setting
  /sim/rendering/on-screen-statistics to "true"
- move that function to the Debug menu (no more key assigned!)
- add "print-statistics" menu entry
2008-04-20 18:24:52 +00:00
durk
8055c315ac Torsten Dreyer: Check whether a valid graphic context has been created
before using a camera.
2008-04-19 10:28:07 +00:00
timoore
fd492a297a model paging patch from Till Busch
From Till:
i started the project at the end of february with a simple idea: move all
3d-model loading to the DatabasePager-thread. my first attempts looked
promising, though they were a little too optimistic (or naive?). the patch
has evolved a lot since.

currently it does the following things:
1. revive SGModelLib, move functions for xml-model-loading there

2. replace all calls to sgLoad3dModel with calls to either
SGModelLib::loadModel() or SGModelLib::loadPagedModel()
almost all models will be loaded by the DatabasePager. the few exceptions are:
your own plane, shared models in scenery, random objects, AIBallistic models.

3. simplify mode-loading functions (avoid passing around fg_root)

4. avoid supurious MatrixTransform nodes in loaded models

5. fix some memory leaks
2008-03-22 09:31:06 +00:00
mfranz
e5c22e159f Tatsuhiro NISHIOKA: "enables osgviewer version of FlightGear to show
window frame, menubar, and Docks properly" (Mac OSX)
2008-03-12 12:38:54 +00:00
timoore
b47157041e Fix main window aspect ratios other than 4/3
This also fixes distortion weirdness in the osgviewer version. That
was caused by osg::GraphicsContext getting in the act on resize events
and adding its own scaling to the projectionOffset of slave cameras!
2008-01-25 18:44:45 +00:00
frohlich
b69ec6fceb Modified Files:
fg_os_osgviewer.cxx: Use the DISPLAY environment variable
	if not set otherwise.
2007-12-26 12:19:20 +00:00
timoore
616b2bf4f6 Use the OSG DatabasePager instead of FGTileLoader
Make an OSG file reader for .stg files.

New class flightgear::SceneryPager, which is a subclass
osg::DatabasePager to handle explicit delete requests.

Modify FGNewCache, FGTileEntry, and FGTileManager to use
SceneryPager. Mostly this involved removing the queues that talked to
FGTileLoader.

Calculate accurate tile timestamps from the time they are traversed in
the cull stage (which means that they are visible) instead of updating
them periodically.

Replace tile entry transform and range node with one LOD node
2007-12-14 22:51:56 +00:00
timoore
49f7330150 move callback registration functions to fg_os_common.cxx 2007-11-30 00:00:36 +00:00
timoore
411435a48f Make comparisons against OSG version less flakey
Turn OPENSCENEGRAPH_MAJOR_VERSION, OPENSCENEGRAPH_MINOR_VERSION and
OPENSCENEGRAPH_PATCH_VERSION into a single number for comparisons in the
preprocessor.
2007-10-04 20:40:29 +00:00
timoore
86c1a089a4 osgviewer mouse warp fixes
After a mouse warp drop all pointer motion events for the entire frame.

Author: Melchior FRANZ
2007-08-19 05:29:00 +00:00
timoore
3f41c9f91b Really implement fgWarpMouse for osgviewer
This fixes a bug that caused both the x and y values of the mouse to
be reset when the cursor was recentered due to hitting the screen
edge.

Based on a suggested patch from Stuart Buchanan
2007-08-18 22:07:11 +00:00
mfranz
9d0c571c9a Tim MOORE:
"This patch fixes the use of the keypad with numlock in the osgViewer
version of FlightGear."

"This also restores the handling of resize events while trying to stay
out of the way of the multiple display code."
2007-07-01 16:39:52 +00:00
fredb
69f0a797b3 OSG file renamed 2007-06-16 16:15:49 +00:00
mfranz
b5917d62d2 Tim MOORE:
FGManipulator.*:
"This patch works around a bug in OSG's handling of modifier keys. The
symptom of the bug is that modifier keys don't appear to be released."

fg_os_osgviewer.cxx:
"This patch fixes the test for support of cursor changes in OSG 2.0."
2007-06-16 09:39:56 +00:00
frohlich
01f9b2d7b2 Modified Files:
fg_os_osgviewer.cxx: Enable mouse cursor change code on
	sufficiently recent osg versions.
2007-06-08 07:14:56 +00:00
frohlich
b59e3fe6ec Modified Files:
src/GUI/dialog.cxx src/GUI/menubar.cxx
	src/Include/config.h-msvc8 src/Main/fg_os_osgviewer.cxx:
	Olaf Flebbe: build fixes for osgviewer on win32.
2007-05-30 13:15:14 +00:00
frohlich
46ccdeffd4 Modified Files:
src/Input/input.cxx src/Input/input.hxx
	src/Main/FGManipulator.cxx src/Main/fg_os.cxx
 	src/Main/fg_os.hxx src/Main/fg_os_osgviewer.cxx
	src/Main/fg_os_sdl.cxx src/Main/renderer.cxx
	src/Main/renderer.hxx: First cut of osg multi view configurations.
2007-05-26 13:53:46 +00:00
frohlich
7443b8b5e8 Modified Files:
configure.ac src/Main/Makefile.am src/Main/fg_os.cxx
	src/Main/fg_os.hxx src/Main/fg_os_sdl.cxx src/Main/main.cxx
	src/Main/renderer.cxx src/Main/renderer.hxx
	src/Network/jpg-httpd.cxx
Added Files:
	src/Main/FGManipulator.cxx src/Main/FGManipulator.hxx
	src/Main/fg_os_osgviewer.cxx:
	Tim Moore: Make use of osgViewer.
2007-05-21 17:50:02 +00:00