Panda3D
Public Member Functions | Static Public Member Functions | List of all members
StereoDisplayRegion Class Reference

This is a special DisplayRegion wrapper that actually includes a pair of DisplayRegions internally: the left and right eyes. The DisplayRegion represented here does not have a physical association with the window, but it pretends it does. Instead, it maintains a pointer to the left and right DisplayRegions separately. More...

Inheritance diagram for StereoDisplayRegion:
DisplayRegion DisplayRegionBase DrawableRegion TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase

Public Member Functions

DisplayRegion getLeftEye ()
 Returns a pointer to the left DisplayRegion managed by this stereo object. More...
 
DisplayRegion getRightEye ()
 Returns a pointer to the right DisplayRegion managed by this stereo object. More...
 
- Public Member Functions inherited from DisplayRegion
 clearCullCallback ()
 Removes the callback set by an earlier call to set_cull_callback(). More...
 
 clearDrawCallback ()
 Removes the callback set by an earlier call to set_draw_callback(). More...
 
float getBottom (int i)
 Retrieves the y coordinate of the bottom edge of the rectangle within its GraphicsOutput. This number will be in the range [0..1]. More...
 
NodePath getCamera (Thread current_thread)
 Returns the camera associated with this DisplayRegion, or an empty NodePath if no camera is associated. More...
 
CallbackObject getCullCallback ()
 Returns the CallbackObject set by set_cull_callback(). More...
 
CullTraverser getCullTraverser ()
 Returns the CullTraverser that will be used to draw the contents of this DisplayRegion. More...
 
LVecBase4 getDimensions (int i)
 Retrieves the coordinates of the DisplayRegion's rectangle within its GraphicsOutput. These numbers will be in the range [0..1]. More...
 
CallbackObject getDrawCallback ()
 Returns the CallbackObject set by set_draw_callback(). More...
 
bool getIncompleteRender ()
 Returns the incomplete_render flag. See set_incomplete_render(). More...
 
float getLeft (int i)
 Retrieves the x coordinate of the left edge of the rectangle within its GraphicsOutput. This number will be in the range [0..1]. More...
 
int getLensIndex ()
 Returns the specific lens of the associated Camera that will be used for rendering this scene. Most Cameras hold only one lens, but for multiple lenses this method may be used to selected between them. More...
 
int getNumRegions ()
 Returns the number of regions, see set_num_regions. More...
 
GraphicsPipe getPipe ()
 Returns the GraphicsPipe that this DisplayRegion is ultimately associated with, or NULL if no pipe is associated. More...
 
int getPixelHeight (int i)
 Returns the height of the DisplayRegion in pixels. More...
 
int getPixelWidth (int i)
 Returns the width of the DisplayRegion in pixels. More...
 
float getRight (int i)
 Retrieves the x coordinate of the right edge of the rectangle within its GraphicsOutput. This number will be in the range [0..1]. More...
 
bool getScissorEnabled ()
 Returns whether or not scissor testing is enabled for this region. The default is true, except for the overlay display region. More...
 
Texture getScreenshot ()
 Captures the most-recently rendered image from the framebuffer and returns it as a Texture, or NULL on failure. More...
 
bool getScreenshot (PNMImage image)
 Captures the most-recently rendered image from the framebuffer into the indicated PNMImage. Returns true on success, false on failure. More...
 
int getSort ()
 Returns the sort value associated with the DisplayRegion. More...
 
Lens::StereoChannel getStereoChannel ()
 Returns whether the DisplayRegion is specified as the left or right channel of a stereo pair, or whether it is a normal, monocular image. See set_stereo_channel(). More...
 
int getTargetTexPage ()
 Returns the target page number associated with this particular DisplayRegion, or -1 if it is not associated with a page. See set_target_tex_page(). More...
 
int getTextureReloadPriority ()
 Returns the priority which is assigned to asynchronous texture reload requests. See set_texture_reload_priority(). More...
 
int getTexViewOffset ()
 Returns the current texture view offset for this DisplayRegion. This is normally set to zero. If nonzero, it is used to select a particular view of any multiview textures that are rendered within this DisplayRegion. More...
 
