docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct XRCameraIntrinsics

    Camera intrinsics describe physical characteristics of a camera.

    Implements
    IEquatable<XRCameraIntrinsics>
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.ARSubsystems
    Assembly: Unity.XR.ARSubsystems.dll
    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 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 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 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 object to compare against.

    Returns
    Type Description
    bool

    True if obj is of type XRCameraIntrinsics and Equals(XRCameraIntrinsics) also returns true; otherwise false.

    Overrides
    ValueType.Equals(object)

    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
    bool

    True if every field in other is equal to this XRCameraIntrinsics, otherwise false.

    GetHashCode()

    Generates a hash suitable for use with containers like HashSet and Dictionary.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code generated from this object's fields.

    Overrides
    ValueType.GetHashCode()

    ToString()

    Generates a string representation of this XRCameraIntrinsics.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string representation of this XRCameraIntrinsics.

    Overrides
    ValueType.ToString()

    Operators

    operator ==(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
    bool

    True if lhs is equal to rhs, otherwise false.

    operator !=(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
    bool

    True if lhs is not equal to rhs, otherwise false.

    Implements

    IEquatable<T>
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)