summaryrefslogtreecommitdiff
path: root/doc/classes/Camera3D.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/Camera3D.xml')
-rw-r--r--doc/classes/Camera3D.xml137
1 files changed, 49 insertions, 88 deletions
diff --git a/doc/classes/Camera3D.xml b/doc/classes/Camera3D.xml
index afba478a20..2ada0c556d 100644
--- a/doc/classes/Camera3D.xml
+++ b/doc/classes/Camera3D.xml
@@ -11,173 +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="Transform3D">
- </return>
+ <return type="Transform3D" />
<description>
Gets the camera transform. Subclassed cameras such as [ClippedCamera3D] may provide different transforms than the [Node] transform.
</description>
</method>
<method name="get_cull_mask_bit" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="layer" type="int">
- </argument>
+ <return type="bool" />
+ <argument index="0" name="layer" type="int" />
<description>
Returns [code]true[/code] if the given [code]layer[/code] in the [member cull_mask] is enabled, [code]false[/code] otherwise.
</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 (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">
- </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 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>
+ <return type="void" />
+ <argument index="0" name="layer" type="int" />
+ <argument index="1" name="enable" type="bool" />
<description>
Enables or disables the given [code]layer[/code] in the [member cull_mask].
</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>