float getTop (int i)
 Retrieves the y coordinate of the top edge of the rectangle within its GraphicsOutput. This number will be in the range [0..1]. More...
 
GraphicsOutput getWindow ()
 Returns the GraphicsOutput that this DisplayRegion is ultimately associated with, or NULL if no window is associated. More...
 
bool isActive ()
 Returns the active flag associated with the DisplayRegion. More...
 
bool isStereo ()
 Returns true if this is a StereoDisplayRegion, false otherwise. More...
 
PandaNode makeCullResultGraph ()
 Returns a special scene graph constructed to represent the results of the last frame's cull operation. More...
 
 output (Ostream out)
 
bool saveScreenshot (const Filename filename, str image_comment)
 Saves a screenshot of the region to the indicated filename. Returns true on success, false on failure. More...
 
Filename saveScreenshotDefault (str prefix)
 Saves a screenshot of the region to a default filename, and returns the filename, or empty string if the screenshot failed. The filename is generated by make_screenshot_filename(). More...
 
 setActive (bool active)
 Sets the active flag associated with the DisplayRegion. If the DisplayRegion is marked inactive, nothing is rendered. More...
 
 setCamera (const NodePath camera)
 Sets the camera that is associated with this DisplayRegion. There is a one-to-many association between cameras and DisplayRegions; one camera may be shared by multiple DisplayRegions. More...
 
 setCubeMapIndex (int cube_map_index)
 Deprecated; replaced by set_target_tex_page(). More...
 
 setCullCallback (CallbackObject object)
 Sets the CallbackObject that will be notified when the DisplayRegion is visited during the cull traversal. This callback will be made during the cull thread. More...
 
 setCullTraverser (CullTraverser trav)
 Specifies the CullTraverser that will be used to draw the contents of this DisplayRegion. Normally the default CullTraverser is sufficient, but this may be changed to change the default cull behavior. More...
 
 setDimensions (const LVecBase4 dimensions)
 Changes the portion of the framebuffer this DisplayRegion corresponds to. The parameters range from 0 to 1, where 0,0 is the lower left corner and 1,1 is the upper right; (0, 1, 0, 1) represents the whole screen. More...
 
 setDimensions (float l, float r, float b, float t)
 Changes the portion of the framebuffer this DisplayRegion corresponds to. The parameters range from 0 to 1, where 0,0 is the lower left corner and 1,1 is the upper right; (0, 1, 0, 1) represents the whole screen. More...
 
 setDimensions (int i, const LVecBase4 dimensions)
 Changes the portion of the framebuffer this DisplayRegion corresponds to. The parameters range from 0 to 1, where 0,0 is the lower left corner and 1,1 is the upper right; (0, 1, 0, 1) represents the whole screen. More...
 
 setDimensions (int i, float l, float r, float b, float t)
 Changes the portion of the framebuffer this DisplayRegion corresponds to. The parameters range from 0 to 1, where 0,0 is the lower left corner and 1,1 is the upper right; (0, 1, 0, 1) represents the whole screen. More...
 
 setDrawCallback (CallbackObject object)
 Sets the CallbackObject that will be notified when the contents of DisplayRegion is drawn during the draw traversal. This callback will be made during the draw thread. More...
 
 setIncompleteRender (bool incomplete_render)
 Sets the incomplete_render flag. When this is true, the frame will be rendered even if some of the geometry or textures in the scene are not available (e.g. they have been temporarily paged out). When this is false, the frame will be held up while this data is reloaded. More...
 
 setLensIndex (int index)
 Sets the lens index, allows for multiple lenses to be attached to a camera. This is useful for a variety of setups, such as fish eye rendering. The default is 0. More...
 
 setNumRegions (int i)
 Sets the number of regions that this DisplayRegion indicates. Usually, this number is 1 (and it is always at least 1), and only the first is used for rendering. However, if more than one is provided, you may select which one to render into using a geometry shader (gl_ViewportIndex in GLSL). More...
 
 setScissorEnabled (bool scissor_enabled)
 Sets whether or not scissor testing is enabled for this region. The default is true, except for the overlay display region. More...
 
 setSort (int sort)
 Sets the sort value associated with the DisplayRegion. Within a window, DisplayRegions will be rendered in order from the lowest sort value to the highest. More...
 
 setStereoChannel (Lens::StereoChannel stereo_channel)
 Specifies whether the DisplayRegion represents the left or right channel of a stereo pair, or whether it is a normal, monocular image. This automatically adjusts the lens that is used to render to this DisplayRegion to its left or right eye, according to the lens's stereo properties. More...
 
 setTargetTexPage (int page)
 This is a special parameter that is only used when rendering the faces of a cube map or multipage and/or multiview texture. More...
 
 setTextureReloadPriority (int texture_reload_priority)
 Specifies an integer priority which is assigned to any asynchronous texture reload requests spawned while processing this DisplayRegion. This controls which textures are loaded first when multiple textures need to be reloaded at once; it also controls the relative priority between asynchronous texture loads and asynchronous model or animation loads. More...
 
 setTexViewOffset (int tex_view_offset)
 Sets the current texture view offset for this DisplayRegion. This is normally set to zero. If nonzero, it is used to select a particular view of any multiview textures that are rendered within this DisplayRegion. More...
 
