Struct XRCameraIntrinsics
Camera intrinsics describe physical characteristics of a camera.
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
Syntax
public struct XRCameraIntrinsics : IEquatable<XRCameraIntrinsics>
Remarks
These intrinsics are based on a pinhole camera model. A pinhole camera is a simple type of lens-less camera, a box with a single pinhole in one side. Rays of light enter the pinhole and land on the opposite wall of the box (the image plane), forming an image. Most cameras use larger apertures with lenses to focus the light, but the pinhole camera provides a simplified mathematical model.
Constructors
XRCameraIntrinsics(Vector2, Vector2, Vector2Int)
Constructs a XRCameraIntrinsics from the given parameters.
Declaration
public XRCameraIntrinsics(Vector2 focalLength, Vector2 principalPoint, Vector2Int resolution)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | focalLength | The focal length in pixels. |
Vector2 | principalPoint | The principal point from the top-left of the image, in pixels. |
Vector2Int | resolution | The dimensions of the image. |
Properties
focalLength
The focal length in pixels.
Declaration
public readonly Vector2 focalLength { get; }
Property Value
Type | Description |
---|---|
Vector2 | The focal length in pixels. |
Remarks
The focal length is the distance between the camera's pinhole and the image plane. In a pinhole camera, the x and y values would be the same, but these can vary for real cameras.
principalPoint
The principal point from the top-left corner of the image, expressed in pixels.
Declaration
public readonly Vector2 principalPoint { get; }
Property Value
Type | Description |
---|---|
Vector2 | The principal point from the top-left corner of the image, expressed in pixels. |
Remarks
The principal point is the point of intersection between the image plane and a line perpendicular to the image plane passing through the camera's pinhole.
resolution
The width and height of the image in pixels.
Declaration
public readonly Vector2Int resolution { get; }
Property Value
Type | Description |
---|---|
Vector2Int | The width and height of the image in pixels. |
Methods
Equals(Object)
Tests for equality.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The |
Returns
Type | Description |
---|---|
Boolean |
|
Overrides
Equals(XRCameraIntrinsics)
Tests for equality.
Declaration
public bool Equals(XRCameraIntrinsics other)
Parameters
Type | Name | Description |
---|---|---|
XRCameraIntrinsics | other | The other XRCameraIntrinsics to compare against. |
Returns
Type | Description |
---|---|
Boolean |
|
Implements
GetHashCode()
Generates a hash suitable for use with containers like HashSet
and Dictionary
.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A hash code generated from this object's fields. |
Overrides
ToString()
Generates a string representation of this XRCameraIntrinsics.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A string representation of this XRCameraIntrinsics. |
Overrides
Operators
Equality(XRCameraIntrinsics, XRCameraIntrinsics)
Tests for equality. Same as Equals(XRCameraIntrinsics).
Declaration
public static bool operator ==(XRCameraIntrinsics lhs, XRCameraIntrinsics rhs)
Parameters
Type | Name | Description |
---|---|---|
XRCameraIntrinsics | lhs | The left-hand side of the comparison. |
XRCameraIntrinsics | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
Boolean |
|
Inequality(XRCameraIntrinsics, XRCameraIntrinsics)
Tests for inequality. Same as !
Equals(XRCameraIntrinsics).
Declaration
public static bool operator !=(XRCameraIntrinsics lhs, XRCameraIntrinsics rhs)
Parameters
Type | Name | Description |
---|---|---|
XRCameraIntrinsics | lhs | The left-hand side of the comparison. |
XRCameraIntrinsics | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
Boolean |
|