15 #include "stereoDisplayRegion.h" 16 #include "pandaNode.h" 45 ~StereoDisplayRegion() {
64 _right_eye->set_clear_active(n, clear_active);
76 _left_eye->set_clear_value(n, clear_value);
77 _right_eye->set_clear_value(n, clear_value);
89 _left_eye->disable_clears();
90 _right_eye->disable_clears();
101 _left_eye->set_pixel_zoom(pixel_zoom);
102 _right_eye->set_pixel_zoom(pixel_zoom);
114 _left_eye->set_dimensions(i, dimensions);
115 _right_eye->set_dimensions(i, dimensions);
138 _left_eye->set_camera(camera);
139 _right_eye->set_camera(camera);
151 _left_eye->set_active(active);
152 _right_eye->set_active(active);
171 _left_eye->set_sort(sort + 1);
172 _right_eye->set_sort(sort + 2);
207 switch (stereo_channel) {
208 case Lens::SC_stereo:
209 _left_eye->set_stereo_channel(Lens::SC_left);
210 _left_eye->set_active(
true);
211 _right_eye->set_stereo_channel(Lens::SC_right);
212 _right_eye->set_active(
true);
216 _left_eye->set_stereo_channel(Lens::SC_left);
217 _left_eye->set_active(
true);
218 _right_eye->set_active(
false);
222 _left_eye->set_active(
false);
223 _right_eye->set_stereo_channel(Lens::SC_right);
224 _right_eye->set_active(
true);
228 _left_eye->set_stereo_channel(Lens::SC_mono);
229 _left_eye->set_active(
true);
230 _right_eye->set_active(
false);
251 _left_eye->set_tex_view_offset(tex_view_offset);
252 _right_eye->set_tex_view_offset(tex_view_offset + 1);
264 _left_eye->set_incomplete_render(incomplete_render);
265 _right_eye->set_incomplete_render(incomplete_render);
277 _left_eye->set_texture_reload_priority(texture_reload_priority);
278 _right_eye->set_texture_reload_priority(texture_reload_priority);
290 _left_eye->set_cull_traverser(trav);
291 _right_eye->set_cull_traverser(trav);
303 _left_eye->set_target_tex_page(page);
304 _right_eye->set_target_tex_page(page);
312 void StereoDisplayRegion::
313 output(ostream &out)
const {
314 out <<
"StereoDisplayRegion(" << *_left_eye <<
")";
325 make_cull_result_graph() {
328 PT(
PandaNode) left = _left_eye->make_cull_result_graph();
329 left->set_name(
"left");
330 root->add_child(left, _left_eye->
get_sort());
332 PT(
PandaNode) right = _right_eye->make_cull_result_graph();
333 right->set_name(
"right");
334 root->add_child(right, _right_eye->
get_sort());
A basic node of the scene graph or data graph.
virtual void disable_clears()
Disables both the color and depth clear.
virtual void set_sort(int sort)
Sets the sort value associated with the DisplayRegion.
virtual void set_clear_active(int n, bool clear_aux_active)
Sets the clear-active flag for any bitplane.
virtual void set_tex_view_offset(int tex_view_offset)
Sets the current texture view offset for this DisplayRegion.
Lens::StereoChannel get_stereo_channel() const
Returns whether the DisplayRegion is specified as the left or right channel of a stereo pair...
virtual void set_texture_reload_priority(int texture_reload_priority)
Sets the texture_reload_priority on both the left and right DisplayRegions to the indicated value...
void set_dimensions(PN_stdfloat l, PN_stdfloat r, PN_stdfloat b, PN_stdfloat t)
Changes the portion of the framebuffer this DisplayRegion corresponds to.
virtual void set_texture_reload_priority(int texture_reload_priority)
Specifies an integer priority which is assigned to any asynchronous texture reload requests spawned w...
virtual void set_target_tex_page(int page)
This is a special parameter that is only used when rendering the faces of a cube map or multipage and...
virtual void set_cull_traverser(CullTraverser *trav)
Specifies the CullTraverser that will be used to draw the contents of this DisplayRegion.
GraphicsOutput * get_window() const
Returns the GraphicsOutput that this DisplayRegion is ultimately associated with, or NULL if no windo...
virtual bool is_stereo() const
Returns true if this is a StereoDisplayRegion, false otherwise.
virtual void set_clear_value(int n, const LColor &clear_value)
Sets the clear value for any bitplane.
virtual void set_tex_view_offset(int tex_view_offset)
Sets the current texture view offset for this DisplayRegion.
virtual void set_incomplete_render(bool incomplete_render)
Sets the incomplete_render flag on both the left and right DisplayRegions to the indicated value...
virtual void set_active(bool active)
Sets the active flag associated with the DisplayRegion.
virtual void set_active(bool active)
Sets the active flag on both the left and right DisplayRegions to the indicated value.
virtual void set_camera(const NodePath &camera)
Sets both the left and right DisplayRegions to the indicated camera.
virtual void set_incomplete_render(bool incomplete_render)
Sets the incomplete_render flag.
virtual void set_stereo_channel(Lens::StereoChannel stereo_channel)
Sets the stereo channels on the left and right eyes, and also sets the active flags independently on ...
virtual void disable_clears()
Disables both the color and depth clear.
virtual void set_stereo_channel(Lens::StereoChannel stereo_channel)
Specifies whether the DisplayRegion represents the left or right channel of a stereo pair...
virtual void set_dimensions(int i, const LVecBase4 &dimensions)
Sets both the left and right DisplayRegions to the indicated dimensions.
This is a base class for the various different classes that represent the result of a frame of render...
int get_sort() const
Returns the sort value associated with the DisplayRegion.
This is the base class for all three-component vectors and points.
virtual void set_camera(const NodePath &camera)
Sets the camera that is associated with this DisplayRegion.
virtual void set_pixel_zoom(PN_stdfloat pixel_zoom)
Sets the pixel_zoom for left and right eyes.
virtual void set_pixel_zoom(PN_stdfloat pixel_zoom)
Sets the amount by which the pixels of the region are scaled internally when filling the image intera...
virtual void set_target_tex_page(int page)
Sets the page and view on both the left and right DisplayRegions to the indicated value...
bool is_active() const
Returns the active flag associated with the DisplayRegion.
virtual void set_sort(int sort)
Sets the indicated sort value on the overall DisplayRegion, the indicated sort value + 1 on the left ...
A rectangular subregion within a window for rendering into.
virtual void set_cull_traverser(CullTraverser *trav)
Sets the CullTraverser for both the left and right DisplayRegions.
TypeHandle is the identifier used to differentiate C++ class types.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling...
virtual void set_clear_active(int n, bool clear_aux_active)
Sets the clear-active flag for any bitplane.
virtual void set_clear_value(int n, const LColor &clear_value)
Sets the clear value for any bitplane.