- Public Member Functions inherited from DisplayRegionBase
 output (Ostream out)
 
- Public Member Functions inherited from TypedObject
TypeHandle getType ()
 Derived classes should override this function to return get_class_type(). More...
 
int getTypeIndex ()
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. This is equivalent to get_type().get_index(). More...
 
bool isExactType (TypeHandle handle)
 Returns true if the current object is the indicated type exactly. More...
 
bool isOfType (TypeHandle handle)
 Returns true if the current object is or derives from the indicated type. More...
 
- Public Member Functions inherited from ReferenceCount
int getRefCount ()
 Returns the current reference count. More...
 
 ref ()
 Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. More...
 
bool testRefCountIntegrity ()
 Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise. More...
 
bool testRefCountNonzero ()
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. Returns true if ok, false otherwise. More...
 
bool unref ()
 Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic.) However, see the helper function unref_delete(). More...
 
- Public Member Functions inherited from DrawableRegion
 disableClears ()
 Disables both the color and depth clear. See set_clear_color_active and set_clear_depth_active. More...
 
bool getClearActive (int n)
 Gets the clear-active flag for any bitplane. More...
 
const LColor getClearColor ()
 Returns the current clear color value. This is the value that will be used to clear the color buffer every frame, but only if get_clear_color_active() returns true. If get_clear_color_active() returns false, this is meaningless. More...
 
bool getClearColorActive ()
 Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame. See set_clear_color_active(). More...
 
float getClearDepth ()
 Returns the current clear depth value. This is the value that will be used to clear the depth buffer every frame, but only if get_clear_depth_active() returns true. If get_clear_depth_active() returns false, this is meaningless. More...
 
bool getClearDepthActive ()
 Returns the current setting of the flag that indicates whether the depth buffer should be cleared every frame. See set_clear_depth_active(). More...
 
unsigned int getClearStencil ()
 Returns the current clear stencil value. This is the value that will be used to clear the stencil buffer every frame, but only if get_clear_stencil_active() returns true. If get_clear_stencil_active() returns false, this is meaningless. More...
 
bool getClearStencilActive ()
 Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame. See set_clear_stencil_active(). More...
 
const LColor getClearValue (int n)
 Returns the clear value for any bitplane. More...
 
