![]() |
VR-Forces 5.0.1 Developer's Guide
|
This class provides the OSG-specific implementation of a DtChannel.

Public Member Functions | |
| virtual | ~DtOsgChannel () |
| virtual void | setSensorName (const std::string &sensorName) |
| virtual void | setClearColor (float r, float g, float b, float a) |
| virtual void | setWindow (DtWindow *view) |
| virtual const DtWindow * | window () const |
| virtual void | setViewport (int x, int y, int width, int height) |
| virtual void | clearFrameBufferIfChanged () |
| virtual void | getViewport (int &x, int &y, int &width, int &height) const |
| virtual void | setCameraPosition (double x, double y, double z) |
| virtual void | setCameraOrientation (double psi, double theta, double phi) |
| virtual void | setCameraPositionAndOrientation (double x, double y, double z, double psi, double theta, double phi) |
| virtual void | setCameraPositionAndOrientation (osg::Vec3d &pos, osg::Quat &orient) |
| virtual void | getCameraPositionAndOrientation (osg::Vec3d &position, osg::Quat &rotation) const |
| virtual void | setChannelEnabled (bool enabled, bool partial) override |
| virtual bool | channelEnabled () const |
| virtual void | update () |
| virtual void | connectToObserver () |
| virtual osgViewer::View & | view () |
| virtual DtCameraNode * | sceneCamera () |
| virtual const DtCameraNode * | sceneCamera () const |
| virtual DtCameraNode * | rttCamera () const |
| virtual DtCameraNode * | activeMainCamera () |
| virtual const DtCameraNode * | activeMainCamera () const |
| virtual DtCameraNode * | overlayCamera () |
| virtual DtCameraNode * | normalizedOverlayCamera () |
| virtual void | setRenderToTexture (bool enabled) |
| virtual void | setRenderToTextureFormat (int format, int sourceFormat, int sourceType) |
| virtual osg::ref_ptr < osg::Texture > | allocateRenderTexture (int width, int height) const |
| virtual osg::ref_ptr < osg::Texture > | getRenderTexture () |
| virtual osg::ref_ptr < osg::Texture > | getOcculsionTexture () |
| virtual osg::ref_ptr < osg::Texture > | getDepthTexture () const |
| virtual void | setDepthTextureUsesStencilBuffer (bool useStencil) |
| virtual bool | depthTextureUsesStencilBuffer () const |
| virtual void | setEnablePostProcessors (bool enable) |
| virtual bool | getEnablePostProcessors () |
| virtual bool | useOldChannelOffsetCalcuation () const |
| virtual void | setUseOldChannelOffsetCalcuation (bool enable) |
| virtual bool | forceHdrLuminanceOverride () |
| virtual void | setForceHdrLuminanceOverride (bool force) |
| virtual void | clearStateGraph (void) |
| virtual void | setEnableHdrPassthrough (bool flag) |
| virtual bool | enableHdrPassthrough () |
| virtual void | setHdrOutputScale (float scale) |
| virtual float | hdrOutputScale () |
| virtual void | screenCapture () |
| virtual void | setOcclusionTextureEnabled (bool enabled) |
| virtual void | initOcclusionTexture () |
| virtual void | updateCameraFrustumPlanes (std::vector< DtVector4< double > > &planes) |
| virtual void | updateAcquisitionBoxFrustumPlanes (const int &boxCenterX, const int &boxCenterY, const int &boxWidth, const int &boxHeight, std::vector< DtVector4< double > > &planes) |
| virtual void | setChannelSensor (DtOsgChannelSensor *extension) |
| virtual DtOsgChannelSensor * | findChannelSensor () |
| virtual void | releaseResources (osg::State *gcState) |
| virtual void | updateShowTracksUniform (bool value) |
Public Member Functions inherited from makVrv::DtChannel | |
| virtual | ~DtChannel () |
| DtObserverObject * | findObserver () const |
| unsigned int | currentModelSet () const |
| const DtChannelConfiguration & | configuration () const |
| virtual void | setObserverName (const std::string &observerName) |
| virtual DtChannelConfiguration::ProjectionResizePolicy | projectionResizePolicy () const |
| std::string & | observerName () |
Protected Types | |
| typedef std::map< int, DtChannelSpecificGroup * > | VisualTypeMap |
Protected Member Functions | |
| DtOsgChannel (DtDe &de, DtOsgWindow *window, DtChannelConfiguration &config) | |
| virtual void | makeObserverToCameraMatrix (osg::Vec3d &orient, osg::Matrixd &offsetObserverToCamera, osg::Matrixd &observerToCamera) |
| virtual void | makeObserverToCameraMatrix (osg::Quat &qObserverToWorld, osg::Matrixd &offsetObserverToCamera, osg::Matrixd &observerToCamera) |
| virtual void | calculateNearFar (double &zNear, double &zFar) |
| virtual bool | useAttachedForNearClip (double alt) |
| virtual double | calculateNearClip (double alt, double zFar) |
| virtual double | calculateFarClip (double alt) |
| virtual double | calculateNearClipMagClamp (double zNear, double zFar, float magLevel=2.) |
| virtual void | projectFor3D () |
| virtual void | projectFor2D () |
| virtual void | connectRttCameraToScene () |
| virtual void | stopUsingModelSet (int modelSet) |
| virtual void | startUsingModelSet (int modelSet) |
| virtual void | slot_visualizerRootAdded (int modelSet, int visualType) |
| virtual void | slot_shadowsRemoved () |
| virtual void | slot_observerModelSetChanged (DtObserverObject *observer, int modelSet) |
| virtual void | slot_observerSettingChanged (DtObserverObject *observer, int setting, bool value) |
| virtual void | slot_observerSettingRemoved (DtObserverObject *observer, int setting) |
| virtual void | slot_projectionChanged (DtObserverObject *observer, bool is2D) |
| virtual void | slot_windowConfigurationModified (const std::string &deName, const std::string &oldWindowName, const DtWindowConfiguration &config) |
| virtual void | slot_channelConfigurationModified (const std::string &deName, const std::string &windowName, const std::string &oldChannelName, const DtChannelConfiguration &channelConfig) |
| virtual void | slot_onCoordinateSystemChanged () |
| virtual void | slot_paperMapEnabledChanged (bool setting) |
| virtual void | observerRemoved (const std::string &observerName) |
| virtual void | updateMultiSampleOverrideSetting () |
| virtual void | getRenderTextureAttachmentInfo (unsigned int &level, unsigned int &face, unsigned int &sampleBuffers, unsigned int &samples) |
| virtual void | initializeRenderTextureColor () |
| virtual void | initializeRenderTextureDepth () |
| virtual void | initializeRttCameraDepth () |
| virtual void | changedRttCameraFbo () |
| virtual void | enableLighting (osg::ref_ptr< osg::Camera > camera, bool enable) |
| virtual void | calculateAndSetFocusPointDistance (double zNear, double zFar) |
| osgViewer::CompositeViewer * | getOrCreateViewer () |
| virtual void | flipHorizontal (bool flip) |
Initialization functions | |
| virtual bool | initialize () |
Create and initialize cameras | |
| virtual void | initializeNormalized2DCamera () |
| virtual void | initialize2DCamera (int w, int h) |
| virtual void | initializeSceneCamera () |
| virtual void | initializeRenderTexture () |
| virtual void | initializeRTTCamera () |
| virtual void | clearRttCamera () |
| virtual void | recreateRTTCamera () |
Enables shadow casting for the channel object | |
| virtual void | setShadowState (bool enable) |
| virtual void | addOverlayDrawablesToCameras () |
| virtual void | initializeSignalConnections () |
Protected Member Functions inherited from makVrv::DtChannel | |
| DtChannel (DtDe &de, DtChannelConfiguration &) | |
| virtual void | observerAdded (const std::string &observerName) |
Static Protected Attributes | |
| static int | theRunningCameraId |
Private Member Functions | |
| DtOsgChannel () | |
| DtOsgChannel (const DtOsgChannel &) | |
| DtOsgChannel & | operator= (const DtOsgChannel &) |
Friends | |
| class | DtOsgChannelCreator |
Gets the shadow quality for the channel object | |
| typedef std::list< std::string > | PostProcessorEffectList |
| boost::signalslib::signal < void(int, int, int, int)> | signal_viewportChanged |
| virtual int | shadowQuality () const |
| virtual std::vector< const osg::Camera * > | getShadowableCameras () const |
| virtual void | setProjectionResizePolicy (DtChannelConfiguration::ProjectionResizePolicy policy) |
| virtual void | updateProjection () |
| virtual void | projectionUnitsToFrustum (DtChannelConfiguration::ProjectionUnits units, double &left, double zNear, double &right, double &top, double &bottom) |
| virtual void | projectionUnitsToFrustumWithZoomAdjustment (DtChannelConfiguration::ProjectionUnits units, double &left, double zNear, double &right, double &top, double &bottom) |
| virtual void | connectChannelToScene () |
| virtual bool | processMouseEvent (const DtMouseEvent &ev) |
| virtual bool | processKeyboardEvent (const DtKeyEvent &ev) |
| virtual void | getWorldToWindowMatrix (osg::Matrix &worldToWindowMatrix) const |
| virtual void | moveMouseToScreenLocation (float screenX, float screenY) |
| virtual void | projectToScreen (double dbX, double dbY, double dbZ, double &screenX, double &screenY, double &screenZ) |
| virtual void | projectToWorld (double screenX, double screenY, double &dbX, double &dbY, double &dbZ) |
| virtual DtIntersectorResult | findWorldIntersection (double screenX, double screenY, DtIntersector::IntersectProperties properties=DtIntersector::AllNodes, std::vector< DtElementID > *ignoreList=0) |
| virtual const std::string & | name () |
| virtual void | addPostProcessEffect (const std::string &postProcessorEffect) |
| virtual void | removePostProcessEffect (const std::string &postProcessorEffect) |
| virtual void | set3DCullVisitorParams (DtOsgCullVisitorParameters *params) |
| virtual void | set2DCullVisitorParams (DtOsgCullVisitorParameters *params) |
| typedef std::list<std::string> makVrv::DtOsgChannel::PostProcessorEffectList |
Emitted when the channel's viewport changes dimensions.
Parameters are lower left x, y, width, and height, as in glViewport.
|
protected |
|
protected |
Called by Creator object.
Must call initialize() on an instance of this class before using it
|
virtual |
DTOR.
|
private |
Default Constructor not implemented.
|
private |
Copy Constructor not implemented - Copy not allowed.
|
protectedvirtual |
Initialize the channel.
Must call this on an instance of this class before using it. Returns false if initialization failed.
Reimplemented in makVrv::vrvScalableDisplay::DtScalableOsgChannel, makVrv::DtOculusChannel, makVrv::DtVirtualRealityChannel, and makVrv::DtExampleChannel.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
Add drawables to render overlays to their respective cameras.
|
protectedvirtual |
Add drawables to render overlays to their respective cameras.
|
protectedvirtual |
Connect channel's slots to signals from other objects.
All signal connections are managed by the member signal connection manager and automatically disconnected when this object is deleted
Reimplemented in makVrv::DtVirtualRealityChannel.
|
virtual |
Set the name of the sensor to use.
The special name defined by DtChannelManager::UseObserverSensor causes the channel to use the sensor specified by its observer
Implements makVrv::DtChannel.
|
virtual |
Set the clear color for the channel.
Implements makVrv::DtChannel.
|
virtual |
Set the window the channel is displayed on.
| DtCorruptedState | if the window pointer is NULL or is not a DtOsgView |
Implements makVrv::DtChannel.
|
virtual |
Get the window the channel is displayed on.
Implements makVrv::DtChannel.
|
virtual |
If something that would mess with the area of the frame buffer outside the current channel needs to be cleaned up then this fucntion will clear the framebuffer. This happens when the viewport changes sizes.
|
virtual |
Get the viewport.
Implements makVrv::DtChannel.
Set the camera position.
Implements makVrv::DtChannel.
|
virtual |
Set the camera orientation.
|
virtual |
Set camera position and orientation. When you need to set Set camera position and orientation. When you need to set both, this a little more efficient than calling setCameraPosition and setCameraOrientation seperately.
|
virtual |
|
virtual |
Get the camera position and orientation.
Enable/Disable the channel. When a channel is disabled, it no longer renders or receives key/mouse events - unless partial is set to true. In that case, the channel osgViewer::View will not be removed from the compositeViewer (or added back on enable) which will cause it to receives key/mouse events. The reason for this option is that if you disable then re-enable a channel, needing to add the channel's View back into the compositeViewer, this may result in a significant stall (seconds). In the case of something like an IG use where there are no mouse or keyboard events involved, there is no need to pay this penalty; in that case, set partial to false when enabling and disabling.
Implements makVrv::DtChannel.
|
virtual |
Enable/Disable the channel. When a channel is disabled, it no longer renders or receives key/mouse events.
Implements makVrv::DtChannel.
|
virtual |
|
virtual |
Set up based on current observer parameters, such as modelSet and is2D.
Implements makVrv::DtChannel.
|
virtual |
Window accessor.
|
virtual |
Accessor for the 3D camera.
|
virtual |
Accessor for the 3D camera.
|
virtual |
Accessor for RTT camera.
|
virtual |
Accessor for which ever camera is currently the main render camera.
|
virtual |
Accessor for which ever camera is currently the main render camera.
|
virtual |
Accessor for the 2D overlay camera.
|
virtual |
Accessor for the normalized 2D overlay camera.
|
virtual |
Toggles whether this channel renders the scene to a texture.
Reimplemented in makVrv::DtVirtualRealityChannel.
|
virtual |
sets the render to texture format for the rttCamera, this was separated from the setRenderToTexture format function so that the SensorFX module could use HDR rendere to texture
|
virtual |
Allocate a new texture and set its size, allows custom channel (DtVirtualRealityChannel) to override.
Reimplemented in makVrv::DtVirtualRealityChannel.
|
virtual |
Gets the texture the scene was rendered to, if setRenderToTexture was enabled.
|
virtual |
|
virtual |
Returns the depth texture for this channel.
|
virtual |
Set the depth texture in RTT mode to use a stencil buffer.
|
virtual |
Return if the depth texture should be using stencil buffer.
|
virtual |
Emitted when the channel's viewport changes dimensions.
Parameters are lower left x, y, width, and height, as in glViewport.
|
virtual |
Used by DtOsgShadowTechnique::setChannelShadowState to determine which cameras should have shadows. Returns the scene camera and RTT camera by default; if other cameras are added this should be overridden to add to the list.
Reimplemented in makVrv::DtOculusChannel.
|
virtual |
Set the policy used to determine if and how the projection matrix should be adjusted on window resizes. */.
Reimplemented from makVrv::DtChannel.
|
virtual |
This method is called when ever the channel's projection matrix needs to be updated.
Implements makVrv::DtChannel.
Reimplemented in makVrv::DtVirtualRealityChannel, makVrv::DtOculusChannel, and makVrv::vrvScalableDisplay::DtScalableOsgChannel.
|
virtual |
Emitted when the channel's viewport changes dimensions.
Parameters are lower left x, y, width, and height, as in glViewport.
|
virtual |
Emitted when the channel's viewport changes dimensions.
Parameters are lower left x, y, width, and height, as in glViewport.
|
virtual |
Set the channel's scene graph root.
|
virtual |
attempt to handle a mouse event with the channel's overlay
Implements makVrv::DtChannel.
|
virtual |
attempt to handle a keyboard event with the channel's overlay
Implements makVrv::DtChannel.
|
virtual |
Get the channel's dynamic overlay if any.
Get the camera's world to window matrix
|
virtual |
Move the mouse pointer to the specified location in screen coordinates.
Implements makVrv::DtChannel.
|
virtual |
Project a point from world coordinates to screen coordinates.
Returns screen coordinates in screenX, screenY, screenZ
Implements makVrv::DtChannel.
|
virtual |
project the local world coordinates given screen coordinates
Implements makVrv::DtChannel.
|
virtual |
project the non-normalized screen coordinates, i.e. in pixels, and intersects the world
Implements makVrv::DtChannel.
|
virtual |
Returns the channel's name as defined in its configuration.
|
virtual |
Add post processor effect names to be enabled during the DtOsgChannel update function The order of the effects is set in the DtPostProcessorFactory.
|
virtual |
Remove post processor effect names to be enabled during the DtOsgChannel update function The order of the effects is set in the DtPostProcessorFactory.
|
virtual |
Emitted when the channel's viewport changes dimensions.
Parameters are lower left x, y, width, and height, as in glViewport.
|
virtual |
Emitted when the channel's viewport changes dimensions.
Parameters are lower left x, y, width, and height, as in glViewport.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
should the HDR post processor force the luminance scalar to 1.0 for this channel used for when the sky is turned off (XR mode)
|
virtual |
|
virtual |
osg maintains an internal cache of StateSets in a StateGraph
|
virtual |
getter/setter for the whether the HDR post processor
|
virtual |
|
virtual |
set the hdr output scale to use with this channel it does not necessarily match the shared state when correlation is turned off
|
virtual |
get the hdr output scale to use with this channel it does not necessarily match the shared state when correlation is turned off
|
virtual |
Takes Screen capture of the current channel.
Implements makVrv::DtChannel.
|
virtual |
enable or disable the creation of an occlusion texture, used for some screen space effects
|
virtual |
init occlusion texture, used for some screen space effects
|
virtual |
Set the Frustum planes for this channel.
Implements makVrv::DtChannel.
|
virtual |
Set the frustum planes for a subset of this channel Scales the channels projection values based on the box's values that are passed in.
Implements makVrv::DtChannel.
|
virtual |
Set an extension.
|
inlinevirtual |
|
virtual |
called by the window manager when the last window is about to be destroyed in order to give the channel a chance to release it's resources before the final flush.
|
virtual |
update the scene and rtt camera uniforms for the show tracks observer mode setting. This is used by the persistent tracks shader to hide/show the tracks.
|
protectedvirtual |
Reimplemented in makVrv::vrvScalableDisplay::DtScalableOsgChannel.
|
protectedvirtual |
Reimplemented in makVrv::vrvScalableDisplay::DtScalableOsgChannel.
|
protectedvirtual |
Calculates near/far depending on visual mode.
When using dynamic clipping plane calculations, determine if channel's view is attached to an entity and that entity should be taken into consideration.
Calculate the dynamic near clipping plane.
Calculate the dynamic far clipping plane.
|
protectedvirtual |
When the NEAR_FAR_DYNAMIC_CLAMP_NEAR_CLIP policy is enabled, this is called with the calculated near and far dynamic clipping planes. It returns the new (possibly clamped) near clipping plane. If the current view magnification is less than magLevel, then zNear is returned unchanged.
|
protectedvirtual |
Projects frustum matrix for 3D viewing.
Reimplemented in makVrv::DtVirtualRealityChannel, and makVrv::DtOculusChannel.
|
protectedvirtual |
Projects ortho matrix for 2D viewing.
Reimplemented in makVrv::DtVirtualRealityChannel.
|
protectedvirtual |
This method is called by initializeRTTCamera and connectChannelToScene to handle the scene setup (including the overlay cameras) for the rtt camera.
|
protectedvirtual |
Stop rendering the specified model set on this channel.
Forwards calls to stopUsingModelSetWork
|
protectedvirtual |
Start rendering the specified model set on this channel.
Forwards calls to startUsingModelSetWork
|
protectedvirtual |
called by signal when a new visualizer root is added
|
protectedvirtual |
Called by signal when the renderer removes all shadows.
|
protectedvirtual |
Called by signal when an observer's model set changes.
|
protectedvirtual |
Called by signal when an observer's visual setting changes.
|
protectedvirtual |
Called by signal when an observer's visual setting is removed.
|
protectedvirtual |
Called by signal when an observer's projection (3D/2D) changes.
|
protectedvirtual |
slot to be called when the window configuration changes.
Reimplemented in makVrv::DtVirtualRealityChannel.
|
protectedvirtual |
slot to be called when the channel configuration changes.
|
protectedvirtual |
receive signals from the shared state about coordinate system changes
|
protectedvirtual |
Receives signals from the shared state about paper map feature changes (i.e. osgEarth mask layer feature being enabled or disabled)
|
protectedvirtual |
connects to signal_observerRemoved so the channel can update it's observer when the observer is removed.
Reimplemented from makVrv::DtChannel.
|
protectedvirtual |
helper function for getting the imgui setting for the multi sample override
|
protectedvirtual |
Get the rtt camera attachment values, allows custom channels (DtVirtualRealityChannel) to override.
Reimplemented in makVrv::DtVirtualRealityChannel.
|
protectedvirtual |
Create and initialize render texture color buffer.
|
protectedvirtual |
Create and initialize render texture depth buffer.
|
protectedvirtual |
Initialize the depth settings for the RTT camera.
|
protectedvirtual |
Called after changes to the RTT camera FBO setting.
|
protectedvirtual |
|
protectedvirtual |
Calculate the focus point if the lod scale center is enabled and the zoom magnification is higher than the limit.
|
protected |
Returns the CompositeViewer for the channel. The function can return NULL and will create a CompositeViewer, if needed.
|
protectedvirtual |
Flip the channel horizontally (ex. to help make a rear view mirror)
|
private |
Assignment Operator not implemented - Copy not allowed.
|
friend |
Emitted when the channel's viewport changes dimensions.
Parameters are lower left x, y, width, and height, as in glViewport.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
The textures the 3D scene renders into when post processing is on.
|
protected |
|
protected |
|
protected |
|
protected |
Slave camera configured to render to myRenderTexture.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
This is used to give names to each camera created. This is appended to the camera name This is useful to differentiate cameras across different views.