diff --git a/classes/class_animatedtexture.rst b/classes/class_animatedtexture.rst index b698f17fc..cdba042f3 100644 --- a/classes/class_animatedtexture.rst +++ b/classes/class_animatedtexture.rst @@ -25,13 +25,19 @@ The playback of the animation is controlled by the :ref:`fps` | flags | ``0`` *(parent override)* | -+---------------------------+------------------------------------------------------+---------------------------+ -| :ref:`float` | :ref:`fps` | ``4.0`` | -+---------------------------+------------------------------------------------------+---------------------------+ -| :ref:`int` | :ref:`frames` | ``1`` | -+---------------------------+------------------------------------------------------+---------------------------+ ++---------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`current_frame` | | ++---------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`int` | flags | ``0`` *(parent override)* | ++---------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`fps` | ``4.0`` | ++---------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`frames` | ``1`` | ++---------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`oneshot` | ``false`` | ++---------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`pause` | ``false`` | ++---------------------------+--------------------------------------------------------------------+---------------------------+ Methods ------- @@ -56,6 +62,20 @@ Constants Property Descriptions --------------------- +.. _class_AnimatedTexture_property_current_frame: + +- :ref:`int` **current_frame** + ++----------+--------------------------+ +| *Setter* | set_current_frame(value) | ++----------+--------------------------+ +| *Getter* | get_current_frame() | ++----------+--------------------------+ + +Sets the currently visible frame of the texture. + +---- + .. _class_AnimatedTexture_property_fps: - :ref:`float` **fps** @@ -88,6 +108,38 @@ For example, an animation with 8 frames, no frame delay and a ``fps`` value of 2 Number of frames to use in the animation. While you can create the frames independently with :ref:`set_frame_texture`, you need to set this value for the animation to take new frames into account. The maximum number of frames is :ref:`MAX_FRAMES`. +---- + +.. _class_AnimatedTexture_property_oneshot: + +- :ref:`bool` **oneshot** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_oneshot(value) | ++-----------+--------------------+ +| *Getter* | get_oneshot() | ++-----------+--------------------+ + +If ``true``, the animation will only play once and will not loop back to the first frame after reaching the end. Note that reaching the end will not set :ref:`pause` to ``true``. + +---- + +.. _class_AnimatedTexture_property_pause: + +- :ref:`bool` **pause** + ++-----------+------------------+ +| *Default* | ``false`` | ++-----------+------------------+ +| *Setter* | set_pause(value) | ++-----------+------------------+ +| *Getter* | get_pause() | ++-----------+------------------+ + +If ``true``, the animation will pause where it currently is (i.e. at :ref:`current_frame`). The animation will continue from where it was paused when changing this property to ``false``. + Method Descriptions ------------------- diff --git a/classes/class_array.rst b/classes/class_array.rst index 826283588..d75617d1a 100644 --- a/classes/class_array.rst +++ b/classes/class_array.rst @@ -35,7 +35,7 @@ Arrays can be concatenated using the ``+`` operator: var array2 = [3, "Four"] print(array1 + array2) # ["One", 2, 3, "Four"] -Arrays are always passed by reference. +**Note:** Arrays are always passed by reference. To get a copy of an array which can be modified independently of the original array, use :ref:`duplicate`. Methods ------- diff --git a/classes/class_cpuparticles2d.rst b/classes/class_cpuparticles2d.rst index 036a9496b..b1aa4958d 100644 --- a/classes/class_cpuparticles2d.rst +++ b/classes/class_cpuparticles2d.rst @@ -981,6 +981,8 @@ If ``true``, particles use the parent node's coordinate space. If ``false``, the Normal map to be used for the :ref:`texture` property. +**Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See `this page `_ for a comparison of normal map coordinates expected by popular engines. + ---- .. _class_CPUParticles2D_property_one_shot: diff --git a/classes/class_dictionary.rst b/classes/class_dictionary.rst index 82b36de57..b2abbdd51 100644 --- a/classes/class_dictionary.rst +++ b/classes/class_dictionary.rst @@ -20,6 +20,8 @@ You can define a dictionary by placing a comma-separated list of ``key: value`` Erasing elements while iterating over them **is not supported** and will result in undefined behavior. +**Note:** Dictionaries are always passed by reference. To get a copy of a dictionary which can be modified independently of the original dictionary, use :ref:`duplicate`. + Creating a dictionary: :: diff --git a/classes/class_dtlsserver.rst b/classes/class_dtlsserver.rst new file mode 100644 index 000000000..3a9cbb267 --- /dev/null +++ b/classes/class_dtlsserver.rst @@ -0,0 +1,103 @@ +:github_url: hide + +.. Generated automatically by doc/tools/makerst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the DTLSServer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_DTLSServer: + +DTLSServer +========== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Helper class to implement a DTLS server. + +Description +----------- + +This class is used to store the state of a DTLS server. Upon :ref:`setup` it converts connected :ref:`PacketPeerUDP` to :ref:`PacketPeerDTLS` accepting them via :ref:`take_connection` as DTLS clients. Under the hood, this class is used to store the DTLS state and cookies of the server. The reason of why the state and cookies are needed is outside of the scope of this documentation. + +Below a small example of how to use it: + +:: + + # server.gd + extends Node + + var dtls := DTLSServer.new() + var server := UDPServer.new() + var peers = [] + + func _ready(): + server.listen(4242) + var key = load("key.key") # Your private key. + var cert = load("cert.crt") # Your X509 certificate. + dtls.setup(key, cert) + + func _process(delta): + while server.is_connection_available(): + var peer : PacketPeerUDP = server.take_connection() + var dtls_peer : PacketPeerDTLS = dtls.take_connection(peer) + if dtls_peer.get_status() != PacketPeerDTLS.STATUS_HANDSHAKING: + continue # It is normal that 50% of the connections fails due to cookie exchange. + print("Peer connected!") + peers.append(dtls_peer) + for p in peers: + p.poll() # Must poll to update the state. + if p.get_status() == PacketPeerDTLS.STATUS_CONNECTED: + while p.get_available_packet_count() > 0: + print("Received message from client: %s" % p.get_packet().get_string_from_utf8()) + p.put_packet("Hello DTLS client".to_utf8()) + +:: + + # client.gd + extends Node + + var dtls := PacketPeerDTLS.new() + var udp := PacketPeerUDP.new() + var connected = false + + func _ready(): + udp.connect_to_host("127.0.0.1", 4242) + dtls.connect_to_peer(udp, false) # Use true in production for certificate validation! + + func _process(delta): + dtls.poll() + if dtls.get_status() == PacketPeerDTLS.STATUS_CONNECTED: + if !connected: + # Try to contact server + dtls.put_packet("The answer is... 42!".to_utf8()) + while dtls.get_available_packet_count() > 0: + print("Connected: %s" % dtls.get_packet().get_string_from_utf8()) + connected = true + +Methods +------- + ++---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`setup` **(** :ref:`CryptoKey` key, :ref:`X509Certificate` certificate, :ref:`X509Certificate` chain=null **)** | ++---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PacketPeerDTLS` | :ref:`take_connection` **(** :ref:`PacketPeerUDP` udp_peer **)** | ++---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_DTLSServer_method_setup: + +- :ref:`Error` **setup** **(** :ref:`CryptoKey` key, :ref:`X509Certificate` certificate, :ref:`X509Certificate` chain=null **)** + +Setup the DTLS server to use the given ``private_key`` and provide the given ``certificate`` to clients. You can pass the optional ``chain`` parameter to provide additional CA chain information along with the certificate. + +---- + +.. _class_DTLSServer_method_take_connection: + +- :ref:`PacketPeerDTLS` **take_connection** **(** :ref:`PacketPeerUDP` udp_peer **)** + +Try to initiate the DTLS handshake with the given ``udp_peer`` which must be already connected (see :ref:`PacketPeerUDP.connect_to_host`). + +**Note**: You must check that the state of the return PacketPeerUDP is :ref:`PacketPeerDTLS.STATUS_HANDSHAKING`, as it is normal that 50% of the new connections will be invalid due to cookie exchange. + diff --git a/classes/class_engine.rst b/classes/class_engine.rst index c872fc62c..331077cc5 100644 --- a/classes/class_engine.rst +++ b/classes/class_engine.rst @@ -11,12 +11,12 @@ Engine **Inherits:** :ref:`Object` -Access to basic engine properties. +Access to engine properties. Description ----------- -The ``Engine`` class allows you to query and modify the project's run-time parameters, such as frames per second, time scale, and others. +The ``Engine`` singleton allows you to query and modify the project's run-time parameters, such as frames per second, time scale, and others. Properties ---------- @@ -258,7 +258,7 @@ Returns the fraction through the current physics tick we are at the time of rend - :ref:`Object` **get_singleton** **(** :ref:`String` name **)** const -Returns a global singleton with given ``name``. Often used for plugins, e.g. GodotPayments. +Returns a global singleton with given ``name``. Often used for plugins, e.g. ``GodotPayment`` on Android. ---- diff --git a/classes/class_externaltexture.rst b/classes/class_externaltexture.rst index 72125918f..f6abeb909 100644 --- a/classes/class_externaltexture.rst +++ b/classes/class_externaltexture.rst @@ -11,7 +11,14 @@ ExternalTexture **Inherits:** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` -Adds support for external textures as defined by https://www.khronos.org/registry/OpenGL/extensions/OES/OES_EGL_image_external.txt +Enable OpenGL ES external texture extension. + +Description +----------- + +Enable support for the OpenGL ES external texture extension as defined by `OES_EGL_image_external `_. + +**Note:** This is only supported for Android platforms. Properties ---------- diff --git a/classes/class_generic6dofjoint.rst b/classes/class_generic6dofjoint.rst index 4e72a860a..bb620159a 100644 --- a/classes/class_generic6dofjoint.rst +++ b/classes/class_generic6dofjoint.rst @@ -241,6 +241,12 @@ Enumerations .. _class_Generic6DOFJoint_constant_PARAM_LINEAR_MOTOR_FORCE_LIMIT: +.. _class_Generic6DOFJoint_constant_PARAM_LINEAR_SPRING_STIFFNESS: + +.. _class_Generic6DOFJoint_constant_PARAM_LINEAR_SPRING_DAMPING: + +.. _class_Generic6DOFJoint_constant_PARAM_LINEAR_SPRING_EQUILIBRIUM_POINT: + .. _class_Generic6DOFJoint_constant_PARAM_ANGULAR_LOWER_LIMIT: .. _class_Generic6DOFJoint_constant_PARAM_ANGULAR_UPPER_LIMIT: @@ -259,6 +265,12 @@ Enumerations .. _class_Generic6DOFJoint_constant_PARAM_ANGULAR_MOTOR_FORCE_LIMIT: +.. _class_Generic6DOFJoint_constant_PARAM_ANGULAR_SPRING_STIFFNESS: + +.. _class_Generic6DOFJoint_constant_PARAM_ANGULAR_SPRING_DAMPING: + +.. _class_Generic6DOFJoint_constant_PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT: + .. _class_Generic6DOFJoint_constant_PARAM_MAX: enum **Param**: @@ -277,6 +289,12 @@ enum **Param**: - **PARAM_LINEAR_MOTOR_FORCE_LIMIT** = **6** --- The maximum force the linear motor will apply while trying to reach the velocity target. +- **PARAM_LINEAR_SPRING_STIFFNESS** = **7** + +- **PARAM_LINEAR_SPRING_DAMPING** = **8** + +- **PARAM_LINEAR_SPRING_EQUILIBRIUM_POINT** = **9** + - **PARAM_ANGULAR_LOWER_LIMIT** = **10** --- The minimum rotation in negative direction to break loose and rotate around the axes. - **PARAM_ANGULAR_UPPER_LIMIT** = **11** --- The minimum rotation in positive direction to break loose and rotate around the axes. @@ -295,6 +313,12 @@ enum **Param**: - **PARAM_ANGULAR_MOTOR_FORCE_LIMIT** = **18** --- Maximum acceleration for the motor at the axes. +- **PARAM_ANGULAR_SPRING_STIFFNESS** = **19** + +- **PARAM_ANGULAR_SPRING_DAMPING** = **20** + +- **PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT** = **21** + - **PARAM_MAX** = **22** --- Represents the size of the :ref:`Param` enum. ---- diff --git a/classes/class_image.rst b/classes/class_image.rst index 8bb09ebdb..e3c00f92d 100644 --- a/classes/class_image.rst +++ b/classes/class_image.rst @@ -712,7 +712,7 @@ Returns ``true`` if all the image's pixels have an alpha value of 0. Returns ``f - :ref:`Error` **load** **(** :ref:`String` path **)** -Loads an image from file ``path``. +Loads an image from file ``path``. See `Supported image formats `_ for a list of supported image formats and limitations. ---- diff --git a/classes/class_kinematicbody.rst b/classes/class_kinematicbody.rst index adfef9aa8..0961479f8 100644 --- a/classes/class_kinematicbody.rst +++ b/classes/class_kinematicbody.rst @@ -225,7 +225,7 @@ This method should be used in :ref:`Node._physics_process` that will be drawn by the ``MeshInstance2D``. The normal map that will be used if using the default :ref:`CanvasItemMaterial`. +**Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See `this page `_ for a comparison of normal map coordinates expected by popular engines. + ---- .. _class_MeshInstance2D_property_texture: diff --git a/classes/class_multimeshinstance2d.rst b/classes/class_multimeshinstance2d.rst index a255e5a8b..35275d61a 100644 --- a/classes/class_multimeshinstance2d.rst +++ b/classes/class_multimeshinstance2d.rst @@ -69,6 +69,8 @@ The :ref:`MultiMesh` that will be drawn by the ``MultiMeshInsta The normal map that will be used if using the default :ref:`CanvasItemMaterial`. +**Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See `this page `_ for a comparison of normal map coordinates expected by popular engines. + ---- .. _class_MultiMeshInstance2D_property_texture: diff --git a/classes/class_networkedmultiplayerenet.rst b/classes/class_networkedmultiplayerenet.rst index f6b213f96..885a16c2c 100644 --- a/classes/class_networkedmultiplayerenet.rst +++ b/classes/class_networkedmultiplayerenet.rst @@ -35,6 +35,8 @@ Properties +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------------------------------+ | :ref:`CompressionMode` | :ref:`compression_mode` | ``0`` | +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------------------------------+ +| :ref:`bool` | :ref:`dtls_verify` | ``true`` | ++-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------------------------------+ | :ref:`bool` | refuse_new_connections | ``false`` *(parent override)* | +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------------------------------+ | :ref:`bool` | :ref:`server_relay` | ``true`` | @@ -43,6 +45,8 @@ Properties +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------------------------------+ | :ref:`TransferMode` | transfer_mode | ``2`` *(parent override)* | +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------------------------------+ +| :ref:`bool` | :ref:`use_dtls` | ``false`` | ++-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------------------------------+ Methods ------- @@ -66,6 +70,10 @@ Methods +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_bind_ip` **(** :ref:`String` ip **)** | +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_dtls_certificate` **(** :ref:`X509Certificate` certificate **)** | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_dtls_key` **(** :ref:`CryptoKey` key **)** | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Enumerations ------------ @@ -145,6 +153,22 @@ The compression method used for network packets. These have different tradeoffs ---- +.. _class_NetworkedMultiplayerENet_property_dtls_verify: + +- :ref:`bool` **dtls_verify** + ++-----------+--------------------------------+ +| *Default* | ``true`` | ++-----------+--------------------------------+ +| *Setter* | set_dtls_verify_enabled(value) | ++-----------+--------------------------------+ +| *Getter* | is_dtls_verify_enabled() | ++-----------+--------------------------------+ + +Enable or disable certiticate verification when :ref:`use_dtls` ``true``. + +---- + .. _class_NetworkedMultiplayerENet_property_server_relay: - :ref:`bool` **server_relay** @@ -175,6 +199,24 @@ Enable or disable the server feature that notifies clients of other peers' conne Set the default channel to be used to transfer data. By default, this value is ``-1`` which means that ENet will only use 2 channels, one for reliable and one for unreliable packets. Channel ``0`` is reserved, and cannot be used. Setting this member to any value between ``0`` and :ref:`channel_count` (excluded) will force ENet to use that channel for sending data. +---- + +.. _class_NetworkedMultiplayerENet_property_use_dtls: + +- :ref:`bool` **use_dtls** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_dtls_enabled(value) | ++-----------+-------------------------+ +| *Getter* | is_dtls_enabled() | ++-----------+-------------------------+ + +When enabled, the client or server created by this peer, will use :ref:`PacketPeerDTLS` instead of raw UDP sockets for communicating with the remote peer. This will make the communication encrypted with DTLS at the cost of higher resource usage and potentially larger packet size. + +Note: When creating a DTLS server, make sure you setup the key/certificate pair via :ref:`set_dtls_key` and :ref:`set_dtls_certificate`. For DTLS clients, have a look at the :ref:`dtls_verify` option, and configure the certificate accordingly via :ref:`set_dtls_certificate`. + Method Descriptions ------------------- @@ -248,3 +290,19 @@ Returns the remote port of the given peer. The IP used when creating a server. This is set to the wildcard ``"*"`` by default, which binds to all available interfaces. The given IP needs to be in IPv4 or IPv6 address format, for example: ``"192.168.1.1"``. +---- + +.. _class_NetworkedMultiplayerENet_method_set_dtls_certificate: + +- void **set_dtls_certificate** **(** :ref:`X509Certificate` certificate **)** + +Configure the :ref:`X509Certificate` to use when :ref:`use_dtls` is ``true``. For servers, you must also setup the :ref:`CryptoKey` via :ref:`set_dtls_key`. + +---- + +.. _class_NetworkedMultiplayerENet_method_set_dtls_key: + +- void **set_dtls_key** **(** :ref:`CryptoKey` key **)** + +Configure the :ref:`CryptoKey` to use when :ref:`use_dtls` is ``true``. Remember to also call :ref:`set_dtls_certificate` to setup your :ref:`X509Certificate`. + diff --git a/classes/class_node.rst b/classes/class_node.rst index a284e6912..eb9b51201 100644 --- a/classes/class_node.rst +++ b/classes/class_node.rst @@ -880,7 +880,7 @@ Similar to :ref:`get_node`, but does not log an erro - :ref:`Node` **get_parent** **(** **)** const -Returns the parent node of the current node, or an empty ``Node`` if the node lacks a parent. +Returns the parent node of the current node, or a ``null instance`` if the node lacks a parent. ---- diff --git a/classes/class_node2d.rst b/classes/class_node2d.rst index f26d88d96..96f68d820 100644 --- a/classes/class_node2d.rst +++ b/classes/class_node2d.rst @@ -47,6 +47,10 @@ Properties +---------------------------------------+-------------------------------------------------------------------------------+---------------------+ | :ref:`Vector2` | :ref:`scale` | ``Vector2( 1, 1 )`` | +---------------------------------------+-------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`skew` | ``0.0`` | ++---------------------------------------+-------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`skew_degrees` | ``0.0`` | ++---------------------------------------+-------------------------------------------------------------------------------+---------------------+ | :ref:`Transform2D` | :ref:`transform` | | +---------------------------------------+-------------------------------------------------------------------------------+---------------------+ | :ref:`bool` | :ref:`z_as_relative` | ``true`` | @@ -218,6 +222,34 @@ The node's scale. Unscaled value: ``(1, 1)``. ---- +.. _class_Node2D_property_skew: + +- :ref:`float` **skew** + ++-----------+-----------------+ +| *Default* | ``0.0`` | ++-----------+-----------------+ +| *Setter* | set_skew(value) | ++-----------+-----------------+ +| *Getter* | get_skew() | ++-----------+-----------------+ + +---- + +.. _class_Node2D_property_skew_degrees: + +- :ref:`float` **skew_degrees** + ++-----------+-------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------+ +| *Setter* | set_skew_degrees(value) | ++-----------+-------------------------+ +| *Getter* | get_skew_degrees() | ++-----------+-------------------------+ + +---- + .. _class_Node2D_property_transform: - :ref:`Transform2D` **transform** @@ -333,7 +365,7 @@ Applies a rotation to the node, in radians, starting from its current rotation. - :ref:`Vector2` **to_global** **(** :ref:`Vector2` local_point **)** const -Converts a local point's coordinates to global coordinates. +Transforms the provided local position into a position in global coordinate space. The input is expected to be local relative to the ``Node2D`` it is called on. e.g. Applying this method to the positions of child nodes will correctly transform their positions into the global coordinate space, but applying it to a node's own position will give an incorrect result, as it will incorporate the node's own transformation into its global position. ---- @@ -341,7 +373,7 @@ Converts a local point's coordinates to global coordinates. - :ref:`Vector2` **to_local** **(** :ref:`Vector2` global_point **)** const -Converts a global point's coordinates to local coordinates. +Transforms the provided global position into a position in local coordinate space. The output will be local relative to the ``Node2D`` it is called on. e.g. It is appropriate for determining the positions of child nodes, but it is not appropriate for determining its own position relative to its parent. ---- diff --git a/classes/class_object.rst b/classes/class_object.rst index e922e7c55..e56530ee5 100644 --- a/classes/class_object.rst +++ b/classes/class_object.rst @@ -347,7 +347,7 @@ Emits the given ``signal``. The signal must exist, so it should be a built-in si - void **free** **(** **)** -Deletes the object from memory. Any pre-existing reference to the freed object will now return ``null``. +Deletes the object from memory. Any pre-existing reference to the freed object will become invalid, e.g. ``is_instance_valid(object)`` will return ``false``. ---- diff --git a/classes/class_os.rst b/classes/class_os.rst index d544e067b..b64f08aaa 100644 --- a/classes/class_os.rst +++ b/classes/class_os.rst @@ -40,6 +40,8 @@ Properties +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ | :ref:`ScreenOrientation` | :ref:`screen_orientation` | ``0`` | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`String` | :ref:`tablet_driver` | ``"wintab"`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ | :ref:`bool` | :ref:`vsync_enabled` | ``true`` | +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ | :ref:`bool` | :ref:`vsync_via_compositor` | ``false`` | @@ -157,6 +159,10 @@ Methods +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_system_time_secs` **(** **)** const | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_tablet_driver_count` **(** **)** const | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_tablet_driver_name` **(** :ref:`int` idx **)** const | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_ticks_msec` **(** **)** const | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_ticks_usec` **(** **)** const | @@ -614,6 +620,22 @@ The current screen orientation. ---- +.. _class_OS_property_tablet_driver: + +- :ref:`String` **tablet_driver** + ++-----------+----------------------------------+ +| *Default* | ``"wintab"`` | ++-----------+----------------------------------+ +| *Setter* | set_current_tablet_driver(value) | ++-----------+----------------------------------+ +| *Getter* | get_current_tablet_driver() | ++-----------+----------------------------------+ + +The current tablet drvier in use. + +---- + .. _class_OS_property_vsync_enabled: - :ref:`bool` **vsync_enabled** @@ -1241,6 +1263,26 @@ Returns the epoch time of the operating system in seconds. ---- +.. _class_OS_method_get_tablet_driver_count: + +- :ref:`int` **get_tablet_driver_count** **(** **)** const + +Returns the total number of available tablet drivers. + +**Note:** This method is implemented on Windows. + +---- + +.. _class_OS_method_get_tablet_driver_name: + +- :ref:`String` **get_tablet_driver_name** **(** :ref:`int` idx **)** const + +Returns the tablet driver name for the given index. + +**Note:** This method is implemented on Windows. + +---- + .. _class_OS_method_get_ticks_msec: - :ref:`int` **get_ticks_msec** **(** **)** const @@ -1737,6 +1779,8 @@ Requests the OS to open a resource with the most appropriate program. For exampl - ``OS.shell_open("mailto:example@example.com")`` opens the default email client with the "To" field set to ``example@example.com``. See `Customizing ``mailto:`` Links `_ for a list of fields that can be added. +Use :ref:`ProjectSettings.globalize_path` to convert a ``res://`` or ``user://`` path into a system path for use with this method. + **Note:** This method is implemented on Android, iOS, HTML5, Linux, macOS and Windows. ---- diff --git a/classes/class_packetpeer.rst b/classes/class_packetpeer.rst index 233c188fe..e71aba58e 100644 --- a/classes/class_packetpeer.rst +++ b/classes/class_packetpeer.rst @@ -11,7 +11,7 @@ PacketPeer **Inherits:** :ref:`Reference` **<** :ref:`Object` -**Inherited By:** :ref:`NetworkedMultiplayerPeer`, :ref:`PacketPeerGDNative`, :ref:`PacketPeerStream`, :ref:`PacketPeerUDP`, :ref:`WebRTCDataChannel`, :ref:`WebSocketPeer` +**Inherited By:** :ref:`NetworkedMultiplayerPeer`, :ref:`PacketPeerDTLS`, :ref:`PacketPeerGDNative`, :ref:`PacketPeerStream`, :ref:`PacketPeerUDP`, :ref:`WebRTCDataChannel`, :ref:`WebSocketPeer` Abstraction and base class for packet-based protocols. diff --git a/classes/class_packetpeerdtls.rst b/classes/class_packetpeerdtls.rst new file mode 100644 index 000000000..666893255 --- /dev/null +++ b/classes/class_packetpeerdtls.rst @@ -0,0 +1,93 @@ +:github_url: hide + +.. Generated automatically by doc/tools/makerst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PacketPeerDTLS.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PacketPeerDTLS: + +PacketPeerDTLS +============== + +**Inherits:** :ref:`PacketPeer` **<** :ref:`Reference` **<** :ref:`Object` + +DTLS packet peer. + +Description +----------- + +This class represents a DTLS peer connection. It can be used to connect to a DTLS server, and is returned by :ref:`DTLSServer.take_connection`. + +Methods +------- + ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`connect_to_peer` **(** :ref:`PacketPeerUDP` packet_peer, :ref:`bool` validate_certs=true, :ref:`String` for_hostname="", :ref:`X509Certificate` valid_certificate=null **)** | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`disconnect_from_peer` **(** **)** | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Status` | :ref:`get_status` **(** **)** const | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`poll` **(** **)** | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_PacketPeerDTLS_Status: + +.. _class_PacketPeerDTLS_constant_STATUS_DISCONNECTED: + +.. _class_PacketPeerDTLS_constant_STATUS_HANDSHAKING: + +.. _class_PacketPeerDTLS_constant_STATUS_CONNECTED: + +.. _class_PacketPeerDTLS_constant_STATUS_ERROR: + +.. _class_PacketPeerDTLS_constant_STATUS_ERROR_HOSTNAME_MISMATCH: + +enum **Status**: + +- **STATUS_DISCONNECTED** = **0** --- A status representing a ``PacketPeerDTLS`` that is disconnected. + +- **STATUS_HANDSHAKING** = **1** --- A status representing a ``PacketPeerDTLS`` that is currently performing the handshake with a remote peer. + +- **STATUS_CONNECTED** = **2** --- A status representing a ``PacketPeerDTLS`` that is connected to a remote peer. + +- **STATUS_ERROR** = **3** --- A status representing a ``PacketPeerDTLS`` in a generic error state. + +- **STATUS_ERROR_HOSTNAME_MISMATCH** = **4** --- An error status that shows a mismatch in the DTLS certificate domain presented by the host and the domain requested for validation. + +Method Descriptions +------------------- + +.. _class_PacketPeerDTLS_method_connect_to_peer: + +- :ref:`Error` **connect_to_peer** **(** :ref:`PacketPeerUDP` packet_peer, :ref:`bool` validate_certs=true, :ref:`String` for_hostname="", :ref:`X509Certificate` valid_certificate=null **)** + +Connects a ``peer`` beginning the DTLS handshake using the underlying :ref:`PacketPeerUDP` which must be connected (see :ref:`PacketPeerUDP.connect_to_host`). If ``validate_certs`` is ``true``, ``PacketPeerDTLS`` will validate that the certificate presented by the remote peer and match it with the ``for_hostname`` argument. You can specify a custom :ref:`X509Certificate` to use for validation via the ``valid_certificate`` argument. + +---- + +.. _class_PacketPeerDTLS_method_disconnect_from_peer: + +- void **disconnect_from_peer** **(** **)** + +Disconnects this peer, terminating the DTLS session. + +---- + +.. _class_PacketPeerDTLS_method_get_status: + +- :ref:`Status` **get_status** **(** **)** const + +Returns the status of the connection. See :ref:`Status` for values. + +---- + +.. _class_PacketPeerDTLS_method_poll: + +- void **poll** **(** **)** + +Poll the connection to check for incoming packets. Call this frequently to update the status and keep the connection working. + diff --git a/classes/class_packetpeerudp.rst b/classes/class_packetpeerudp.rst index 42adf3205..de80a6827 100644 --- a/classes/class_packetpeerudp.rst +++ b/classes/class_packetpeerudp.rst @@ -24,10 +24,14 @@ Methods +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`close` **(** **)** | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`connect_to_host` **(** :ref:`String` host, :ref:`int` port **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_packet_ip` **(** **)** const | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_packet_port` **(** **)** const | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_connected_to_host` **(** **)** const | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_listening` **(** **)** const | +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`join_multicast_group` **(** :ref:`String` multicast_address, :ref:`String` interface_name **)** | @@ -54,6 +58,16 @@ Closes the UDP socket the ``PacketPeerUDP`` is currently listening on. ---- +.. _class_PacketPeerUDP_method_connect_to_host: + +- :ref:`Error` **connect_to_host** **(** :ref:`String` host, :ref:`int` port **)** + +Calling this method connects this UDP peer to the given ``host``/``port`` pair. UDP is in reality connectionless, so this option only means that incoming packets from different addresses are automatically discarded, and that outgoing packets are always sent to the connected address (future calls to :ref:`set_dest_address` are not allowed). This method does not send any data to the remote peer, to do that, use :ref:`PacketPeer.put_var` or :ref:`PacketPeer.put_packet` as usual. See also :ref:`UDPServer`. + +Note: Connecting to the remote peer does not help to protect from malicious attacks like IP spoofing, etc. Think about using an encryption technique like SSL or DTLS if you feel like your application is transfering sensitive information. + +---- + .. _class_PacketPeerUDP_method_get_packet_ip: - :ref:`String` **get_packet_ip** **(** **)** const @@ -70,6 +84,14 @@ Returns the port of the remote peer that sent the last packet(that was received ---- +.. _class_PacketPeerUDP_method_is_connected_to_host: + +- :ref:`bool` **is_connected_to_host** **(** **)** const + +Returns ``true`` if the UDP socket is open and has been connected to a remote address. See :ref:`connect_to_host`. + +---- + .. _class_PacketPeerUDP_method_is_listening: - :ref:`bool` **is_listening** **(** **)** const diff --git a/classes/class_particles2d.rst b/classes/class_particles2d.rst index cec631baa..86851b8e9 100644 --- a/classes/class_particles2d.rst +++ b/classes/class_particles2d.rst @@ -229,6 +229,8 @@ If ``true``, particles use the parent node's coordinate space. If ``false``, the Normal map to be used for the :ref:`texture` property. +**Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See `this page `_ for a comparison of normal map coordinates expected by popular engines. + ---- .. _class_Particles2D_property_one_shot: diff --git a/classes/class_popupmenu.rst b/classes/class_popupmenu.rst index a10432641..dad679a02 100644 --- a/classes/class_popupmenu.rst +++ b/classes/class_popupmenu.rst @@ -71,6 +71,8 @@ Methods +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear` **(** **)** | +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_current_index` **(** **)** const | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_item_accelerator` **(** :ref:`int` idx **)** const | +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_item_count` **(** **)** const | @@ -460,6 +462,12 @@ Removes all items from the ``PopupMenu``. ---- +.. _class_PopupMenu_method_get_current_index: + +- :ref:`int` **get_current_index** **(** **)** const + +---- + .. _class_PopupMenu_method_get_item_accelerator: - :ref:`int` **get_item_accelerator** **(** :ref:`int` idx **)** const diff --git a/classes/class_projectsettings.rst b/classes/class_projectsettings.rst index 74a7b7829..31d2f79bb 100644 --- a/classes/class_projectsettings.rst +++ b/classes/class_projectsettings.rst @@ -210,6 +210,8 @@ Properties +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`display/window/size/width` | ``1024`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`display/window/tablet_driver` | ``"wintab"`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`display/window/vsync/use_vsync` | ``true`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`display/window/vsync/vsync_via_compositor` | ``false`` | @@ -222,6 +224,8 @@ Properties +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`gui/common/swap_ok_cancel` | ``false`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`gui/common/text_edit_undo_stack_max_size` | ``1024`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`gui/theme/custom` | ``""`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`gui/theme/custom_font` | ``""`` | @@ -528,14 +532,22 @@ Properties +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`rendering/gles2/batching/colored_vertex_format_threshold` | ``0.25`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/gles2/batching/item_reordering_lookahead` | ``4`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/gles2/batching/light_max_join_items` | ``32`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`rendering/gles2/batching/light_scissor_area_threshold` | ``1.0`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/gles2/batching/max_join_item_commands` | ``16`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/gles2/batching/single_rect_fallback` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`rendering/gles2/batching/use_batching` | ``true`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`rendering/gles2/debug/diagnose_frame` | ``false`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/gles2/debug/disable_half_float` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`rendering/gles2/debug/flash_batching` | ``false`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`rendering/gles2/debug/use_batching_in_editor` | ``true`` | @@ -556,7 +568,7 @@ Properties +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`rendering/limits/time/time_rollover_secs` | ``3600`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`rendering/quality/2d/gles2_use_nvidia_rect_flicker_workaround` | ``false`` | +| :ref:`bool` | :ref:`rendering/quality/2d/use_nvidia_rect_flicker_workaround` | ``false`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`rendering/quality/2d/use_pixel_snap` | ``false`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ @@ -650,6 +662,8 @@ Properties +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`rendering/vram_compression/import_s3tc` | ``true`` | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`world/2d/cell_size` | ``100`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ Methods ------- @@ -697,7 +711,9 @@ Property Descriptions | *Default* | ``""`` | +-----------+--------+ -Comma-separated list of custom Android modules (which must have been built in the Android export templates) using their Java package path, e.g. ``org/godotengine/org/GodotPaymentV3,org/godotengine/godot/MyCustomSingleton"``. +Comma-separated list of custom Android modules (which must have been built in the Android export templates) using their Java package path, e.g. ``"org/godotengine/godot/MyCustomSingleton,com/example/foo/FrenchFriesFactory"``. + +**Note:** Since Godot 3.2.2, the ``org/godotengine/godot/GodotPaymentV3`` module was deprecated and replaced by the ``GodotPayment`` plugin which should be enabled in the Android export preset under ``Plugins`` section. The singleton to access in code was also renamed to ``GodotPayment``. ---- @@ -1025,7 +1041,7 @@ Setting to hardcode audio delay when playing video. Best to leave this untouched | *Default* | ``-1`` | +-----------+--------+ -Default compression level for gzip. Affects compressed scenes and resources. +The default compression level for gzip. Affects compressed scenes and resources. Higher levels result in smaller files at the cost of compression speed. Decompression speed is mostly unaffected by the compression level. ``-1`` uses the default gzip compression level, which is identical to ``6`` but could change in the future due to underlying zlib updates. ---- @@ -1037,7 +1053,7 @@ Default compression level for gzip. Affects compressed scenes and resources. | *Default* | ``-1`` | +-----------+--------+ -Default compression level for Zlib. Affects compressed scenes and resources. +The default compression level for Zlib. Affects compressed scenes and resources. Higher levels result in smaller files at the cost of compression speed. Decompression speed is mostly unaffected by the compression level. ``-1`` uses the default gzip compression level, which is identical to ``6`` but could change in the future due to underlying zlib updates. ---- @@ -1049,7 +1065,7 @@ Default compression level for Zlib. Affects compressed scenes and resources. | *Default* | ``3`` | +-----------+-------+ -Default compression level for Zstandard. Affects compressed scenes and resources. +The default compression level for Zstandard. Affects compressed scenes and resources. Higher levels result in smaller files at the cost of compression speed. Decompression speed is mostly unaffected by the compression level. ---- @@ -1061,7 +1077,7 @@ Default compression level for Zstandard. Affects compressed scenes and resources | *Default* | ``false`` | +-----------+-----------+ -Enables long-distance matching in Zstandard. +Enables `long-distance matching `_ in Zstandard. ---- @@ -1073,7 +1089,7 @@ Enables long-distance matching in Zstandard. | *Default* | ``27`` | +-----------+--------+ -Largest size limit (in power of 2) allowed when compressing using long-distance matching with Zstandard. +Largest size limit (in power of 2) allowed when compressing using long-distance matching with Zstandard. Higher values can result in better compression, but will require more memory when compressing and decompressing. ---- @@ -1801,6 +1817,18 @@ Sets the game's main viewport width. On desktop platforms, this is the default w ---- +.. _class_ProjectSettings_property_display/window/tablet_driver: + +- :ref:`String` **display/window/tablet_driver** + ++-----------+--------------+ +| *Default* | ``"wintab"`` | ++-----------+--------------+ + +Specifies the tablet driver to use. If left empty, the default driver will be used. + +---- + .. _class_ProjectSettings_property_display/window/vsync/use_vsync: - :ref:`bool` **display/window/vsync/use_vsync** @@ -1875,6 +1903,16 @@ If ``true``, swaps OK and Cancel buttons in dialogs on Windows and UWP to follow ---- +.. _class_ProjectSettings_property_gui/common/text_edit_undo_stack_max_size: + +- :ref:`int` **gui/common/text_edit_undo_stack_max_size** + ++-----------+----------+ +| *Default* | ``1024`` | ++-----------+----------+ + +---- + .. _class_ProjectSettings_property_gui/theme/custom: - :ref:`String` **gui/theme/custom** @@ -3357,7 +3395,9 @@ Page size used by remote filesystem (in bytes). | *Default* | ``""`` | +-----------+--------+ -CA certificates bundle to use for SSL connections. If not defined, Godot's internal CA certificates are used. +The CA certificates bundle to use for SSL connections. If this is set to a non-empty value, this will *override* Godot's default `Mozilla certificate bundle `_. If left empty, the default certificate bundle will be used. + +If in doubt, leave this setting empty. ---- @@ -3723,6 +3763,30 @@ Including color in the vertex format has a cost, however, not including color pr ---- +.. _class_ProjectSettings_property_rendering/gles2/batching/item_reordering_lookahead: + +- :ref:`int` **rendering/gles2/batching/item_reordering_lookahead** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +In certain circumstances, the batcher can reorder items in order to better join them. This may result in better performance. An overlap test is needed however for each item lookahead, so there is a trade off, with diminishing returns. If you are getting no benefit, setting this to 0 will switch it off. + +---- + +.. _class_ProjectSettings_property_rendering/gles2/batching/light_max_join_items: + +- :ref:`int` **rendering/gles2/batching/light_max_join_items** + ++-----------+--------+ +| *Default* | ``32`` | ++-----------+--------+ + +Lights have the potential to prevent joining items, and break many of the performance benefits of batching. This setting enables some complex logic to allow joining items if their lighting is similar, and overlap tests pass. This can significantly improve performance in some games. Set to 0 to switch off. With large values the cost of overlap tests may lead to diminishing returns. + +---- + .. _class_ProjectSettings_property_rendering/gles2/batching/light_scissor_area_threshold: - :ref:`float` **rendering/gles2/batching/light_scissor_area_threshold** @@ -3747,6 +3811,18 @@ Sets the number of commands to lookahead to determine whether to batch render it ---- +.. _class_ProjectSettings_property_rendering/gles2/batching/single_rect_fallback: + +- :ref:`bool` **rendering/gles2/batching/single_rect_fallback** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Enabling this uses the legacy method to draw single rects, which is faster, but can cause flicker on some systems. This is best disabled unless crucial for performance. + +---- + .. _class_ProjectSettings_property_rendering/gles2/batching/use_batching: - :ref:`bool` **rendering/gles2/batching/use_batching** @@ -3771,6 +3847,18 @@ When batching is on, this regularly prints a frame diagnosis log. Note that this ---- +.. _class_ProjectSettings_property_rendering/gles2/debug/disable_half_float: + +- :ref:`bool` **rendering/gles2/debug/disable_half_float** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +The use of half-float vertex compression may be producing rendering errors on some platforms (especially iOS). These have been seen particularly in particles. Disabling half-float may resolve these problems. + +---- + .. _class_ProjectSettings_property_rendering/gles2/debug/flash_batching: - :ref:`bool` **rendering/gles2/debug/flash_batching** @@ -3891,9 +3979,9 @@ Shaders have a time variable that constantly increases. At some point, it needs ---- -.. _class_ProjectSettings_property_rendering/quality/2d/gles2_use_nvidia_rect_flicker_workaround: +.. _class_ProjectSettings_property_rendering/quality/2d/use_nvidia_rect_flicker_workaround: -- :ref:`bool` **rendering/quality/2d/gles2_use_nvidia_rect_flicker_workaround** +- :ref:`bool` **rendering/quality/2d/use_nvidia_rect_flicker_workaround** +-----------+-----------+ | *Default* | ``false`` | @@ -3901,7 +3989,7 @@ Shaders have a time variable that constantly increases. At some point, it needs Some NVIDIA GPU drivers have a bug which produces flickering issues for the ``draw_rect`` method, especially as used in :ref:`TileMap`. Refer to `GitHub issue 9913 `_ for details. -If ``true``, this option enables a "safe" code path for such NVIDIA GPUs at the cost of performance. This option only impacts the GLES2 rendering backend (so the bug stays if you use GLES3), and only desktop platforms. +If ``true``, this option enables a "safe" code path for such NVIDIA GPUs at the cost of performance. This option affects GLES2 and GLES3 rendering, but only on desktop platforms. ---- @@ -4465,6 +4553,18 @@ If ``true``, the texture importer will import VRAM-compressed textures using the If ``true``, the texture importer will import VRAM-compressed textures using the S3 Texture Compression algorithm. This algorithm is only supported on desktop platforms and consoles. +---- + +.. _class_ProjectSettings_property_world/2d/cell_size: + +- :ref:`int` **world/2d/cell_size** + ++-----------+---------+ +| *Default* | ``100`` | ++-----------+---------+ + +Cell size used for the 2D hash grid that :ref:`VisibilityNotifier2D` uses. + Method Descriptions ------------------- diff --git a/classes/class_reference.rst b/classes/class_reference.rst index cbb47234b..902bdc1e4 100644 --- a/classes/class_reference.rst +++ b/classes/class_reference.rst @@ -11,7 +11,7 @@ Reference **Inherits:** :ref:`Object` -**Inherited By:** :ref:`ARVRInterface`, :ref:`AStar`, :ref:`AStar2D`, :ref:`AnimationTrackEditPlugin`, :ref:`AudioEffectInstance`, :ref:`AudioStreamPlayback`, :ref:`CameraFeed`, :ref:`CharFXTransform`, :ref:`ConfigFile`, :ref:`Crypto`, :ref:`Directory`, :ref:`EditorExportPlugin`, :ref:`EditorFeatureProfile`, :ref:`EditorInspectorPlugin`, :ref:`EditorResourceConversionPlugin`, :ref:`EditorResourcePreviewGenerator`, :ref:`EditorSceneImporter`, :ref:`EditorScenePostImport`, :ref:`EditorScript`, :ref:`EncodedObjectAsID`, :ref:`Expression`, :ref:`File`, :ref:`FuncRef`, :ref:`GDNative`, :ref:`GDScriptFunctionState`, :ref:`HTTPClient`, :ref:`HashingContext`, :ref:`JSONParseResult`, :ref:`JavaClass`, :ref:`KinematicCollision`, :ref:`KinematicCollision2D`, :ref:`MeshDataTool`, :ref:`MultiplayerAPI`, :ref:`Mutex`, :ref:`PCKPacker`, :ref:`PackedDataContainerRef`, :ref:`PacketPeer`, :ref:`Physics2DShapeQueryParameters`, :ref:`Physics2DShapeQueryResult`, :ref:`Physics2DTestMotionResult`, :ref:`PhysicsShapeQueryParameters`, :ref:`PhysicsShapeQueryResult`, :ref:`RandomNumberGenerator`, :ref:`RegEx`, :ref:`RegExMatch`, :ref:`Resource`, :ref:`ResourceFormatLoader`, :ref:`ResourceFormatSaver`, :ref:`ResourceImporter`, :ref:`ResourceInteractiveLoader`, :ref:`SceneState`, :ref:`SceneTreeTimer`, :ref:`Semaphore`, :ref:`SkinReference`, :ref:`SpatialGizmo`, :ref:`SpatialVelocityTracker`, :ref:`StreamPeer`, :ref:`SurfaceTool`, :ref:`TCP_Server`, :ref:`Thread`, :ref:`TriangleMesh`, :ref:`UPNP`, :ref:`UPNPDevice`, :ref:`VisualScriptFunctionState`, :ref:`WeakRef`, :ref:`WebRTCPeerConnection`, :ref:`XMLParser` +**Inherited By:** :ref:`ARVRInterface`, :ref:`AStar`, :ref:`AStar2D`, :ref:`AnimationTrackEditPlugin`, :ref:`AudioEffectInstance`, :ref:`AudioStreamPlayback`, :ref:`CameraFeed`, :ref:`CharFXTransform`, :ref:`ConfigFile`, :ref:`Crypto`, :ref:`DTLSServer`, :ref:`Directory`, :ref:`EditorExportPlugin`, :ref:`EditorFeatureProfile`, :ref:`EditorInspectorPlugin`, :ref:`EditorResourceConversionPlugin`, :ref:`EditorResourcePreviewGenerator`, :ref:`EditorSceneImporter`, :ref:`EditorScenePostImport`, :ref:`EditorScript`, :ref:`EncodedObjectAsID`, :ref:`Expression`, :ref:`File`, :ref:`FuncRef`, :ref:`GDNative`, :ref:`GDScriptFunctionState`, :ref:`HTTPClient`, :ref:`HashingContext`, :ref:`JSONParseResult`, :ref:`JavaClass`, :ref:`KinematicCollision`, :ref:`KinematicCollision2D`, :ref:`MeshDataTool`, :ref:`MultiplayerAPI`, :ref:`Mutex`, :ref:`PCKPacker`, :ref:`PackedDataContainerRef`, :ref:`PacketPeer`, :ref:`Physics2DShapeQueryParameters`, :ref:`Physics2DShapeQueryResult`, :ref:`Physics2DTestMotionResult`, :ref:`PhysicsShapeQueryParameters`, :ref:`PhysicsShapeQueryResult`, :ref:`RandomNumberGenerator`, :ref:`RegEx`, :ref:`RegExMatch`, :ref:`Resource`, :ref:`ResourceFormatLoader`, :ref:`ResourceFormatSaver`, :ref:`ResourceImporter`, :ref:`ResourceInteractiveLoader`, :ref:`SceneState`, :ref:`SceneTreeTimer`, :ref:`Semaphore`, :ref:`SkinReference`, :ref:`SpatialGizmo`, :ref:`SpatialVelocityTracker`, :ref:`StreamPeer`, :ref:`SurfaceTool`, :ref:`TCP_Server`, :ref:`Thread`, :ref:`TriangleMesh`, :ref:`UDPServer`, :ref:`UPNP`, :ref:`UPNPDevice`, :ref:`VisualScriptFunctionState`, :ref:`WeakRef`, :ref:`WebRTCPeerConnection`, :ref:`XMLParser` Base class for reference-counted objects. diff --git a/classes/class_spatialmaterial.rst b/classes/class_spatialmaterial.rst index 35aeaea24..12197180d 100644 --- a/classes/class_spatialmaterial.rst +++ b/classes/class_spatialmaterial.rst @@ -1071,6 +1071,8 @@ Texture used to specify how the detail textures get blended with the base textur Texture that specifies the per-pixel normal of the detail overlay. +**Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See `this page `_ for a comparison of normal map coordinates expected by popular engines. + ---- .. _class_SpatialMaterial_property_detail_uv_layer: @@ -1517,6 +1519,8 @@ The strength of the normal map's effect. Texture used to specify the normal at a given pixel. The ``normal_texture`` only uses the red and green channels. The normal read from ``normal_texture`` is oriented around the surface normal provided by the :ref:`Mesh`. +**Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See `this page `_ for a comparison of normal map coordinates expected by popular engines. + ---- .. _class_SpatialMaterial_property_params_alpha_scissor_threshold: diff --git a/classes/class_spinbox.rst b/classes/class_spinbox.rst index c6d6fa55c..32cc43ea6 100644 --- a/classes/class_spinbox.rst +++ b/classes/class_spinbox.rst @@ -124,7 +124,7 @@ Adds the specified ``prefix`` string before the numerical value of the ``SpinBox | *Getter* | get_suffix() | +-----------+-------------------+ -Adds the specified ``prefix`` string after the numerical value of the ``SpinBox``. +Adds the specified ``suffix`` string after the numerical value of the ``SpinBox``. Method Descriptions ------------------- diff --git a/classes/class_sprite.rst b/classes/class_sprite.rst index bd8b29a79..a11f58076 100644 --- a/classes/class_sprite.rst +++ b/classes/class_sprite.rst @@ -186,6 +186,8 @@ The number of columns in the sprite sheet. The normal map gives depth to the Sprite. +**Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See `this page `_ for a comparison of normal map coordinates expected by popular engines. + ---- .. _class_Sprite_property_offset: diff --git a/classes/class_styleboxtexture.rst b/classes/class_styleboxtexture.rst index c4886e129..6f7787dbb 100644 --- a/classes/class_styleboxtexture.rst +++ b/classes/class_styleboxtexture.rst @@ -321,6 +321,8 @@ Modulates the color of the texture when this style box is drawn. The normal map to use when drawing this style box. +**Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See `this page `_ for a comparison of normal map coordinates expected by popular engines. + ---- .. _class_StyleBoxTexture_property_region_rect: diff --git a/classes/class_textedit.rst b/classes/class_textedit.rst index d4c5134ac..dfc69e84f 100644 --- a/classes/class_textedit.rst +++ b/classes/class_textedit.rst @@ -159,6 +159,8 @@ Methods +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`select_all` **(** **)** | +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_line` **(** :ref:`int` line, :ref:`String` new_text **)** | ++-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_line_as_hidden` **(** :ref:`int` line, :ref:`bool` enable **)** | +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`toggle_fold_line` **(** :ref:`int` line **)** | @@ -1103,6 +1105,14 @@ Select all the text. ---- +.. _class_TextEdit_method_set_line: + +- void **set_line** **(** :ref:`int` line, :ref:`String` new_text **)** + +Sets the text for a specific line. + +---- + .. _class_TextEdit_method_set_line_as_hidden: - void **set_line_as_hidden** **(** :ref:`int` line, :ref:`bool` enable **)** diff --git a/classes/class_tilemap.rst b/classes/class_tilemap.rst index 1b24535b6..d0eed9255 100644 --- a/classes/class_tilemap.rst +++ b/classes/class_tilemap.rst @@ -556,7 +556,7 @@ Returns a :ref:`Vector2` array with the positions of all cells co - :ref:`Array` **get_used_cells_by_id** **(** :ref:`int` id **)** const -Returns an array of all cells with the given tile ``id``. +Returns an array of all cells with the given tile index specified in ``id``. ---- diff --git a/classes/class_tileset.rst b/classes/class_tileset.rst index 4f75129d1..dfb0b54a9 100644 --- a/classes/class_tileset.rst +++ b/classes/class_tileset.rst @@ -693,6 +693,8 @@ Sets an offset for the tile's navigation polygon. Sets the tile's normal map texture. +**Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See `this page `_ for a comparison of normal map coordinates expected by popular engines. + ---- .. _class_TileSet_method_tile_set_occluder_offset: diff --git a/classes/class_transform.rst b/classes/class_transform.rst index cd8bd656e..f261b89c3 100644 --- a/classes/class_transform.rst +++ b/classes/class_transform.rst @@ -212,7 +212,7 @@ Rotates the transform around the given axis by the given angle (in radians), usi - :ref:`Transform` **scaled** **(** :ref:`Vector3` scale **)** -Scales the transform by the given scale factor, using matrix multiplication. +Scales basis and origin of the transform by the given scale factor, using matrix multiplication. ---- diff --git a/classes/class_tree.rst b/classes/class_tree.rst index 6c1b6be1f..8811b7eb4 100644 --- a/classes/class_tree.rst +++ b/classes/class_tree.rst @@ -31,7 +31,7 @@ Trees are built via code, using :ref:`TreeItem` objects to creat var subchild1 = tree.create_item(child1) subchild1.set_text(0, "Subchild1") -To iterate over all the :ref:`TreeItem` objects in a ``Tree`` object, use :ref:`TreeItem.get_next` and :ref:`TreeItem.get_children` after getting the root through :ref:`get_root`. +To iterate over all the :ref:`TreeItem` objects in a ``Tree`` object, use :ref:`TreeItem.get_next` and :ref:`TreeItem.get_children` after getting the root through :ref:`get_root`. You can use :ref:`Object.free` on a :ref:`TreeItem` to remove it from the ``Tree``. Properties ---------- diff --git a/classes/class_treeitem.rst b/classes/class_treeitem.rst index efee7a0d1..801c8fd11 100644 --- a/classes/class_treeitem.rst +++ b/classes/class_treeitem.rst @@ -18,6 +18,8 @@ Description Control for a single item inside a :ref:`Tree`. May have child ``TreeItem``\ s and be styled as well as contain buttons. +You can remove a ``TreeItem`` by using :ref:`Object.free`. + Properties ---------- @@ -85,6 +87,8 @@ Methods +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`get_range_config` **(** :ref:`int` column **)** | +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_suffix` **(** :ref:`int` column **)** const | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_text` **(** :ref:`int` column **)** const | +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`TextAlign` | :ref:`get_text_align` **(** :ref:`int` column **)** const | @@ -147,6 +151,8 @@ Methods +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_selectable` **(** :ref:`int` column, :ref:`bool` selectable **)** | +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_suffix` **(** :ref:`int` column, :ref:`String` text **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_text` **(** :ref:`int` column, :ref:`String` text **)** | +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_text_align` **(** :ref:`int` column, :ref:`TextAlign` text_align **)** | @@ -451,6 +457,12 @@ If ``wrap`` is enabled, the method will wrap around to the last visible element ---- +.. _class_TreeItem_method_get_suffix: + +- :ref:`String` **get_suffix** **(** :ref:`int` column **)** const + +---- + .. _class_TreeItem_method_get_text: - :ref:`String` **get_text** **(** :ref:`int` column **)** const @@ -541,7 +553,7 @@ Moves this TreeItem to the top in the :ref:`Tree` hierarchy. - void **remove_child** **(** :ref:`Object` child **)** -Removes the given child TreeItem. +Removes the given child ``TreeItem`` and all its children from the :ref:`Tree`. Note that it doesn't free the item from memory, so it can be reused later. To completely remove a ``TreeItem`` use :ref:`Object.free`. ---- @@ -691,6 +703,12 @@ If ``true``, the given column is selectable. ---- +.. _class_TreeItem_method_set_suffix: + +- void **set_suffix** **(** :ref:`int` column, :ref:`String` text **)** + +---- + .. _class_TreeItem_method_set_text: - void **set_text** **(** :ref:`int` column, :ref:`String` text **)** diff --git a/classes/class_tween.rst b/classes/class_tween.rst index 97304285f..e699a9526 100644 --- a/classes/class_tween.rst +++ b/classes/class_tween.rst @@ -34,7 +34,7 @@ Many methods require a property name, such as ``"position"`` above. You can find Many of the methods accept ``trans_type`` and ``ease_type``. The first accepts an :ref:`TransitionType` constant, and refers to the way the timing of the animation is handled (see `easings.net `_ for some examples). The second accepts an :ref:`EaseType` constant, and controls the where ``trans_type`` is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different :ref:`TransitionType` constants with :ref:`EASE_IN_OUT`, and use the one that looks best. -**`Tween easing and transition types cheatsheet `_** +`Tween easing and transition types cheatsheet `_ Properties ---------- diff --git a/classes/class_udpserver.rst b/classes/class_udpserver.rst new file mode 100644 index 000000000..0812ec3a9 --- /dev/null +++ b/classes/class_udpserver.rst @@ -0,0 +1,123 @@ +:github_url: hide + +.. Generated automatically by doc/tools/makerst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the UDPServer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_UDPServer: + +UDPServer +========= + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Helper class to implement a UDP server. + +Description +----------- + +A simple server that opens a UDP socket and returns connected :ref:`PacketPeerUDP` upon receiving new packets. See also :ref:`PacketPeerUDP.connect_to_host`. + +Below a small example of how it can be used: + +:: + + # server.gd + extends Node + + var server := UDPServer.new() + var peers = [] + + func _ready(): + server.listen(4242) + + func _process(delta): + if server.is_connection_available(): + var peer : PacketPeerUDP = server.take_connection() + var pkt = peer.get_packet() + print("Accepted peer: %s:%s" % [peer.get_packet_ip(), peer.get_packet_port()]) + print("Received data: %s" % [pkt.get_string_from_utf8()]) + # Reply so it knows we received the message. + peer.put_packet(pkt) + # Keep a reference so we can keep contacting the remote peer. + peers.append(peer) + + for i in range(0, peers.size()): + pass # Do something with the connected peers. + + +:: + + # client.gd + extends Node + + var udp := PacketPeerUDP.new() + var connected = false + + func _ready(): + udp.connect_to_host("127.0.0.1", 4242) + + func _process(delta): + if !connected: + # Try to contact server + udp.put_packet("The answer is... 42!".to_utf8()) + if udp.get_available_packet_count() > 0: + print("Connected: %s" % udp.get_packet().get_string_from_utf8()) + connected = true + +Methods +------- + ++-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_connection_available` **(** **)** const | ++-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_listening` **(** **)** const | ++-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`listen` **(** :ref:`int` port, :ref:`String` bind_address="*" **)** | ++-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`stop` **(** **)** | ++-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PacketPeerUDP` | :ref:`take_connection` **(** **)** | ++-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_UDPServer_method_is_connection_available: + +- :ref:`bool` **is_connection_available** **(** **)** const + +Returns ``true`` if a packet with a new address/port combination is received on the socket. + +---- + +.. _class_UDPServer_method_is_listening: + +- :ref:`bool` **is_listening** **(** **)** const + +Returns ``true`` if the socket is open and listening on a port. + +---- + +.. _class_UDPServer_method_listen: + +- :ref:`Error` **listen** **(** :ref:`int` port, :ref:`String` bind_address="*" **)** + +Starts the server by opening a UDP socket listening on the given port. You can optionally specify a ``bind_address`` to only listen for packets sent to that address. See also :ref:`PacketPeerUDP.listen`. + +---- + +.. _class_UDPServer_method_stop: + +- void **stop** **(** **)** + +Stops the server, closing the UDP socket if open. Will not disconnect any connected :ref:`PacketPeerUDP`. + +---- + +.. _class_UDPServer_method_take_connection: + +- :ref:`PacketPeerUDP` **take_connection** **(** **)** + +Returns a :ref:`PacketPeerUDP` connected to the address/port combination of the first packet in queue. Will return ``null`` if no packet is in queue. See also :ref:`PacketPeerUDP.connect_to_host`. + diff --git a/classes/class_vector3.rst b/classes/class_vector3.rst index 081eca313..79a702c83 100644 --- a/classes/class_vector3.rst +++ b/classes/class_vector3.rst @@ -458,7 +458,7 @@ Returns the component of the vector along a plane defined by the given normal. - :ref:`Vector3` **snapped** **(** :ref:`Vector3` by **)** -Returns a copy of the vector snapped to the lowest neared multiple. +Returns the vector snapped to a grid with the given size. ---- diff --git a/classes/class_visibilityenabler2d.rst b/classes/class_visibilityenabler2d.rst index 1e8f89cc3..e6bba6f2c 100644 --- a/classes/class_visibilityenabler2d.rst +++ b/classes/class_visibilityenabler2d.rst @@ -18,7 +18,7 @@ Description The VisibilityEnabler2D will disable :ref:`RigidBody2D`, :ref:`AnimationPlayer`, and other nodes when they are not visible. It will only affect nodes with the same root node as the VisibilityEnabler2D, and the root node itself. -**Note:** VisibilityEnabler2D uses an approximate heuristic for performance reasons. If you need exact visibility checking, use another method such as adding an :ref:`Area2D` node as a child of a :ref:`Camera2D` node. +**Note:** For performance reasons, VisibilityEnabler2D uses an approximate heuristic with precision determined by :ref:`ProjectSettings.world/2d/cell_size`. If you need exact visibility checking, use another method such as adding an :ref:`Area2D` node as a child of a :ref:`Camera2D` node. **Note:** VisibilityEnabler2D will not affect nodes added after scene initialization. diff --git a/classes/class_visibilitynotifier2d.rst b/classes/class_visibilitynotifier2d.rst index d1bbf5ea8..e6b6b64f7 100644 --- a/classes/class_visibilitynotifier2d.rst +++ b/classes/class_visibilitynotifier2d.rst @@ -20,7 +20,7 @@ Description The VisibilityNotifier2D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a viewport. -**Note:** VisibilityNotifier2D uses an approximate heuristic for performance reasons. If you need exact visibility checking, use another method such as adding an :ref:`Area2D` node as a child of a :ref:`Camera2D` node. +**Note:** For performance reasons, VisibilityNotifier2D uses an approximate heuristic with precision determined by :ref:`ProjectSettings.world/2d/cell_size`. If you need exact visibility checking, use another method such as adding an :ref:`Area2D` node as a child of a :ref:`Camera2D` node. Properties ---------- diff --git a/classes/class_visualshadernodeinput.rst b/classes/class_visualshadernodeinput.rst index a51b41d26..53e3afa88 100644 --- a/classes/class_visualshadernodeinput.rst +++ b/classes/class_visualshadernodeinput.rst @@ -13,6 +13,16 @@ VisualShaderNodeInput +Description +----------- + +Gives access to input variables (built-ins) available for the shader. See the shading reference for the list of available built-ins for each shader type (check ``Tutorials`` section for link). + +Tutorials +--------- + +- :doc:`../tutorials/shading/shading_reference/index` + Properties ---------- @@ -49,6 +59,8 @@ Property Descriptions | *Getter* | get_input_name() | +-----------+-----------------------+ +One of the several input constants in lower-case style like: "vertex"(``VERTEX``) or "point_size"(``POINT_SIZE``). + Method Descriptions ------------------- diff --git a/classes/class_visualshadernodeis.rst b/classes/class_visualshadernodeis.rst index aff95b8b6..f7c0fcb18 100644 --- a/classes/class_visualshadernodeis.rst +++ b/classes/class_visualshadernodeis.rst @@ -11,7 +11,12 @@ VisualShaderNodeIs **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +A boolean comparison operator to be used within the visual shader graph. +Description +----------- + +Returns the boolean result of the comparison between ``INF`` or ``NaN`` and a scalar parameter. Properties ---------- @@ -31,9 +36,9 @@ Enumerations enum **Function**: -- **FUNC_IS_INF** = **0** +- **FUNC_IS_INF** = **0** --- Comparison with ``INF`` (Infinity). -- **FUNC_IS_NAN** = **1** +- **FUNC_IS_NAN** = **1** --- Comparison with ``NaN`` (Not a Number; denotes invalid numeric results, e.g. division by zero). Property Descriptions --------------------- @@ -50,3 +55,5 @@ Property Descriptions | *Getter* | get_function() | +-----------+---------------------+ +The comparison function. See :ref:`Function` for options. + diff --git a/classes/class_visualshadernodeouterproduct.rst b/classes/class_visualshadernodeouterproduct.rst index bdd2a2f2c..1c3ece654 100644 --- a/classes/class_visualshadernodeouterproduct.rst +++ b/classes/class_visualshadernodeouterproduct.rst @@ -11,5 +11,10 @@ VisualShaderNodeOuterProduct **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Calculates an outer product of two vectors within the visual shader graph. +Description +----------- + +``OuterProduct`` treats the first parameter ``c`` as a column vector (matrix with one column) and the second parameter ``r`` as a row vector (matrix with one row) and does a linear algebraic matrix multiply ``c * r``, yielding a matrix whose number of rows is the number of components in ``c`` and whose number of columns is the number of components in ``r``. diff --git a/classes/class_visualshadernodeoutput.rst b/classes/class_visualshadernodeoutput.rst index 024e5a10b..92cdc33a5 100644 --- a/classes/class_visualshadernodeoutput.rst +++ b/classes/class_visualshadernodeoutput.rst @@ -11,5 +11,10 @@ VisualShaderNodeOutput **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Represents the output shader parameters within the visual shader graph. +Description +----------- + +This visual shader node is present in all shader graphs in form of "Output" block with mutliple output value ports. diff --git a/classes/class_visualshadernodescalarclamp.rst b/classes/class_visualshadernodescalarclamp.rst index 7a7cb2022..c7ae41cb9 100644 --- a/classes/class_visualshadernodescalarclamp.rst +++ b/classes/class_visualshadernodescalarclamp.rst @@ -11,5 +11,10 @@ VisualShaderNodeScalarClamp **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Clamps a scalar value within the visual shader graph. +Description +----------- + +Constrains a value to lie between ``min`` and ``max`` values. diff --git a/classes/class_visualshadernodescalarderivativefunc.rst b/classes/class_visualshadernodescalarderivativefunc.rst index 79295a83f..e7edee8b9 100644 --- a/classes/class_visualshadernodescalarderivativefunc.rst +++ b/classes/class_visualshadernodescalarderivativefunc.rst @@ -11,7 +11,12 @@ VisualShaderNodeScalarDerivativeFunc **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Calculates a scalar derivative within the visual shader graph. +Description +----------- + +This node is only available in ``Fragment`` and ``Light`` visual shaders. Properties ---------- @@ -33,11 +38,11 @@ Enumerations enum **Function**: -- **FUNC_SUM** = **0** +- **FUNC_SUM** = **0** --- Sum of absolute derivative in ``x`` and ``y``. -- **FUNC_X** = **1** +- **FUNC_X** = **1** --- Derivative in ``x`` using local differencing. -- **FUNC_Y** = **2** +- **FUNC_Y** = **2** --- Derivative in ``y`` using local differencing. Property Descriptions --------------------- @@ -54,3 +59,5 @@ Property Descriptions | *Getter* | get_function() | +-----------+---------------------+ +The derivative type. See :ref:`Function` for options. + diff --git a/classes/class_visualshadernodescalarinterp.rst b/classes/class_visualshadernodescalarinterp.rst index 507ca882a..30f75151a 100644 --- a/classes/class_visualshadernodescalarinterp.rst +++ b/classes/class_visualshadernodescalarinterp.rst @@ -11,5 +11,10 @@ VisualShaderNodeScalarInterp **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Linearly interpolates between two scalars within the visual shader graph. +Description +----------- + +Translates to ``mix(a, b, weight)`` in the shader language. diff --git a/classes/class_visualshadernodescalarsmoothstep.rst b/classes/class_visualshadernodescalarsmoothstep.rst index 11a45f5e6..7ea18247a 100644 --- a/classes/class_visualshadernodescalarsmoothstep.rst +++ b/classes/class_visualshadernodescalarsmoothstep.rst @@ -11,5 +11,12 @@ VisualShaderNodeScalarSmoothStep **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Calculates a scalar SmoothStep function within the visual shader graph. +Description +----------- + +Translates to ``smoothstep(edge0, edge1, x)`` in the shader language. + +Returns ``0.0`` if ``x`` is smaller than ``edge0`` and ``1.0`` if ``x`` is larger than ``edge1``. Otherwise the return value is interpolated between ``0.0`` and ``1.0`` using Hermite polynomials. diff --git a/classes/class_visualshadernodescalarswitch.rst b/classes/class_visualshadernodescalarswitch.rst index e17fb4ed9..d469d42df 100644 --- a/classes/class_visualshadernodescalarswitch.rst +++ b/classes/class_visualshadernodescalarswitch.rst @@ -11,5 +11,10 @@ VisualShaderNodeScalarSwitch **Inherits:** :ref:`VisualShaderNodeSwitch` **<** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +A boolean/scalar function for use within the visual shader graph. +Description +----------- + +Returns an associated scalar if the provided boolean value is ``true`` or ``false``. diff --git a/classes/class_visualshadernodeswitch.rst b/classes/class_visualshadernodeswitch.rst index d38e0749a..25f9a3ba6 100644 --- a/classes/class_visualshadernodeswitch.rst +++ b/classes/class_visualshadernodeswitch.rst @@ -13,5 +13,10 @@ VisualShaderNodeSwitch **Inherited By:** :ref:`VisualShaderNodeScalarSwitch` +A boolean/vector function for use within the visual shader graph. +Description +----------- + +Returns an associated vector if the provided boolean value is ``true`` or ``false``. diff --git a/classes/class_visualshadernodetexture.rst b/classes/class_visualshadernodetexture.rst index ac489d435..7b304a326 100644 --- a/classes/class_visualshadernodetexture.rst +++ b/classes/class_visualshadernodetexture.rst @@ -11,7 +11,12 @@ VisualShaderNodeTexture **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Performs a texture lookup within the visual shader graph. +Description +----------- + +Performs a lookup operation on the provided texture, with support for multiple texture sources to choose from. Properties ---------- @@ -43,17 +48,17 @@ Enumerations enum **Source**: -- **SOURCE_TEXTURE** = **0** +- **SOURCE_TEXTURE** = **0** --- Use the texture given as an argument for this function. -- **SOURCE_SCREEN** = **1** +- **SOURCE_SCREEN** = **1** --- Use the current viewport's texture as the source. -- **SOURCE_2D_TEXTURE** = **2** +- **SOURCE_2D_TEXTURE** = **2** --- Use the texture from this shader's texture built-in (e.g. a texture of a :ref:`Sprite`). -- **SOURCE_2D_NORMAL** = **3** +- **SOURCE_2D_NORMAL** = **3** --- Use the texture from this shader's normal map built-in. -- **SOURCE_DEPTH** = **4** +- **SOURCE_DEPTH** = **4** --- Use the depth texture available for this shader. -- **SOURCE_PORT** = **5** +- **SOURCE_PORT** = **5** --- Use the texture provided in the input port for this function. ---- @@ -67,11 +72,11 @@ enum **Source**: enum **TextureType**: -- **TYPE_DATA** = **0** +- **TYPE_DATA** = **0** --- No hints are added to the uniform declaration. -- **TYPE_COLOR** = **1** +- **TYPE_COLOR** = **1** --- Adds ``hint_albedo`` as hint to the uniform declaration for proper sRGB to linear conversion. -- **TYPE_NORMALMAP** = **2** +- **TYPE_NORMALMAP** = **2** --- Adds ``hint_normal`` as hint to the uniform declaration, which internally converts the texture for proper usage as normal map. Property Descriptions --------------------- @@ -88,6 +93,8 @@ Property Descriptions | *Getter* | get_source() | +-----------+-------------------+ +Determines the source for the lookup. See :ref:`Source` for options. + ---- .. _class_VisualShaderNodeTexture_property_texture: @@ -100,6 +107,8 @@ Property Descriptions | *Getter* | get_texture() | +----------+--------------------+ +The source texture, if needed for the selected :ref:`source`. + ---- .. _class_VisualShaderNodeTexture_property_texture_type: @@ -114,3 +123,5 @@ Property Descriptions | *Getter* | get_texture_type() | +-----------+-------------------------+ +Specifies the type of the texture if :ref:`source` is set to :ref:`SOURCE_TEXTURE`. See :ref:`TextureType` for options. + diff --git a/classes/class_visualshadernodetextureuniform.rst b/classes/class_visualshadernodetextureuniform.rst index 57cdfa741..91dd87f79 100644 --- a/classes/class_visualshadernodetextureuniform.rst +++ b/classes/class_visualshadernodetextureuniform.rst @@ -13,7 +13,12 @@ VisualShaderNodeTextureUniform **Inherited By:** :ref:`VisualShaderNodeCubeMapUniform`, :ref:`VisualShaderNodeTextureUniformTriplanar` +Performs a uniform texture lookup within the visual shader graph. +Description +----------- + +Performs a lookup operation on the texture provided as a uniform for the shader. Properties ---------- @@ -39,13 +44,13 @@ Enumerations enum **TextureType**: -- **TYPE_DATA** = **0** +- **TYPE_DATA** = **0** --- No hints are added to the uniform declaration. -- **TYPE_COLOR** = **1** +- **TYPE_COLOR** = **1** --- Adds ``hint_albedo`` as hint to the uniform declaration for proper sRGB to linear conversion. -- **TYPE_NORMALMAP** = **2** +- **TYPE_NORMALMAP** = **2** --- Adds ``hint_normal`` as hint to the uniform declaration, which internally converts the texture for proper usage as normal map. -- **TYPE_ANISO** = **3** +- **TYPE_ANISO** = **3** --- Adds ``hint_aniso`` as hint to the uniform declaration to use for a flowmap. ---- @@ -57,9 +62,9 @@ enum **TextureType**: enum **ColorDefault**: -- **COLOR_DEFAULT_WHITE** = **0** +- **COLOR_DEFAULT_WHITE** = **0** --- Defaults to white color. -- **COLOR_DEFAULT_BLACK** = **1** +- **COLOR_DEFAULT_BLACK** = **1** --- Defaults to black color. Property Descriptions --------------------- @@ -76,6 +81,8 @@ Property Descriptions | *Getter* | get_color_default() | +-----------+--------------------------+ +Sets the default color if no texture is assigned to the uniform. + ---- .. _class_VisualShaderNodeTextureUniform_property_texture_type: @@ -90,3 +97,5 @@ Property Descriptions | *Getter* | get_texture_type() | +-----------+-------------------------+ +Defines the type of data provided by the source texture. See :ref:`TextureType` for options. + diff --git a/classes/class_visualshadernodetextureuniformtriplanar.rst b/classes/class_visualshadernodetextureuniformtriplanar.rst index 75693e6d7..067e45b8f 100644 --- a/classes/class_visualshadernodetextureuniformtriplanar.rst +++ b/classes/class_visualshadernodetextureuniformtriplanar.rst @@ -11,5 +11,10 @@ VisualShaderNodeTextureUniformTriplanar **Inherits:** :ref:`VisualShaderNodeTextureUniform` **<** :ref:`VisualShaderNodeUniform` **<** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Performs a uniform texture lookup with triplanar within the visual shader graph. +Description +----------- + +Performs a lookup operation on the texture provided as a uniform for the shader, with support for triplanar mapping. diff --git a/classes/class_visualshadernodetransformcompose.rst b/classes/class_visualshadernodetransformcompose.rst index 5f7cb1348..5e71b6ec2 100644 --- a/classes/class_visualshadernodetransformcompose.rst +++ b/classes/class_visualshadernodetransformcompose.rst @@ -11,5 +11,10 @@ VisualShaderNodeTransformCompose **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Composes a :ref:`Transform` from four :ref:`Vector3`\ s within the visual shader graph. +Description +----------- + +Creates a 4x4 transform matrix using four vectors of type ``vec3``. Each vector is one row in the matrix and the last column is a ``vec4(0, 0, 0, 1)``. diff --git a/classes/class_visualshadernodetransformconstant.rst b/classes/class_visualshadernodetransformconstant.rst index c5e7dcab9..11122e8fb 100644 --- a/classes/class_visualshadernodetransformconstant.rst +++ b/classes/class_visualshadernodetransformconstant.rst @@ -11,7 +11,12 @@ VisualShaderNodeTransformConstant **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +A :ref:`Transform` constant for use within the visual shader graph. +Description +----------- + +A constant :ref:`Transform`, which can be used as an input node. Properties ---------- @@ -35,3 +40,5 @@ Property Descriptions | *Getter* | get_constant() | +-----------+-----------------------------------------------------+ +A :ref:`Transform` constant which represents the state of this node. + diff --git a/classes/class_visualshadernodetransformdecompose.rst b/classes/class_visualshadernodetransformdecompose.rst index c5dc641c3..c31724d01 100644 --- a/classes/class_visualshadernodetransformdecompose.rst +++ b/classes/class_visualshadernodetransformdecompose.rst @@ -11,5 +11,10 @@ VisualShaderNodeTransformDecompose **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Decomposes a :ref:`Transform` into four :ref:`Vector3`\ s within the visual shader graph. +Description +----------- + +Takes a 4x4 transform matrix and decomposes it into four ``vec3`` values, one from each row of the matrix. diff --git a/classes/class_visualshadernodetransformfunc.rst b/classes/class_visualshadernodetransformfunc.rst index 35a7c85f6..1d627349c 100644 --- a/classes/class_visualshadernodetransformfunc.rst +++ b/classes/class_visualshadernodetransformfunc.rst @@ -11,7 +11,12 @@ VisualShaderNodeTransformFunc **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Computes a :ref:`Transform` function within the visual shader graph. +Description +----------- + +Computes an inverse or transpose function on the provided :ref:`Transform`. Properties ---------- @@ -31,9 +36,9 @@ Enumerations enum **Function**: -- **FUNC_INVERSE** = **0** +- **FUNC_INVERSE** = **0** --- Perform the inverse operation on the :ref:`Transform` matrix. -- **FUNC_TRANSPOSE** = **1** +- **FUNC_TRANSPOSE** = **1** --- Perform the transpose operation on the :ref:`Transform` matrix. Property Descriptions --------------------- @@ -50,3 +55,5 @@ Property Descriptions | *Getter* | get_function() | +-----------+---------------------+ +The function to be computed. See :ref:`Function` for options. + diff --git a/classes/class_visualshadernodetransformmult.rst b/classes/class_visualshadernodetransformmult.rst index 13b858e93..6799b1038 100644 --- a/classes/class_visualshadernodetransformmult.rst +++ b/classes/class_visualshadernodetransformmult.rst @@ -11,7 +11,12 @@ VisualShaderNodeTransformMult **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Multiplies :ref:`Transform` by :ref:`Transform` within the visual shader graph. +Description +----------- + +A multiplication operation on two transforms (4x4 matrices), with support for different multiplication operators. Properties ---------- @@ -35,13 +40,13 @@ Enumerations enum **Operator**: -- **OP_AxB** = **0** +- **OP_AxB** = **0** --- Multiplies transform ``a`` by the transform ``b``. -- **OP_BxA** = **1** +- **OP_BxA** = **1** --- Multiplies transform ``b`` by the transform ``a``. -- **OP_AxB_COMP** = **2** +- **OP_AxB_COMP** = **2** --- Performs a component-wise multiplication of transform ``a`` by the transform ``b``. -- **OP_BxA_COMP** = **3** +- **OP_BxA_COMP** = **3** --- Performs a component-wise multiplication of transform ``b`` by the transform ``a``. Property Descriptions --------------------- @@ -58,3 +63,5 @@ Property Descriptions | *Getter* | get_operator() | +-----------+---------------------+ +The multiplication type to be performed on the transforms. See :ref:`Operator` for options. + diff --git a/classes/class_visualshadernodetransformuniform.rst b/classes/class_visualshadernodetransformuniform.rst index 66e61dcc0..10791c69d 100644 --- a/classes/class_visualshadernodetransformuniform.rst +++ b/classes/class_visualshadernodetransformuniform.rst @@ -11,5 +11,10 @@ VisualShaderNodeTransformUniform **Inherits:** :ref:`VisualShaderNodeUniform` **<** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +A :ref:`Transform` uniform for use within the visual shader graph. +Description +----------- + +Translated to ``uniform mat4`` in the shader language. diff --git a/classes/class_visualshadernodetransformvecmult.rst b/classes/class_visualshadernodetransformvecmult.rst index c7ba6fd9e..9dbe07361 100644 --- a/classes/class_visualshadernodetransformvecmult.rst +++ b/classes/class_visualshadernodetransformvecmult.rst @@ -11,7 +11,12 @@ VisualShaderNodeTransformVecMult **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Multiplies a :ref:`Transform` and a :ref:`Vector3` within the visual shader graph. +Description +----------- + +A multiplication operation on a transform (4x4 matrix) and a vector, with support for different multiplication operators. Properties ---------- @@ -35,13 +40,13 @@ Enumerations enum **Operator**: -- **OP_AxB** = **0** +- **OP_AxB** = **0** --- Multiplies transform ``a`` by the vector ``b``. -- **OP_BxA** = **1** +- **OP_BxA** = **1** --- Multiplies vector ``b`` by the transform ``a``. -- **OP_3x3_AxB** = **2** +- **OP_3x3_AxB** = **2** --- Multiplies transform ``a`` by the vector ``b``, skipping the last row and column of the transform. -- **OP_3x3_BxA** = **3** +- **OP_3x3_BxA** = **3** --- Multiplies vector ``b`` by the transform ``a``, skipping the last row and column of the transform. Property Descriptions --------------------- @@ -58,3 +63,5 @@ Property Descriptions | *Getter* | get_operator() | +-----------+---------------------+ +The multiplication type to be performed. See :ref:`Operator` for options. + diff --git a/classes/class_visualshadernodeuniform.rst b/classes/class_visualshadernodeuniform.rst index f823bee9b..9a8b7e9ab 100644 --- a/classes/class_visualshadernodeuniform.rst +++ b/classes/class_visualshadernodeuniform.rst @@ -13,7 +13,12 @@ VisualShaderNodeUniform **Inherited By:** :ref:`VisualShaderNodeBooleanUniform`, :ref:`VisualShaderNodeColorUniform`, :ref:`VisualShaderNodeScalarUniform`, :ref:`VisualShaderNodeTextureUniform`, :ref:`VisualShaderNodeTransformUniform`, :ref:`VisualShaderNodeVec3Uniform` +A base type for the uniforms within the visual shader graph. +Description +----------- + +A uniform represents a variable in the shader which is set externally, i.e. from the :ref:`ShaderMaterial`. Uniforms are exposed as properties in the :ref:`ShaderMaterial` and can be assigned from the inspector or from a script. Properties ---------- @@ -37,3 +42,5 @@ Property Descriptions | *Getter* | get_uniform_name() | +-----------+-------------------------+ +Name of the uniform, by which it can be accessed through the :ref:`ShaderMaterial` properties. + diff --git a/classes/class_visualshadernodevec3constant.rst b/classes/class_visualshadernodevec3constant.rst index e59d84746..35befeef1 100644 --- a/classes/class_visualshadernodevec3constant.rst +++ b/classes/class_visualshadernodevec3constant.rst @@ -11,7 +11,12 @@ VisualShaderNodeVec3Constant **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +A :ref:`Vector3` constant to be used within the visual shader graph. +Description +----------- + +A constant :ref:`Vector3`, which can be used as an input node. Properties ---------- @@ -35,3 +40,5 @@ Property Descriptions | *Getter* | get_constant() | +-----------+------------------------+ +A :ref:`Vector3` constant which represents the state of this node. + diff --git a/classes/class_visualshadernodevec3uniform.rst b/classes/class_visualshadernodevec3uniform.rst index 10d778087..afb7b39c5 100644 --- a/classes/class_visualshadernodevec3uniform.rst +++ b/classes/class_visualshadernodevec3uniform.rst @@ -11,5 +11,10 @@ VisualShaderNodeVec3Uniform **Inherits:** :ref:`VisualShaderNodeUniform` **<** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +A :ref:`Vector3` uniform to be used within the visual shader graph. +Description +----------- + +Translated to ``uniform vec3`` in the shader language. diff --git a/classes/class_visualshadernodevectorclamp.rst b/classes/class_visualshadernodevectorclamp.rst index 63c3c34d3..80e16f329 100644 --- a/classes/class_visualshadernodevectorclamp.rst +++ b/classes/class_visualshadernodevectorclamp.rst @@ -11,5 +11,10 @@ VisualShaderNodeVectorClamp **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Clamps a vector value within the visual shader graph. +Description +----------- + +Constrains a value to lie between ``min`` and ``max`` values. The operation is performed on each component of the vector individually. diff --git a/classes/class_visualshadernodevectorcompose.rst b/classes/class_visualshadernodevectorcompose.rst index 63be6ca8f..5ae408dbd 100644 --- a/classes/class_visualshadernodevectorcompose.rst +++ b/classes/class_visualshadernodevectorcompose.rst @@ -11,5 +11,10 @@ VisualShaderNodeVectorCompose **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Composes a :ref:`Vector3` from three scalars within the visual shader graph. +Description +----------- + +Creates a ``vec3`` using three scalar values that can be provided from separate inputs. diff --git a/classes/class_visualshadernodevectordecompose.rst b/classes/class_visualshadernodevectordecompose.rst index fc0fa3a46..45651dbcc 100644 --- a/classes/class_visualshadernodevectordecompose.rst +++ b/classes/class_visualshadernodevectordecompose.rst @@ -11,5 +11,10 @@ VisualShaderNodeVectorDecompose **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Decomposes a :ref:`Vector3` into three scalars within the visual shader graph. +Description +----------- + +Takes a ``vec3`` and decomposes it into three scalar values that can be used as separate inputs. diff --git a/classes/class_visualshadernodevectorderivativefunc.rst b/classes/class_visualshadernodevectorderivativefunc.rst index 130241e6c..d4e7ef0e3 100644 --- a/classes/class_visualshadernodevectorderivativefunc.rst +++ b/classes/class_visualshadernodevectorderivativefunc.rst @@ -11,7 +11,12 @@ VisualShaderNodeVectorDerivativeFunc **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Calculates a vector derivative within the visual shader graph. +Description +----------- + +This node is only available in ``Fragment`` and ``Light`` visual shaders. Properties ---------- @@ -33,11 +38,11 @@ Enumerations enum **Function**: -- **FUNC_SUM** = **0** +- **FUNC_SUM** = **0** --- Sum of absolute derivative in ``x`` and ``y``. -- **FUNC_X** = **1** +- **FUNC_X** = **1** --- Derivative in ``x`` using local differencing. -- **FUNC_Y** = **2** +- **FUNC_Y** = **2** --- Derivative in ``y`` using local differencing. Property Descriptions --------------------- @@ -54,3 +59,5 @@ Property Descriptions | *Getter* | get_function() | +-----------+---------------------+ +A derivative type. See :ref:`Function` for options. + diff --git a/classes/class_visualshadernodevectordistance.rst b/classes/class_visualshadernodevectordistance.rst index 08402bf9f..06075a283 100644 --- a/classes/class_visualshadernodevectordistance.rst +++ b/classes/class_visualshadernodevectordistance.rst @@ -11,5 +11,12 @@ VisualShaderNodeVectorDistance **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Returns the distance between two points. To be used within the visual shader graph. +Description +----------- + +Calculates distance from point represented by vector ``p0`` to vector ``p1``. + +Translated to ``distance(p0, p1)`` in the shader language. diff --git a/classes/class_visualshadernodevectorfunc.rst b/classes/class_visualshadernodevectorfunc.rst index 7ff36c646..1d492809c 100644 --- a/classes/class_visualshadernodevectorfunc.rst +++ b/classes/class_visualshadernodevectorfunc.rst @@ -11,7 +11,12 @@ VisualShaderNodeVectorFunc **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +A vector function to be used within the visual shader graph. +Description +----------- + +A visual shader node able to perform different functions using vectors. Properties ---------- @@ -97,75 +102,75 @@ Enumerations enum **Function**: -- **FUNC_NORMALIZE** = **0** +- **FUNC_NORMALIZE** = **0** --- Normalizes the vector so that it has a length of ``1`` but points in the same direction. -- **FUNC_SATURATE** = **1** +- **FUNC_SATURATE** = **1** --- Clamps the value between ``0.0`` and ``1.0``. -- **FUNC_NEGATE** = **2** +- **FUNC_NEGATE** = **2** --- Returns the opposite value of the parameter. -- **FUNC_RECIPROCAL** = **3** +- **FUNC_RECIPROCAL** = **3** --- Returns ``1/vector``. -- **FUNC_RGB2HSV** = **4** +- **FUNC_RGB2HSV** = **4** --- Converts RGB vector to HSV equivalent. -- **FUNC_HSV2RGB** = **5** +- **FUNC_HSV2RGB** = **5** --- Converts HSV vector to RGB equivalent. -- **FUNC_ABS** = **6** +- **FUNC_ABS** = **6** --- Returns the absolute value of the parameter. -- **FUNC_ACOS** = **7** +- **FUNC_ACOS** = **7** --- Returns the arc-cosine of the parameter. -- **FUNC_ACOSH** = **8** +- **FUNC_ACOSH** = **8** --- Returns the inverse hyperbolic cosine of the parameter. -- **FUNC_ASIN** = **9** +- **FUNC_ASIN** = **9** --- Returns the arc-sine of the parameter. -- **FUNC_ASINH** = **10** +- **FUNC_ASINH** = **10** --- Returns the inverse hyperbolic sine of the parameter. -- **FUNC_ATAN** = **11** +- **FUNC_ATAN** = **11** --- Returns the arc-tangent of the parameter. -- **FUNC_ATANH** = **12** +- **FUNC_ATANH** = **12** --- Returns the inverse hyperbolic tangent of the parameter. -- **FUNC_CEIL** = **13** +- **FUNC_CEIL** = **13** --- Finds the nearest integer that is greater than or equal to the parameter. -- **FUNC_COS** = **14** +- **FUNC_COS** = **14** --- Returns the cosine of the parameter. -- **FUNC_COSH** = **15** +- **FUNC_COSH** = **15** --- Returns the hyperbolic cosine of the parameter. -- **FUNC_DEGREES** = **16** +- **FUNC_DEGREES** = **16** --- Converts a quantity in radians to degrees. -- **FUNC_EXP** = **17** +- **FUNC_EXP** = **17** --- Base-e Exponential. -- **FUNC_EXP2** = **18** +- **FUNC_EXP2** = **18** --- Base-2 Exponential. -- **FUNC_FLOOR** = **19** +- **FUNC_FLOOR** = **19** --- Finds the nearest integer less than or equal to the parameter. -- **FUNC_FRAC** = **20** +- **FUNC_FRAC** = **20** --- Computes the fractional part of the argument. -- **FUNC_INVERSE_SQRT** = **21** +- **FUNC_INVERSE_SQRT** = **21** --- Returns the inverse of the square root of the parameter. -- **FUNC_LOG** = **22** +- **FUNC_LOG** = **22** --- Natural logarithm. -- **FUNC_LOG2** = **23** +- **FUNC_LOG2** = **23** --- Base-2 logarithm. -- **FUNC_RADIANS** = **24** +- **FUNC_RADIANS** = **24** --- Converts a quantity in degrees to radians. -- **FUNC_ROUND** = **25** +- **FUNC_ROUND** = **25** --- Finds the nearest integer to the parameter. -- **FUNC_ROUNDEVEN** = **26** +- **FUNC_ROUNDEVEN** = **26** --- Finds the nearest even integer to the parameter. -- **FUNC_SIGN** = **27** +- **FUNC_SIGN** = **27** --- Extracts the sign of the parameter, i.e. returns ``-1`` if the parameter is negative, ``1`` if it's positive and ``0`` otherwise. -- **FUNC_SIN** = **28** +- **FUNC_SIN** = **28** --- Returns the sine of the parameter. -- **FUNC_SINH** = **29** +- **FUNC_SINH** = **29** --- Returns the hyperbolic sine of the parameter. -- **FUNC_SQRT** = **30** +- **FUNC_SQRT** = **30** --- Returns the square root of the parameter. -- **FUNC_TAN** = **31** +- **FUNC_TAN** = **31** --- Returns the tangent of the parameter. -- **FUNC_TANH** = **32** +- **FUNC_TANH** = **32** --- Returns the hyperbolic tangent of the parameter. -- **FUNC_TRUNC** = **33** +- **FUNC_TRUNC** = **33** --- Returns a value equal to the nearest integer to the parameter whose absolute value is not larger than the absolute value of the parameter. -- **FUNC_ONEMINUS** = **34** +- **FUNC_ONEMINUS** = **34** --- Returns ``1.0 - vector``. Property Descriptions --------------------- @@ -182,3 +187,5 @@ Property Descriptions | *Getter* | get_function() | +-----------+---------------------+ +The function to be performed. See :ref:`Function` for options. + diff --git a/classes/class_visualshadernodevectorinterp.rst b/classes/class_visualshadernodevectorinterp.rst index 5fb03ab2d..e5b809fb2 100644 --- a/classes/class_visualshadernodevectorinterp.rst +++ b/classes/class_visualshadernodevectorinterp.rst @@ -11,5 +11,10 @@ VisualShaderNodeVectorInterp **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Linearly interpolates between two vectors within the visual shader graph. +Description +----------- + +Translates to ``mix(a, b, weight)`` in the shader language, where ``weight`` is a :ref:`Vector3` with weights for each component. diff --git a/classes/class_visualshadernodevectorlen.rst b/classes/class_visualshadernodevectorlen.rst index 0c90cb363..819f4ef68 100644 --- a/classes/class_visualshadernodevectorlen.rst +++ b/classes/class_visualshadernodevectorlen.rst @@ -11,5 +11,10 @@ VisualShaderNodeVectorLen **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Returns the length of a :ref:`Vector3` within the visual shader graph. +Description +----------- + +Translated to ``length(p0)`` in the shader language. diff --git a/classes/class_visualshadernodevectorop.rst b/classes/class_visualshadernodevectorop.rst index c80e38446..cf6f17a2d 100644 --- a/classes/class_visualshadernodevectorop.rst +++ b/classes/class_visualshadernodevectorop.rst @@ -11,7 +11,12 @@ VisualShaderNodeVectorOp **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +A vector operator to be used within the visual shader graph. +Description +----------- + +A visual shader node for use of vector operators. Operates on vector ``a`` and vector ``b``. Properties ---------- @@ -51,29 +56,29 @@ Enumerations enum **Operator**: -- **OP_ADD** = **0** +- **OP_ADD** = **0** --- Adds two vectors. -- **OP_SUB** = **1** +- **OP_SUB** = **1** --- Subtracts a vector from a vector. -- **OP_MUL** = **2** +- **OP_MUL** = **2** --- Multiplies two vectors. -- **OP_DIV** = **3** +- **OP_DIV** = **3** --- Divides vector by vector. -- **OP_MOD** = **4** +- **OP_MOD** = **4** --- Returns the remainder of the two vectors. -- **OP_POW** = **5** +- **OP_POW** = **5** --- Returns the value of the first parameter raised to the power of the second, for each component of the vectors. -- **OP_MAX** = **6** +- **OP_MAX** = **6** --- Returns the greater of two values, for each component of the vectors. -- **OP_MIN** = **7** +- **OP_MIN** = **7** --- Returns the lesser of two values, for each component of the vectors. -- **OP_CROSS** = **8** +- **OP_CROSS** = **8** --- Calculates the cross product of two vectors. -- **OP_ATAN2** = **9** +- **OP_ATAN2** = **9** --- Returns the arc-tangent of the parameters. -- **OP_REFLECT** = **10** +- **OP_REFLECT** = **10** --- Returns the vector that points in the direction of reflection. ``a`` is incident vector and ``b`` is the normal vector. -- **OP_STEP** = **11** +- **OP_STEP** = **11** --- Vector step operator. Returns ``0.0`` if ``a`` is smaller than ``b`` and ``1.0`` otherwise. Property Descriptions --------------------- @@ -90,3 +95,5 @@ Property Descriptions | *Getter* | get_operator() | +-----------+---------------------+ +The operator to be used. See :ref:`Operator` for options. + diff --git a/classes/class_visualshadernodevectorrefract.rst b/classes/class_visualshadernodevectorrefract.rst index 05f8cbe40..dfe240ba7 100644 --- a/classes/class_visualshadernodevectorrefract.rst +++ b/classes/class_visualshadernodevectorrefract.rst @@ -11,5 +11,10 @@ VisualShaderNodeVectorRefract **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Returns the :ref:`Vector3` that points in the direction of refraction. For use within the visual shader graph. +Description +----------- + +Translated to ``refract(I, N, eta)`` in the shader language, where ``I`` is the incident vector, ``N`` is the normal vector and ``eta`` is the ratio of the indicies of the refraction. diff --git a/classes/class_visualshadernodevectorscalarmix.rst b/classes/class_visualshadernodevectorscalarmix.rst index 291f2202b..5b4621b1e 100644 --- a/classes/class_visualshadernodevectorscalarmix.rst +++ b/classes/class_visualshadernodevectorscalarmix.rst @@ -11,5 +11,10 @@ VisualShaderNodeVectorScalarMix **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Linearly interpolates between two vectors using a scalar. For use within the visual shader graph. +Description +----------- + +Translates to ``mix(a, b, weight)`` in the shader language, where ``a`` and ``b`` are vectors and ``weight`` is a scalar. diff --git a/classes/class_visualshadernodevectorscalarsmoothstep.rst b/classes/class_visualshadernodevectorscalarsmoothstep.rst index 3863f540f..aeae7941e 100644 --- a/classes/class_visualshadernodevectorscalarsmoothstep.rst +++ b/classes/class_visualshadernodevectorscalarsmoothstep.rst @@ -11,5 +11,12 @@ VisualShaderNodeVectorScalarSmoothStep **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Calculates a vector SmoothStep function using scalar within the visual shader graph. +Description +----------- + +Translates to ``smoothstep(edge0, edge1, x)`` in the shader language, where ``x`` is a scalar. + +Returns ``0.0`` if ``x`` is smaller than ``edge0`` and ``1.0`` if ``x`` is larger than ``edge1``. Otherwise the return value is interpolated between ``0.0`` and ``1.0`` using Hermite polynomials. diff --git a/classes/class_visualshadernodevectorscalarstep.rst b/classes/class_visualshadernodevectorscalarstep.rst index ced52f5ec..09808e41d 100644 --- a/classes/class_visualshadernodevectorscalarstep.rst +++ b/classes/class_visualshadernodevectorscalarstep.rst @@ -11,5 +11,12 @@ VisualShaderNodeVectorScalarStep **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Calculates a vector Step function within the visual shader graph. +Description +----------- + +Translates to ``step(edge, x)`` in the shader language. + +Returns ``0.0`` if ``x`` is smaller than ``edge`` and ``1.0`` otherwise. diff --git a/classes/class_visualshadernodevectorsmoothstep.rst b/classes/class_visualshadernodevectorsmoothstep.rst index 9d6e1b60b..dcf96e8ae 100644 --- a/classes/class_visualshadernodevectorsmoothstep.rst +++ b/classes/class_visualshadernodevectorsmoothstep.rst @@ -11,5 +11,12 @@ VisualShaderNodeVectorSmoothStep **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` +Calculates a vector SmoothStep function within the visual shader graph. +Description +----------- + +Translates to ``smoothstep(edge0, edge1, x)`` in the shader language, where ``x`` is a vector. + +Returns ``0.0`` if ``x`` is smaller than ``edge0`` and ``1.0`` if ``x`` is larger than ``edge1``. Otherwise the return value is interpolated between ``0.0`` and ``1.0`` using Hermite polynomials. diff --git a/classes/class_world.rst b/classes/class_world.rst index 6b8d31006..4c5f090cd 100644 --- a/classes/class_world.rst +++ b/classes/class_world.rst @@ -49,7 +49,7 @@ Property Descriptions | *Getter* | get_direct_space_state() | +----------+--------------------------+ -The World's physics direct space state, used for making various queries. Might be used only during ``_physics_process``. +Direct access to the world's physics 3D space state. Used for querying current and potential collisions. Must only be accessed from within ``_physics_process(delta)``. ---- diff --git a/classes/class_world2d.rst b/classes/class_world2d.rst index e0c51265b..408cd1209 100644 --- a/classes/class_world2d.rst +++ b/classes/class_world2d.rst @@ -57,7 +57,7 @@ The :ref:`RID` of this world's canvas resource. Used by the :ref:`Vis | *Getter* | get_direct_space_state() | +----------+--------------------------+ -The state of this world's physics space. This allows arbitrary querying for collision. +Direct access to the world's physics 2D space state. Used for querying current and potential collisions. Must only be accessed from the main thread within ``_physics_process(delta)``. ----