Camera
La référence est en anglais : elle est générée à partir des commentaires du code, écrits en anglais.
public sealed class Camera : ComponentNamespace 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
public static Camera main { get; }The camera of the local player (the eyes in VR).
enabled
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
public int cullingMask { get; set; }The layers the camera draws, one bit per layer.
useOcclusionCulling
public bool useOcclusionCulling { get; set; }The camera uses the scene's occlusion data.
targetTexture
public RenderTexture targetTexture { set; }The render texture the camera draws into.
stereoEnabled
public bool stereoEnabled { get; }The camera renders for a VR headset, one image per eye.
allowHDR
public bool allowHDR { get; }The camera renders in HDR.
clearFlags
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
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
public bool showLocalPlayerHead { get; set; }Also renders the head of the local player, hidden for its own eyes (mirrors).
worldToCameraMatrix
public Matrix4x4 worldToCameraMatrix { get; set; }The matrix from the world to the camera's space.
projectionMatrix
public Matrix4x4 projectionMatrix { get; set; }The camera's projection matrix.
nearClipPlane
public float nearClipPlane { get; set; }The nearest distance drawn.
farClipPlane
public float farClipPlane { get; set; }The farthest distance drawn.
fieldOfView
public float fieldOfView { get; set; }Vertical field of view, in degrees.
aspect
public float aspect { get; set; }Width divided by height.
pixelWidth
public int pixelWidth { get; }Width of the image, in pixels.
pixelHeight
public int pixelHeight { get; }Height of the image, in pixels.
Methods
Create
public static Camera Create()A new camera owned by the world, disabled (it renders only when the script calls Render).
GetStereoViewMatrix
public Matrix4x4 GetStereoViewMatrix(StereoscopicEye eye)The view matrix of one eye (VR).
GetStereoProjectionMatrix
public Matrix4x4 GetStereoProjectionMatrix(StereoscopicEye eye)The projection matrix of one eye (VR).
CalculateObliqueMatrix
public Matrix4x4 CalculateObliqueMatrix(Vector4 clipPlane)The projection of this camera with its near plane replaced by clipPlane (camera space).
Render
public void Render()Renders the camera now, into its target texture.
