Skip to content

Chart3DPose

StructChartGuruChartGuru
public struct Chart3DPose

Camera pose for 3D charts, expressed as azimuth (rotation around Y) and inclination (tilt up/down). Swift Charts equivalent: Chart3DPose. Mirrors Chart3DPose(azimuth: .degrees(20), inclination: .degrees(7)).

Lives in the core ChartGuru package so ChartGuru.Chart can hold a pose value directly without a type dependency on the 3D add-on. All interactive rendering of the pose is performed by the ChartGuru.3D add-on.

public float AzimuthDegrees

Rotation around the Y axis, in degrees. Positive values rotate left-to-right.

Returns

System.Single

public float InclinationDegrees

Tilt up/down, in degrees. Positive values tilt the camera upward.

Returns

System.Single

public float Distance

Distance from the chart origin to the camera (orbit radius). 0 lets the host choose.

Returns

System.Single

public static readonly Chart3DPose Default

Default pose: three-quarter oblique, matches Swift Charts Chart3DPose.default.

Returns

ChartGuru.Chart3DPose

public static readonly Chart3DPose Front

Front elevation (looking straight along +Z).

Returns

ChartGuru.Chart3DPose

public static readonly Chart3DPose Back

Back elevation.

Returns

ChartGuru.Chart3DPose

public static readonly Chart3DPose Right

Right-side elevation.

Returns

ChartGuru.Chart3DPose

public static readonly Chart3DPose Left

Left-side elevation.

Returns

ChartGuru.Chart3DPose

public static readonly Chart3DPose Top

Top-down plan view.

Returns

ChartGuru.Chart3DPose

public static readonly Chart3DPose Bottom

Bottom-up plan view.

Returns

ChartGuru.Chart3DPose

public Chart3DPose(float azimuthDegrees, float inclinationDegrees, float distance = 0)

Creates an orbit-camera pose from azimuth and inclination angles in degrees plus distance from the pivot.

Parameters

Name Type
azimuthDegrees System.Single
inclinationDegrees System.Single
distance System.Single

public static Chart3DPose Lerp(Chart3DPose a, Chart3DPose b, float t)

Linear interpolation between two poses (for animations).

Parameters

Name Type
a ChartGuru.Chart3DPose
b ChartGuru.Chart3DPose
t System.Single

Returns

ChartGuru.Chart3DPose

public Quaternion ToCameraRotation()

Compose a world-space rotation for a camera orbiting the origin.

Returns

UnityEngine.Quaternion

public Vector3 ToCameraPosition(Vector3 pivot, float radius)

Compute the camera position on the orbit sphere with the given radius and pivot. When ChartGuru.Chart3DPose.Distance is zero, the supplied radius is used.

Parameters

Name Type
pivot UnityEngine.Vector3
radius System.Single

Returns

UnityEngine.Vector3

public bool Equals(Chart3DPose other)

Parameters

Name Type
other ChartGuru.Chart3DPose

Returns

System.Boolean

public override bool Equals(object obj)

Parameters

Name Type
obj System.Object

Returns

System.Boolean

public override int GetHashCode()

Returns

System.Int32

public override string ToString()

Returns

System.String

public static bool operator ==(Chart3DPose a, Chart3DPose b)

Reports whether azimuth, inclination, and distance are approximately equal using Unity float tolerances.

Parameters

Name Type
a ChartGuru.Chart3DPose
b ChartGuru.Chart3DPose

Returns

System.Boolean

public static bool operator !=(Chart3DPose a, Chart3DPose b)

Reports whether any orbit angle or distance differs beyond Unity float tolerances.

Parameters

Name Type
a ChartGuru.Chart3DPose
b ChartGuru.Chart3DPose

Returns

System.Boolean