NodeWorld

Camera

La référence est en anglais : elle est générée à partir des commentaires du code, écrits en anglais.

csharp
public sealed class Camera : Component

Namespace NodeWorld.Flux.

A camera of the world: the player's (Camera.main, to read), or one a script made (Create), which renders into a render texture when the script calls Render. The server has none.

Properties

main

csharp
public static Camera main { get; }

The camera of the local player (the eyes in VR).

enabled

csharp
public bool enabled { get; set; }

The camera is on. A camera made by a script stays off: it renders when the script calls Render.

cullingMask

csharp
public int cullingMask { get; set; }

The layers the camera draws, one bit per layer.

useOcclusionCulling

csharp
public bool useOcclusionCulling { get; set; }

The camera uses the scene's occlusion data.

targetTexture

csharp
public RenderTexture targetTexture { set; }

The render texture the camera draws into.

stereoEnabled

csharp
public bool stereoEnabled { get; }

The camera renders for a VR headset, one image per eye.

allowHDR

csharp
public bool allowHDR { get; }

The camera renders in HDR.

clearFlags

csharp
public CameraClearFlags clearFlags { get; set; }

What the camera draws before the scene: the sky (default), a solid color (backgroundColor), the depth only, or nothing.

backgroundColor

csharp
public Color backgroundColor { get; set; }

The color a SolidColor clear fills the image with (alpha included: a mirror of the players only clears to transparent black).

showLocalPlayerHead

csharp
public bool showLocalPlayerHead { get; set; }

Also renders the head of the local player, hidden for its own eyes (mirrors).

worldToCameraMatrix

csharp
public Matrix4x4 worldToCameraMatrix { get; set; }

The matrix from the world to the camera's space.

projectionMatrix

csharp
public Matrix4x4 projectionMatrix { get; set; }

The camera's projection matrix.

nearClipPlane

csharp
public float nearClipPlane { get; set; }

The nearest distance drawn.

farClipPlane

csharp
public float farClipPlane { get; set; }

The farthest distance drawn.

fieldOfView

csharp
public float fieldOfView { get; set; }

Vertical field of view, in degrees.

aspect

csharp
public float aspect { get; set; }

Width divided by height.

pixelWidth

csharp
public int pixelWidth { get; }

Width of the image, in pixels.

pixelHeight

csharp
public int pixelHeight { get; }

Height of the image, in pixels.

Methods

Create

csharp
public static Camera Create()

A new camera owned by the world, disabled (it renders only when the script calls Render).

GetStereoViewMatrix

csharp
public Matrix4x4 GetStereoViewMatrix(StereoscopicEye eye)

The view matrix of one eye (VR).

GetStereoProjectionMatrix

csharp
public Matrix4x4 GetStereoProjectionMatrix(StereoscopicEye eye)

The projection matrix of one eye (VR).

CalculateObliqueMatrix

csharp
public Matrix4x4 CalculateObliqueMatrix(Vector4 clipPlane)

The projection of this camera with its near plane replaced by clipPlane (camera space).

Render

csharp
public void Render()

Renders the camera now, into its target texture.

Nested types