From 94bd4cc0724772d6841bc11265fecb85bb9d9f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 28 Mar 2019 10:42:26 +0100 Subject: [PATCH] Sync classref with current source (cherry picked from commit 15e264eb3f763a0c0fd0cc7868fdbe72c3fae792) --- classes/class_@gdscript.rst | 2 +- classes/class_animatedtexture.rst | 16 +++---- classes/class_audiostreamsample.rst | 12 +++-- classes/class_dictionary.rst | 18 ++++++++ classes/class_editorspatialgizmoplugin.rst | 6 +++ classes/class_kinematicbody.rst | 6 ++- classes/class_kinematicbody2d.rst | 14 +++++- classes/class_light2d.rst | 5 ++ classes/class_lightoccluder2d.rst | 5 ++ classes/class_meshinstance2d.rst | 5 ++ classes/class_multimesh.rst | 5 ++ classes/class_multimeshinstance.rst | 7 +++ classes/class_particles.rst | 5 ++ classes/class_particles2d.rst | 5 ++ classes/class_physics2ddirectbodystate.rst | 53 ++++++++++++++-------- classes/class_physicsdirectbodystate.rst | 43 +++++++++++++++--- classes/class_projectsettings.rst | 8 ++++ classes/class_raycast.rst | 4 +- classes/class_rect2.rst | 2 +- classes/class_shadermaterial.rst | 5 ++ classes/class_skeleton2d.rst | 5 ++ 21 files changed, 186 insertions(+), 45 deletions(-) diff --git a/classes/class_@gdscript.rst b/classes/class_@gdscript.rst index 4470ec857..733942fb8 100644 --- a/classes/class_@gdscript.rst +++ b/classes/class_@gdscript.rst @@ -317,7 +317,7 @@ Returns the arc tangent of ``y/x`` in radians. Use to get the angle of tangent ` :: - a = atan(0, -1) # a is 3.141593 + a = atan2(0, -1) # a is 3.141593 .. _class_@GDScript_method_bytes2var: diff --git a/classes/class_animatedtexture.rst b/classes/class_animatedtexture.rst index 21cb72a7e..ab3a1ca79 100644 --- a/classes/class_animatedtexture.rst +++ b/classes/class_animatedtexture.rst @@ -48,7 +48,7 @@ Constants Description ----------- -``AnimatedTexture`` is a resource format for simple frame-based animations, where multiple frames textures can be chained automatically with a predefined delay for each frame. It's not a :ref:`Node`, contrarily to :ref:`AnimationPlayer` or :ref:`AnimatedSprite`, but has the advantage of being usable at any place where a :ref:`Texture` resource can be used, e.g. in a :ref:`TileSet`. +``AnimatedTexture`` is a resource format for frame-based animations, where multiple textures can be chained automatically with a predefined delay for each frame. Unlike :ref:`AnimationPlayer` or :ref:`AnimatedSprite`, it isn't a :ref:`Node`, but has the advantage of being usable anywhere a :ref:`Texture` resource can be used, e.g. in a :ref:`TileSet`. The playback of the animation is controlled by the :ref:`fps` property as well as each frame's optional delay (see :ref:`set_frame_delay`). The animation loops, i.e. it will restart at frame 0 automatically after playing the last frame. @@ -67,9 +67,9 @@ Property Descriptions | *Getter* | get_fps() | +----------+----------------+ -Number of frames per second. This value defines the default time interval between two frames of the animation, and thus the overall duration of the animation loop based on the :ref:`frames` property. A value of 0 means no predefined number of frames per second, the animation will play according to each frame's frame delay (see :ref:`set_frame_delay`). Default value: 4. +Animation speed in frames per second. This value defines the default time interval between two frames of the animation, and thus the overall duration of the animation loop based on the :ref:`frames` property. A value of 0 means no predefined number of frames per second, the animation will play according to each frame's frame delay (see :ref:`set_frame_delay`). Default value: 4. -For example, an animation with 8 frames, no frame delay and a ``fps`` value of 2 will run over 4 seconds, with one frame each 0.5 seconds. +For example, an animation with 8 frames, no frame delay and a ``fps`` value of 2 will run for 4 seconds, with each frame lasting 0.5 seconds. .. _class_AnimatedTexture_property_frames: @@ -90,19 +90,19 @@ Method Descriptions - :ref:`float` **get_frame_delay** **(** :ref:`int` frame **)** const -Retrieves the delayed assigned to the given ``frame`` ID. +Returns the given frame's delay value. .. _class_AnimatedTexture_method_get_frame_texture: - :ref:`Texture` **get_frame_texture** **(** :ref:`int` frame **)** const -Retrieves the :ref:`Texture` assigned to the given ``frame`` ID. +Returns the given frame's :ref:`Texture`. .. _class_AnimatedTexture_method_set_frame_delay: - void **set_frame_delay** **(** :ref:`int` frame, :ref:`float` delay **)** -Defines an additional delay (in seconds) between this frame and the next one, that will be added to the time interval defined by :ref:`fps`. By default, frames have no delay defined. If a delay value is defined, the final time interval between this frame and the next will be ``1.0 / fps + delay``. +Sets an additional delay (in seconds) between this frame and the next one, that will be added to the time interval defined by :ref:`fps`. By default, frames have no delay defined. If a delay value is defined, the final time interval between this frame and the next will be ``1.0 / fps + delay``. For example, for an animation with 3 frames, 2 FPS and a frame delay on the second frame of 1.2, the resulting playback will be: @@ -117,7 +117,7 @@ For example, for an animation with 3 frames, 2 FPS and a frame delay on the seco - void **set_frame_texture** **(** :ref:`int` frame, :ref:`Texture` texture **)** -Assigns a :ref:`Texture` to the given ``frame`` ID. IDs start at 0 (so the first frame has ID 0, and the last frame of the animation has ID :ref:`frames` - 1). +Assigns a :ref:`Texture` to the given frame. Frame IDs start at 0, so the first frame has ID 0, and the last frame of the animation has ID :ref:`frames` - 1. -You can define any frame texture up to :ref:`MAX_FRAMES`, but keep in mind that only frames from 0 to :ref:`frames` - 1 will be part of the animation. +You can define any number of textures up to :ref:`MAX_FRAMES`, but keep in mind that only frames from 0 to :ref:`frames` - 1 will be part of the animation. diff --git a/classes/class_audiostreamsample.rst b/classes/class_audiostreamsample.rst index 10a002165..31d94b01d 100644 --- a/classes/class_audiostreamsample.rst +++ b/classes/class_audiostreamsample.rst @@ -38,9 +38,9 @@ Properties Methods ------- -+------+-------------------------------------------------------------------------------------------------------------+ -| void | :ref:`save_to_wav` **(** :ref:`String` path **)** | -+------+-------------------------------------------------------------------------------------------------------------+ ++---------------------------------------+-------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save_to_wav` **(** :ref:`String` path **)** | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------+ Enumerations ------------ @@ -178,5 +178,9 @@ Method Descriptions .. _class_AudioStreamSample_method_save_to_wav: -- void **save_to_wav** **(** :ref:`String` path **)** +- :ref:`Error` **save_to_wav** **(** :ref:`String` path **)** + +Saves the AudioStreamSample as a WAV file to ``path``. Samples with IMA ADPCM format can't be saved. + +Note that a ``.wav`` extension is automatically appended to ``path`` if it is missing. diff --git a/classes/class_dictionary.rst b/classes/class_dictionary.rst index 2fd619eb7..e44690750 100644 --- a/classes/class_dictionary.rst +++ b/classes/class_dictionary.rst @@ -48,6 +48,24 @@ Dictionary type. Associative container which contains values referenced by uniqu Erasing elements while iterating over them **is not supported**. +Creating a dictionary: + +:: + + var d = {4: 5, "A key": "A value", 28: [1, 2, 3]} + +To add a key to an existing dictionary, access it like an existing key and assign to it: + +:: + + d[4] = "hello" # Add integer 4 as a key and assign the String "hello" as its value. + d["Godot"] = 3.01 # Add String "Godot" as a key and assign the value 3.01 to it. + +Tutorials +--------- + +- `#dictionary <../getting_started/scripting/gdscript/gdscript_basics.html#dictionary>`_ in :doc:`../getting_started/scripting/gdscript/gdscript_basics` + Method Descriptions ------------------- diff --git a/classes/class_editorspatialgizmoplugin.rst b/classes/class_editorspatialgizmoplugin.rst index d539a7cf0..328a03f54 100644 --- a/classes/class_editorspatialgizmoplugin.rst +++ b/classes/class_editorspatialgizmoplugin.rst @@ -42,6 +42,8 @@ Methods +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_name` **(** **)** virtual | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_priority` **(** **)** virtual | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_gizmo` **(** :ref:`Spatial` spatial **)** virtual | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_handle_highlighted` **(** :ref:`EditorSpatialGizmo` gizmo, :ref:`int` index **)** virtual | @@ -132,6 +134,10 @@ Get material from the internal list of materials. If an :ref:`EditorSpatialGizmo Override this method to provide the name that will appear in the gizmo visibility menu. +.. _class_EditorSpatialGizmoPlugin_method_get_priority: + +- :ref:`String` **get_priority** **(** **)** virtual + .. _class_EditorSpatialGizmoPlugin_method_has_gizmo: - :ref:`bool` **has_gizmo** **(** :ref:`Spatial` spatial **)** virtual diff --git a/classes/class_kinematicbody.rst b/classes/class_kinematicbody.rst index 8f075563e..ceb4a59fa 100644 --- a/classes/class_kinematicbody.rst +++ b/classes/class_kinematicbody.rst @@ -176,13 +176,15 @@ Moves the body along a vector. If the body collides with another, it will slide ``floor_normal`` is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of ``Vector3(0, 0, 0)``, everything is considered a wall. This is useful for topdown games. -If the body is standing on a slope and the horizontal speed (relative to the floor's speed) goes below ``slope_stop_min_velocity``, the body will stop completely. This prevents the body from sliding down slopes when you include gravity in ``linear_velocity``. When set to lower values, the body will not be able to stand still on steep slopes. +If ``stop_on_slope`` is true, body will not slide on slopes if you include gravity in ``linear_velocity``. If the body collides, it will change direction a maximum of ``max_slides`` times before it stops. ``floor_max_angle`` is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees. -Returns the movement that remained when the body stopped. To get more detailed information about collisions that occurred, use :ref:`get_slide_collision`. +If ``infinite_inertia`` is true, body will be able to push :ref:`RigidBody` nodes, but it won't also detect any collisions with them. When false, it will interact with :ref:`RigidBody` nodes like with :ref:`StaticBody`. + +Returns the ``linear_velocity`` vector, rotated and/or scaled if a slide collision occurred. To get detailed information about collisions that occurred, use :ref:`get_slide_collision`. .. _class_KinematicBody_method_move_and_slide_with_snap: diff --git a/classes/class_kinematicbody2d.rst b/classes/class_kinematicbody2d.rst index 9a74d7a5d..38c6ea7fa 100644 --- a/classes/class_kinematicbody2d.rst +++ b/classes/class_kinematicbody2d.rst @@ -101,6 +101,14 @@ Returns the velocity of the floor. Only updates when calling :ref:`move_and_slid Returns a :ref:`KinematicCollision2D`, which contains information about a collision that occurred during the last :ref:`move_and_slide` call. Since the body can collide several times in a single call to :ref:`move_and_slide`, you must specify the index of the collision in the range 0 to (:ref:`get_slide_count` - 1). +Example usage: + +:: + + for i in get_slide_count(): + var collision = get_slide_collision(i) + print("Collided with: ", collision.collider.name) + .. _class_KinematicBody2D_method_get_slide_count: - :ref:`int` **get_slide_count** **(** **)** const @@ -141,13 +149,15 @@ Moves the body along a vector. If the body collides with another, it will slide ``floor_normal`` is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of ``Vector2(0, 0)``, everything is considered a wall. This is useful for topdown games. -If the body is standing on a slope and the horizontal speed (relative to the floor's speed) goes below ``slope_stop_min_velocity``, the body will stop completely. This prevents the body from sliding down slopes when you include gravity in ``linear_velocity``. When set to lower values, the body will not be able to stand still on steep slopes. +If ``stop_on_slope`` is true, body will not slide on slopes when you include gravity in ``linear_velocity`` and the body is standing still. If the body collides, it will change direction a maximum of ``max_slides`` times before it stops. ``floor_max_angle`` is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees. -Returns the ``linear_velocity`` vector, rotated and/or scaled if a slide collision occurred. To get more detailed information about collisions that occurred, use :ref:`get_slide_collision`. +If ``infinite_inertia`` is true, body will be able to push :ref:`RigidBody2D` nodes, but it won't also detect any collisions with them. When false, it will interact with :ref:`RigidBody2D` nodes like with :ref:`StaticBody2D`. + +Returns the ``linear_velocity`` vector, rotated and/or scaled if a slide collision occurred. To get detailed information about collisions that occurred, use :ref:`get_slide_collision`. .. _class_KinematicBody2D_method_move_and_slide_with_snap: diff --git a/classes/class_light2d.rst b/classes/class_light2d.rst index 2e7fc7fe3..5888614db 100644 --- a/classes/class_light2d.rst +++ b/classes/class_light2d.rst @@ -119,6 +119,11 @@ Description Casts light in a 2D environment. Light is defined by a (usually grayscale) texture, a color, an energy value, a mode (see constants), and various other parameters (range and shadows-related). Note that Light2D can be used as a mask. +Tutorials +--------- + +- :doc:`../tutorials/2d/2d_lights_and_shadows` + Property Descriptions --------------------- diff --git a/classes/class_lightoccluder2d.rst b/classes/class_lightoccluder2d.rst index 8751f0d68..12e3296d2 100644 --- a/classes/class_lightoccluder2d.rst +++ b/classes/class_lightoccluder2d.rst @@ -30,6 +30,11 @@ Description Occludes light cast by a Light2D, casting shadows. The LightOccluder2D must be provided with an :ref:`OccluderPolygon2D` in order for the shadow to be computed. +Tutorials +--------- + +- :doc:`../tutorials/2d/2d_lights_and_shadows` + Property Descriptions --------------------- diff --git a/classes/class_meshinstance2d.rst b/classes/class_meshinstance2d.rst index 0d117be79..eb6fe4823 100644 --- a/classes/class_meshinstance2d.rst +++ b/classes/class_meshinstance2d.rst @@ -27,6 +27,11 @@ Properties | :ref:`Texture` | :ref:`texture` | +-------------------------------+-------------------------------------------------------------+ +Tutorials +--------- + +- :doc:`../tutorials/2d/2d_meshes` + Property Descriptions --------------------- diff --git a/classes/class_multimesh.rst b/classes/class_multimesh.rst index 01393694a..28dfec407 100644 --- a/classes/class_multimesh.rst +++ b/classes/class_multimesh.rst @@ -112,6 +112,11 @@ As a drawback, if the instances are too far away of each other, performance may Since instances may have any behavior, the AABB used for visibility must be provided by the user. +Tutorials +--------- + +- :doc:`../tutorials/3d/vertex_animation/animating_thousands_of_fish` + Property Descriptions --------------------- diff --git a/classes/class_multimeshinstance.rst b/classes/class_multimeshinstance.rst index 6e5609a82..02db57c61 100644 --- a/classes/class_multimeshinstance.rst +++ b/classes/class_multimeshinstance.rst @@ -30,6 +30,13 @@ Description This is useful to optimize the rendering of a high amount of instances of a given mesh (for example tree in a forest or grass strands). +Tutorials +--------- + +- :doc:`../tutorials/3d/vertex_animation/animating_thousands_of_fish` + +- :doc:`../tutorials/3d/using_multi_mesh_instance` + Property Descriptions --------------------- diff --git a/classes/class_particles.rst b/classes/class_particles.rst index 89b64d9fc..a9fee981d 100644 --- a/classes/class_particles.rst +++ b/classes/class_particles.rst @@ -101,6 +101,11 @@ Description Use the ``process_material`` property to add a :ref:`ParticlesMaterial` to configure particle appearance and behavior. Alternatively, you can add a :ref:`ShaderMaterial` which will be applied to all particles. +Tutorials +--------- + +- :doc:`../tutorials/3d/vertex_animation/controlling_thousands_of_fish` + Property Descriptions --------------------- diff --git a/classes/class_particles2d.rst b/classes/class_particles2d.rst index 3f5c8d688..883110c71 100644 --- a/classes/class_particles2d.rst +++ b/classes/class_particles2d.rst @@ -84,6 +84,11 @@ Description Use the ``process_material`` property to add a :ref:`ParticlesMaterial` to configure particle appearance and behavior. Alternatively, you can add a :ref:`ShaderMaterial` which will be applied to all particles. +Tutorials +--------- + +- :doc:`../tutorials/2d/particle_systems_2d` + Property Descriptions --------------------- diff --git a/classes/class_physics2ddirectbodystate.rst b/classes/class_physics2ddirectbodystate.rst index e0c21cc2c..4bc3eec65 100644 --- a/classes/class_physics2ddirectbodystate.rst +++ b/classes/class_physics2ddirectbodystate.rst @@ -89,7 +89,12 @@ Methods Description ----------- -Direct access object to a physics body in the :ref:`Physics2DServer`. This object is passed via the direct state callback of rigid/character bodies, and is intended for changing the direct state of that body. +Provides direct access to a physics body in the :ref:`Physics2DServer`, allowing safe changes to physics properties. This object is passed via the direct state callback of rigid/character bodies, and is intended for changing the direct state of that body. See :ref:`RigidBody2D._integrate_forces`. + +Tutorials +--------- + +- :doc:`../tutorials/physics/ray-casting` Property Descriptions --------------------- @@ -104,7 +109,7 @@ Property Descriptions | *Getter* | get_angular_velocity() | +----------+-----------------------------+ -The angular velocity of the body. +The body's rotational velocity. .. _class_Physics2DDirectBodyState_property_inverse_inertia: @@ -136,7 +141,7 @@ The inverse of the mass of the body. | *Getter* | get_linear_velocity() | +----------+----------------------------+ -The linear velocity of the body. +The body's linear velocity. .. _class_Physics2DDirectBodyState_property_sleeping: @@ -148,7 +153,7 @@ The linear velocity of the body. | *Getter* | is_sleeping() | +----------+------------------------+ -``true`` if this body is currently sleeping (not active). +If ``true``, this body is currently sleeping (not active). .. _class_Physics2DDirectBodyState_property_step: @@ -200,7 +205,7 @@ The rate at which the body stops moving, if there are not any other forces movin | *Getter* | get_transform() | +----------+----------------------+ -The transformation matrix of the body. +The body's transformation matrix. Method Descriptions ------------------- @@ -209,101 +214,113 @@ Method Descriptions - void **add_central_force** **(** :ref:`Vector2` force **)** +Adds a constant directional force without affecting rotation. + .. _class_Physics2DDirectBodyState_method_add_force: - void **add_force** **(** :ref:`Vector2` offset, :ref:`Vector2` force **)** +Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates. + .. _class_Physics2DDirectBodyState_method_add_torque: - void **add_torque** **(** :ref:`float` torque **)** +Adds a constant rotational force. + .. _class_Physics2DDirectBodyState_method_apply_central_impulse: - void **apply_central_impulse** **(** :ref:`Vector2` impulse **)** +Applies a directional impulse without affecting rotation. + .. _class_Physics2DDirectBodyState_method_apply_impulse: - void **apply_impulse** **(** :ref:`Vector2` offset, :ref:`Vector2` impulse **)** +Applies a positioned impulse to the body. An impulse is time independent! Applying an impulse every frame would result in a framerate dependent force. For this reason it should only be used when simulating one-time impacts (use the "_force" functions otherwise). The offset uses the rotation of the global coordinate system, but is centered at the object's origin. + .. _class_Physics2DDirectBodyState_method_apply_torque_impulse: - void **apply_torque_impulse** **(** :ref:`float` impulse **)** +Applies a rotational impulse to the body. + .. _class_Physics2DDirectBodyState_method_get_contact_collider: - :ref:`RID` **get_contact_collider** **(** :ref:`int` contact_idx **)** const -Return the :ref:`RID` of the collider. +Returns the collider's :ref:`RID`. .. _class_Physics2DDirectBodyState_method_get_contact_collider_id: - :ref:`int` **get_contact_collider_id** **(** :ref:`int` contact_idx **)** const -Return the object id of the collider. +Returns the collider's object id. .. _class_Physics2DDirectBodyState_method_get_contact_collider_object: - :ref:`Object` **get_contact_collider_object** **(** :ref:`int` contact_idx **)** const -Return the collider object, this depends on how it was created (will return a scene node if such was used to create it). +Returns the collider object. This depends on how it was created (will return a scene node if such was used to create it). .. _class_Physics2DDirectBodyState_method_get_contact_collider_position: - :ref:`Vector2` **get_contact_collider_position** **(** :ref:`int` contact_idx **)** const -Return the contact position in the collider. +Returns the contact position in the collider. .. _class_Physics2DDirectBodyState_method_get_contact_collider_shape: - :ref:`int` **get_contact_collider_shape** **(** :ref:`int` contact_idx **)** const -Return the collider shape index. +Returns the collider's shape index. .. _class_Physics2DDirectBodyState_method_get_contact_collider_shape_metadata: - :ref:`Variant` **get_contact_collider_shape_metadata** **(** :ref:`int` contact_idx **)** const -Return the metadata of the collided shape. This metadata is different from :ref:`Object.get_meta`, and is set with :ref:`Physics2DServer.shape_set_data`. +Returns the collided shape's metadata. This metadata is different from :ref:`Object.get_meta`, and is set with :ref:`Physics2DServer.shape_set_data`. .. _class_Physics2DDirectBodyState_method_get_contact_collider_velocity_at_position: - :ref:`Vector2` **get_contact_collider_velocity_at_position** **(** :ref:`int` contact_idx **)** const -Return the linear velocity vector at contact point of the collider. +Returns the linear velocity vector at the collider's contact point. .. _class_Physics2DDirectBodyState_method_get_contact_count: - :ref:`int` **get_contact_count** **(** **)** const -Return the amount of contacts this body has with other bodies. Note that by default this returns 0 unless bodies are configured to log contacts. +Returns the number of contacts this body has with other bodies. Note that by default this returns 0 unless bodies are configured to log contacts. See :ref:`RigidBody2D.contact_monitor`. .. _class_Physics2DDirectBodyState_method_get_contact_local_normal: - :ref:`Vector2` **get_contact_local_normal** **(** :ref:`int` contact_idx **)** const -Return the local normal (of this body) of the contact point. +Returns the local normal at the contact point. .. _class_Physics2DDirectBodyState_method_get_contact_local_position: - :ref:`Vector2` **get_contact_local_position** **(** :ref:`int` contact_idx **)** const -Return the local position (of this body) of the contact point. +Returns the local position of the contact point. .. _class_Physics2DDirectBodyState_method_get_contact_local_shape: - :ref:`int` **get_contact_local_shape** **(** :ref:`int` contact_idx **)** const -Return the local shape index of the collision. +Returns the local shape index of the collision. .. _class_Physics2DDirectBodyState_method_get_space_state: - :ref:`Physics2DDirectSpaceState` **get_space_state** **(** **)** -Return the current state of space, useful for queries. +Returns the current state of the space, useful for queries. .. _class_Physics2DDirectBodyState_method_integrate_forces: - void **integrate_forces** **(** **)** -Call the built-in force integration code. +Calls the built-in force integration code. diff --git a/classes/class_physicsdirectbodystate.rst b/classes/class_physicsdirectbodystate.rst index 152725a9e..377afd096 100644 --- a/classes/class_physicsdirectbodystate.rst +++ b/classes/class_physicsdirectbodystate.rst @@ -16,7 +16,7 @@ PhysicsDirectBodyState Brief Description ----------------- - +Direct access object to a physics body in the :ref:`PhysicsServer`. Properties ---------- @@ -90,6 +90,11 @@ Methods | void | :ref:`integrate_forces` **(** **)** | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +Description +----------- + +Provides direct access to a physics body in the :ref:`PhysicsServer`, allowing safe changes to physics properties. This object is passed via the direct state callback of rigid/character bodies, and is intended for changing the direct state of that body. See :ref:`RigidBody._integrate_forces`. + Property Descriptions --------------------- @@ -103,7 +108,7 @@ Property Descriptions | *Getter* | get_angular_velocity() | +----------+-----------------------------+ -The angular velocity of the body. +The body's rotational velocity. .. _class_PhysicsDirectBodyState_property_center_of_mass: @@ -143,7 +148,7 @@ The inverse of the mass of the body. | *Getter* | get_linear_velocity() | +----------+----------------------------+ -The linear velocity of the body. +The body's linear velocity. .. _class_PhysicsDirectBodyState_property_principal_inertia_axes: @@ -163,7 +168,7 @@ The linear velocity of the body. | *Getter* | is_sleeping() | +----------+------------------------+ -``true`` if this body is currently sleeping (not active). +If ``true``, this body is currently sleeping (not active). .. _class_PhysicsDirectBodyState_property_step: @@ -215,7 +220,7 @@ The rate at which the body stops moving, if there are not any other forces movin | *Getter* | get_transform() | +----------+----------------------+ -The transformation matrix of the body. +The body's transformation matrix. Method Descriptions ------------------- @@ -232,13 +237,13 @@ This is equivalent to ``add_force(force, Vector3(0,0,0))``. - void **add_force** **(** :ref:`Vector3` force, :ref:`Vector3` position **)** -Adds a constant force (i.e. acceleration). +Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates. .. _class_PhysicsDirectBodyState_method_add_torque: - void **add_torque** **(** :ref:`Vector3` torque **)** -Adds a constant rotational force (i.e. a motor) without affecting position. +Adds a constant rotational force without affecting position. .. _class_PhysicsDirectBodyState_method_apply_central_impulse: @@ -264,30 +269,44 @@ Apply a torque impulse (which will be affected by the body mass and shape). This - :ref:`RID` **get_contact_collider** **(** :ref:`int` contact_idx **)** const +Returns the collider's :ref:`RID`. + .. _class_PhysicsDirectBodyState_method_get_contact_collider_id: - :ref:`int` **get_contact_collider_id** **(** :ref:`int` contact_idx **)** const +Returns the collider's object id. + .. _class_PhysicsDirectBodyState_method_get_contact_collider_object: - :ref:`Object` **get_contact_collider_object** **(** :ref:`int` contact_idx **)** const +Returns the collider object. + .. _class_PhysicsDirectBodyState_method_get_contact_collider_position: - :ref:`Vector3` **get_contact_collider_position** **(** :ref:`int` contact_idx **)** const +Returns the contact position in the collider. + .. _class_PhysicsDirectBodyState_method_get_contact_collider_shape: - :ref:`int` **get_contact_collider_shape** **(** :ref:`int` contact_idx **)** const +Returns the collider's shape index. + .. _class_PhysicsDirectBodyState_method_get_contact_collider_velocity_at_position: - :ref:`Vector3` **get_contact_collider_velocity_at_position** **(** :ref:`int` contact_idx **)** const +Returns the linear velocity vector at the collider's contact point. + .. _class_PhysicsDirectBodyState_method_get_contact_count: - :ref:`int` **get_contact_count** **(** **)** const +Returns the number of contacts this body has with other bodies. Note that by default this returns 0 unless bodies are configured to log contacts. See :ref:`RigidBody.contact_monitor`. + .. _class_PhysicsDirectBodyState_method_get_contact_impulse: - :ref:`float` **get_contact_impulse** **(** :ref:`int` contact_idx **)** const @@ -298,19 +317,29 @@ Impulse created by the contact. Only implemented for Bullet physics. - :ref:`Vector3` **get_contact_local_normal** **(** :ref:`int` contact_idx **)** const +Returns the local normal at the contact point. + .. _class_PhysicsDirectBodyState_method_get_contact_local_position: - :ref:`Vector3` **get_contact_local_position** **(** :ref:`int` contact_idx **)** const +Returns the local position of the contact point. + .. _class_PhysicsDirectBodyState_method_get_contact_local_shape: - :ref:`int` **get_contact_local_shape** **(** :ref:`int` contact_idx **)** const +Returns the local shape index of the collision. + .. _class_PhysicsDirectBodyState_method_get_space_state: - :ref:`PhysicsDirectSpaceState` **get_space_state** **(** **)** +Returns the current state of the space, useful for queries. + .. _class_PhysicsDirectBodyState_method_integrate_forces: - void **integrate_forces** **(** **)** +Calls the built-in force integration code. + diff --git a/classes/class_projectsettings.rst b/classes/class_projectsettings.rst index 56f14fd9c..22a88a3e2 100644 --- a/classes/class_projectsettings.rst +++ b/classes/class_projectsettings.rst @@ -148,6 +148,8 @@ Properties +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`display/mouse_cursor/custom_image_hotspot` | +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`display/mouse_cursor/tooltip_position_offset` | ++-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`display/window/dpi/allow_hidpi` | +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`display/window/energy_saving/keep_screen_on` | @@ -904,6 +906,12 @@ Custom image for the mouse cursor. Hotspot for the custom mouse cursor image. +.. _class_ProjectSettings_property_display/mouse_cursor/tooltip_position_offset: + +- :ref:`Vector2` **display/mouse_cursor/tooltip_position_offset** + +Position offset for tooltips, relative to the hotspot of the mouse cursor. + .. _class_ProjectSettings_property_display/window/dpi/allow_hidpi: - :ref:`bool` **display/window/dpi/allow_hidpi** diff --git a/classes/class_raycast.rst b/classes/class_raycast.rst index 106a79894..d9b44de08 100644 --- a/classes/class_raycast.rst +++ b/classes/class_raycast.rst @@ -69,13 +69,13 @@ Description A RayCast represents a line from its origin to its destination position, ``cast_to``. It is used to query the 3D space in order to find the closest object along the path of the ray. -RayCast can ignore some objects by adding them to the exception list via ``add_exception``, by setting proper filtering with collision layers, or by filtering object types with type masks. +RayCast can ignore some objects by adding them to the exception list via ``add_exception`` or by setting proper filtering with collision layers and masks. RayCast can be configured to report collisions with :ref:`Area`\ s (:ref:`collide_with_areas`) and/or :ref:`PhysicsBody`\ s (:ref:`collide_with_bodies`). Only enabled raycasts will be able to query the space and report collisions. -RayCast calculates intersection every physics frame (see :ref:`Node`), and the result is cached so it can be used later until the next frame. If multiple queries are required between physics frames (or during the same frame) use :ref:`force_raycast_update` after adjusting the raycast. +RayCast calculates intersection every physics frame (see :ref:`Node`), and the result is cached so it can be used later until the next frame. If multiple queries are required between physics frames (or during the same frame), use :ref:`force_raycast_update` after adjusting the raycast. Property Descriptions --------------------- diff --git a/classes/class_rect2.rst b/classes/class_rect2.rst index d9516a726..04d9ad6d3 100644 --- a/classes/class_rect2.rst +++ b/classes/class_rect2.rst @@ -172,5 +172,5 @@ Returns ``true`` if the ``Rect2`` overlaps with another. - :ref:`Rect2` **merge** **(** :ref:`Rect2` b **)** -Returns a larger Rect2 that contains this Rect2 and ``with``. +Returns a larger Rect2 that contains this Rect2 and ``b``. diff --git a/classes/class_shadermaterial.rst b/classes/class_shadermaterial.rst index 726e1a631..62ca9a030 100644 --- a/classes/class_shadermaterial.rst +++ b/classes/class_shadermaterial.rst @@ -41,6 +41,11 @@ Description A material that uses a custom :ref:`Shader` program to render either items to screen or process particles. You can create multiple materials for the same shader but configure different values for the uniforms defined in the shader. +Tutorials +--------- + +- :doc:`../tutorials/shading/index` + Property Descriptions --------------------- diff --git a/classes/class_skeleton2d.rst b/classes/class_skeleton2d.rst index fb33673e6..349f459a1 100644 --- a/classes/class_skeleton2d.rst +++ b/classes/class_skeleton2d.rst @@ -34,6 +34,11 @@ Signals - **bone_setup_changed** **(** **)** +Tutorials +--------- + +- :doc:`../tutorials/animation/2d_skeletons` + Method Descriptions -------------------