Class VolumeCamera
Inherited Members
Namespace: Unity.PolySpatial
Assembly: solution.dll
Syntax
[Icon("Camera Gizmo")]
public class VolumeCamera : MonoBehaviour
Fields
CullingMask
Declaration
[Tooltip("Only objects in the selected layers will be visible inside this Volume Camera.")]
public LayerMask CullingMask
Field Value
Type | Description |
---|---|
LayerMask |
OnWindowClosed
An event that is triggered when a window that is showing this volume camera is closed (by the user or via code).
Declaration
[SerializeField]
[Tooltip("An event that is triggered when this volume camera's window is closed.")]
public UnityEvent OnWindowClosed
Field Value
Type | Description |
---|---|
UnityEvent |
OnWindowFocused
An event that is triggered when this volume camera's window gains or loses focus, as defined by the OS.
The first argument is a boolean indicating if the window has focus or not.
Declaration
[SerializeField]
[Tooltip("An event that is triggered when this volume camera's window's gains or loses focus.")]
public UnityEvent<bool> OnWindowFocused
Field Value
Type | Description |
---|---|
UnityEvent<bool> |
OnWindowOpened
An event that is triggered when this volume camera's window is opened.
The first argument is the actual dimensions of the window in world space, or Vector3.zero if the volume is unbounded. The second argument is the actual dimensions of the content, which may be different due to aspect ratio mapping, in world space, or Vector3.zero if the volume is unbounded. The third argument is the output mode the window was opened in.
Any of these may be different from DesiredOutputDimensions or DesiredOutputMode, based on OS decisions.
Declaration
[SerializeField]
[Tooltip("An event that is triggered when this volume camera's window is opened.")]
public UnityEvent<Vector3, Vector3, VolumeCamera.PolySpatialVolumeCameraMode> OnWindowOpened
Field Value
Type | Description |
---|---|
UnityEvent<Vector3, Vector3, VolumeCamera.PolySpatialVolumeCameraMode> |
OnWindowResized
An event that is triggered when this volume camera's window is resized.
The first argument is the actual dimensions of the window in world space, or Vector3.zero if the volume is unbounded. The second argument is the actual dimensions of the content, which may be different due to aspect ratio mapping, in world space, or Vector3.zero if the volume is unbounded. The third argument is the output mode the window was opened in.
Declaration
[SerializeField]
[Tooltip("An event that is triggered when this volume camera's window's size changes.")]
public UnityEvent<Vector3, Vector3, VolumeCamera.PolySpatialVolumeCameraMode> OnWindowResized
Field Value
Type | Description |
---|---|
UnityEvent<Vector3, Vector3, VolumeCamera.PolySpatialVolumeCameraMode> |
OpenWindowOnLoad
Declaration
[SerializeField]
[Tooltip("If true, a window is automatically opened for this volume camera when loaded. If false, the window must be opened manually via OpenWindow().")]
public bool OpenWindowOnLoad
Field Value
Type | Description |
---|---|
bool |
Properties
Dimensions
Defines the (unscaled) size of the camera's bounding box. The box is centered at the position of the VolumeCamera’s transform.
Declaration
public Vector3 Dimensions { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Remarks
The effective, world space dimensions of the bounding box are calculated by multiplying the Dimensions by the transform's scale.
When you set the volume camera Mode to Bounded, the camera only displays GameObjects within the scaled bounding box. A bounding box is not used when you set the Mode to Unbounded.
OutputDimensions
The dimensions in meters of the actual output size of the volume camera. May be different than Dimensions, in which case the space described by Dimensions is scaled to fit the OutputDimensions.
Declaration
public Vector3 OutputDimensions { get; }
Property Value
Type | Description |
---|---|
Vector3 |
VolumeSpaceToWorldSpaceMatrix
Declaration
public Matrix4x4 VolumeSpaceToWorldSpaceMatrix { get; }
Property Value
Type | Description |
---|---|
Matrix4x4 |
WindowConfiguration
Declaration
public VolumeCameraWindowConfiguration WindowConfiguration { get; set; }
Property Value
Type | Description |
---|---|
VolumeCameraWindowConfiguration |
WindowFocused
Returns true if a window that is showing the contents of this volume camera is focused.
Declaration
public bool WindowFocused { get; }
Property Value
Type | Description |
---|---|
bool |
WindowMode
The mode this volume camera will display its content in, Bounded or Unbounded.
Declaration
public VolumeCamera.PolySpatialVolumeCameraMode WindowMode { get; }
Property Value
Type | Description |
---|---|
VolumeCamera.PolySpatialVolumeCameraMode |
WindowOpen
Returns true if a window is open and showing the contents of this volume camera.
Declaration
public bool WindowOpen { get; }
Property Value
Type | Description |
---|---|
bool |
WorldSpaceToVolumeSpaceMatrix
Declaration
public Matrix4x4 WorldSpaceToVolumeSpaceMatrix { get; }
Property Value
Type | Description |
---|---|
Matrix4x4 |
Methods
CloseWindow()
Request that the OS close the window that is showing the contents of this volume camera. Does nothing if the window is not open.
Declaration
public void CloseWindow()
OpenWindow()
Request that a window is opened to show the contents of this volume camera. Does nothing if the window is already open.
Declaration
public void OpenWindow()