123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Projection.xml.
- .. _class_Projection:
- Projection
- ==========
- A 4ร4 matrix for 3D projective transformations.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- A 4ร4 matrix used for 3D projective transformations. It can represent transformations such as translation, rotation, scaling, shearing, and perspective division. It consists of four :ref:`Vector4<class_Vector4>` columns.
- For purely linear transformations (translation, rotation, and scale), it is recommended to use :ref:`Transform3D<class_Transform3D>`, as it is more performant and requires less memory.
- Used internally as :ref:`Camera3D<class_Camera3D>`'s projection matrix.
- .. note::
- There are notable differences when using this API with C#. See :ref:`doc_c_sharp_differences` for more information.
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +-------------------------------+---------------------------------------+-------------------------+
- | :ref:`Vector4<class_Vector4>` | :ref:`w<class_Projection_property_w>` | ``Vector4(0, 0, 0, 1)`` |
- +-------------------------------+---------------------------------------+-------------------------+
- | :ref:`Vector4<class_Vector4>` | :ref:`x<class_Projection_property_x>` | ``Vector4(1, 0, 0, 0)`` |
- +-------------------------------+---------------------------------------+-------------------------+
- | :ref:`Vector4<class_Vector4>` | :ref:`y<class_Projection_property_y>` | ``Vector4(0, 1, 0, 0)`` |
- +-------------------------------+---------------------------------------+-------------------------+
- | :ref:`Vector4<class_Vector4>` | :ref:`z<class_Projection_property_z>` | ``Vector4(0, 0, 1, 0)`` |
- +-------------------------------+---------------------------------------+-------------------------+
- .. rst-class:: classref-reftable-group
- Constructors
- ------------
- .. table::
- :widths: auto
- +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Projection<class_Projection>` | :ref:`Projection<class_Projection_constructor_Projection>`\ (\ ) |
- +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Projection<class_Projection>` | :ref:`Projection<class_Projection_constructor_Projection>`\ (\ from\: :ref:`Projection<class_Projection>`\ ) |
- +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Projection<class_Projection>` | :ref:`Projection<class_Projection_constructor_Projection>`\ (\ from\: :ref:`Transform3D<class_Transform3D>`\ ) |
- +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Projection<class_Projection>` | :ref:`Projection<class_Projection_constructor_Projection>`\ (\ x_axis\: :ref:`Vector4<class_Vector4>`, y_axis\: :ref:`Vector4<class_Vector4>`, z_axis\: :ref:`Vector4<class_Vector4>`, w_axis\: :ref:`Vector4<class_Vector4>`\ ) |
- +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- .. rst-class:: classref-reftable-group
- Methods
- -------
- .. table::
- :widths: auto
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Projection<class_Projection>` | :ref:`create_depth_correction<class_Projection_method_create_depth_correction>`\ (\ flip_y\: :ref:`bool<class_bool>`\ ) |static| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Projection<class_Projection>` | :ref:`create_fit_aabb<class_Projection_method_create_fit_aabb>`\ (\ aabb\: :ref:`AABB<class_AABB>`\ ) |static| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Projection<class_Projection>` | :ref:`create_for_hmd<class_Projection_method_create_for_hmd>`\ (\ eye\: :ref:`int<class_int>`, aspect\: :ref:`float<class_float>`, intraocular_dist\: :ref:`float<class_float>`, display_width\: :ref:`float<class_float>`, display_to_lens\: :ref:`float<class_float>`, oversample\: :ref:`float<class_float>`, z_near\: :ref:`float<class_float>`, z_far\: :ref:`float<class_float>`\ ) |static| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Projection<class_Projection>` | :ref:`create_frustum<class_Projection_method_create_frustum>`\ (\ left\: :ref:`float<class_float>`, right\: :ref:`float<class_float>`, bottom\: :ref:`float<class_float>`, top\: :ref:`float<class_float>`, z_near\: :ref:`float<class_float>`, z_far\: :ref:`float<class_float>`\ ) |static| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Projection<class_Projection>` | :ref:`create_frustum_aspect<class_Projection_method_create_frustum_aspect>`\ (\ size\: :ref:`float<class_float>`, aspect\: :ref:`float<class_float>`, offset\: :ref:`Vector2<class_Vector2>`, z_near\: :ref:`float<class_float>`, z_far\: :ref:`float<class_float>`, flip_fov\: :ref:`bool<class_bool>` = false\ ) |static| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Projection<class_Projection>` | :ref:`create_light_atlas_rect<class_Projection_method_create_light_atlas_rect>`\ (\ rect\: :ref:`Rect2<class_Rect2>`\ ) |static| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Projection<class_Projection>` | :ref:`create_orthogonal<class_Projection_method_create_orthogonal>`\ (\ left\: :ref:`float<class_float>`, right\: :ref:`float<class_float>`, bottom\: :ref:`float<class_float>`, top\: :ref:`float<class_float>`, z_near\: :ref:`float<class_float>`, z_far\: :ref:`float<class_float>`\ ) |static| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Projection<class_Projection>` | :ref:`create_orthogonal_aspect<class_Projection_method_create_orthogonal_aspect>`\ (\ size\: :ref:`float<class_float>`, aspect\: :ref:`float<class_float>`, z_near\: :ref:`float<class_float>`, z_far\: :ref:`float<class_float>`, flip_fov\: :ref:`bool<class_bool>` = false\ ) |static| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Projection<class_Projection>` | :ref:`create_perspective<class_Projection_method_create_perspective>`\ (\ fovy\: :ref:`float<class_float>`, aspect\: :ref:`float<class_float>`, z_near\: :ref:`float<class_float>`, z_far\: :ref:`float<class_float>`, flip_fov\: :ref:`bool<class_bool>` = false\ ) |static| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Projection<class_Projection>` | :ref:`create_perspective_hmd<class_Projection_method_create_perspective_hmd>`\ (\ fovy\: :ref:`float<class_float>`, aspect\: :ref:`float<class_float>`, z_near\: :ref:`float<class_float>`, z_far\: :ref:`float<class_float>`, flip_fov\: :ref:`bool<class_bool>`, eye\: :ref:`int<class_int>`, intraocular_dist\: :ref:`float<class_float>`, convergence_dist\: :ref:`float<class_float>`\ ) |static| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`determinant<class_Projection_method_determinant>`\ (\ ) |const| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Projection<class_Projection>` | :ref:`flipped_y<class_Projection_method_flipped_y>`\ (\ ) |const| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_aspect<class_Projection_method_get_aspect>`\ (\ ) |const| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2<class_Vector2>` | :ref:`get_far_plane_half_extents<class_Projection_method_get_far_plane_half_extents>`\ (\ ) |const| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_fov<class_Projection_method_get_fov>`\ (\ ) |const| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_fovy<class_Projection_method_get_fovy>`\ (\ fovx\: :ref:`float<class_float>`, aspect\: :ref:`float<class_float>`\ ) |static| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_lod_multiplier<class_Projection_method_get_lod_multiplier>`\ (\ ) |const| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_pixels_per_meter<class_Projection_method_get_pixels_per_meter>`\ (\ for_pixel_width\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Plane<class_Plane>` | :ref:`get_projection_plane<class_Projection_method_get_projection_plane>`\ (\ plane\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2<class_Vector2>` | :ref:`get_viewport_half_extents<class_Projection_method_get_viewport_half_extents>`\ (\ ) |const| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_z_far<class_Projection_method_get_z_far>`\ (\ ) |const| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_z_near<class_Projection_method_get_z_near>`\ (\ ) |const| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Projection<class_Projection>` | :ref:`inverse<class_Projection_method_inverse>`\ (\ ) |const| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_orthogonal<class_Projection_method_is_orthogonal>`\ (\ ) |const| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Projection<class_Projection>` | :ref:`jitter_offseted<class_Projection_method_jitter_offseted>`\ (\ offset\: :ref:`Vector2<class_Vector2>`\ ) |const| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Projection<class_Projection>` | :ref:`perspective_znear_adjusted<class_Projection_method_perspective_znear_adjusted>`\ (\ new_znear\: :ref:`float<class_float>`\ ) |const| |
- +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- .. rst-class:: classref-reftable-group
- Operators
- ---------
- .. table::
- :widths: auto
- +-------------------------------------+-----------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`operator !=<class_Projection_operator_neq_Projection>`\ (\ right\: :ref:`Projection<class_Projection>`\ ) |
- +-------------------------------------+-----------------------------------------------------------------------------------------------------------------+
- | :ref:`Projection<class_Projection>` | :ref:`operator *<class_Projection_operator_mul_Projection>`\ (\ right\: :ref:`Projection<class_Projection>`\ ) |
- +-------------------------------------+-----------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector4<class_Vector4>` | :ref:`operator *<class_Projection_operator_mul_Vector4>`\ (\ right\: :ref:`Vector4<class_Vector4>`\ ) |
- +-------------------------------------+-----------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`operator ==<class_Projection_operator_eq_Projection>`\ (\ right\: :ref:`Projection<class_Projection>`\ ) |
- +-------------------------------------+-----------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector4<class_Vector4>` | :ref:`operator []<class_Projection_operator_idx_int>`\ (\ index\: :ref:`int<class_int>`\ ) |
- +-------------------------------------+-----------------------------------------------------------------------------------------------------------------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Enumerations
- ------------
- .. _enum_Projection_Planes:
- .. rst-class:: classref-enumeration
- enum **Planes**: :ref:`๐<enum_Projection_Planes>`
- .. _class_Projection_constant_PLANE_NEAR:
- .. rst-class:: classref-enumeration-constant
- :ref:`Planes<enum_Projection_Planes>` **PLANE_NEAR** = ``0``
- The index value of the projection's near clipping plane.
- .. _class_Projection_constant_PLANE_FAR:
- .. rst-class:: classref-enumeration-constant
- :ref:`Planes<enum_Projection_Planes>` **PLANE_FAR** = ``1``
- The index value of the projection's far clipping plane.
- .. _class_Projection_constant_PLANE_LEFT:
- .. rst-class:: classref-enumeration-constant
- :ref:`Planes<enum_Projection_Planes>` **PLANE_LEFT** = ``2``
- The index value of the projection's left clipping plane.
- .. _class_Projection_constant_PLANE_TOP:
- .. rst-class:: classref-enumeration-constant
- :ref:`Planes<enum_Projection_Planes>` **PLANE_TOP** = ``3``
- The index value of the projection's top clipping plane.
- .. _class_Projection_constant_PLANE_RIGHT:
- .. rst-class:: classref-enumeration-constant
- :ref:`Planes<enum_Projection_Planes>` **PLANE_RIGHT** = ``4``
- The index value of the projection's right clipping plane.
- .. _class_Projection_constant_PLANE_BOTTOM:
- .. rst-class:: classref-enumeration-constant
- :ref:`Planes<enum_Projection_Planes>` **PLANE_BOTTOM** = ``5``
- The index value of the projection bottom clipping plane.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Constants
- ---------
- .. _class_Projection_constant_IDENTITY:
- .. rst-class:: classref-constant
- **IDENTITY** = ``Projection(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)`` :ref:`๐<class_Projection_constant_IDENTITY>`
- A **Projection** with no transformation defined. When applied to other data structures, no transformation is performed.
- .. _class_Projection_constant_ZERO:
- .. rst-class:: classref-constant
- **ZERO** = ``Projection(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)`` :ref:`๐<class_Projection_constant_ZERO>`
- A **Projection** with all values initialized to 0. When applied to other data structures, they will be zeroed.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_Projection_property_w:
- .. rst-class:: classref-property
- :ref:`Vector4<class_Vector4>` **w** = ``Vector4(0, 0, 0, 1)`` :ref:`๐<class_Projection_property_w>`
- The projection matrix's W vector (column 3). Equivalent to array index ``3``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_property_x:
- .. rst-class:: classref-property
- :ref:`Vector4<class_Vector4>` **x** = ``Vector4(1, 0, 0, 0)`` :ref:`๐<class_Projection_property_x>`
- The projection matrix's X vector (column 0). Equivalent to array index ``0``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_property_y:
- .. rst-class:: classref-property
- :ref:`Vector4<class_Vector4>` **y** = ``Vector4(0, 1, 0, 0)`` :ref:`๐<class_Projection_property_y>`
- The projection matrix's Y vector (column 1). Equivalent to array index ``1``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_property_z:
- .. rst-class:: classref-property
- :ref:`Vector4<class_Vector4>` **z** = ``Vector4(0, 0, 1, 0)`` :ref:`๐<class_Projection_property_z>`
- The projection matrix's Z vector (column 2). Equivalent to array index ``2``.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Constructor Descriptions
- ------------------------
- .. _class_Projection_constructor_Projection:
- .. rst-class:: classref-constructor
- :ref:`Projection<class_Projection>` **Projection**\ (\ ) :ref:`๐<class_Projection_constructor_Projection>`
- Constructs a default-initialized **Projection** identical to :ref:`IDENTITY<class_Projection_constant_IDENTITY>`.
- \ **Note:** In C#, this constructs a **Projection** identical to :ref:`ZERO<class_Projection_constant_ZERO>`.
- .. rst-class:: classref-item-separator
- ----
- .. rst-class:: classref-constructor
- :ref:`Projection<class_Projection>` **Projection**\ (\ from\: :ref:`Projection<class_Projection>`\ )
- Constructs a **Projection** as a copy of the given **Projection**.
- .. rst-class:: classref-item-separator
- ----
- .. rst-class:: classref-constructor
- :ref:`Projection<class_Projection>` **Projection**\ (\ from\: :ref:`Transform3D<class_Transform3D>`\ )
- Constructs a Projection as a copy of the given :ref:`Transform3D<class_Transform3D>`.
- .. rst-class:: classref-item-separator
- ----
- .. rst-class:: classref-constructor
- :ref:`Projection<class_Projection>` **Projection**\ (\ x_axis\: :ref:`Vector4<class_Vector4>`, y_axis\: :ref:`Vector4<class_Vector4>`, z_axis\: :ref:`Vector4<class_Vector4>`, w_axis\: :ref:`Vector4<class_Vector4>`\ )
- Constructs a Projection from four :ref:`Vector4<class_Vector4>` values (matrix columns).
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Method Descriptions
- -------------------
- .. _class_Projection_method_create_depth_correction:
- .. rst-class:: classref-method
- :ref:`Projection<class_Projection>` **create_depth_correction**\ (\ flip_y\: :ref:`bool<class_bool>`\ ) |static| :ref:`๐<class_Projection_method_create_depth_correction>`
- Creates a new **Projection** that projects positions from a depth range of ``-1`` to ``1`` to one that ranges from ``0`` to ``1``, and flips the projected positions vertically, according to ``flip_y``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_create_fit_aabb:
- .. rst-class:: classref-method
- :ref:`Projection<class_Projection>` **create_fit_aabb**\ (\ aabb\: :ref:`AABB<class_AABB>`\ ) |static| :ref:`๐<class_Projection_method_create_fit_aabb>`
- Creates a new **Projection** that scales a given projection to fit around a given :ref:`AABB<class_AABB>` in projection space.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_create_for_hmd:
- .. rst-class:: classref-method
- :ref:`Projection<class_Projection>` **create_for_hmd**\ (\ eye\: :ref:`int<class_int>`, aspect\: :ref:`float<class_float>`, intraocular_dist\: :ref:`float<class_float>`, display_width\: :ref:`float<class_float>`, display_to_lens\: :ref:`float<class_float>`, oversample\: :ref:`float<class_float>`, z_near\: :ref:`float<class_float>`, z_far\: :ref:`float<class_float>`\ ) |static| :ref:`๐<class_Projection_method_create_for_hmd>`
- Creates a new **Projection** for projecting positions onto a head-mounted display with the given X:Y aspect ratio, distance between eyes, display width, distance to lens, oversampling factor, and depth clipping planes.
- \ ``eye`` creates the projection for the left eye when set to 1, or the right eye when set to 2.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_create_frustum:
- .. rst-class:: classref-method
- :ref:`Projection<class_Projection>` **create_frustum**\ (\ left\: :ref:`float<class_float>`, right\: :ref:`float<class_float>`, bottom\: :ref:`float<class_float>`, top\: :ref:`float<class_float>`, z_near\: :ref:`float<class_float>`, z_far\: :ref:`float<class_float>`\ ) |static| :ref:`๐<class_Projection_method_create_frustum>`
- Creates a new **Projection** that projects positions in a frustum with the given clipping planes.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_create_frustum_aspect:
- .. rst-class:: classref-method
- :ref:`Projection<class_Projection>` **create_frustum_aspect**\ (\ size\: :ref:`float<class_float>`, aspect\: :ref:`float<class_float>`, offset\: :ref:`Vector2<class_Vector2>`, z_near\: :ref:`float<class_float>`, z_far\: :ref:`float<class_float>`, flip_fov\: :ref:`bool<class_bool>` = false\ ) |static| :ref:`๐<class_Projection_method_create_frustum_aspect>`
- Creates a new **Projection** that projects positions in a frustum with the given size, X:Y aspect ratio, offset, and clipping planes.
- \ ``flip_fov`` determines whether the projection's field of view is flipped over its diagonal.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_create_light_atlas_rect:
- .. rst-class:: classref-method
- :ref:`Projection<class_Projection>` **create_light_atlas_rect**\ (\ rect\: :ref:`Rect2<class_Rect2>`\ ) |static| :ref:`๐<class_Projection_method_create_light_atlas_rect>`
- Creates a new **Projection** that projects positions into the given :ref:`Rect2<class_Rect2>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_create_orthogonal:
- .. rst-class:: classref-method
- :ref:`Projection<class_Projection>` **create_orthogonal**\ (\ left\: :ref:`float<class_float>`, right\: :ref:`float<class_float>`, bottom\: :ref:`float<class_float>`, top\: :ref:`float<class_float>`, z_near\: :ref:`float<class_float>`, z_far\: :ref:`float<class_float>`\ ) |static| :ref:`๐<class_Projection_method_create_orthogonal>`
- Creates a new **Projection** that projects positions using an orthogonal projection with the given clipping planes.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_create_orthogonal_aspect:
- .. rst-class:: classref-method
- :ref:`Projection<class_Projection>` **create_orthogonal_aspect**\ (\ size\: :ref:`float<class_float>`, aspect\: :ref:`float<class_float>`, z_near\: :ref:`float<class_float>`, z_far\: :ref:`float<class_float>`, flip_fov\: :ref:`bool<class_bool>` = false\ ) |static| :ref:`๐<class_Projection_method_create_orthogonal_aspect>`
- Creates a new **Projection** that projects positions using an orthogonal projection with the given size, X:Y aspect ratio, and clipping planes.
- \ ``flip_fov`` determines whether the projection's field of view is flipped over its diagonal.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_create_perspective:
- .. rst-class:: classref-method
- :ref:`Projection<class_Projection>` **create_perspective**\ (\ fovy\: :ref:`float<class_float>`, aspect\: :ref:`float<class_float>`, z_near\: :ref:`float<class_float>`, z_far\: :ref:`float<class_float>`, flip_fov\: :ref:`bool<class_bool>` = false\ ) |static| :ref:`๐<class_Projection_method_create_perspective>`
- Creates a new **Projection** that projects positions using a perspective projection with the given Y-axis field of view (in degrees), X:Y aspect ratio, and clipping planes.
- \ ``flip_fov`` determines whether the projection's field of view is flipped over its diagonal.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_create_perspective_hmd:
- .. rst-class:: classref-method
- :ref:`Projection<class_Projection>` **create_perspective_hmd**\ (\ fovy\: :ref:`float<class_float>`, aspect\: :ref:`float<class_float>`, z_near\: :ref:`float<class_float>`, z_far\: :ref:`float<class_float>`, flip_fov\: :ref:`bool<class_bool>`, eye\: :ref:`int<class_int>`, intraocular_dist\: :ref:`float<class_float>`, convergence_dist\: :ref:`float<class_float>`\ ) |static| :ref:`๐<class_Projection_method_create_perspective_hmd>`
- Creates a new **Projection** that projects positions using a perspective projection with the given Y-axis field of view (in degrees), X:Y aspect ratio, and clipping distances. The projection is adjusted for a head-mounted display with the given distance between eyes and distance to a point that can be focused on.
- \ ``eye`` creates the projection for the left eye when set to 1, or the right eye when set to 2.
- \ ``flip_fov`` determines whether the projection's field of view is flipped over its diagonal.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_determinant:
- .. rst-class:: classref-method
- :ref:`float<class_float>` **determinant**\ (\ ) |const| :ref:`๐<class_Projection_method_determinant>`
- Returns a scalar value that is the signed factor by which areas are scaled by this matrix. If the sign is negative, the matrix flips the orientation of the area.
- The determinant can be used to calculate the invertibility of a matrix or solve linear systems of equations involving the matrix, among other applications.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_flipped_y:
- .. rst-class:: classref-method
- :ref:`Projection<class_Projection>` **flipped_y**\ (\ ) |const| :ref:`๐<class_Projection_method_flipped_y>`
- Returns a copy of this **Projection** with the signs of the values of the Y column flipped.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_get_aspect:
- .. rst-class:: classref-method
- :ref:`float<class_float>` **get_aspect**\ (\ ) |const| :ref:`๐<class_Projection_method_get_aspect>`
- Returns the X:Y aspect ratio of this **Projection**'s viewport.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_get_far_plane_half_extents:
- .. rst-class:: classref-method
- :ref:`Vector2<class_Vector2>` **get_far_plane_half_extents**\ (\ ) |const| :ref:`๐<class_Projection_method_get_far_plane_half_extents>`
- Returns the dimensions of the far clipping plane of the projection, divided by two.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_get_fov:
- .. rst-class:: classref-method
- :ref:`float<class_float>` **get_fov**\ (\ ) |const| :ref:`๐<class_Projection_method_get_fov>`
- Returns the horizontal field of view of the projection (in degrees).
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_get_fovy:
- .. rst-class:: classref-method
- :ref:`float<class_float>` **get_fovy**\ (\ fovx\: :ref:`float<class_float>`, aspect\: :ref:`float<class_float>`\ ) |static| :ref:`๐<class_Projection_method_get_fovy>`
- Returns the vertical field of view of the projection (in degrees) associated with the given horizontal field of view (in degrees) and aspect ratio.
- \ **Note:** Unlike most methods of **Projection**, ``aspect`` is expected to be 1 divided by the X:Y aspect ratio.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_get_lod_multiplier:
- .. rst-class:: classref-method
- :ref:`float<class_float>` **get_lod_multiplier**\ (\ ) |const| :ref:`๐<class_Projection_method_get_lod_multiplier>`
- Returns the factor by which the visible level of detail is scaled by this **Projection**.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_get_pixels_per_meter:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_pixels_per_meter**\ (\ for_pixel_width\: :ref:`int<class_int>`\ ) |const| :ref:`๐<class_Projection_method_get_pixels_per_meter>`
- Returns the number of pixels with the given pixel width displayed per meter, after this **Projection** is applied.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_get_projection_plane:
- .. rst-class:: classref-method
- :ref:`Plane<class_Plane>` **get_projection_plane**\ (\ plane\: :ref:`int<class_int>`\ ) |const| :ref:`๐<class_Projection_method_get_projection_plane>`
- Returns the clipping plane of this **Projection** whose index is given by ``plane``.
- \ ``plane`` should be equal to one of :ref:`PLANE_NEAR<class_Projection_constant_PLANE_NEAR>`, :ref:`PLANE_FAR<class_Projection_constant_PLANE_FAR>`, :ref:`PLANE_LEFT<class_Projection_constant_PLANE_LEFT>`, :ref:`PLANE_TOP<class_Projection_constant_PLANE_TOP>`, :ref:`PLANE_RIGHT<class_Projection_constant_PLANE_RIGHT>`, or :ref:`PLANE_BOTTOM<class_Projection_constant_PLANE_BOTTOM>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_get_viewport_half_extents:
- .. rst-class:: classref-method
- :ref:`Vector2<class_Vector2>` **get_viewport_half_extents**\ (\ ) |const| :ref:`๐<class_Projection_method_get_viewport_half_extents>`
- Returns the dimensions of the viewport plane that this **Projection** projects positions onto, divided by two.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_get_z_far:
- .. rst-class:: classref-method
- :ref:`float<class_float>` **get_z_far**\ (\ ) |const| :ref:`๐<class_Projection_method_get_z_far>`
- Returns the distance for this **Projection** beyond which positions are clipped.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_get_z_near:
- .. rst-class:: classref-method
- :ref:`float<class_float>` **get_z_near**\ (\ ) |const| :ref:`๐<class_Projection_method_get_z_near>`
- Returns the distance for this **Projection** before which positions are clipped.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_inverse:
- .. rst-class:: classref-method
- :ref:`Projection<class_Projection>` **inverse**\ (\ ) |const| :ref:`๐<class_Projection_method_inverse>`
- Returns a **Projection** that performs the inverse of this **Projection**'s projective transformation.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_is_orthogonal:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **is_orthogonal**\ (\ ) |const| :ref:`๐<class_Projection_method_is_orthogonal>`
- Returns ``true`` if this **Projection** performs an orthogonal projection.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_jitter_offseted:
- .. rst-class:: classref-method
- :ref:`Projection<class_Projection>` **jitter_offseted**\ (\ offset\: :ref:`Vector2<class_Vector2>`\ ) |const| :ref:`๐<class_Projection_method_jitter_offseted>`
- Returns a **Projection** with the X and Y values from the given :ref:`Vector2<class_Vector2>` added to the first and second values of the final column respectively.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_method_perspective_znear_adjusted:
- .. rst-class:: classref-method
- :ref:`Projection<class_Projection>` **perspective_znear_adjusted**\ (\ new_znear\: :ref:`float<class_float>`\ ) |const| :ref:`๐<class_Projection_method_perspective_znear_adjusted>`
- Returns a **Projection** with the near clipping distance adjusted to be ``new_znear``.
- \ **Note:** The original **Projection** must be a perspective projection.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Operator Descriptions
- ---------------------
- .. _class_Projection_operator_neq_Projection:
- .. rst-class:: classref-operator
- :ref:`bool<class_bool>` **operator !=**\ (\ right\: :ref:`Projection<class_Projection>`\ ) :ref:`๐<class_Projection_operator_neq_Projection>`
- Returns ``true`` if the projections are not equal.
- \ **Note:** Due to floating-point precision errors, this may return ``true``, even if the projections are virtually equal. An ``is_equal_approx`` method may be added in a future version of Godot.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_operator_mul_Projection:
- .. rst-class:: classref-operator
- :ref:`Projection<class_Projection>` **operator ***\ (\ right\: :ref:`Projection<class_Projection>`\ ) :ref:`๐<class_Projection_operator_mul_Projection>`
- Returns a **Projection** that applies the combined transformations of this **Projection** and ``right``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_operator_mul_Vector4:
- .. rst-class:: classref-operator
- :ref:`Vector4<class_Vector4>` **operator ***\ (\ right\: :ref:`Vector4<class_Vector4>`\ ) :ref:`๐<class_Projection_operator_mul_Vector4>`
- Projects (multiplies) the given :ref:`Vector4<class_Vector4>` by this **Projection** matrix.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_operator_eq_Projection:
- .. rst-class:: classref-operator
- :ref:`bool<class_bool>` **operator ==**\ (\ right\: :ref:`Projection<class_Projection>`\ ) :ref:`๐<class_Projection_operator_eq_Projection>`
- Returns ``true`` if the projections are equal.
- \ **Note:** Due to floating-point precision errors, this may return ``false``, even if the projections are virtually equal. An ``is_equal_approx`` method may be added in a future version of Godot.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Projection_operator_idx_int:
- .. rst-class:: classref-operator
- :ref:`Vector4<class_Vector4>` **operator []**\ (\ index\: :ref:`int<class_int>`\ ) :ref:`๐<class_Projection_operator_idx_int>`
- Returns the column of the **Projection** with the given index.
- Indices are in the following order: x, y, z, w.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
- .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
- .. |void| replace:: :abbr:`void (No return value.)`
|