ParelVRDocs
Player site

Scripting / Reference

Cameras

Types in the ParelVR.Volt.Cameras namespace.

VoltCamera#

ParelVR.Volt.Cameras.VoltCamera reference extends VoltComponent

A camera that belongs to the world, for mirrors, screens and security monitors. Scripts never get the camera a player sees through, and a world camera cannot render to a player's display.

Properties#

bool Enabled { get; set; }

Whether the camera renders.

float FarClip { get; set; }

Farthest distance the camera draws.

float FieldOfView { get; set; }

Vertical field of view in degrees.

float NearClip { get; set; }

Nearest distance the camera draws.

Vector3 Position { get; set; }

Position of the camera in world space.

Quaternion Rotation { get; set; }

Rotation of the camera in world space.

VoltRenderTexture TargetTexture { get; set; }

The render texture the camera draws into, for screens, monitors and portals: put the same texture on a renderer with . Setting it to null also switches the camera off, since a world camera never draws onto a player's screen.

Methods#

void LookAt(Vector3 worldPosition)

Turns the camera to look at a position.

void Render()

Draws one picture into the target texture now, for a camera that is switched off and updated only when something changes (a photo, a slow security monitor). At most once a frame per camera, and four cameras a frame.

Vector3 WorldToViewportPoint(Vector3 worldPosition)

Where a world position appears in the camera's picture: x and y from 0 to 1, z the distance.