Files
godot-docs/classes/class_projection.rst
2022-08-31 15:18:54 +02:00

402 lines
36 KiB
ReStructuredText

: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
==========
Properties
----------
+-------------------------------+---------------------------------------+-------------------------+
| :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)`` |
+-------------------------------+---------------------------------------+-------------------------+
Constructors
------------
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Projection<class_Projection>` | :ref:`Projection<class_Projection_constructor_Projection>` **(** **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Projection<class_Projection>` | :ref:`Projection<class_Projection_constructor_Projection>` **(** :ref:`Projection<class_Projection>` from **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Projection<class_Projection>` | :ref:`Projection<class_Projection_constructor_Projection>` **(** :ref:`Transform3D<class_Transform3D>` from **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Projection<class_Projection>` | :ref:`Projection<class_Projection_constructor_Projection>` **(** :ref:`Vector4<class_Vector4>` x_axis, :ref:`Vector4<class_Vector4>` y_axis, :ref:`Vector4<class_Vector4>` z_axis, :ref:`Vector4<class_Vector4>` w_axis **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Methods
-------
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Projection<class_Projection>` | :ref:`create_depth_correction<class_Projection_method_create_depth_correction>` **(** :ref:`bool<class_bool>` flip_y **)** |static| |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Projection<class_Projection>` | :ref:`create_fit_aabb<class_Projection_method_create_fit_aabb>` **(** :ref:`AABB<class_AABB>` aabb **)** |static| |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Projection<class_Projection>` | :ref:`create_for_hmd<class_Projection_method_create_for_hmd>` **(** :ref:`int<class_int>` eye, :ref:`float<class_float>` 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 **)** |static| |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Projection<class_Projection>` | :ref:`create_frustum<class_Projection_method_create_frustum>` **(** :ref:`float<class_float>` 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 **)** |static| |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Projection<class_Projection>` | :ref:`create_frustum_aspect<class_Projection_method_create_frustum_aspect>` **(** :ref:`float<class_float>` size, :ref:`float<class_float>` aspect, :ref:`Vector2<class_Vector2>` offset, :ref:`float<class_float>` z_near, :ref:`float<class_float>` z_far, :ref:`bool<class_bool>` flip_fov=false **)** |static| |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Projection<class_Projection>` | :ref:`create_light_atlas_rect<class_Projection_method_create_light_atlas_rect>` **(** :ref:`Rect2<class_Rect2>` rect **)** |static| |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Projection<class_Projection>` | :ref:`create_orthogonal<class_Projection_method_create_orthogonal>` **(** :ref:`float<class_float>` 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 **)** |static| |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Projection<class_Projection>` | :ref:`create_orthogonal_aspect<class_Projection_method_create_orthogonal_aspect>` **(** :ref:`float<class_float>` size, :ref:`float<class_float>` aspect, :ref:`float<class_float>` z_near, :ref:`float<class_float>` z_far, :ref:`bool<class_bool>` flip_fov=false **)** |static| |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Projection<class_Projection>` | :ref:`create_perspective<class_Projection_method_create_perspective>` **(** :ref:`float<class_float>` fovy, :ref:`float<class_float>` aspect, :ref:`float<class_float>` z_near, :ref:`float<class_float>` z_far, :ref:`bool<class_bool>` flip_fov=false **)** |static| |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Projection<class_Projection>` | :ref:`create_perspective_hmd<class_Projection_method_create_perspective_hmd>` **(** :ref:`float<class_float>` fovy, :ref:`float<class_float>` aspect, :ref:`float<class_float>` z_near, :ref:`float<class_float>` z_far, :ref:`bool<class_bool>` flip_fov, :ref:`int<class_int>` eye, :ref:`float<class_float>` intraocular_dist, :ref:`float<class_float>` convergence_dist **)** |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>` **(** :ref:`float<class_float>` fovx, :ref:`float<class_float>` aspect **)** |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>` **(** :ref:`int<class_int>` for_pixel_width **)** |const| |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Plane<class_Plane>` | :ref:`get_projection_plane<class_Projection_method_get_projection_plane>` **(** :ref:`int<class_int>` plane **)** |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>` **(** :ref:`Vector2<class_Vector2>` offset **)** |const| |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Projection<class_Projection>` | :ref:`perspective_znear_adjusted<class_Projection_method_perspective_znear_adjusted>` **(** :ref:`float<class_float>` new_znear **)** |const| |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Operators
---------
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`operator !=<class_Projection_operator_neq_bool>` **(** :ref:`Projection<class_Projection>` right **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------+
| :ref:`Projection<class_Projection>` | :ref:`operator *<class_Projection_operator_mul_Projection>` **(** :ref:`Projection<class_Projection>` right **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector4<class_Vector4>` | :ref:`operator *<class_Projection_operator_mul_Vector4>` **(** :ref:`Vector4<class_Vector4>` right **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`operator ==<class_Projection_operator_eq_bool>` **(** :ref:`Projection<class_Projection>` right **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector4<class_Vector4>` | :ref:`operator []<class_Projection_operator_idx_Vector4>` **(** :ref:`int<class_int>` index **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------+
Constants
---------
.. _class_Projection_constant_PLANE_NEAR:
.. _class_Projection_constant_PLANE_FAR:
.. _class_Projection_constant_PLANE_LEFT:
.. _class_Projection_constant_PLANE_TOP:
.. _class_Projection_constant_PLANE_RIGHT:
.. _class_Projection_constant_PLANE_BOTTOM:
.. _class_Projection_constant_IDENTITY:
.. _class_Projection_constant_ZERO:
- **PLANE_NEAR** = **0**
- **PLANE_FAR** = **1**
- **PLANE_LEFT** = **2**
- **PLANE_TOP** = **3**
- **PLANE_RIGHT** = **4**
- **PLANE_BOTTOM** = **5**
- **IDENTITY** = **Projection(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)**
- **ZERO** = **Projection(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)**
Property Descriptions
---------------------
.. _class_Projection_property_w:
- :ref:`Vector4<class_Vector4>` **w**
+-----------+-------------------------+
| *Default* | ``Vector4(0, 0, 0, 1)`` |
+-----------+-------------------------+
----
.. _class_Projection_property_x:
- :ref:`Vector4<class_Vector4>` **x**
+-----------+-------------------------+
| *Default* | ``Vector4(1, 0, 0, 0)`` |
+-----------+-------------------------+
----
.. _class_Projection_property_y:
- :ref:`Vector4<class_Vector4>` **y**
+-----------+-------------------------+
| *Default* | ``Vector4(0, 1, 0, 0)`` |
+-----------+-------------------------+
----
.. _class_Projection_property_z:
- :ref:`Vector4<class_Vector4>` **z**
+-----------+-------------------------+
| *Default* | ``Vector4(0, 0, 1, 0)`` |
+-----------+-------------------------+
Constructor Descriptions
------------------------
.. _class_Projection_constructor_Projection:
- :ref:`Projection<class_Projection>` **Projection** **(** **)**
----
- :ref:`Projection<class_Projection>` **Projection** **(** :ref:`Projection<class_Projection>` from **)**
----
- :ref:`Projection<class_Projection>` **Projection** **(** :ref:`Transform3D<class_Transform3D>` from **)**
----
- :ref:`Projection<class_Projection>` **Projection** **(** :ref:`Vector4<class_Vector4>` x_axis, :ref:`Vector4<class_Vector4>` y_axis, :ref:`Vector4<class_Vector4>` z_axis, :ref:`Vector4<class_Vector4>` w_axis **)**
Constructs a Projection from four :ref:`Vector4<class_Vector4>` values (matrix columns).
Method Descriptions
-------------------
.. _class_Projection_method_create_depth_correction:
- :ref:`Projection<class_Projection>` **create_depth_correction** **(** :ref:`bool<class_bool>` flip_y **)** |static|
----
.. _class_Projection_method_create_fit_aabb:
- :ref:`Projection<class_Projection>` **create_fit_aabb** **(** :ref:`AABB<class_AABB>` aabb **)** |static|
----
.. _class_Projection_method_create_for_hmd:
- :ref:`Projection<class_Projection>` **create_for_hmd** **(** :ref:`int<class_int>` eye, :ref:`float<class_float>` 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 **)** |static|
----
.. _class_Projection_method_create_frustum:
- :ref:`Projection<class_Projection>` **create_frustum** **(** :ref:`float<class_float>` 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 **)** |static|
----
.. _class_Projection_method_create_frustum_aspect:
- :ref:`Projection<class_Projection>` **create_frustum_aspect** **(** :ref:`float<class_float>` size, :ref:`float<class_float>` aspect, :ref:`Vector2<class_Vector2>` offset, :ref:`float<class_float>` z_near, :ref:`float<class_float>` z_far, :ref:`bool<class_bool>` flip_fov=false **)** |static|
----
.. _class_Projection_method_create_light_atlas_rect:
- :ref:`Projection<class_Projection>` **create_light_atlas_rect** **(** :ref:`Rect2<class_Rect2>` rect **)** |static|
----
.. _class_Projection_method_create_orthogonal:
- :ref:`Projection<class_Projection>` **create_orthogonal** **(** :ref:`float<class_float>` 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 **)** |static|
----
.. _class_Projection_method_create_orthogonal_aspect:
- :ref:`Projection<class_Projection>` **create_orthogonal_aspect** **(** :ref:`float<class_float>` size, :ref:`float<class_float>` aspect, :ref:`float<class_float>` z_near, :ref:`float<class_float>` z_far, :ref:`bool<class_bool>` flip_fov=false **)** |static|
----
.. _class_Projection_method_create_perspective:
- :ref:`Projection<class_Projection>` **create_perspective** **(** :ref:`float<class_float>` fovy, :ref:`float<class_float>` aspect, :ref:`float<class_float>` z_near, :ref:`float<class_float>` z_far, :ref:`bool<class_bool>` flip_fov=false **)** |static|
----
.. _class_Projection_method_create_perspective_hmd:
- :ref:`Projection<class_Projection>` **create_perspective_hmd** **(** :ref:`float<class_float>` fovy, :ref:`float<class_float>` aspect, :ref:`float<class_float>` z_near, :ref:`float<class_float>` z_far, :ref:`bool<class_bool>` flip_fov, :ref:`int<class_int>` eye, :ref:`float<class_float>` intraocular_dist, :ref:`float<class_float>` convergence_dist **)** |static|
----
.. _class_Projection_method_determinant:
- :ref:`float<class_float>` **determinant** **(** **)** |const|
----
.. _class_Projection_method_flipped_y:
- :ref:`Projection<class_Projection>` **flipped_y** **(** **)** |const|
----
.. _class_Projection_method_get_aspect:
- :ref:`float<class_float>` **get_aspect** **(** **)** |const|
----
.. _class_Projection_method_get_far_plane_half_extents:
- :ref:`Vector2<class_Vector2>` **get_far_plane_half_extents** **(** **)** |const|
----
.. _class_Projection_method_get_fov:
- :ref:`float<class_float>` **get_fov** **(** **)** |const|
----
.. _class_Projection_method_get_fovy:
- :ref:`float<class_float>` **get_fovy** **(** :ref:`float<class_float>` fovx, :ref:`float<class_float>` aspect **)** |static|
----
.. _class_Projection_method_get_lod_multiplier:
- :ref:`float<class_float>` **get_lod_multiplier** **(** **)** |const|
----
.. _class_Projection_method_get_pixels_per_meter:
- :ref:`int<class_int>` **get_pixels_per_meter** **(** :ref:`int<class_int>` for_pixel_width **)** |const|
----
.. _class_Projection_method_get_projection_plane:
- :ref:`Plane<class_Plane>` **get_projection_plane** **(** :ref:`int<class_int>` plane **)** |const|
----
.. _class_Projection_method_get_viewport_half_extents:
- :ref:`Vector2<class_Vector2>` **get_viewport_half_extents** **(** **)** |const|
----
.. _class_Projection_method_get_z_far:
- :ref:`float<class_float>` **get_z_far** **(** **)** |const|
----
.. _class_Projection_method_get_z_near:
- :ref:`float<class_float>` **get_z_near** **(** **)** |const|
----
.. _class_Projection_method_inverse:
- :ref:`Projection<class_Projection>` **inverse** **(** **)** |const|
----
.. _class_Projection_method_is_orthogonal:
- :ref:`bool<class_bool>` **is_orthogonal** **(** **)** |const|
----
.. _class_Projection_method_jitter_offseted:
- :ref:`Projection<class_Projection>` **jitter_offseted** **(** :ref:`Vector2<class_Vector2>` offset **)** |const|
----
.. _class_Projection_method_perspective_znear_adjusted:
- :ref:`Projection<class_Projection>` **perspective_znear_adjusted** **(** :ref:`float<class_float>` new_znear **)** |const|
Operator Descriptions
---------------------
.. _class_Projection_operator_neq_bool:
- :ref:`bool<class_bool>` **operator !=** **(** :ref:`Projection<class_Projection>` right **)**
----
.. _class_Projection_operator_mul_Projection:
- :ref:`Projection<class_Projection>` **operator *** **(** :ref:`Projection<class_Projection>` right **)**
----
- :ref:`Vector4<class_Vector4>` **operator *** **(** :ref:`Vector4<class_Vector4>` right **)**
----
.. _class_Projection_operator_eq_bool:
- :ref:`bool<class_bool>` **operator ==** **(** :ref:`Projection<class_Projection>` right **)**
----
.. _class_Projection_operator_idx_Vector4:
- :ref:`Vector4<class_Vector4>` **operator []** **(** :ref:`int<class_int>` index **)**
.. |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.)`