float getPixelFactor ()
 Returns the amount by which the height and width of the region will be scaled internally, based on the zoom factor set by set_pixel_zoom(). This will return 1.0 if the pixel_zoom was not set or if it is not being respected (for instance, because the underlying renderer doesn't support it–see supports_pixel_zoom). More...
 
float getPixelZoom ()
 Returns the value set by set_pixel_zoom(), regardless of whether it is being respected or not. Also see get_pixel_factor(). More...
 
bool isAnyClearActive ()
 Returns true if any of the clear types (so far there are just color or depth) have been set active, or false if none of them are active and there is no need to clear. More...
 
 setClearActive (int n, bool clear_aux_active)
 Sets the clear-active flag for any bitplane. More...
 
 setClearColor (const LColor color)
 Sets the clear color to the indicated value. This is the value that will be used to clear the color buffer every frame, but only if get_clear_color_active() returns true. If get_clear_color_active() returns false, this is meaningless. More...
 
 setClearColorActive (bool clear_color_active)
 Toggles the flag that indicates whether the color buffer should be cleared every frame. If this is true, the color buffer will be cleared to the color indicated by set_clear_color(); otherwise, it will be left alone. More...
 
 setClearDepth (float depth)
 Sets the clear depth to the indicated value. This is the value that will be used to clear the depth buffer every frame, but only if get_clear_depth_active() returns true. If get_clear_depth_active() returns false, this is meaningless. More...
 
 setClearDepthActive (bool clear_depth_active)
 Toggles the flag that indicates whether the depth buffer should be cleared every frame. If this is true, the depth buffer will be cleared to the depth value indicated by set_clear_depth(); otherwise, it will be left alone. More...
 
 setClearStencil (unsigned int stencil)
 
 setClearStencilActive (bool clear_stencil_active)
 Toggles the flag that indicates whether the stencil buffer should be cleared every frame. If this is true, the stencil buffer will be cleared to the value indicated by set_clear_stencil(); otherwise, it will be left alone. More...
 
 setClearValue (int n, const LColor clear_value)
 Sets the clear value for any bitplane. More...
 
 setPixelZoom (float pixel_zoom)
 Sets the amount by which the pixels of the region are scaled internally when filling the image interally. Setting this number larger makes the pixels blockier, but may make the rendering faster, particularly for software renderers. Setting this number to 2.0 reduces the number of pixels that have to be filled by the renderer by a factor of 2.0. It doesn't make sense to set this lower than 1.0. More...
 
bool supportsPixelZoom ()
 Returns true if a call to set_pixel_zoom() will be respected, false if it will be ignored. If this returns false, then get_pixel_factor() will always return 1.0, regardless of what value you specify for set_pixel_zoom(). More...
 

Static Public Member Functions

static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from DisplayRegion
static TypeHandle getClassType ()
 
static Filename makeScreenshotFilename (str prefix)
 Synthesizes a suitable default filename for passing to save_screenshot(). More...
 
- Static Public Member Functions inherited from DisplayRegionBase
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from DrawableRegion
static int getRenderbufferType (int plane)
 Returns the RenderBuffer::Type that corresponds to a RenderTexturePlane. More...
 

Additional Inherited Members

- Public Types inherited from DrawableRegion
enum  RenderTexturePlane {
  RTP_stencil = 0, RTP_depth_stencil = 1, RTP_color = 2, RTP_aux_rgba_0 = 3,
  RTP_aux_rgba_1 = 4, RTP_aux_rgba_2 = 5, RTP_aux_rgba_3 = 6, RTP_aux_hrgba_0 = 7,
  RTP_aux_hrgba_1 = 8, RTP_aux_hrgba_2 = 9, RTP_aux_hrgba_3 = 10, RTP_aux_float_0 = 11,
  RTP_aux_float_1 = 12, RTP_aux_float_2 = 13, RTP_aux_float_3 = 14, RTP_depth = 15,
  RTP_COUNT = 16
}
 It seems awkward to have this type, and also RenderBuffer::Type. However, the fact that RenderBuffer::Type is a bitmask makes it awfully awkward to work with. More...
 

Detailed Description

This is a special DisplayRegion wrapper that actually includes a pair of DisplayRegions internally: the left and right eyes. The DisplayRegion represented here does not have a physical association with the window, but it pretends it does. Instead, it maintains a pointer to the left and right DisplayRegions separately.

Operations on the StereoDisplayRegion object affect both left and right eyes together. To access the left or right eyes independently, use get_left_eye() and get_right_eye().

Member Function Documentation

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ getLeftEye()

DisplayRegion getLeftEye ( )

Returns a pointer to the left DisplayRegion managed by this stereo object.

◆ getRightEye()

DisplayRegion getRightEye ( )

Returns a pointer to the right DisplayRegion managed by this stereo object.