17#ifndef CAMERAGROUP_HXX
18#define CAMERAGROUP_HXX 1
27#include <osg/Referenced>
29#include <osg/TextureRectangle>
30#include <osg/Texture2D>
32#include <osgUtil/RenderBin>
33#include <osgViewer/View>
35#include <simgear/scene/viewer/Compositor.hxx>
88 simgear::compositor::Compositor::MVRInfo
mvr;
193 void update(
const osg::Vec3d& position,
194 const osg::Quat& orientation);
227 const osg::Vec2d& windowPos,
228 osgUtil::LineSegmentIntersector::Intersections&
248 osg::Viewport *viewport);
255 SGPropertyNode* node);
274 const osg::Vec2d& windowPos,
275 osgUtil::LineSegmentIntersector::Intersections&
static CameraGroup * getDefault()
Get the default CameraGroup.
const CameraList & getCameras()
void buildGUICamera(SGPropertyNode *cameraNode, GraphicsWindow *window=0)
Create a camera from properties that will draw the GUI and add it to the camera group.
friend bool computeIntersections(const CameraGroup *cgroup, const osg::Vec2d &windowPos, osgUtil::LineSegmentIntersector::Intersections &intersections)
Choose a camera using an event and do intersection testing on its view of the scene.
void buildSplashCamera(SGPropertyNode *cameraNode, GraphicsWindow *window=0)
Create a camera from properties that will draw the splash screen and add it to the camera group.
CameraInfo * getGUICamera() const
simgear::compositor::Compositor * buildVRMirrorCompositor(osg::GraphicsContext *gc, osg::Viewport *viewport)
Create a compositor for a VR mirror.
void removeCamera(CameraInfo *info)
Remove a camera from the camera group.
std::vector< osg::ref_ptr< CameraInfo > > CameraList
void resized()
Update camera properties after a resize event.
static osg::ref_ptr< CameraGroup > _defaultGroup
friend CameraGroupListener
double getMasterAspectRatio() const
get aspect ratio of master camera's viewport
std::unique_ptr< CameraGroupListener > _listener
friend void reloadCompositors(CameraGroup *cgroup)
Force a reload of all Compositor instances in the CameraGroup, except the one used by the GUI camera.
static CameraGroup * buildCameraGroup(osgViewer::View *viewer, SGPropertyNode *node)
Build a complete CameraGroup from a property node.
static void buildDefaultGroup(osgViewer::View *view)
Set the default CameraGroup, which is the only one that matters at this time.
CameraInfo * buildCamera(SGPropertyNode *cameraNode)
Create an osg::Camera from a property node and add it to the camera group.
static void setDefault(CameraGroup *group)
osg::ref_ptr< osgViewer::View > _viewer
void setCameraCullMasks(osg::Node::NodeMask nm)
Set the cull mask on all non-GUI cameras.
void setCameraParameters(float vfov, float aspectRatio)
Set the parameters of the viewer's master camera.
void setLODScale(float scale)
Set the LOD scale on all non-GUI cameras.
CameraGroup(osgViewer::View *viewer)
Create a camera group associated with an osgViewer::Viewer.
osgViewer::View * getView()
Get the camera group's Viewer.
void update(const osg::Vec3d &position, const osg::Quat &orientation)
Update the view for the camera group.
A window with a graphics context and an integer ID.
FlightPlan.hxx - defines a full flight-plan object, including departure, cruise, arrival information ...
osg::Camera * getGUICamera(CameraGroup *cgroup)
Get the osg::Camera that draws the GUI, if any, from a camera group.
void reloadCompositors(CameraGroup *cgroup)
Force a reload of all Compositor instances in the CameraGroup, except the one used by the GUI camera.
void warpGUIPointer(CameraGroup *cgroup, int x, int y)
Warp the pointer to coordinates in the GUI camera of a camera group.
bool computeIntersections(const CameraGroup *cgroup, const osg::Vec2d &windowPos, osgUtil::LineSegmentIntersector::Intersections &intersections)
Choose a camera using an event and do intersection testing on its view of the scene.
virtual void preReloadCompositor(CameraGroup *, CameraInfo *)=0
virtual void postReloadCompositor(CameraGroup *, CameraInfo *)=0
A wrapper around osg::Camera that contains some extra information.
Flags
properties of a camera.
@ GUI
Camera draws the GUI.
@ VIEW_ABSOLUTE
The camera view is absolute, not relative to the master camera.
@ DO_INTERSECTION_TEST
scene intersection tests this camera.
@ SPLASH
For splash screen.
@ ENABLE_MASTER_ZOOM
Can apply the zoom algorithm.
@ ORTHO
The projection is orthographic.
@ VR_MIRROR
Switch to a mirror of VR.
@ PROJECTION_ABSOLUTE
The projection is absolute.
@ FIXED_NEAR_FAR
take the near far values in the projection for real.
simgear::compositor::Compositor::MVRInfo mvr
Multiview rendering properties.
const CameraInfo * relativeCameraParent
Non-owning reference to the parent camera for relative camera configurations.
unsigned flags
Properties of the camera.
std::string compositor_path
Compositor path.
osg::Vec2d thisReference[2]
The reference points in the current projection space.
osg::Matrix viewMatrix
Current view and projection matrices for this camera.
std::unique_ptr< simgear::compositor::Compositor > compositor
The Compositor used to manage the pipeline of this camera.
osg::Matrix viewOffset
View offset from the viewer master camera.
CameraInfo(unsigned flags_)
osg::Matrix projOffset
Projection offset from the viewer master camera.
osg::Vec2d parentReference[2]
The reference points in the parents projection space.
std::string name
The name as given in the config file.
osg::ref_ptr< ReloadCompositorCallback > reloadCompositorCallback
double physicalWidth
Physical size parameters.