mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-18 12:43:44 -04:00
default-stereo-camera
This commit is contained in:
parent
264fc31115
commit
37b172d3d3
@ -371,8 +371,8 @@ class ShowBase(DirectObject.DirectObject):
|
||||
pipeType.getName()))
|
||||
|
||||
def openWindow(self, props = None, pipe = None, gsg = None,
|
||||
type = None, name = None, scene = None,
|
||||
size = None, aspectRatio = None):
|
||||
type = None, name = None, size = None, aspectRatio = None,
|
||||
makeCamera = 1, scene = None, stereo = None):
|
||||
"""
|
||||
Creates a window and adds it to the list of windows that are
|
||||
to be updated every frame.
|
||||
@ -433,7 +433,9 @@ class ShowBase(DirectObject.DirectObject):
|
||||
self.winList.append(win)
|
||||
|
||||
# Set up a 3-d camera for the window by default.
|
||||
self.makeCamera(win, scene = scene, aspectRatio = aspectRatio)
|
||||
if makeCamera:
|
||||
self.makeCamera(win, scene = scene, aspectRatio = aspectRatio,
|
||||
stereo = stereo)
|
||||
|
||||
return win
|
||||
|
||||
@ -803,7 +805,7 @@ class ShowBase(DirectObject.DirectObject):
|
||||
dr.setCamera(cam)
|
||||
|
||||
if stereo == None:
|
||||
stereo = win.isStereo()
|
||||
stereo = (win.isStereo() and self.config.GetBool('default-stereo-camera', 1))
|
||||
if stereo:
|
||||
# A stereo camera! The first DisplayRegion becomes the
|
||||
# left channel.
|
||||
|
@ -34,6 +34,8 @@ ConfigVariableDouble aspect_ratio
|
||||
("aspect-ratio", 0.0);
|
||||
ConfigVariableBool show_frame_rate_meter
|
||||
("show-frame-rate-meter", false);
|
||||
ConfigVariableBool default_stereo_camera
|
||||
("default-stereo-camera", true);
|
||||
|
||||
ConfigVariableString record_session
|
||||
("record-session", "");
|
||||
|
@ -31,6 +31,7 @@ NotifyCategoryDecl(framework, EXPCL_FRAMEWORK, EXPTP_FRAMEWORK);
|
||||
// Configure variables for framework package.
|
||||
extern ConfigVariableDouble aspect_ratio;
|
||||
extern ConfigVariableBool show_frame_rate_meter;
|
||||
extern ConfigVariableBool default_stereo_camera;
|
||||
|
||||
extern ConfigVariableString record_session;
|
||||
extern ConfigVariableString playback_session;
|
||||
|
@ -186,7 +186,7 @@ open_window(const WindowProperties &props, GraphicsEngine *engine,
|
||||
NodePath camera_np = make_camera();
|
||||
_display_region_3d->set_camera(camera_np);
|
||||
|
||||
if (_window->is_stereo()) {
|
||||
if (_window->is_stereo() && default_stereo_camera) {
|
||||
// Actually, let's make a stereo camera. That means the
|
||||
// _display_region_3d will be the left channel, and we need to
|
||||
// make another one to be the right channel.
|
||||
|
Loading…
x
Reference in New Issue
Block a user