Sync classref with current source

This commit is contained in:
Rémi Verschelde
2019-03-28 10:42:26 +01:00
parent c05db58ecc
commit 15e264eb3f
21 changed files with 186 additions and 45 deletions

View File

@@ -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:

View File

@@ -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<class_Node>`, contrarily to :ref:`AnimationPlayer<class_AnimationPlayer>` or :ref:`AnimatedSprite<class_AnimatedSprite>`, but has the advantage of being usable at any place where a :ref:`Texture<class_Texture>` resource can be used, e.g. in a :ref:`TileSet<class_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<class_AnimationPlayer>` or :ref:`AnimatedSprite<class_AnimatedSprite>`, it isn't a :ref:`Node<class_Node>`, but has the advantage of being usable anywhere a :ref:`Texture<class_Texture>` resource can be used, e.g. in a :ref:`TileSet<class_TileSet>`.
The playback of the animation is controlled by the :ref:`fps<class_AnimatedTexture_property_fps>` property as well as each frame's optional delay (see :ref:`set_frame_delay<class_AnimatedTexture_method_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<class_AnimatedTexture_property_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<class_AnimatedTexture_method_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<class_AnimatedTexture_property_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<class_AnimatedTexture_method_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<class_float>` **get_frame_delay** **(** :ref:`int<class_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<class_Texture>` **get_frame_texture** **(** :ref:`int<class_int>` frame **)** const
Retrieves the :ref:`Texture<class_Texture>` assigned to the given ``frame`` ID.
Returns the given frame's :ref:`Texture<class_Texture>`.
.. _class_AnimatedTexture_method_set_frame_delay:
- void **set_frame_delay** **(** :ref:`int<class_int>` frame, :ref:`float<class_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<class_AnimatedTexture_property_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<class_AnimatedTexture_property_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<class_int>` frame, :ref:`Texture<class_Texture>` texture **)**
Assigns a :ref:`Texture<class_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<class_AnimatedTexture_property_frames>` - 1).
Assigns a :ref:`Texture<class_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<class_AnimatedTexture_property_frames>` - 1.
You can define any frame texture up to :ref:`MAX_FRAMES<class_AnimatedTexture_constant_MAX_FRAMES>`, but keep in mind that only frames from 0 to :ref:`frames<class_AnimatedTexture_property_frames>` - 1 will be part of the animation.
You can define any number of textures up to :ref:`MAX_FRAMES<class_AnimatedTexture_constant_MAX_FRAMES>`, but keep in mind that only frames from 0 to :ref:`frames<class_AnimatedTexture_property_frames>` - 1 will be part of the animation.

View File

@@ -38,9 +38,9 @@ Properties
Methods
-------
+------+-------------------------------------------------------------------------------------------------------------+
| void | :ref:`save_to_wav<class_AudioStreamSample_method_save_to_wav>` **(** :ref:`String<class_String>` path **)** |
+------+-------------------------------------------------------------------------------------------------------------+
+---------------------------------------+-------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save_to_wav<class_AudioStreamSample_method_save_to_wav>` **(** :ref:`String<class_String>` path **)** |
+---------------------------------------+-------------------------------------------------------------------------------------------------------------+
Enumerations
------------
@@ -178,5 +178,9 @@ Method Descriptions
.. _class_AudioStreamSample_method_save_to_wav:
- void **save_to_wav** **(** :ref:`String<class_String>` path **)**
- :ref:`Error<enum_@GlobalScope_Error>` **save_to_wav** **(** :ref:`String<class_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.

View File

@@ -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
-------------------

View File

@@ -42,6 +42,8 @@ Methods
+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_name<class_EditorSpatialGizmoPlugin_method_get_name>` **(** **)** virtual |
+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_priority<class_EditorSpatialGizmoPlugin_method_get_priority>` **(** **)** virtual |
+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_gizmo<class_EditorSpatialGizmoPlugin_method_has_gizmo>` **(** :ref:`Spatial<class_Spatial>` spatial **)** virtual |
+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_handle_highlighted<class_EditorSpatialGizmoPlugin_method_is_handle_highlighted>` **(** :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` gizmo, :ref:`int<class_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<class_String>` **get_priority** **(** **)** virtual
.. _class_EditorSpatialGizmoPlugin_method_has_gizmo:
- :ref:`bool<class_bool>` **has_gizmo** **(** :ref:`Spatial<class_Spatial>` spatial **)** virtual

View File

@@ -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<class_KinematicBody_method_get_slide_collision>`.
If ``infinite_inertia`` is true, body will be able to push :ref:`RigidBody<class_RigidBody>` nodes, but it won't also detect any collisions with them. When false, it will interact with :ref:`RigidBody<class_RigidBody>` nodes like with :ref:`StaticBody<class_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_get_slide_collision>`.
.. _class_KinematicBody_method_move_and_slide_with_snap:

View File

@@ -101,6 +101,14 @@ Returns the velocity of the floor. Only updates when calling :ref:`move_and_slid
Returns a :ref:`KinematicCollision2D<class_KinematicCollision2D>`, which contains information about a collision that occurred during the last :ref:`move_and_slide<class_KinematicBody2D_method_move_and_slide>` call. Since the body can collide several times in a single call to :ref:`move_and_slide<class_KinematicBody2D_method_move_and_slide>`, you must specify the index of the collision in the range 0 to (:ref:`get_slide_count<class_KinematicBody2D_method_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<class_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<class_KinematicBody2D_method_get_slide_collision>`.
If ``infinite_inertia`` is true, body will be able to push :ref:`RigidBody2D<class_RigidBody2D>` nodes, but it won't also detect any collisions with them. When false, it will interact with :ref:`RigidBody2D<class_RigidBody2D>` nodes like with :ref:`StaticBody2D<class_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_get_slide_collision>`.
.. _class_KinematicBody2D_method_move_and_slide_with_snap:

View File

@@ -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
---------------------

View File

@@ -30,6 +30,11 @@ Description
Occludes light cast by a Light2D, casting shadows. The LightOccluder2D must be provided with an :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` in order for the shadow to be computed.
Tutorials
---------
- :doc:`../tutorials/2d/2d_lights_and_shadows`
Property Descriptions
---------------------

View File

@@ -27,6 +27,11 @@ Properties
| :ref:`Texture<class_Texture>` | :ref:`texture<class_MeshInstance2D_property_texture>` |
+-------------------------------+-------------------------------------------------------------+
Tutorials
---------
- :doc:`../tutorials/2d/2d_meshes`
Property Descriptions
---------------------

View File

@@ -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
---------------------

View File

@@ -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
---------------------

View File

@@ -101,6 +101,11 @@ Description
Use the ``process_material`` property to add a :ref:`ParticlesMaterial<class_ParticlesMaterial>` to configure particle appearance and behavior. Alternatively, you can add a :ref:`ShaderMaterial<class_ShaderMaterial>` which will be applied to all particles.
Tutorials
---------
- :doc:`../tutorials/3d/vertex_animation/controlling_thousands_of_fish`
Property Descriptions
---------------------

View File

@@ -84,6 +84,11 @@ Description
Use the ``process_material`` property to add a :ref:`ParticlesMaterial<class_ParticlesMaterial>` to configure particle appearance and behavior. Alternatively, you can add a :ref:`ShaderMaterial<class_ShaderMaterial>` which will be applied to all particles.
Tutorials
---------
- :doc:`../tutorials/2d/particle_systems_2d`
Property Descriptions
---------------------

View File

@@ -89,7 +89,12 @@ Methods
Description
-----------
Direct access object to a physics body in the :ref:`Physics2DServer<class_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<class_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<class_RigidBody2D_method__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<class_Vector2>` force **)**
Adds a constant directional force without affecting rotation.
.. _class_Physics2DDirectBodyState_method_add_force:
- void **add_force** **(** :ref:`Vector2<class_Vector2>` offset, :ref:`Vector2<class_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<class_float>` torque **)**
Adds a constant rotational force.
.. _class_Physics2DDirectBodyState_method_apply_central_impulse:
- void **apply_central_impulse** **(** :ref:`Vector2<class_Vector2>` impulse **)**
Applies a directional impulse without affecting rotation.
.. _class_Physics2DDirectBodyState_method_apply_impulse:
- void **apply_impulse** **(** :ref:`Vector2<class_Vector2>` offset, :ref:`Vector2<class_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<class_float>` impulse **)**
Applies a rotational impulse to the body.
.. _class_Physics2DDirectBodyState_method_get_contact_collider:
- :ref:`RID<class_RID>` **get_contact_collider** **(** :ref:`int<class_int>` contact_idx **)** const
Return the :ref:`RID<class_RID>` of the collider.
Returns the collider's :ref:`RID<class_RID>`.
.. _class_Physics2DDirectBodyState_method_get_contact_collider_id:
- :ref:`int<class_int>` **get_contact_collider_id** **(** :ref:`int<class_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<class_Object>` **get_contact_collider_object** **(** :ref:`int<class_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<class_Vector2>` **get_contact_collider_position** **(** :ref:`int<class_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<class_int>` **get_contact_collider_shape** **(** :ref:`int<class_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<class_Variant>` **get_contact_collider_shape_metadata** **(** :ref:`int<class_int>` contact_idx **)** const
Return the metadata of the collided shape. This metadata is different from :ref:`Object.get_meta<class_Object_method_get_meta>`, and is set with :ref:`Physics2DServer.shape_set_data<class_Physics2DServer_method_shape_set_data>`.
Returns the collided shape's metadata. This metadata is different from :ref:`Object.get_meta<class_Object_method_get_meta>`, and is set with :ref:`Physics2DServer.shape_set_data<class_Physics2DServer_method_shape_set_data>`.
.. _class_Physics2DDirectBodyState_method_get_contact_collider_velocity_at_position:
- :ref:`Vector2<class_Vector2>` **get_contact_collider_velocity_at_position** **(** :ref:`int<class_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<class_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_RigidBody2D_property_contact_monitor>`.
.. _class_Physics2DDirectBodyState_method_get_contact_local_normal:
- :ref:`Vector2<class_Vector2>` **get_contact_local_normal** **(** :ref:`int<class_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<class_Vector2>` **get_contact_local_position** **(** :ref:`int<class_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<class_int>` **get_contact_local_shape** **(** :ref:`int<class_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<class_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.

View File

@@ -16,7 +16,7 @@ PhysicsDirectBodyState
Brief Description
-----------------
Direct access object to a physics body in the :ref:`PhysicsServer<class_PhysicsServer>`.
Properties
----------
@@ -90,6 +90,11 @@ Methods
| void | :ref:`integrate_forces<class_PhysicsDirectBodyState_method_integrate_forces>` **(** **)** |
+---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Description
-----------
Provides direct access to a physics body in the :ref:`PhysicsServer<class_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<class_RigidBody_method__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<class_Vector3>` force, :ref:`Vector3<class_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<class_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<class_RID>` **get_contact_collider** **(** :ref:`int<class_int>` contact_idx **)** const
Returns the collider's :ref:`RID<class_RID>`.
.. _class_PhysicsDirectBodyState_method_get_contact_collider_id:
- :ref:`int<class_int>` **get_contact_collider_id** **(** :ref:`int<class_int>` contact_idx **)** const
Returns the collider's object id.
.. _class_PhysicsDirectBodyState_method_get_contact_collider_object:
- :ref:`Object<class_Object>` **get_contact_collider_object** **(** :ref:`int<class_int>` contact_idx **)** const
Returns the collider object.
.. _class_PhysicsDirectBodyState_method_get_contact_collider_position:
- :ref:`Vector3<class_Vector3>` **get_contact_collider_position** **(** :ref:`int<class_int>` contact_idx **)** const
Returns the contact position in the collider.
.. _class_PhysicsDirectBodyState_method_get_contact_collider_shape:
- :ref:`int<class_int>` **get_contact_collider_shape** **(** :ref:`int<class_int>` contact_idx **)** const
Returns the collider's shape index.
.. _class_PhysicsDirectBodyState_method_get_contact_collider_velocity_at_position:
- :ref:`Vector3<class_Vector3>` **get_contact_collider_velocity_at_position** **(** :ref:`int<class_int>` contact_idx **)** const
Returns the linear velocity vector at the collider's contact point.
.. _class_PhysicsDirectBodyState_method_get_contact_count:
- :ref:`int<class_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_RigidBody_property_contact_monitor>`.
.. _class_PhysicsDirectBodyState_method_get_contact_impulse:
- :ref:`float<class_float>` **get_contact_impulse** **(** :ref:`int<class_int>` contact_idx **)** const
@@ -298,19 +317,29 @@ Impulse created by the contact. Only implemented for Bullet physics.
- :ref:`Vector3<class_Vector3>` **get_contact_local_normal** **(** :ref:`int<class_int>` contact_idx **)** const
Returns the local normal at the contact point.
.. _class_PhysicsDirectBodyState_method_get_contact_local_position:
- :ref:`Vector3<class_Vector3>` **get_contact_local_position** **(** :ref:`int<class_int>` contact_idx **)** const
Returns the local position of the contact point.
.. _class_PhysicsDirectBodyState_method_get_contact_local_shape:
- :ref:`int<class_int>` **get_contact_local_shape** **(** :ref:`int<class_int>` contact_idx **)** const
Returns the local shape index of the collision.
.. _class_PhysicsDirectBodyState_method_get_space_state:
- :ref:`PhysicsDirectSpaceState<class_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.

View File

@@ -148,6 +148,8 @@ Properties
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`display/mouse_cursor/custom_image_hotspot<class_ProjectSettings_property_display/mouse_cursor/custom_image_hotspot>` |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`display/mouse_cursor/tooltip_position_offset<class_ProjectSettings_property_display/mouse_cursor/tooltip_position_offset>` |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`display/window/dpi/allow_hidpi<class_ProjectSettings_property_display/window/dpi/allow_hidpi>` |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`display/window/energy_saving/keep_screen_on<class_ProjectSettings_property_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<class_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<class_bool>` **display/window/dpi/allow_hidpi**

View File

@@ -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<class_Area>`\ s (:ref:`collide_with_areas<class_RayCast_property_collide_with_areas>`) and/or :ref:`PhysicsBody<class_PhysicsBody>`\ s (:ref:`collide_with_bodies<class_RayCast_property_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<class_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<class_RayCast_method_force_raycast_update>` after adjusting the raycast.
RayCast calculates intersection every physics frame (see :ref:`Node<class_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<class_RayCast_method_force_raycast_update>` after adjusting the raycast.
Property Descriptions
---------------------

View File

@@ -172,5 +172,5 @@ Returns ``true`` if the ``Rect2`` overlaps with another.
- :ref:`Rect2<class_Rect2>` **merge** **(** :ref:`Rect2<class_Rect2>` b **)**
Returns a larger Rect2 that contains this Rect2 and ``with``.
Returns a larger Rect2 that contains this Rect2 and ``b``.

View File

@@ -41,6 +41,11 @@ Description
A material that uses a custom :ref:`Shader<class_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
---------------------

View File

@@ -34,6 +34,11 @@ Signals
- **bone_setup_changed** **(** **)**
Tutorials
---------
- :doc:`../tutorials/animation/2d_skeletons`
Method Descriptions
-------------------