Class ziviDomeLive
Create one instance in the sketch's setup(), call setup() after the P3D
surface exists, and provide content through Scene. The facade owns scene activation,
renderers, Processing hooks, camera synchronization, the built-in control panel, outputs, and
terminal cleanup.
Methods documented as Processing Callback are Java-public only because the constructor registers them with Processing. Sketches must not call those callbacks directly. Performance methods are explicitly Experimental; the remaining artist-facing facade is Stable for the 2.x series.
API stability: Stable, except methods explicitly marked Experimental or Processing Callback.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAspect policy used to compute Standard output dimensions. -
Constructor Summary
ConstructorsConstructorDescriptionziviDomeLive(processing.core.PApplet p) Creates a facade owned by the supplied Processing sketch and registers runtime callbacks. -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the configured environment background.voidDisables collection without discarding completed samples.voiddispose()Processing Callback that performs terminal, idempotent cleanup.voiddraw()Processing Callback that renders the already-updated frame and built-in interface.static voidEnables verbose DEBUG logs to the console and library log file.voidEnables experimental performance collection using the default ring-buffer capacity.voidenablePerformanceProfiling(PerformanceMode mode, int sampleCapacity) Enables experimental performance collection with preallocated sample storage.voidenablePerformanceProfiling(PerformanceMode mode, int sampleCapacity, GpuTimerPolicy timerPolicy) Enables profiling with an explicit GPU timer ownership/fallback policy.static voidEnables RELEASE mode, which disables library-managed log output.Gets the configured preview view.floatReturns the current environment background colour multiplier.floatReturns the current equirectangular environment yaw offset.floatReturns the domemaster circle size.floatgetFov()Returns the domemaster angular field of view.Returns a read-only diagnostic report for the active Processing graphics renderer.static LogModeReturns the currently active logging mode.Returns artist-facing output control and telemetry.intReturns the current output resolution used by offscreen render targets.processing.core.PAppletReturns the Processing sketch that owns this facade.Creates an immutable performance snapshot.floatgetPitch()Returns the spherical pitch control accumulator.Returns the active global render mode.floatgetRoll()Returns the spherical roll control accumulator.Returns the native scene-space orbit camera service.Returns the current SceneManager instance.Returns the aspect policy currently used to compute Standard output dimensions.intReturns the configured target frame rate.floatgetYaw()Returns the spherical yaw control accumulator.booleanReports whether an environment background image is currently configured.booleanReports whether the configured environment background is visible.booleanReports whether setup and lazy OpenGL manager initialization completed successfully.booleanReturns whether built-in mouse handling for the scene camera is enabled.booleanChecks if the preview is shown.booleanReports whether the currentScene.sceneRender(PGraphicsOpenGL)call is being executed by a spherical cubemap capture pass.voidkeyEvent(processing.event.KeyEvent event) Processing Callback that routes key events to built-ins, named scene actions, and the active scene's raw callback.voidmouseEvent(processing.event.MouseEvent event) Processing Callback that routes mouse events to named actions, the active scene, the built-in interface, and exactly one navigation camera.voidpause()Processing Callback that pauses frame work, drops queued external input, clears pointer anchors, and disables outputs while remembering their enabled state.voidpost()Processing Callback that performs lazy renderer initialization aftersetup().voidpre()Processing Callback that establishes the authoritative frame boundary.voidregisterScene(Scene scene) Registers a scene with the facade-owned manager without activating it when another user scene is already active.voidResets the built-in controls to their default state when the interface is initialized.voidresetGraphics(int newResolution) Schedules output-target recreation at a safe draw boundary.voidRestores the spherical orientation to the identity quaternion.voidClears all performance samples and invariant counters.voidresume()Processing Callback that resumes activation input and outputs remembered bypause().voidsetCurrentScene(Scene newScene) Alias forsetScene(Scene)retained as part of the 2.x scene API.voidsetCurrentView(ViewType currentView) Sets the configured preview view.voidsetEnvironmentBackgroundIntensity(float intensity) Sets the colour multiplier applied to the LDR environment background.voidsetEnvironmentBackgroundVisible(boolean visible) Shows or hides the configured environment background without releasing the image.voidsetEnvironmentBackgroundYawOffset(float yawOffset) Rotates the equirectangular environment lookup around the vertical axis.voidsetEquirectangularBackground(String imagePath) Loads and sets an LDR equirectangular environment background from the sketch data path.voidsetEquirectangularBackground(processing.core.PImage image) Sets an LDR equirectangular environment background for all render modes.voidsetFishSize(float fishSize) Sets the domemaster circle size.voidsetFov(float fov) Sets the domemaster angular field of view.static voidsetLogMode(LogMode mode) Sets the global logging mode used by the library.voidConfigures an offscreen output-resolution view for performance qualification.voidsetPitch(float pitch) Sets spherical pitch by composing the shortest delta around the local X axis.voidsetRenderMode(RenderMode renderMode) Selects the global rendering behavior.voidsetRoll(float roll) Sets spherical roll by composing the shortest delta around the local Y axis.voidSelects and activates a scene through the facade-owned manager.voidsetSceneCameraInputEnabled(boolean enabled) Enables or disables built-in mouse handling for the scene camera.voidsetSceneManager(SceneManager sceneManager) Sets the SceneManager instance for managing multiple scenes.voidsetShowPreview(boolean showPreview) Sets whether the preview is shown.voidSets the aspect policy used to compute Standard output dimensions.voidsetTargetFrameRate(int fps) Sets the target frame rate applied during setup.voidsetup()Sets up the rendering environment, including frame rate, OpenGL info, texture hints, output coordination, and the built-in interface.voidsetYaw(float yaw) Sets spherical yaw by composing the shortest delta around the local Z axis.voidstop()Processing Callback that stops the instance permanently and releases all owned resources.
-
Constructor Details
-
ziviDomeLive
public ziviDomeLive(processing.core.PApplet p) Creates a facade owned by the supplied Processing sketch and registers runtime callbacks.Call
setup()from the sketch'ssetup()after creating its P3D surface.- Parameters:
p- non-null Processing sketch used for rendering- Throws:
IllegalArgumentException- if the PApplet instance is null
-
-
Method Details
-
setLogMode
Sets the global logging mode used by the library. Call this before creating a ziviDomeLive instance so startup follows the selected profile.- Parameters:
mode- desired logging mode
-
enableDebugLogging
public static void enableDebugLogging()Enables verbose DEBUG logs to the console and library log file. -
enableReleaseLogging
public static void enableReleaseLogging()Enables RELEASE mode, which disables library-managed log output. -
getLogMode
Returns the currently active logging mode.- Returns:
- active logging mode
-
setScene
Selects and activates a scene through the facade-owned manager.An unregistered instance is registered automatically. Switching performs the complete activation order: stop old activation work, dispose the previous scene, create fresh services, configure the new scene, then set it up.
- Parameters:
scene- scene instance to activate;nullis ignored
-
registerScene
Registers a scene with the facade-owned manager without activating it when another user scene is already active. The first registered user scene replaces the bootstrap fallback.The facade lifecycle guarantees that
Scene.configure(SceneServices)runs before the first setup.- Parameters:
scene- scene to register
-
setup
public void setup()Sets up the rendering environment, including frame rate, OpenGL info, texture hints, output coordination, and the built-in interface.Call once from the sketch's
setup()after its P3D surface has been created. The operation is idempotent; renderer allocation completes lazily in the registeredpost()callback when the OpenGL context is active.- Throws:
IllegalStateException- if the PApplet instance is not properly configured
-
setStandardOutputAspectMode
Sets the aspect policy used to compute Standard output dimensions.Changing this setting schedules an output-render-target rebuild on the next frame so the Standard output FBO dimensions are updated without recreating preview targets.
- Parameters:
mode- desired aspect mode, ignored whennull
-
getStandardOutputAspectMode
Returns the aspect policy currently used to compute Standard output dimensions.- Returns:
- current Standard output aspect mode
-
draw
public void draw()Processing Callback that renders the already-updated frame and built-in interface.The constructor registers this method automatically. Sketches must not call it directly or call a second ziviDomeLive render method from their own
draw(). -
resetGraphics
public void resetGraphics(int newResolution) Schedules output-target recreation at a safe draw boundary. Preview resolution remains derived from the Processing window.- Parameters:
newResolution- positive output resolution in pixels- Throws:
IllegalArgumentException- whennewResolutionis not positive
-
getOutputResolution
public int getOutputResolution()Returns the current output resolution used by offscreen render targets.- Returns:
- current output resolution
-
setCurrentScene
Alias forsetScene(Scene)retained as part of the 2.x scene API.- Parameters:
newScene- scene instance to activate;nullis ignored
-
keyEvent
public void keyEvent(processing.event.KeyEvent event) Processing Callback that routes key events to built-ins, named scene actions, and the active scene's raw callback.The constructor registers this method automatically; sketches must not call or register it themselves.
- Parameters:
event- the KeyEvent object containing details of the key event
-
mouseEvent
public void mouseEvent(processing.event.MouseEvent event) Processing Callback that routes mouse events to named actions, the active scene, the built-in interface, and exactly one navigation camera.The constructor registers this method automatically; sketches must not call or register it themselves. A visible control under the pointer owns its gesture and suppresses navigation.
- Parameters:
event- the MouseEvent object containing details of the mouse event
-
getOutputManager
Returns artist-facing output control and telemetry.- Returns:
- output manager, or
nullbeforesetup()completes
-
getFishSize
public float getFishSize()Returns the domemaster circle size.- Returns:
- configured size as a percentage of the square target
-
setFishSize
public void setFishSize(float fishSize) Sets the domemaster circle size.- Parameters:
fishSize- size percentage; values outside 0..100 are constrained
-
getFov
public float getFov()Returns the domemaster angular field of view.- Returns:
- field of view in degrees
-
setFov
public void setFov(float fov) Sets the domemaster angular field of view.- Parameters:
fov- field of view in degrees; finite values are constrained to 0..360 and non-finite values are ignored
-
getPitch
public float getPitch()Returns the spherical pitch control accumulator.- Returns:
- pitch in radians
-
setPitch
public void setPitch(float pitch) Sets spherical pitch by composing the shortest delta around the local X axis.- Parameters:
pitch- control value in radians; non-finite values are ignored
-
getYaw
public float getYaw()Returns the spherical yaw control accumulator.- Returns:
- yaw in radians
-
setYaw
public void setYaw(float yaw) Sets spherical yaw by composing the shortest delta around the local Z axis.- Parameters:
yaw- control value in radians; non-finite values are ignored
-
getRoll
public float getRoll()Returns the spherical roll control accumulator.- Returns:
- roll in radians
-
setRoll
public void setRoll(float roll) Sets spherical roll by composing the shortest delta around the local Y axis.- Parameters:
roll- control value in radians; non-finite values are ignored
-
resetOrientation
public void resetOrientation()Restores the spherical orientation to the identity quaternion. -
getCurrentView
Gets the configured preview view.In a dedicated
RenderMode, the effective representation is controlled by that mode while this value is preserved for a later return toRenderMode.FULL.- Returns:
- configured preview view
-
setCurrentView
Sets the configured preview view.The selection takes effect immediately in
RenderMode.FULL. Dedicated modes keep it as the preview selection to restore when FULL is selected again.- Parameters:
currentView- new preview view;nullis ignored
-
getRenderMode
Returns the active global render mode.- Returns:
- active mode, defaulting to
RenderMode.FULL - Since:
- 1.5.0
-
setRenderMode
Selects the global rendering behavior.FULL preserves independent preview and external-output routing. A dedicated mode overrides their effective representation without mutating the configured
ViewTypevalues.- Parameters:
renderMode- new global mode;nullis ignored- Since:
- 1.5.0
-
setTargetFrameRate
public void setTargetFrameRate(int fps) Sets the target frame rate applied during setup. Defaults to 60. Call before setup() to take effect at startup; calling afterwards applies immediately and updates the default NDI frame-rate metadata. Reapplying the configured value does not restart Processing's animator.- Parameters:
fps- desired frame rate, must be positive
-
getTargetFrameRate
public int getTargetFrameRate()Returns the configured target frame rate.- Returns:
- target frame rate in frames per second
-
setPerformanceOutputDemand
Configures an offscreen output-resolution view for performance qualification.This demand is honored only while performance profiling is enabled. It renders the requested high-resolution output dependency chain without enabling, disabling, or sending NDI, Syphon, or Spout. Passing
nullclears the qualification demand.This is an experimental benchmarking hook; normal applications should route output through
OutputManager.API stability: Experimental.
- Parameters:
view- output-resolution view to render during profiling, ornullto clear- Since:
- 2.0.0
-
isShowPreview
public boolean isShowPreview()Checks if the preview is shown.- Returns:
- true if the preview is shown, false otherwise
-
setShowPreview
public void setShowPreview(boolean showPreview) Sets whether the preview is shown.- Parameters:
showPreview- true to show the preview, false to hide
-
resetControls
public void resetControls()Resets the built-in controls to their default state when the interface is initialized. -
getSceneCamera
Returns the native scene-space orbit camera service.Scenes normally obtain this same camera from
SceneServices.camera()and apply it insidesceneRenderbetweenpushMatrix/popMatrix. The camera transforms the scene modelview directly, so it works across every projection without touching the dome parameters (yaw/pitch/roll/fov). Its current rotational quaternion is synchronized with the shared Environment every frame; target and distance remain scene-only so the background stays infinite.- Returns:
- the shared
OrbitCamerainstance
-
isSphericalCaptureActive
public boolean isSphericalCaptureActive()Reports whether the currentScene.sceneRender(PGraphicsOpenGL)call is being executed by a spherical cubemap capture pass.Scenes can use this to skip viewport-only background geometry, HUDs, or helper elements that should not be baked into domemaster, equirectangular, or skybox outputs. The method does not change the
sceneRender(PGraphicsOpenGL)contract; it only exposes the current renderer phase.- Returns:
truewhile a cubemap capture pass is rendering the scene- Since:
- 2.0.0
-
setEquirectangularBackground
public void setEquirectangularBackground(processing.core.PImage image) Sets an LDR equirectangular environment background for all render modes.The image is rendered by the library as an infinite far-depth background after the active
Sceneis drawn. This keeps backgrounds out of scene geometry, survives scene-ownedbackground()calls, and makes the same environment available to domemaster, equirectangular, skybox, and Standard projections. In Standard view the environment follows camera rotation but remains invariant under camera translation. Passingnullclears the environment.- Parameters:
image- equirectangular Processing image, ornullto clear
-
setEquirectangularBackground
Loads and sets an LDR equirectangular environment background from the sketch data path.This is a synchronous Processing asset load. Use it during sketch setup, not inside a recurring frame callback or background task.
- Parameters:
imagePath- Processing data path or absolute image path; null or blank clears the source
-
clearEnvironmentBackground
public void clearEnvironmentBackground()Clears the configured environment background. -
hasEnvironmentBackground
public boolean hasEnvironmentBackground()Reports whether an environment background image is currently configured.- Returns:
truewhen an image is configured
-
setEnvironmentBackgroundVisible
public void setEnvironmentBackgroundVisible(boolean visible) Shows or hides the configured environment background without releasing the image.- Parameters:
visible-trueto draw the environment background
-
isEnvironmentBackgroundVisible
public boolean isEnvironmentBackgroundVisible()Reports whether the configured environment background is visible.- Returns:
truewhen visible
-
setEnvironmentBackgroundIntensity
public void setEnvironmentBackgroundIntensity(float intensity) Sets the colour multiplier applied to the LDR environment background.- Parameters:
intensity- colour multiplier; finite negative values are clamped to zero and non-finite values are ignored
-
getEnvironmentBackgroundIntensity
public float getEnvironmentBackgroundIntensity()Returns the current environment background colour multiplier.- Returns:
- non-negative colour multiplier
-
setEnvironmentBackgroundYawOffset
public void setEnvironmentBackgroundYawOffset(float yawOffset) Rotates the equirectangular environment lookup around the vertical axis.- Parameters:
yawOffset- radians added to the source longitude lookup; non-finite values are ignored
-
getEnvironmentBackgroundYawOffset
public float getEnvironmentBackgroundYawOffset()Returns the current equirectangular environment yaw offset.- Returns:
- yaw offset in radians
-
setSceneCameraInputEnabled
public void setSceneCameraInputEnabled(boolean enabled) Enables or disables built-in mouse handling for the scene camera. When enabled, the library forwards mouse drag/wheel events togetSceneCamera()automatically and suspends the independent Standard-view camera input, preventing the same gesture from rotating two cameras at once.- Parameters:
enabled- true to let the library drive the scene camera from mouse input
-
isSceneCameraInputEnabled
public boolean isSceneCameraInputEnabled()Returns whether built-in mouse handling for the scene camera is enabled.- Returns:
- true if the library forwards mouse input to the scene camera
-
getPApplet
public processing.core.PApplet getPApplet()Returns the Processing sketch that owns this facade.Scenes should prefer
SceneServices.applet()so ownership remains explicit for the current activation.- Returns:
- non-null owning Processing sketch
-
isInitialized
public boolean isInitialized()Reports whether setup and lazy OpenGL manager initialization completed successfully.- Returns:
truewhen the facade can render frames
-
enablePerformanceProfiling
Enables experimental performance collection using the default ring-buffer capacity.PerformanceMode.CPU_GPUadds one capability-gated asynchronous GPU timestamp interval around the complete render pipeline. Unsupported contexts fall back to CPU, and no synchronous query orglFinish()is introduced.API stability: Experimental.
- Parameters:
mode- non-null requested profiling mode- Throws:
IllegalArgumentException- whenmodeis null- Since:
- 2.0.0
-
enablePerformanceProfiling
Enables experimental performance collection with preallocated sample storage. Calling this method resets previously collected samples.API stability: Experimental.
- Parameters:
mode- non-null requested profiling modesampleCapacity- number of completed frames retained in the ring buffer, from 2 to 100000- Throws:
IllegalArgumentException- when an argument is invalid- Since:
- 2.0.0
-
enablePerformanceProfiling
public void enablePerformanceProfiling(PerformanceMode mode, int sampleCapacity, GpuTimerPolicy timerPolicy) Enables profiling with an explicit GPU timer ownership/fallback policy.GpuTimerPolicy.ARCHITECTURE_AWAREis intended for controlled benchmark scenes. On Apple Silicon it may ownGL_TIME_ELAPSEDfor the complete pipeline, so scene code must not start another elapsed timer query during the interval.API stability: Experimental.
- Parameters:
mode- non-null requested profiling modesampleCapacity- number of completed frames retained in the ring buffer, from 2 to 100000timerPolicy- non-null GPU timer selection policy- Throws:
IllegalArgumentException- when an argument is invalid- Since:
- 2.0.0
-
disablePerformanceProfiling
public void disablePerformanceProfiling()Disables collection without discarding completed samples.API stability: Experimental.
- Since:
- 2.0.0
-
resetPerformanceStatistics
public void resetPerformanceStatistics()Clears all performance samples and invariant counters.API stability: Experimental.
- Since:
- 2.0.0
-
getPerformanceSnapshot
Creates an immutable performance snapshot. Call outside a measured interval because snapshot aggregation intentionally allocates and sorts copies of retained samples.API stability: Experimental.
- Returns:
- immutable snapshot of completed frames
- Since:
- 2.0.0
-
getGraphicsCapabilities
Returns a read-only diagnostic report for the active Processing graphics renderer.Call on the Processing/OpenGL thread after the renderer is initialized.
API stability: Experimental.
- Returns:
- current graphics capability report
- Since:
- 2.0.0
-
setSceneManager
Sets the SceneManager instance for managing multiple scenes.A detached manager selects, but does not set up, its first registered scene. Attaching it here begins that activation with facade-owned services. Replacing the manager disposes the previously owned activation first.
- Parameters:
sceneManager- the SceneManager instance to manage scenes
-
getSceneManager
Returns the current SceneManager instance.- Returns:
- the current SceneManager
-
pre
public void pre()Processing Callback that establishes the authoritative frame boundary.It drains activation queues and bounded external input, ticks the frame clock, processes a deferred reload or calls
Scene.update(), refreshes tracked camera targets, and advances camera interpolation once. The constructor registers it automatically; sketches must not call it directly. -
post
public void post()Processing Callback that performs lazy renderer initialization aftersetup().The constructor registers it automatically and the facade unregisters it after successful initialization. Sketches must not call it directly.
-
stop
public void stop()Processing Callback that stops the instance permanently and releases all owned resources.This terminal operation delegates to
dispose()and is idempotent. Processing calls it automatically; applications normally do not. -
resume
public void resume()Processing Callback that resumes activation input and outputs remembered bypause().The constructor registers it automatically; sketches must not call it directly.
-
pause
public void pause()Processing Callback that pauses frame work, drops queued external input, clears pointer anchors, and disables outputs while remembering their enabled state.The constructor registers it automatically; sketches must not call it directly.
-
dispose
public void dispose()Processing Callback that performs terminal, idempotent cleanup.Processing calls this method automatically. It may also be invoked once by an application that intentionally ends the facade early; no facade operation may reactivate it afterward.
-