diff options
Diffstat (limited to 'doc/classes/Camera3D.xml')
-rw-r--r-- | doc/classes/Camera3D.xml | 154 |
1 files changed, 62 insertions, 92 deletions
diff --git a/doc/classes/Camera3D.xml b/doc/classes/Camera3D.xml index 034b2e9629..cd17a31e23 100644 --- a/doc/classes/Camera3D.xml +++ b/doc/classes/Camera3D.xml @@ -11,164 +11,134 @@ </tutorials> <methods> <method name="clear_current"> - <return type="void"> - </return> - <argument index="0" name="enable_next" type="bool" default="true"> - </argument> + <return type="void" /> + <argument index="0" name="enable_next" type="bool" default="true" /> <description> If this is the current camera, remove it from being current. If [code]enable_next[/code] is [code]true[/code], request to make the next camera current, if any. </description> </method> <method name="get_camera_rid" qualifiers="const"> - <return type="RID"> - </return> + <return type="RID" /> <description> Returns the camera's RID from the [RenderingServer]. </description> </method> <method name="get_camera_transform" qualifiers="const"> - <return type="Transform"> - </return> + <return type="Transform3D" /> <description> - Gets the camera transform. Subclassed cameras such as [ClippedCamera3D] may provide different transforms than the [Node] transform. + Returns the transform of the camera plus the vertical ([member v_offset]) and horizontal ([member h_offset]) offsets; and any other adjustments made to the position and orientation of the camera by subclassed cameras such as [ClippedCamera3D] and [XRCamera3D]. </description> </method> - <method name="get_cull_mask_bit" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="layer" type="int"> - </argument> + <method name="get_cull_mask_value" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="layer_number" type="int" /> <description> - Returns [code]true[/code] if the given [code]layer[/code] in the [member cull_mask] is enabled, [code]false[/code] otherwise. + Returns whether or not the specified layer of the [member cull_mask] is enabled, given a [code]layer_number[/code] between 1 and 20. </description> </method> <method name="get_frustum" qualifiers="const"> - <return type="Array"> - </return> + <return type="Array" /> <description> - Returns the camera's frustum planes in world-space units as an array of [Plane]s in the following order: near, far, left, top, right, bottom. Not to be confused with [member frustum_offset]. + Returns the camera's frustum planes in world space units as an array of [Plane]s in the following order: near, far, left, top, right, bottom. Not to be confused with [member frustum_offset]. </description> </method> <method name="is_position_behind" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="world_point" type="Vector3"> - </argument> + <return type="bool" /> + <argument index="0" name="world_point" type="Vector3" /> <description> - Returns [code]true[/code] if the given position is behind the camera. + Returns [code]true[/code] if the given position is behind the camera (the blue part of the linked diagram). [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/camera3d_position_frustum.png]See this diagram[/url] for an overview of position query methods. [b]Note:[/b] A position which returns [code]false[/code] may still be outside the camera's field of view. </description> </method> + <method name="is_position_in_frustum" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="world_point" type="Vector3" /> + <description> + Returns [code]true[/code] if the given position is inside the camera's frustum (the green part of the linked diagram). [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/camera3d_position_frustum.png]See this diagram[/url] for an overview of position query methods. + </description> + </method> <method name="make_current"> - <return type="void"> - </return> + <return type="void" /> <description> Makes this camera the current camera for the [Viewport] (see class description). If the camera node is outside the scene tree, it will attempt to become current once it's added. </description> </method> <method name="project_local_ray_normal" qualifiers="const"> - <return type="Vector3"> - </return> - <argument index="0" name="screen_point" type="Vector2"> - </argument> + <return type="Vector3" /> + <argument index="0" name="screen_point" type="Vector2" /> <description> Returns a normal vector from the screen point location directed along the camera. Orthogonal cameras are normalized. Perspective cameras account for perspective, screen width/height, etc. </description> </method> <method name="project_position" qualifiers="const"> - <return type="Vector3"> - </return> - <argument index="0" name="screen_point" type="Vector2"> - </argument> - <argument index="1" name="z_depth" type="float"> - </argument> + <return type="Vector3" /> + <argument index="0" name="screen_point" type="Vector2" /> + <argument index="1" name="z_depth" type="float" /> <description> - Returns the 3D point in worldspace that maps to the given 2D coordinate in the [Viewport] rectangle on a plane that is the given [code]z_depth[/code] distance into the scene away from the camera. + Returns the 3D point in world space that maps to the given 2D coordinate in the [Viewport] rectangle on a plane that is the given [code]z_depth[/code] distance into the scene away from the camera. </description> </method> <method name="project_ray_normal" qualifiers="const"> - <return type="Vector3"> - </return> - <argument index="0" name="screen_point" type="Vector2"> - </argument> + <return type="Vector3" /> + <argument index="0" name="screen_point" type="Vector2" /> <description> - Returns a normal vector in worldspace, that is the result of projecting a point on the [Viewport] rectangle by the camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. + Returns a normal vector in world space, that is the result of projecting a point on the [Viewport] rectangle by the camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. </description> </method> <method name="project_ray_origin" qualifiers="const"> - <return type="Vector3"> - </return> - <argument index="0" name="screen_point" type="Vector2"> - </argument> + <return type="Vector3" /> + <argument index="0" name="screen_point" type="Vector2" /> <description> - Returns a 3D position in worldspace, that is the result of projecting a point on the [Viewport] rectangle by the camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. + Returns a 3D position in world space, that is the result of projecting a point on the [Viewport] rectangle by the camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. </description> </method> - <method name="set_cull_mask_bit"> - <return type="void"> - </return> - <argument index="0" name="layer" type="int"> - </argument> - <argument index="1" name="enable" type="bool"> - </argument> + <method name="set_cull_mask_value"> + <return type="void" /> + <argument index="0" name="layer_number" type="int" /> + <argument index="1" name="value" type="bool" /> <description> - Enables or disables the given [code]layer[/code] in the [member cull_mask]. + Based on [code]value[/code], enables or disables the specified layer in the [member cull_mask], given a [code]layer_number[/code] between 1 and 20. </description> </method> <method name="set_frustum"> - <return type="void"> - </return> - <argument index="0" name="size" type="float"> - </argument> - <argument index="1" name="offset" type="Vector2"> - </argument> - <argument index="2" name="z_near" type="float"> - </argument> - <argument index="3" name="z_far" type="float"> - </argument> + <return type="void" /> + <argument index="0" name="size" type="float" /> + <argument index="1" name="offset" type="Vector2" /> + <argument index="2" name="z_near" type="float" /> + <argument index="3" name="z_far" type="float" /> <description> - Sets the camera projection to frustum mode (see [constant PROJECTION_FRUSTUM]), by specifying a [code]size[/code], an [code]offset[/code], and the [code]z_near[/code] and [code]z_far[/code] clip planes in world-space units. + Sets the camera projection to frustum mode (see [constant PROJECTION_FRUSTUM]), by specifying a [code]size[/code], an [code]offset[/code], and the [code]z_near[/code] and [code]z_far[/code] clip planes in world space units. </description> </method> <method name="set_orthogonal"> - <return type="void"> - </return> - <argument index="0" name="size" type="float"> - </argument> - <argument index="1" name="z_near" type="float"> - </argument> - <argument index="2" name="z_far" type="float"> - </argument> + <return type="void" /> + <argument index="0" name="size" type="float" /> + <argument index="1" name="z_near" type="float" /> + <argument index="2" name="z_far" type="float" /> <description> - Sets the camera projection to orthogonal mode (see [constant PROJECTION_ORTHOGONAL]), by specifying a [code]size[/code], and the [code]z_near[/code] and [code]z_far[/code] clip planes in world-space units. (As a hint, 2D games often use this projection, with values specified in pixels.) + Sets the camera projection to orthogonal mode (see [constant PROJECTION_ORTHOGONAL]), by specifying a [code]size[/code], and the [code]z_near[/code] and [code]z_far[/code] clip planes in world space units. (As a hint, 2D games often use this projection, with values specified in pixels.) </description> </method> <method name="set_perspective"> - <return type="void"> - </return> - <argument index="0" name="fov" type="float"> - </argument> - <argument index="1" name="z_near" type="float"> - </argument> - <argument index="2" name="z_far" type="float"> - </argument> + <return type="void" /> + <argument index="0" name="fov" type="float" /> + <argument index="1" name="z_near" type="float" /> + <argument index="2" name="z_far" type="float" /> <description> - Sets the camera projection to perspective mode (see [constant PROJECTION_PERSPECTIVE]), by specifying a [code]fov[/code] (field of view) angle in degrees, and the [code]z_near[/code] and [code]z_far[/code] clip planes in world-space units. + Sets the camera projection to perspective mode (see [constant PROJECTION_PERSPECTIVE]), by specifying a [code]fov[/code] (field of view) angle in degrees, and the [code]z_near[/code] and [code]z_far[/code] clip planes in world space units. </description> </method> <method name="unproject_position" qualifiers="const"> - <return type="Vector2"> - </return> - <argument index="0" name="world_point" type="Vector3"> - </argument> + <return type="Vector2" /> + <argument index="0" name="world_point" type="Vector3" /> <description> - Returns the 2D coordinate in the [Viewport] rectangle that maps to the given 3D point in worldspace. + Returns the 2D coordinate in the [Viewport] rectangle that maps to the given 3D point in world space. [b]Note:[/b] When using this to position GUI elements over a 3D viewport, use [method is_position_behind] to prevent them from appearing if the 3D point is behind the camera: [codeblock] # This code block is part of a script that inherits from Node3D. # `control` is a reference to a node inheriting from Control. - control.visible = not get_viewport().get_camera().is_position_behind(global_transform.origin) - control.rect_position = get_viewport().get_camera().unproject_position(global_transform.origin) + control.visible = not get_viewport().get_camera_3d().is_position_behind(global_transform.origin) + control.rect_position = get_viewport().get_camera_3d().unproject_position(global_transform.origin) [/codeblock] </description> </method> @@ -194,13 +164,13 @@ </member> <member name="fov" type="float" setter="set_fov" getter="get_fov" default="75.0"> The camera's field of view angle (in degrees). Only applicable in perspective mode. Since [member keep_aspect] locks one axis, [code]fov[/code] sets the other axis' field of view angle. - For reference, the default vertical field of view value ([code]75.0[/code]) is equivalent to an horizontal FOV of: + For reference, the default vertical field of view value ([code]75.0[/code]) is equivalent to a horizontal FOV of: - ~91.31 degrees in a 4:3 viewport - ~101.67 degrees in a 16:10 viewport - ~107.51 degrees in a 16:9 viewport - ~121.63 degrees in a 21:9 viewport </member> - <member name="frustum_offset" type="Vector2" setter="set_frustum_offset" getter="get_frustum_offset" default="Vector2( 0, 0 )"> + <member name="frustum_offset" type="Vector2" setter="set_frustum_offset" getter="get_frustum_offset" default="Vector2(0, 0)"> The camera's frustum offset. This can be changed from the default to create "tilted frustum" effects such as [url=https://zdoom.org/wiki/Y-shearing]Y-shearing[/url]. </member> <member name="h_offset" type="float" setter="set_h_offset" getter="get_h_offset" default="0.0"> |