NonlinearImager

Inheritance:

Methods of NonlinearImager:

addScreen
int NonlinearImager::add_screen(ProjectionScreen *screen);

Description: Adds a new ProjectionScreen to the list of screens that will be processed by the NonlinearImager. Each ProjectionScreen represents a view into the world. It must be based on a linear camera (or whatever kind of camera is respected by the graphics engine).
Each ProjectionScreen object should already have some screen geometry created.
As each frame is rendered, an offscreen image will be rendered from the source camera associated with each ProjectionScreen, and the resulting image will be applied to the screen geometry.
The return value is the index number of the new screen.

addViewer
int NonlinearImager::add_viewer(DisplayRegion *dr);

Description: Adds the indicated DisplayRegion as a viewer into the NonlinearImager room. The camera associated with the DisplayRegion at the time add_viewer() is called is used as the initial viewer camera; it may have a nonlinear lens, like a fisheye or cylindrical lens.
This sets up a special scene graph for this DisplayRegion alone and sets up the DisplayRegion with a specialty camera. If future changes to the camera are desired, you should use the set_viewer_camera() interface.
All viewers must share the same GraphicsEngine.
The return value is the index of the new viewer.

findScreen
int NonlinearImager::find_screen(NodePath const &screen) const;

Description: Returns the index number of the first appearance of the indicated screen within the imager's list, or -1 if it does not appear.

findViewer
int NonlinearImager::find_viewer(DisplayRegion *dr) const;

Description: Returns the index number of the indicated DisplayRegion within the list of viewers, or -1 if it is not found.

getBuffer
GraphicsOutput *NonlinearImager::get_buffer(int index) const;

Description: Returns the offscreen buffer that is automatically created for the nth projection screen. This may return NULL if the screen is inactive or if it has not been rendered yet.

getDarkRoom
NodePath NonlinearImager::get_dark_room(void) const;

Description: Returns the NodePath to the root of the dark room scene. This is the scene in which all of the ProjectionScreens and the viewer cameras reside. It's a standalone scene with a few projection screens arranged artfully around one or more viewers; it's so named because it's a little virtual theater.
Normally this scene is not rendered directly; it only exists as an abstract concept, and to define the relation between the ProjectionScreens and the viewers. But it may be rendered to help visualize the NonlinearImager's behavior.

getGraphicsEngine
GraphicsEngine *NonlinearImager::get_graphics_engine(void) const;

Description: Returns the GraphicsEngine that all of the viewers added to the NonlinearImager have in common.

getNumScreens
int NonlinearImager::get_num_screens(void) const;

Description: Returns the number of screens that have been added to the imager.

getNumViewers
int NonlinearImager::get_num_viewers(void) const;

Description: Returns the number of viewers that have been added to the imager.

getScreen
NodePath NonlinearImager::get_screen(int index) const;

Description: Returns the nth screen that has been added to the imager.

getScreenActive
bool NonlinearImager::get_screen_active(int index) const;

Description: Returns the active flag on the indicated screen.

getViewer
DisplayRegion *NonlinearImager::get_viewer(int index) const;

Description: Returns the nth viewer's DisplayRegion that has been added to the imager.

getViewerCamera
NodePath NonlinearImager::get_viewer_camera(int index) const;

Description: Returns the NodePath to the LensNode that is to serve as nth viewer for this screen.

getViewerScene
NodePath NonlinearImager::get_viewer_scene(int index) const;

Description: Returns a pointer to the root node of the internal scene graph for the nth viewer, which is used to render all of the screen meshes for this viewer.
This is the scene graph in which the screen meshes within the dark room have been flattened into the appropriate transformation according to the viewer's lens properties (and position relative to the screens). It is this scene graph that is finally rendered to the window.

recompute
void NonlinearImager::recompute(void);

Description: Forces a regeneration of all the mesh objects, etc.

removeAllScreens
void NonlinearImager::remove_all_screens(void);

Description: Removes all screens from the imager.

removeAllViewers
void NonlinearImager::remove_all_viewers(void);

Description: Removes all viewers from the imager.

removeScreen
void NonlinearImager::remove_screen(int index);

Description: Removes the screen with the indicated index number from the imager.

removeViewer
void NonlinearImager::remove_viewer(int index);

Description: Removes the viewer with the indicated index number from the imager.

setScreenActive
void NonlinearImager::set_screen_active(int index, bool active);

Description: Sets the active flag on the indicated screen. If the active flag is true, the screen will be used; otherwise, it will not appear.

setSourceCamera
void NonlinearImager::set_source_camera(int index, NodePath const &source_camera);

Description: Specifies the camera that will be used to render the image for this particular screen.
The parameter must be a NodePath whose node is a Camera. The camera itself indicates the scene that is to be rendered.

setTextureSize
void NonlinearImager::set_texture_size(int index, int width, int height);

Description: Sets the width and height of the texture used to render the scene for the indicated screen. This must be less than or equal to the window size, and it should be a power of two.
In general, the larger the texture, the greater the detail of the rendered scene.

setViewerCamera
void NonlinearImager::set_viewer_camera(int index, NodePath const &viewer_camera);

Description: Specifies the LensNode that is to serve as the viewer for this screen. The relative position of the LensNode to the NonlinearImager, as well as the properties of the lens associated with the LensNode, determines the UV's that will be assigned to the geometry within the NonlinearImager.
It is not necessary to call this except to change the camera after a viewer has been added, since the default is to use whatever camera is associated with the DisplayRegion at the time the viewer is added.
The NodePath must refer to a LensNode (or a Camera).