Skip to content

Chart3DCameraRig

ClassChartGuruChartGuru.3D
public class Chart3DCameraRig : MonoBehaviour

Orbit rig that keeps a scene camera on a Chart3DComponent: it orbits by the chart's Chart.Pose and follows its Chart.Projection. By default it fits the whole chart, labels included, into the camera's view with the framing and field of view Chart 3D outputs use; off, it places the camera at its own distance and orthographic size. It writes the camera only when the pose, projection, plot, geometry, host transform, camera aspect or a rig setting changed, or something else moved the camera.

public static Chart3DCameraRig EnsureRig(Chart3DComponent host)

Returns the rig on the __CameraRig child of host, creating that child and its camera when it is missing, and points the rig at the host; null for a null host. The rig is saved with the scene. A host without a Chart3DComponent.CameraRig takes the rig as its own, so the rig orbits by the pose and the host stops turning its content by it.

Parameters

NameType
hostChartGuru.Chart3DComponent

Returns

ChartGuru.Chart3DCameraRig

public Chart3DCameraRig()

public Chart3DComponent Host { get; set; }

Returns

ChartGuru.Chart3DComponent

public Camera ActiveCamera { get; }

Returns

UnityEngine.Camera

public bool AutoFrame { get; set; }

Whether the rig fits the whole chart into the camera’s view; off, it uses Chart3DCameraRig.Distance and its orthographic size.

Returns

System.Boolean

public float Distance { get; set; }

The camera’s distance from the plot center, in the chart’s local units: the chart pose’s distance when it has one, else the latest automatic framing’s, else the rig’s own. Setting it clamps it between the minimum and maximum distances and, while the rig orbits by the chart’s pose, stores it in the pose.

Returns

System.Single