diff options
173 files changed, 758 insertions, 659 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 95f433607c..efd7e3dbf5 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -1266,7 +1266,7 @@ void _OS::_bind_methods() { ClassDB::bind_method(D_METHOD("get_processor_count"), &_OS::get_processor_count); ClassDB::bind_method(D_METHOD("get_executable_path"), &_OS::get_executable_path); - ClassDB::bind_method(D_METHOD("execute", "path", "arguments", "blocking", "output", "read_stderr"), &_OS::execute, DEFVAL(Array()), DEFVAL(false)); + ClassDB::bind_method(D_METHOD("execute", "path", "arguments", "blocking", "output", "read_stderr"), &_OS::execute, DEFVAL(true), DEFVAL(Array()), DEFVAL(false)); ClassDB::bind_method(D_METHOD("kill", "pid"), &_OS::kill); ClassDB::bind_method(D_METHOD("shell_open", "uri"), &_OS::shell_open); ClassDB::bind_method(D_METHOD("get_process_id"), &_OS::get_process_id); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 65f20c375e..87da51f97e 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -227,7 +227,7 @@ public: int get_low_processor_usage_mode_sleep_usec() const; String get_executable_path() const; - int execute(const String &p_path, const Vector<String> &p_arguments, bool p_blocking, Array p_output = Array(), bool p_read_stderr = false); + int execute(const String &p_path, const Vector<String> &p_arguments, bool p_blocking = true, Array p_output = Array(), bool p_read_stderr = false); Error kill(int p_pid); Error shell_open(String p_uri); diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp index 165bb9f823..380bae871a 100644 --- a/core/math/camera_matrix.cpp +++ b/core/math/camera_matrix.cpp @@ -247,7 +247,7 @@ real_t CameraMatrix::get_z_near() const { return new_plane.d; } -void CameraMatrix::get_viewport_size(real_t &r_width, real_t &r_height) const { +Vector2 CameraMatrix::get_viewport_half_extents() const { const real_t *matrix = (const real_t *)this->matrix; ///////--- Near Plane ---/////// @@ -273,8 +273,7 @@ void CameraMatrix::get_viewport_size(real_t &r_width, real_t &r_height) const { Vector3 res; near_plane.intersect_3(right_plane, top_plane, &res); - r_width = res.x; - r_height = res.y; + return Vector2(res.x, res.y); } bool CameraMatrix::get_endpoints(const Transform &p_transform, Vector3 *p_8points) const { @@ -563,9 +562,8 @@ CameraMatrix::operator String() const { real_t CameraMatrix::get_aspect() const { - real_t w, h; - get_viewport_size(w, h); - return w / h; + Vector2 vp_he = get_viewport_half_extents(); + return vp_he.x / vp_he.y; } int CameraMatrix::get_pixels_per_meter(int p_for_pixel_width) const { diff --git a/core/math/camera_matrix.h b/core/math/camera_matrix.h index 59e34c0855..2eed6d25d6 100644 --- a/core/math/camera_matrix.h +++ b/core/math/camera_matrix.h @@ -73,7 +73,7 @@ struct CameraMatrix { Vector<Plane> get_projection_planes(const Transform &p_transform) const; bool get_endpoints(const Transform &p_transform, Vector3 *p_8points) const; - void get_viewport_size(real_t &r_width, real_t &r_height) const; + Vector2 get_viewport_half_extents() const; void invert(); CameraMatrix inverse() const; diff --git a/core/object.cpp b/core/object.cpp index 21666a334c..21a3b2cc6c 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1213,9 +1213,9 @@ Error Object::emit_signal(const StringName &p_name, const Variant **p_args, int MessageQueue::get_singleton()->push_call(target->get_instance_id(), c.method, args, argc, true); } else { Variant::CallError ce; - s->lock++; + _emitting = true; target->call(c.method, args, argc, ce); - s->lock--; + _emitting = false; if (ce.error != Variant::CallError::CALL_OK) { #ifdef DEBUG_ENABLED @@ -1920,6 +1920,7 @@ Object::Object() { _instance_id = ObjectDB::add_instance(this); _can_translate = true; _is_queued_for_deletion = false; + _emitting = false; instance_binding_count = 0; memset(_script_instance_bindings, 0, sizeof(void *) * MAX_SCRIPT_INSTANCE_BINDINGS); script_instance = NULL; @@ -1942,15 +1943,15 @@ Object::~Object() { const StringName *S = NULL; + if (_emitting) { + //@todo this may need to actually reach the debugger prioritarily somehow because it may crash before + ERR_PRINTS("Object " + to_string() + " was freed or unreferenced while a signal is being emitted from it. Try connecting to the signal using 'CONNECT_DEFERRED' flag, or use queue_free() to free the object (if this object is a Node) to avoid this error and potential crashes."); + } + while ((S = signal_map.next(NULL))) { Signal *s = &signal_map[*S]; - if (s->lock > 0) { - //@todo this may need to actually reach the debugger prioritarily somehow because it may crash before - ERR_PRINTS("Object was freed or unreferenced while signal '" + String(*S) + "' is being emitted from it. Try connecting to the signal using 'CONNECT_DEFERRED' flag, or use queue_free() to free the object (if this object is a Node) to avoid this error and potential crashes."); - } - //brute force disconnect for performance int slot_count = s->slot_map.size(); const VMap<Signal::Target, Signal::Slot>::Pair *slot_list = s->slot_map.get_array(); diff --git a/core/object.h b/core/object.h index ad1865da7b..865c155764 100644 --- a/core/object.h +++ b/core/object.h @@ -465,8 +465,7 @@ private: MethodInfo user; VMap<Target, Slot> slot_map; - int lock; - Signal() { lock = 0; } + Signal() {} }; HashMap<StringName, Signal> signal_map; @@ -481,6 +480,7 @@ private: bool _predelete(); void _postinitialize(); bool _can_translate; + bool _emitting; #ifdef TOOLS_ENABLED bool _edited; uint32_t _edited_version; diff --git a/core/os/midi_driver.cpp b/core/os/midi_driver.cpp index 614ce99b2e..3e020a1585 100644 --- a/core/os/midi_driver.cpp +++ b/core/os/midi_driver.cpp @@ -52,7 +52,12 @@ void MIDIDriver::receive_input_packet(uint64_t timestamp, uint8_t *data, uint32_ uint32_t param_position = 1; if (length >= 1) { - if ((data[0] & 0x80) == 0x00) { + if (data[0] >= 0xF0) { + // channel does not apply to system common messages + event->set_channel(0); + event->set_message(data[0]); + last_received_message = data[0]; + } else if ((data[0] & 0x80) == 0x00) { // running status event->set_channel(last_received_message & 0xF); event->set_message(last_received_message >> 4); diff --git a/core/os/os.cpp b/core/os/os.cpp index 81dea159a6..1ed9484208 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -221,7 +221,7 @@ bool OS::has_virtual_keyboard() const { return false; } -void OS::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect) { +void OS::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect, int p_max_input_length) { } void OS::hide_virtual_keyboard() { diff --git a/core/os/os.h b/core/os/os.h index 714c4e3f09..89b3414b3e 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -267,7 +267,7 @@ public: virtual int get_low_processor_usage_mode_sleep_usec() const; virtual String get_executable_path() const; - virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false, Mutex *p_pipe_mutex = NULL) = 0; + virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking = true, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false, Mutex *p_pipe_mutex = NULL) = 0; virtual Error kill(const ProcessID &p_pid) = 0; virtual int get_process_id() const; virtual void vibrate_handheld(int p_duration_ms = 500); @@ -380,7 +380,7 @@ public: }; virtual bool has_virtual_keyboard() const; - virtual void show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2()); + virtual void show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2(), int p_max_input_length = -1); virtual void hide_virtual_keyboard(); // returns height of the currently shown virtual keyboard (0 if keyboard is hidden) diff --git a/doc/classes/ARVRAnchor.xml b/doc/classes/ARVRAnchor.xml index 2177ed8930..b4a9f0d9e6 100644 --- a/doc/classes/ARVRAnchor.xml +++ b/doc/classes/ARVRAnchor.xml @@ -4,7 +4,7 @@ An anchor point in AR space. </brief_description> <description> - The ARVR Anchor point is a spatial node that maps a real world location identified by the AR platform to a position within the game world. For example, as long as plane detection in ARKit is on, ARKit will identify and update the position of planes (tables, floors, etc) and create anchors for them. + The [ARVRAnchor] point is a spatial node that maps a real world location identified by the AR platform to a position within the game world. For example, as long as plane detection in ARKit is on, ARKit will identify and update the position of planes (tables, floors, etc) and create anchors for them. This node is mapped to one of the anchors through its unique ID. When you receive a signal that a new anchor is available, you should add this node to your scene for that anchor. You can predefine nodes and set the ID; the nodes will simply remain on 0,0,0 until a plane is recognized. Keep in mind that, as long as plane detection is enabled, the size, placing and orientation of an anchor will be updated as the detection logic learns more about the real world out there especially if only part of the surface is in view. </description> @@ -29,7 +29,7 @@ <return type="Mesh"> </return> <description> - If provided by the ARVR Interface, this returns a mesh object for the anchor. For an anchor, this can be a shape related to the object being tracked or it can be a mesh that provides topology related to the anchor and can be used to create shadows/reflections on surfaces or for generating collision shapes. + If provided by the [ARVRInterface], this returns a mesh object for the anchor. For an anchor, this can be a shape related to the object being tracked or it can be a mesh that provides topology related to the anchor and can be used to create shadows/reflections on surfaces or for generating collision shapes. </description> </method> <method name="get_plane" qualifiers="const"> diff --git a/doc/classes/ARVRCamera.xml b/doc/classes/ARVRCamera.xml index 1c468f193f..cffe7a238d 100644 --- a/doc/classes/ARVRCamera.xml +++ b/doc/classes/ARVRCamera.xml @@ -8,6 +8,7 @@ The position and orientation of this node is automatically updated by the ARVR Server to represent the location of the HMD if such tracking is available and can thus be used by game logic. Note that, in contrast to the ARVR Controller, the render thread has access to the most up-to-date tracking data of the HMD and the location of the ARVRCamera can lag a few milliseconds behind what is used for rendering as a result. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/ARVRController.xml b/doc/classes/ARVRController.xml index 24d8b48077..30e0afbf85 100644 --- a/doc/classes/ARVRController.xml +++ b/doc/classes/ARVRController.xml @@ -9,6 +9,7 @@ The position of the controller node is automatically updated by the [ARVRServer]. This makes this node ideal to add child nodes to visualize the controller. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link> </tutorials> <methods> <method name="get_controller_name" qualifiers="const"> diff --git a/doc/classes/ARVRInterface.xml b/doc/classes/ARVRInterface.xml index 41effcaecb..6b46a2b67d 100644 --- a/doc/classes/ARVRInterface.xml +++ b/doc/classes/ARVRInterface.xml @@ -8,6 +8,7 @@ Interfaces should be written in such a way that simply enabling them will give us a working setup. You can query the available interfaces through [ARVRServer]. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link> </tutorials> <methods> <method name="get_camera_feed_id"> @@ -120,7 +121,7 @@ We don't know the status of the tracking or this interface does not provide feedback. </constant> <constant name="ARVR_NOT_TRACKING" value="4" enum="Tracking_status"> - Tracking is not functional (camera not plugged in or obscured, lighthouses turned off, etc.) + Tracking is not functional (camera not plugged in or obscured, lighthouses turned off, etc.). </constant> </constants> </class> diff --git a/doc/classes/ARVROrigin.xml b/doc/classes/ARVROrigin.xml index b6b55741aa..4d8c643f98 100644 --- a/doc/classes/ARVROrigin.xml +++ b/doc/classes/ARVROrigin.xml @@ -10,6 +10,7 @@ For example, if your character is driving a car, the ARVROrigin node should be a child node of this car. Or, if you're implementing a teleport system to move your character, you should change the position of this node. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/ARVRPositionalTracker.xml b/doc/classes/ARVRPositionalTracker.xml index c4acfd3b51..610aafa0e8 100644 --- a/doc/classes/ARVRPositionalTracker.xml +++ b/doc/classes/ARVRPositionalTracker.xml @@ -9,6 +9,7 @@ The [ARVRController] and [ARVRAnchor] both consume objects of this type and should be used in your project. The positional trackers are just under-the-hood objects that make this all work. These are mostly exposed so that GDNative-based interfaces can interact with them. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link> </tutorials> <methods> <method name="get_hand" qualifiers="const"> diff --git a/doc/classes/ARVRServer.xml b/doc/classes/ARVRServer.xml index b71a18858f..dbf819a972 100644 --- a/doc/classes/ARVRServer.xml +++ b/doc/classes/ARVRServer.xml @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="ARVRServer" inherits="Object" category="Core" version="3.2"> <brief_description> - The AR/VR server. + Server for AR and VR features. </brief_description> <description> - The AR/VR server is the heart of our AR/VR solution and handles all the processing. + The AR/VR server is the heart of our Advanced and Virtual Reality solution and handles all the processing. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link> </tutorials> <methods> <method name="center_on_hmd"> @@ -47,14 +48,14 @@ <argument index="0" name="idx" type="int"> </argument> <description> - Gets the interface registered at a given index in our list of interfaces. + Returns the interface registered at a given index in our list of interfaces. </description> </method> <method name="get_interface_count" qualifiers="const"> <return type="int"> </return> <description> - Gets the number of interfaces currently registered with the AR/VR server. If your project supports multiple AR/VR platforms, you can look through the available interface, and either present the user with a selection or simply try to initialize each interface and use the first one that returns [code]true[/code]. + Returns the number of interfaces currently registered with the AR/VR server. If your project supports multiple AR/VR platforms, you can look through the available interface, and either present the user with a selection or simply try to initialize each interface and use the first one that returns [code]true[/code]. </description> </method> <method name="get_interfaces" qualifiers="const"> @@ -68,25 +69,28 @@ <return type="int"> </return> <description> + Returns the absolute timestamp (in μs) of the last [ARVRServer] commit of the AR/VR eyes to [VisualServer]. The value comes from an internal call to [method OS.get_ticks_usec]. </description> </method> <method name="get_last_frame_usec"> <return type="int"> </return> <description> + Returns the duration (in μs) of the last frame. This is computed as the difference between [method get_last_commit_usec] and [method get_last_process_usec] when committing. </description> </method> <method name="get_last_process_usec"> <return type="int"> </return> <description> + Returns the absolute timestamp (in μs) of the last [ARVRServer] process callback. The value comes from an internal call to [method OS.get_ticks_usec]. </description> </method> <method name="get_reference_frame" qualifiers="const"> <return type="Transform"> </return> <description> - Gets the reference frame transform. Mostly used internally and exposed for GDNative build interfaces. + Returns the reference frame transform. Mostly used internally and exposed for GDNative build interfaces. </description> </method> <method name="get_tracker" qualifiers="const"> @@ -95,19 +99,20 @@ <argument index="0" name="idx" type="int"> </argument> <description> - Gets the positional tracker at the given ID. + Returns the positional tracker at the given ID. </description> </method> <method name="get_tracker_count" qualifiers="const"> <return type="int"> </return> <description> - Gets the number of trackers currently registered. + Returns the number of trackers currently registered. </description> </method> </methods> <members> <member name="primary_interface" type="ARVRInterface" setter="set_primary_interface" getter="get_primary_interface"> + The primary [ARVRInterface] currently bound to the [ARVRServer]. </member> <member name="world_scale" type="float" setter="set_world_scale" getter="get_world_scale" default="1.0"> Allows you to adjust the scale to your game's units. Most AR/VR platforms assume a scale of 1 game world unit = 1 real world meter. diff --git a/doc/classes/AStar2D.xml b/doc/classes/AStar2D.xml index 3002e3c351..d500b99243 100644 --- a/doc/classes/AStar2D.xml +++ b/doc/classes/AStar2D.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AStar2D" inherits="Reference" category="Core" version="3.2"> <brief_description> - AStar class representation that uses 2d-vectors as edges. + AStar class representation that uses 2D vectors as edges. </brief_description> <description> This is a wrapper for the [AStar] class which uses 2D vectors instead of 3D vectors. diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml index 79ec0f0a47..c8a16921f2 100644 --- a/doc/classes/AnimationNode.xml +++ b/doc/classes/AnimationNode.xml @@ -8,6 +8,7 @@ Inherit this when creating nodes mainly for use in [AnimationNodeBlendTree], otherwise [AnimationRootNode] should be used instead. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> <method name="add_input"> @@ -16,7 +17,7 @@ <argument index="0" name="name" type="String"> </argument> <description> - Adds an input to the node. This is only useful for nodes created for use in an [AnimationNodeBlendTree] + Adds an input to the node. This is only useful for nodes created for use in an [AnimationNodeBlendTree]. </description> </method> <method name="blend_animation"> @@ -33,7 +34,7 @@ <argument index="4" name="blend" type="float"> </argument> <description> - Blend an animation by "blend" amount (name must be valid in the linked [AnimationPlayer]). A time and delta mas be passed, as well as whether seek happened. + Blend an animation by [code]blend[/code] amount (name must be valid in the linked [AnimationPlayer]). A [code]time[/code] and [code]delta[/code] may be passed, as well as whether [code]seek[/code] happened. </description> </method> <method name="blend_input"> @@ -52,7 +53,7 @@ <argument index="5" name="optimize" type="bool" default="true"> </argument> <description> - Blend an input. This is only useful for nodes created for an [AnimationNodeBlendTree]. Time is a delta, unless "seek" is [code]true[/code], in which case it is absolute. A filter mode may be optionally passed. + Blend an input. This is only useful for nodes created for an [AnimationNodeBlendTree]. The [code]time[/code] parameter is a relative delta, unless [code]seek[/code] is [code]true[/code], in which case it is absolute. A filter mode may be optionally passed (see [enum FilterAction] for options). </description> </method> <method name="blend_node"> @@ -164,10 +165,9 @@ <argument index="1" name="seek" type="bool"> </argument> <description> - Called when a custom node is processed. The argument "time" is relative, unless "seek" is [code]true[/code] (in which case it is absolute). - Here, call the [method blend_input], [method blend_node] or [method blend_animation] functions. - You can also use [method get_parameter] and [method set_parameter] to modify local memory. - This function returns the time left for the current animation to finish (if unsure, just pass the value from the main blend being called). + User-defined callback called when a custom node is processed. The [code]time[/code] parameter is a relative delta, unless [code]seek[/code] is [code]true[/code], in which case it is absolute. + Here, call the [method blend_input], [method blend_node] or [method blend_animation] functions. You can also use [method get_parameter] and [method set_parameter] to modify local memory. + This function should return the time left for the current animation to finish (if unsure, pass the value from the main blend being called). </description> </method> <method name="remove_input"> diff --git a/doc/classes/AnimationNodeAdd2.xml b/doc/classes/AnimationNodeAdd2.xml index bb7857717d..66b40b0287 100644 --- a/doc/classes/AnimationNodeAdd2.xml +++ b/doc/classes/AnimationNodeAdd2.xml @@ -7,6 +7,7 @@ A resource to add to an [AnimationNodeBlendTree]. Blends two animations additively based on an amount value in the [code][0.0, 1.0][/code] range. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/AnimationNodeAdd3.xml b/doc/classes/AnimationNodeAdd3.xml index d338c2cf9e..067eba7f42 100644 --- a/doc/classes/AnimationNodeAdd3.xml +++ b/doc/classes/AnimationNodeAdd3.xml @@ -11,6 +11,7 @@ - A +add animation to blend with when the blend amount is in the [code][0.0, 1.0][/code] range </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/AnimationNodeAnimation.xml b/doc/classes/AnimationNodeAnimation.xml index a964877068..338b75db86 100644 --- a/doc/classes/AnimationNodeAnimation.xml +++ b/doc/classes/AnimationNodeAnimation.xml @@ -7,6 +7,7 @@ A resource to add to an [AnimationNodeBlendTree]. Only features one output set using the [member animation] property. Use it as an input for [AnimationNode] that blend animations together. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/AnimationNodeBlend2.xml b/doc/classes/AnimationNodeBlend2.xml index cac97b9ee7..05ef0d57a0 100644 --- a/doc/classes/AnimationNodeBlend2.xml +++ b/doc/classes/AnimationNodeBlend2.xml @@ -7,6 +7,7 @@ A resource to add to an [AnimationNodeBlendTree]. Blends two animations linearly based on an amount value in the [code][0.0, 1.0][/code] range. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/AnimationNodeBlend3.xml b/doc/classes/AnimationNodeBlend3.xml index 3b5c1f0b99..cd2291bdb6 100644 --- a/doc/classes/AnimationNodeBlend3.xml +++ b/doc/classes/AnimationNodeBlend3.xml @@ -11,6 +11,7 @@ - A +blend animation to blend with when the blend amount is in the [code][0.0, 1.0][/code] range </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/AnimationNodeBlendSpace1D.xml b/doc/classes/AnimationNodeBlendSpace1D.xml index 82d5716ee3..987f26f94f 100644 --- a/doc/classes/AnimationNodeBlendSpace1D.xml +++ b/doc/classes/AnimationNodeBlendSpace1D.xml @@ -6,10 +6,11 @@ <description> A resource to add to an [AnimationNodeBlendTree]. This is a virtual axis on which you can add any type of [AnimationNode] using [method add_blend_point]. - Outputs the linear blend of the two [code]AnimationNode[/code] closest to the node's current [code]value[/code]. + Outputs the linear blend of the two [AnimationNode]s closest to the node's current value. You can set the extents of the axis using the [member min_space] and [member max_space]. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> <method name="add_blend_point"> @@ -22,7 +23,7 @@ <argument index="2" name="at_index" type="int" default="-1"> </argument> <description> - Adds a new point that represents a [code]node[/code] on the virtual axis at a given position set by [code]pos[/code]. You can insert it at a specific index using the [code]at_index[/code] argument. If you use the default value for [code]at_index[/code] , the point is inserted at the end of the blend points array. + Adds a new point that represents a [code]node[/code] on the virtual axis at a given position set by [code]pos[/code]. You can insert it at a specific index using the [code]at_index[/code] argument. If you use the default value for [code]at_index[/code], the point is inserted at the end of the blend points array. </description> </method> <method name="get_blend_point_count" qualifiers="const"> @@ -38,7 +39,7 @@ <argument index="0" name="point" type="int"> </argument> <description> - Returns the [code]AnimationNode[/code] referenced by the point at index [code]point[/code]. + Returns the [AnimationNode] referenced by the point at index [code]point[/code]. </description> </method> <method name="get_blend_point_position" qualifiers="const"> @@ -67,7 +68,7 @@ <argument index="1" name="node" type="AnimationRootNode"> </argument> <description> - Changes the AnimationNode referenced by the point at index [code]point[/code]. + Changes the [AnimationNode] referenced by the point at index [code]point[/code]. </description> </method> <method name="set_blend_point_position"> diff --git a/doc/classes/AnimationNodeBlendSpace2D.xml b/doc/classes/AnimationNodeBlendSpace2D.xml index d8ea7fea5b..c81e19cea8 100644 --- a/doc/classes/AnimationNodeBlendSpace2D.xml +++ b/doc/classes/AnimationNodeBlendSpace2D.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AnimationNodeBlendSpace2D" inherits="AnimationRootNode" category="Core" version="3.2"> <brief_description> - Blends linearly between three [AnimationNode] of any type placed in a 2d space. + Blends linearly between three [AnimationNode] of any type placed in a 2D space. </brief_description> <description> A resource to add to an [AnimationNodeBlendTree]. @@ -9,6 +9,7 @@ You can add vertices to the blend space with [method add_blend_point] and automatically triangulate it by setting [member auto_triangles] to [code]true[/code]. Otherwise, use [method add_triangle] and [method remove_triangle] to create up the blend space by hand. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> <method name="add_blend_point"> @@ -21,7 +22,7 @@ <argument index="2" name="at_index" type="int" default="-1"> </argument> <description> - Adds a new point that represents a [code]node[/code] at the position set by [code]pos[/code]. You can insert it at a specific index using the [code]at_index[/code] argument. If you use the default value for [code]at_index[/code] , the point is inserted at the end of the blend points array. + Adds a new point that represents a [code]node[/code] at the position set by [code]pos[/code]. You can insert it at a specific index using the [code]at_index[/code] argument. If you use the default value for [code]at_index[/code], the point is inserted at the end of the blend points array. </description> </method> <method name="add_triangle"> @@ -36,7 +37,7 @@ <argument index="3" name="at_index" type="int" default="-1"> </argument> <description> - Creates a new triangle using three points [code]x[/code], [code]y[/code], and [code]z[/code]. Triangles can overlap. You can insert the triangle at a specific index using the [code]at_index[/code] argument. If you use the default value for [code]at_index[/code] , the point is inserted at the end of the blend points array. + Creates a new triangle using three points [code]x[/code], [code]y[/code], and [code]z[/code]. Triangles can overlap. You can insert the triangle at a specific index using the [code]at_index[/code] argument. If you use the default value for [code]at_index[/code], the point is inserted at the end of the blend points array. </description> </method> <method name="get_blend_point_count" qualifiers="const"> @@ -52,7 +53,7 @@ <argument index="0" name="point" type="int"> </argument> <description> - Returns the [code]AnimationRootNode[/code] referenced by the point at index [code]point[/code]. + Returns the [AnimationRootNode] referenced by the point at index [code]point[/code]. </description> </method> <method name="get_blend_point_position" qualifiers="const"> @@ -108,7 +109,7 @@ <argument index="1" name="node" type="AnimationRootNode"> </argument> <description> - Changes the AnimationNode referenced by the point at index [code]point[/code]. + Changes the [AnimationNode] referenced by the point at index [code]point[/code]. </description> </method> <method name="set_blend_point_position"> diff --git a/doc/classes/AnimationNodeBlendTree.xml b/doc/classes/AnimationNodeBlendTree.xml index 76a0d65920..bfb244a2ea 100644 --- a/doc/classes/AnimationNodeBlendTree.xml +++ b/doc/classes/AnimationNodeBlendTree.xml @@ -5,6 +5,7 @@ <description> </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> <method name="add_node"> diff --git a/doc/classes/AnimationNodeOneShot.xml b/doc/classes/AnimationNodeOneShot.xml index 099548f60a..30680c3ae8 100644 --- a/doc/classes/AnimationNodeOneShot.xml +++ b/doc/classes/AnimationNodeOneShot.xml @@ -5,6 +5,7 @@ <description> </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> <method name="get_mix_mode" qualifiers="const"> diff --git a/doc/classes/AnimationNodeOutput.xml b/doc/classes/AnimationNodeOutput.xml index bfe28319c6..5d36354258 100644 --- a/doc/classes/AnimationNodeOutput.xml +++ b/doc/classes/AnimationNodeOutput.xml @@ -5,6 +5,7 @@ <description> </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/AnimationNodeStateMachine.xml b/doc/classes/AnimationNodeStateMachine.xml index 9a21492b8a..a15ccc4efe 100644 --- a/doc/classes/AnimationNodeStateMachine.xml +++ b/doc/classes/AnimationNodeStateMachine.xml @@ -4,7 +4,7 @@ State machine for control of animations. </brief_description> <description> - Contains multiple nodes representing animation states, connected in a graph. Node transitions can be configured to happen automatically or via code, using a shortest-path algorithm. Retrieve the AnimationNodeStateMachinePlayback object from the [AnimationTree] node to control it programmatically. + Contains multiple nodes representing animation states, connected in a graph. Node transitions can be configured to happen automatically or via code, using a shortest-path algorithm. Retrieve the [AnimationNodeStateMachinePlayback] object from the [AnimationTree] node to control it programmatically. [b]Example:[/b] [codeblock] var state_machine = $AnimationTree.get("parameters/playback") @@ -12,6 +12,7 @@ [/codeblock] </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> <method name="add_node"> @@ -159,7 +160,7 @@ <argument index="1" name="to" type="String"> </argument> <description> - Deletes the given transition. + Deletes the transition between the two specified nodes. </description> </method> <method name="remove_transition_by_index"> @@ -168,7 +169,7 @@ <argument index="0" name="idx" type="int"> </argument> <description> - Deletes the given transition. + Deletes the given transition by index. </description> </method> <method name="rename_node"> diff --git a/doc/classes/AnimationNodeStateMachinePlayback.xml b/doc/classes/AnimationNodeStateMachinePlayback.xml index 09cd369bc4..2d50b753b4 100644 --- a/doc/classes/AnimationNodeStateMachinePlayback.xml +++ b/doc/classes/AnimationNodeStateMachinePlayback.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AnimationNodeStateMachinePlayback" inherits="Resource" category="Core" version="3.2"> <brief_description> - Playback control for AnimationNodeStateMachine. + Playback control for [AnimationNodeStateMachine]. </brief_description> <description> Allows control of [AnimationTree] state machines created with [AnimationNodeStateMachine]. Retrieve with [code]$AnimationTree.get("parameters/playback")[/code]. @@ -12,6 +12,7 @@ [/codeblock] </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> <method name="get_current_node" qualifiers="const"> @@ -25,6 +26,7 @@ <return type="PoolStringArray"> </return> <description> + Returns the current travel path as computed internally by the A* algorithm. </description> </method> <method name="is_playing" qualifiers="const"> diff --git a/doc/classes/AnimationNodeStateMachineTransition.xml b/doc/classes/AnimationNodeStateMachineTransition.xml index 08ff9997cf..ad9fb95e57 100644 --- a/doc/classes/AnimationNodeStateMachineTransition.xml +++ b/doc/classes/AnimationNodeStateMachineTransition.xml @@ -5,14 +5,15 @@ <description> </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> </methods> <members> <member name="advance_condition" type="String" setter="set_advance_condition" getter="get_advance_condition" default=""""> - Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the [AnimationTree] that can be controlled from code (see [url=https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html#controlling-from-code][/url]). For example, if [member AnimationTree.tree_root] is an [AnimationNodeStateMachine] and [member advance_condition] is set to "idle": + Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the [AnimationTree] that can be controlled from code (see [url=https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html#controlling-from-code][/url]). For example, if [member AnimationTree.tree_root] is an [AnimationNodeStateMachine] and [member advance_condition] is set to [code]"idle"[/code]: [codeblock] - $animation_tree["parameters/conditions/idle"] = is_on_floor and linear_velocity.x == 0 + $animation_tree["parameters/conditions/idle"] = is_on_floor and (linear_velocity.x == 0) [/codeblock] </member> <member name="auto_advance" type="bool" setter="set_auto_advance" getter="has_auto_advance" default="false"> @@ -34,6 +35,7 @@ <signals> <signal name="advance_condition_changed"> <description> + Emitted when [member advance_condition] is changed. </description> </signal> </signals> diff --git a/doc/classes/AnimationNodeTimeScale.xml b/doc/classes/AnimationNodeTimeScale.xml index 9ce773c4e2..39716f5b8f 100644 --- a/doc/classes/AnimationNodeTimeScale.xml +++ b/doc/classes/AnimationNodeTimeScale.xml @@ -5,6 +5,7 @@ <description> </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/AnimationNodeTimeSeek.xml b/doc/classes/AnimationNodeTimeSeek.xml index d593f5489c..62b3526497 100644 --- a/doc/classes/AnimationNodeTimeSeek.xml +++ b/doc/classes/AnimationNodeTimeSeek.xml @@ -5,6 +5,7 @@ <description> </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> </methods> diff --git a/doc/classes/AnimationNodeTransition.xml b/doc/classes/AnimationNodeTransition.xml index 82839b6bab..4429283682 100644 --- a/doc/classes/AnimationNodeTransition.xml +++ b/doc/classes/AnimationNodeTransition.xml @@ -5,6 +5,7 @@ <description> </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> <method name="get_input_caption" qualifiers="const"> @@ -45,134 +46,6 @@ </method> </methods> <members> - <member name="input_0/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_0/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_1/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_1/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_10/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_10/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_11/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_11/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_12/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_12/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_13/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_13/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_14/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_14/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_15/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_15/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_16/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_16/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_17/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_17/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_18/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_18/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_19/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_19/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_2/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_2/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_20/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_20/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_21/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_21/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_22/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_22/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_23/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_23/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_24/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_24/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_25/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_25/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_26/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_26/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_27/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_27/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_28/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_28/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_29/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_29/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_3/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_3/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_30/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_30/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_31/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_31/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_4/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_4/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_5/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_5/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_6/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_6/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_7/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_7/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_8/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_8/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> - <member name="input_9/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> - </member> - <member name="input_9/name" type="String" setter="set_input_caption" getter="get_input_caption"> - </member> <member name="input_count" type="int" setter="set_enabled_inputs" getter="get_enabled_inputs" default="0"> </member> <member name="xfade_time" type="float" setter="set_cross_fade_time" getter="get_cross_fade_time" default="0.0"> diff --git a/doc/classes/AnimationTreePlayer.xml b/doc/classes/AnimationTreePlayer.xml index 0d7a34b179..1bbb605065 100644 --- a/doc/classes/AnimationTreePlayer.xml +++ b/doc/classes/AnimationTreePlayer.xml @@ -1,13 +1,14 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AnimationTreePlayer" inherits="Node" category="Core" version="3.2"> <brief_description> - Animation Player that uses a node graph for blending Animations. + Animation player that uses a node graph for blending animations. </brief_description> <description> A node graph tool for blending multiple animations bound to an [AnimationPlayer]. Especially useful for animating characters or other skeleton-based rigs. It can combine several animations to form a desired pose. It takes [Animation]s from an [AnimationPlayer] node and mixes them depending on the graph. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> <method name="add_node"> @@ -27,7 +28,7 @@ <argument index="0" name="delta" type="float"> </argument> <description> - Shifts position in the animation timeline. Delta is the time in seconds to shift. Events between the current frame and [code]delta[/code] are handled. + Shifts position in the animation timeline. [code]delta[/code] is the time in seconds to shift. Events between the current frame and [code]delta[/code] are handled. </description> </method> <method name="animation_node_get_animation" qualifiers="const"> @@ -54,6 +55,7 @@ <argument index="0" name="id" type="String"> </argument> <description> + Returns the absolute playback timestamp of the animation node with name [code]id[/code]. </description> </method> <method name="animation_node_set_animation"> @@ -122,10 +124,8 @@ </argument> <description> Sets the blend amount of a Blend2 node given its name and value. - A Blend2 Node blends two animations with the amount between 0 and 1. - At 0, Output is input a. - Towards 1, the influence of a gets lessened, the influence of b gets raised. - At 1, Output is input b. + A Blend2 node blends two animations (A and B) with the amount between 0 and 1. + At 0, output is input A. Towards 1, the influence of A gets lessened, the influence of B gets raised. At 1, output is input B. </description> </method> <method name="blend2_node_set_filter_path"> @@ -138,7 +138,7 @@ <argument index="2" name="enable" type="bool"> </argument> <description> - If [code]enable[/code] is [code]true[/code], the blend2 node with ID [code]id[/code] turns off the track modifying the property at [code]path[/code]. The modified node's children continue to animate. + If [code]enable[/code] is [code]true[/code], the Blend2 node with name [code]id[/code] turns off the track modifying the property at [code]path[/code]. The modified node's children continue to animate. </description> </method> <method name="blend3_node_get_amount" qualifiers="const"> @@ -159,12 +159,8 @@ </argument> <description> Sets the blend amount of a Blend3 node given its name and value. - A Blend3 Node blends three animations with the amount between -1 and 1. - At -1, Output is input b-. - From -1 to 0, the influence of b- gets lessened, the influence of a gets raised and the influence of b+ is 0. - At 0, Output is input a. - From 0 to 1, the influence of a gets lessened, the influence of b+ gets raised and the influence of b+ is 0. - At 1, Output is input b+. + A Blend3 Node blends three animations (A, B-, B+) with the amount between -1 and 1. + At -1, output is input B-. From -1 to 0, the influence of B- gets lessened, the influence of A gets raised and the influence of B+ is 0. At 0, output is input A. From 0 to 1, the influence of A gets lessened, the influence of B+ gets raised and the influence of B+ is 0. At 1, output is input B+. </description> </method> <method name="blend4_node_get_amount" qualifiers="const"> @@ -186,7 +182,7 @@ <description> Sets the blend amount of a Blend4 node given its name and value. A Blend4 Node blends two pairs of animations. - The two pairs are blended like blend2 and then added together. + The two pairs are blended like Blend2 and then added together. </description> </method> <method name="connect_nodes"> @@ -226,7 +222,7 @@ <argument index="0" name="id" type="String"> </argument> <description> - Returns mix amount of a Mix node given its name. + Returns the mix amount of a Mix node given its name. </description> </method> <method name="mix_node_set_amount"> @@ -237,7 +233,7 @@ <argument index="1" name="ratio" type="float"> </argument> <description> - Sets mix amount of a Mix node given its name and value. + Sets the mix amount of a Mix node given its name and value. A Mix node adds input b to input a by the amount given by ratio. </description> </method> @@ -296,7 +292,7 @@ <argument index="1" name="new_name" type="String"> </argument> <description> - Rename a node in the graph. + Renames a node in the graph. </description> </method> <method name="node_set_position"> @@ -307,7 +303,7 @@ <argument index="1" name="screen_position" type="Vector2"> </argument> <description> - Sets position of a node in the graph given its name and position. + Sets the position of a node in the graph given its name and position. </description> </method> <method name="oneshot_node_get_autorestart_delay" qualifiers="const"> @@ -316,7 +312,7 @@ <argument index="0" name="id" type="String"> </argument> <description> - Returns autostart delay of a OneShot node given its name. + Returns the autostart delay of a OneShot node given its name. </description> </method> <method name="oneshot_node_get_autorestart_random_delay" qualifiers="const"> @@ -325,7 +321,7 @@ <argument index="0" name="id" type="String"> </argument> <description> - Returns autostart random delay of a OneShot node given its name. + Returns the autostart random delay of a OneShot node given its name. </description> </method> <method name="oneshot_node_get_fadein_time" qualifiers="const"> @@ -334,7 +330,7 @@ <argument index="0" name="id" type="String"> </argument> <description> - Returns fade in time of a OneShot node given its name. + Returns the fade in time of a OneShot node given its name. </description> </method> <method name="oneshot_node_get_fadeout_time" qualifiers="const"> @@ -343,7 +339,7 @@ <argument index="0" name="id" type="String"> </argument> <description> - Returns fade out time of a OneShot node given its name. + Returns the fade out time of a OneShot node given its name. </description> </method> <method name="oneshot_node_has_autorestart" qualifiers="const"> @@ -372,7 +368,7 @@ <argument index="1" name="enable" type="bool"> </argument> <description> - Sets autorestart property of a OneShot node given its name and value. + Sets the autorestart property of a OneShot node given its name and value. </description> </method> <method name="oneshot_node_set_autorestart_delay"> @@ -383,7 +379,7 @@ <argument index="1" name="delay_sec" type="float"> </argument> <description> - Sets autorestart delay of a OneShot node given its name and value in seconds. + Sets the autorestart delay of a OneShot node given its name and value in seconds. </description> </method> <method name="oneshot_node_set_autorestart_random_delay"> @@ -394,7 +390,7 @@ <argument index="1" name="rand_sec" type="float"> </argument> <description> - Sets autorestart random delay of a OneShot node given its name and value in seconds. + Sets the autorestart random delay of a OneShot node given its name and value in seconds. </description> </method> <method name="oneshot_node_set_fadein_time"> @@ -405,7 +401,7 @@ <argument index="1" name="time_sec" type="float"> </argument> <description> - Sets fade in time of a OneShot node given its name and value in seconds. + Sets the fade in time of a OneShot node given its name and value in seconds. </description> </method> <method name="oneshot_node_set_fadeout_time"> @@ -416,7 +412,7 @@ <argument index="1" name="time_sec" type="float"> </argument> <description> - Sets fade out time of a OneShot node given its name and value in seconds. + Sets the fade out time of a OneShot node given its name and value in seconds. </description> </method> <method name="oneshot_node_set_filter_path"> @@ -429,7 +425,7 @@ <argument index="2" name="enable" type="bool"> </argument> <description> - If [code]enable[/code] is [code]true[/code], the oneshot node with ID [code]id[/code] turns off the track modifying the property at [code]path[/code]. The modified node's children continue to animate. + If [code]enable[/code] is [code]true[/code], the OneShot node with ID [code]id[/code] turns off the track modifying the property at [code]path[/code]. The modified node's children continue to animate. </description> </method> <method name="oneshot_node_start"> @@ -479,7 +475,7 @@ <argument index="0" name="id" type="String"> </argument> <description> - Returns time scale value of the TimeScale node with name [code]id[/code]. + Returns the time scale value of the TimeScale node with name [code]id[/code]. </description> </method> <method name="timescale_node_set_scale"> @@ -491,7 +487,7 @@ </argument> <description> Sets the time scale of the TimeScale node with name [code]id[/code] to [code]scale[/code]. - The timescale node is used to speed [Animation]s up if the scale is above 1 or slow them down if it is below 1. + The TimeScale node is used to speed [Animation]s up if the scale is above 1 or slow them down if it is below 1. If applied after a blend or mix, affects all input animations to that blend or mix. </description> </method> @@ -533,7 +529,7 @@ <argument index="0" name="id" type="String"> </argument> <description> - Returns the number of inputs for the transition node with name [code]id[/code]. You can add inputs by rightclicking on the transition node. + Returns the number of inputs for the transition node with name [code]id[/code]. You can add inputs by right-clicking on the transition node. </description> </method> <method name="transition_node_get_xfade_time" qualifiers="const"> @@ -553,7 +549,7 @@ <argument index="1" name="input_idx" type="int"> </argument> <description> - Returns [code]true[/code] if the input at [code]input_idx[/code] on transition node with name [code]id[/code] is set to automatically advance to the next input upon completion. + Returns [code]true[/code] if the input at [code]input_idx[/code] on the transition node with name [code]id[/code] is set to automatically advance to the next input upon completion. </description> </method> <method name="transition_node_set_current"> @@ -609,11 +605,11 @@ </member> <member name="base_path" type="NodePath" setter="set_base_path" getter="get_base_path" default="NodePath("..")"> The node from which to relatively access other nodes. - It accesses the Bones, so it should point to the same Node the AnimationPlayer would point its Root Node at. + It accesses the bones, so it should point to the same node the [AnimationPlayer] would point its Root Node at. </member> <member name="master_player" type="NodePath" setter="set_master_player" getter="get_master_player" default="NodePath("")"> The path to the [AnimationPlayer] from which this [AnimationTreePlayer] binds animations to animation nodes. - Once set, Animation nodes can be added to the AnimationTreePlayer. + Once set, [Animation] nodes can be added to the [AnimationTreePlayer]. </member> <member name="playback_process_mode" type="int" setter="set_animation_process_mode" getter="get_animation_process_mode" enum="AnimationTreePlayer.AnimationProcessMode" default="1"> The thread in which to update animations. diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml index e3e9c38419..db529e0ef5 100644 --- a/doc/classes/ArrayMesh.xml +++ b/doc/classes/ArrayMesh.xml @@ -4,7 +4,8 @@ [Mesh] type that provides utility for constructing a surface from arrays. </brief_description> <description> - The [ArrayMesh] is used to construct a [Mesh] by specifying the attributes as arrays. The most basic example is the creation of a single triangle + The [ArrayMesh] is used to construct a [Mesh] by specifying the attributes as arrays. + The most basic example is the creation of a single triangle: [codeblock] var vertices = PoolVector3Array() vertices.push_back(Vector3(0, 1, 0)) @@ -20,7 +21,7 @@ var m = MeshInstance.new() m.mesh = arr_mesh [/codeblock] - The [code]MeshInstance[/code] is ready to be added to the SceneTree to be shown. + The [MeshInstance] is ready to be added to the [SceneTree] to be shown. </description> <tutorials> <link>http://docs.godotengine.org/en/latest/tutorials/content/procedural_geometry/arraymesh.html</link> @@ -234,10 +235,10 @@ Array format will include vertices (mandatory). </constant> <constant name="ARRAY_FORMAT_NORMAL" value="2" enum="ArrayFormat"> - Array format will include normals + Array format will include normals. </constant> <constant name="ARRAY_FORMAT_TANGENT" value="4" enum="ArrayFormat"> - Array format will include tangents + Array format will include tangents. </constant> <constant name="ARRAY_FORMAT_COLOR" value="8" enum="ArrayFormat"> Array format will include a color array. diff --git a/doc/classes/AudioServer.xml b/doc/classes/AudioServer.xml index 71e78500af..9aa131a055 100644 --- a/doc/classes/AudioServer.xml +++ b/doc/classes/AudioServer.xml @@ -4,7 +4,7 @@ Server interface for low-level audio access. </brief_description> <description> - AudioServer is a low-level server interface for audio access. It is in charge of creating sample data (playable audio) as well as its playback via a voice interface. + [AudioServer] is a low-level server interface for audio access. It is in charge of creating sample data (playable audio) as well as its playback via a voice interface. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_buses.html</link> @@ -52,6 +52,7 @@ <argument index="0" name="name" type="String"> </argument> <description> + Sets which audio input device is used for audio capture. </description> </method> <method name="generate_bus_layout" qualifiers="const"> @@ -100,6 +101,7 @@ <argument index="2" name="channel" type="int" default="0"> </argument> <description> + Returns the [AudioEffectInstance] assigned to the given bus and effect indices (and optionally channel). </description> </method> <method name="get_bus_index" qualifiers="const"> @@ -192,12 +194,14 @@ <return type="float"> </return> <description> + Returns the relative time since the last mix occurred. </description> </method> <method name="get_time_to_next_mix" qualifiers="const"> <return type="float"> </return> <description> + Returns the relative time until the next mix occurs. </description> </method> <method name="is_bus_bypassing_effects" qualifiers="const"> @@ -242,7 +246,8 @@ <return type="void"> </return> <description> - Locks the audio driver's main loop. Remember to unlock it afterwards. + Locks the audio driver's main loop. + [b]Note:[/b] Remember to unlock it afterwards. </description> </method> <method name="move_bus"> @@ -411,10 +416,10 @@ A 3.1 channel surround setup was detected. </constant> <constant name="SPEAKER_SURROUND_51" value="2" enum="SpeakerMode"> - A 5.1 channel surround setup was detected. + A 5.1 channel surround setup was detected. </constant> <constant name="SPEAKER_SURROUND_71" value="3" enum="SpeakerMode"> - A 7.1 channel surround setup was detected. + A 7.1 channel surround setup was detected. </constant> </constants> </class> diff --git a/doc/classes/BitmapFont.xml b/doc/classes/BitmapFont.xml index 5b7c3def63..b10f67bec1 100644 --- a/doc/classes/BitmapFont.xml +++ b/doc/classes/BitmapFont.xml @@ -2,7 +2,7 @@ <class name="BitmapFont" inherits="Font" category="Core" version="3.2"> <brief_description> Renders text using fonts under the [url=https://www.angelcode.com/products/bmfont/]BMFont[/url] format. - Handles files with the [code].fnt[/code] extension + Handles files with the [code].fnt[/code] extension. </brief_description> <description> Renders text using [code]*.fnt[/code] fonts containing texture atlases. Supports distance fields. For using vector font files like TTF directly, see [DynamicFont]. diff --git a/doc/classes/CPUParticles.xml b/doc/classes/CPUParticles.xml index cef0ee7587..97bd673f0b 100644 --- a/doc/classes/CPUParticles.xml +++ b/doc/classes/CPUParticles.xml @@ -25,6 +25,7 @@ <argument index="0" name="param" type="int" enum="CPUParticles.Parameter"> </argument> <description> + Returns the base value of the parameter specified by [enum Parameter]. </description> </method> <method name="get_param_curve" qualifiers="const"> @@ -33,6 +34,7 @@ <argument index="0" name="param" type="int" enum="CPUParticles.Parameter"> </argument> <description> + Returns the [Curve] of the parameter specified by [enum Parameter]. </description> </method> <method name="get_param_randomness" qualifiers="const"> @@ -41,6 +43,7 @@ <argument index="0" name="param" type="int" enum="CPUParticles.Parameter"> </argument> <description> + Returns the randomness factor of the parameter specified by [enum Parameter]. </description> </method> <method name="get_particle_flag" qualifiers="const"> @@ -49,6 +52,7 @@ <argument index="0" name="flag" type="int" enum="CPUParticles.Flags"> </argument> <description> + Returns the enabled state of the given flag (see [enum Flags] for options). </description> </method> <method name="restart"> @@ -66,6 +70,7 @@ <argument index="1" name="value" type="float"> </argument> <description> + Sets the base value of the parameter specified by [enum Parameter]. </description> </method> <method name="set_param_curve"> @@ -76,6 +81,7 @@ <argument index="1" name="curve" type="Curve"> </argument> <description> + Sets the [Curve] of the parameter specified by [enum Parameter]. </description> </method> <method name="set_param_randomness"> @@ -86,6 +92,7 @@ <argument index="1" name="randomness" type="float"> </argument> <description> + Sets the randomness factor of the parameter specified by [enum Parameter]. </description> </method> <method name="set_particle_flag"> @@ -96,6 +103,7 @@ <argument index="1" name="enable" type="bool"> </argument> <description> + Enables or disables the given flag (see [enum Flags] for options). </description> </method> </methods> diff --git a/doc/classes/CPUParticles2D.xml b/doc/classes/CPUParticles2D.xml index 0a376278f8..706083e86d 100644 --- a/doc/classes/CPUParticles2D.xml +++ b/doc/classes/CPUParticles2D.xml @@ -26,6 +26,7 @@ <argument index="0" name="param" type="int" enum="CPUParticles2D.Parameter"> </argument> <description> + Returns the base value of the parameter specified by [enum Parameter]. </description> </method> <method name="get_param_curve" qualifiers="const"> @@ -34,6 +35,7 @@ <argument index="0" name="param" type="int" enum="CPUParticles2D.Parameter"> </argument> <description> + Returns the [Curve] of the parameter specified by [enum Parameter]. </description> </method> <method name="get_param_randomness" qualifiers="const"> @@ -42,6 +44,7 @@ <argument index="0" name="param" type="int" enum="CPUParticles2D.Parameter"> </argument> <description> + Returns the randomness factor of the parameter specified by [enum Parameter]. </description> </method> <method name="get_particle_flag" qualifiers="const"> @@ -50,6 +53,7 @@ <argument index="0" name="flag" type="int" enum="CPUParticles2D.Flags"> </argument> <description> + Returns the enabled state of the given flag (see [enum Flags] for options). </description> </method> <method name="restart"> @@ -67,6 +71,7 @@ <argument index="1" name="value" type="float"> </argument> <description> + Sets the base value of the parameter specified by [enum Parameter]. </description> </method> <method name="set_param_curve"> @@ -77,6 +82,7 @@ <argument index="1" name="curve" type="Curve"> </argument> <description> + Sets the [Curve] of the parameter specified by [enum Parameter]. </description> </method> <method name="set_param_randomness"> @@ -87,6 +93,7 @@ <argument index="1" name="randomness" type="float"> </argument> <description> + Sets the randomness factor of the parameter specified by [enum Parameter]. </description> </method> <method name="set_particle_flag"> @@ -97,6 +104,7 @@ <argument index="1" name="enable" type="bool"> </argument> <description> + Enables or disables the given flag (see [enum Flags] for options). </description> </method> </methods> @@ -188,8 +196,6 @@ <member name="flag_align_y" type="bool" setter="set_particle_flag" getter="get_particle_flag" default="false"> Align Y axis of particle with the direction of its velocity. </member> - <member name="flatness" type="float" setter="set_flatness" getter="get_flatness" default="0.0"> - </member> <member name="fract_delta" type="bool" setter="set_fractional_delta" getter="get_fractional_delta" default="true"> If [code]true[/code], results in fractional delta calculation which has a smoother particles display effect. </member> diff --git a/doc/classes/CameraServer.xml b/doc/classes/CameraServer.xml index 850794c1da..f01426377c 100644 --- a/doc/classes/CameraServer.xml +++ b/doc/classes/CameraServer.xml @@ -1,9 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CameraServer" inherits="Object" category="Core" version="3.2"> <brief_description> - The CameraServer keeps track of different cameras accessible in Godot. These are external cameras such as webcams or the cameras on your phone. + Server keeping track of different cameras accessible in Godot. </brief_description> <description> + The [CameraServer] keeps track of different cameras accessible in Godot. These are external cameras such as webcams or the cameras on your phone. + It is notably used to provide AR modules with a video feed from the camera. </description> <tutorials> </tutorials> @@ -55,14 +57,14 @@ <argument index="0" name="id" type="int"> </argument> <description> - Emitted when a [CameraFeed] is added (webcam is plugged in). + Emitted when a [CameraFeed] is added (e.g. webcam is plugged in). </description> </signal> <signal name="camera_feed_removed"> <argument index="0" name="id" type="int"> </argument> <description> - Emitted when a [CameraFeed] is removed (webcam is removed). + Emitted when a [CameraFeed] is removed (e.g. webcam is unplugged). </description> </signal> </signals> diff --git a/doc/classes/CameraTexture.xml b/doc/classes/CameraTexture.xml index e2bff76998..89e048662f 100644 --- a/doc/classes/CameraTexture.xml +++ b/doc/classes/CameraTexture.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CameraTexture" inherits="Texture" category="Core" version="3.2"> <brief_description> - This texture gives access to the camera texture provided by a [CameraFeed]. - [b]Note:[/b] Many cameras supply YCbCr images which need to be converted in a shader. + Texture provided by a [CameraFeed]. </brief_description> <description> + This texture gives access to the camera texture provided by a [CameraFeed]. + [b]Note:[/b] Many cameras supply YCbCr images which need to be converted in a shader. </description> <tutorials> </tutorials> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 54d917c931..5475296c74 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -4,10 +4,10 @@ Base class of anything 2D. </brief_description> <description> - Base class of anything 2D. Canvas items are laid out in a tree; children inherit and extend their parent's transform. CanvasItem is extended by [Control] for anything GUI-related, and by [Node2D] for anything related to the 2D engine. - Any CanvasItem can draw. For this, [method update] must be called, then [constant NOTIFICATION_DRAW] will be received on idle time to request redraw. Because of this, canvas items don't need to be redrawn on every frame, improving the performance significantly. Several functions for drawing on the CanvasItem are provided (see [code]draw_*[/code] functions). However, they can only be used inside the [method Object._notification], signal or [method _draw] virtual functions. - Canvas items are drawn in tree order. By default, children are on top of their parents so a root CanvasItem will be drawn behind everything. This behavior can be changed on a per-item basis. - A CanvasItem can also be hidden, which will also hide its children. It provides many ways to change parameters such as modulation (for itself and its children) and self modulation (only for itself), as well as its blend mode. + Base class of anything 2D. Canvas items are laid out in a tree; children inherit and extend their parent's transform. [CanvasItem] is extended by [Control] for anything GUI-related, and by [Node2D] for anything related to the 2D engine. + Any [CanvasItem] can draw. For this, [method update] must be called, then [constant NOTIFICATION_DRAW] will be received on idle time to request redraw. Because of this, canvas items don't need to be redrawn on every frame, improving the performance significantly. Several functions for drawing on the [CanvasItem] are provided (see [code]draw_*[/code] functions). However, they can only be used inside the [method Object._notification], signal or [method _draw] virtual functions. + Canvas items are drawn in tree order. By default, children are on top of their parents so a root [CanvasItem] will be drawn behind everything. This behavior can be changed on a per-item basis. + A [CanvasItem] can also be hidden, which will also hide its children. It provides many ways to change parameters such as modulation (for itself and its children) and self modulation (only for itself), as well as its blend mode. Ultimately, a transform notification can be requested, which will notify the node that its global position changed in case the parent tree changed. </description> <tutorials> @@ -19,7 +19,7 @@ <return type="void"> </return> <description> - Called (if exists) to draw the canvas item. + Overridable function called by the engine (if defined) to draw the canvas item. </description> </method> <method name="draw_arc"> @@ -125,6 +125,7 @@ <argument index="4" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> </argument> <description> + Draws a [Mesh] in 2D, using the provided texture. See [MeshInstance2D] for related documentation. </description> </method> <method name="draw_multiline"> @@ -167,6 +168,7 @@ <argument index="2" name="normal_map" type="Texture" default="null"> </argument> <description> + Draws a [MultiMesh] in 2D with the provided texture. See [MultiMeshInstance2D] for related documentation. </description> </method> <method name="draw_polygon"> @@ -385,70 +387,70 @@ <return type="Transform2D"> </return> <description> - Gets the transform matrix of this item's canvas. + Returns the transform matrix of this item's canvas. </description> </method> <method name="get_global_mouse_position" qualifiers="const"> <return type="Vector2"> </return> <description> - Gets the global position of the mouse. + Returns the global position of the mouse. </description> </method> <method name="get_global_transform" qualifiers="const"> <return type="Transform2D"> </return> <description> - Gets the global transform matrix of this item. + Returns the global transform matrix of this item. </description> </method> <method name="get_global_transform_with_canvas" qualifiers="const"> <return type="Transform2D"> </return> <description> - Gets the global transform matrix of this item in relation to the canvas. + Returns the global transform matrix of this item in relation to the canvas. </description> </method> <method name="get_local_mouse_position" qualifiers="const"> <return type="Vector2"> </return> <description> - Gets the mouse position relative to this item's position. + Returns the mouse position relative to this item's position. </description> </method> <method name="get_transform" qualifiers="const"> <return type="Transform2D"> </return> <description> - Gets the transform matrix of this item. + Returns the transform matrix of this item. </description> </method> <method name="get_viewport_rect" qualifiers="const"> <return type="Rect2"> </return> <description> - Gets the viewport's boundaries as a [Rect2]. + Returns the viewport's boundaries as a [Rect2]. </description> </method> <method name="get_viewport_transform" qualifiers="const"> <return type="Transform2D"> </return> <description> - Gets this item's transform in relation to the viewport. + Returns this item's transform in relation to the viewport. </description> </method> <method name="get_world_2d" qualifiers="const"> <return type="World2D"> </return> <description> - Gets the [World2D] where this item is in. + Returns the [World2D] where this item is in. </description> </method> <method name="hide"> <return type="void"> </return> <description> - Hide the CanvasItem if it's currently visible. + Hide the [CanvasItem] if it's currently visible. </description> </method> <method name="is_local_transform_notification_enabled" qualifiers="const"> @@ -528,14 +530,14 @@ <return type="void"> </return> <description> - Show the CanvasItem if it's currently hidden. For controls that inherit [Popup], the correct way to make them visible is to call one of the multiple [code]popup*()[/code] functions instead. + Show the [CanvasItem] if it's currently hidden. For controls that inherit [Popup], the correct way to make them visible is to call one of the multiple [code]popup*()[/code] functions instead. </description> </method> <method name="update"> <return type="void"> </return> <description> - Queue the CanvasItem for update. [constant NOTIFICATION_DRAW] will be called on idle time to request redraw. + Queue the [CanvasItem] for update. [constant NOTIFICATION_DRAW] will be called on idle time to request redraw. </description> </method> </methods> @@ -568,7 +570,7 @@ <signals> <signal name="draw"> <description> - Emitted when the CanvasItem must redraw. This can only be connected realtime, as deferred will not allow drawing. + Emitted when the [CanvasItem] must redraw. This can only be connected realtime, as deferred will not allow drawing. </description> </signal> <signal name="hide"> @@ -607,19 +609,19 @@ Disables blending mode. Colors including alpha are written as-is. Only applicable for render targets with a transparent background. No lighting will be applied. </constant> <constant name="NOTIFICATION_TRANSFORM_CHANGED" value="2000"> - The CanvasItem's transform has changed. This notification is only received if enabled by [method set_notify_transform] or [method set_notify_local_transform]. + The [CanvasItem]'s transform has changed. This notification is only received if enabled by [method set_notify_transform] or [method set_notify_local_transform]. </constant> <constant name="NOTIFICATION_DRAW" value="30"> - The CanvasItem is requested to draw. + The [CanvasItem] is requested to draw. </constant> <constant name="NOTIFICATION_VISIBILITY_CHANGED" value="31"> - The CanvasItem's visibility has changed. + The [CanvasItem]'s visibility has changed. </constant> <constant name="NOTIFICATION_ENTER_CANVAS" value="32"> - The CanvasItem has entered the canvas. + The [CanvasItem] has entered the canvas. </constant> <constant name="NOTIFICATION_EXIT_CANVAS" value="33"> - The CanvasItem has exited the canvas. + The [CanvasItem] has exited the canvas. </constant> </constants> </class> diff --git a/doc/classes/CanvasItemMaterial.xml b/doc/classes/CanvasItemMaterial.xml index 5963e00d9e..865876609a 100644 --- a/doc/classes/CanvasItemMaterial.xml +++ b/doc/classes/CanvasItemMaterial.xml @@ -18,12 +18,20 @@ The manner in which material reacts to lighting. </member> <member name="particles_anim_h_frames" type="int" setter="set_particles_anim_h_frames" getter="get_particles_anim_h_frames"> + The number of columns in the spritesheet assigned as [Texture] for a [Particles2D] or [CPUParticles2D]. + [b]Note:[/b] This property is only used and visible in the editor if [member particles_animation] is [code]true[/code]. </member> <member name="particles_anim_loop" type="bool" setter="set_particles_anim_loop" getter="get_particles_anim_loop"> + If [code]true[/code], the particles animation will loop. + [b]Note:[/b] This property is only used and visible in the editor if [member particles_animation] is [code]true[/code]. </member> <member name="particles_anim_v_frames" type="int" setter="set_particles_anim_v_frames" getter="get_particles_anim_v_frames"> + The number of rows in the spritesheet assigned as [Texture] for a [Particles2D] or [CPUParticles2D]. + [b]Note:[/b] This property is only used and visible in the editor if [member particles_animation] is [code]true[/code]. </member> <member name="particles_animation" type="bool" setter="set_particles_animation" getter="get_particles_animation" default="false"> + If [code]true[/code], enable spritesheet-based animation features when assigned to [Particles2D] and [CPUParticles2D] nodes. The [member ParticlesMaterial.anim_speed] or [member CPUParticles2D.anim_speed] should also be set to a positive value for the animation to play. + This property (and other [code]particles_anim_*[/code] properties that depend on it) has no effect on other types of nodes. </member> </members> <constants> diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index 7cb6b1b754..facf2d1025 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -4,16 +4,61 @@ Dictionary type. </brief_description> <description> - Dictionary type. Associative container which contains values referenced by unique keys. Dictionaries are always passed by reference. + Dictionary type. Associative container which contains values referenced by unique keys. Dictionary are composed of pairs of keys (which must be unique) and values. You can define a dictionary by placing a comma separated list of [code]key: value[/code] pairs in curly braces [code]{}[/code]. Erasing elements while iterating over them [b]is not supported[/b]. Creating a dictionary: [codeblock] - var d = {4: 5, "A key": "A value", 28: [1, 2, 3]} + var my_dir = {} # Creates an empty dictionary. + var points_dir = {"White": 50, "Yellow": 75, "Orange": 100} + var my_dir = { + key1: value1, + key2: value2, + key3: value3, + } + [/codeblock] + You can access values of a dictionary by referencing appropriate key in above example [code]points_dir["White"][/code] would return value of 50. + [codeblock] + export(String, "White", "Yellow", "Orange") var my_color + var points_dir = {"White": 50, "Yellow": 75, "Orange": 100} + + func _ready(): + var points = points_dir[my_color] + [/codeblock] + In the above code [code]points[/code] will be assigned the value that is paired with the appropriate color selected in [code]my_color[/code]. + Dictionaries can contain more complex data: + [codeblock] + my_dir = {"First Array": [1, 2, 3, 4]} # Assigns an Array to a String key. [/codeblock] To add a key to an existing dictionary, access it like an existing key and assign to it: [codeblock] - d[4] = "hello" # Add integer 4 as a key and assign the String "hello" as its value. - d["Godot"] = 3.01 # Add String "Godot" as a key and assign the value 3.01 to it. + var points_dir = {"White": 50, "Yellow": 75, "Orange": 100} + var points_dir["Blue"] = 150 # Add "Blue" as a key and assign 150 as its value. + [/codeblock] + Finally, dictionaries can contain different types of keys and values in the same dictionary: + [codeblock] + var my_dir = {"String Key": 5, 4: [1, 2, 3], 7: "Hello"} # This is a valid dictionary. + [/codeblock] + [b]Note:[/b] Unlike [Array]s you can't compare dictionaries directly: + [codeblock] + array1 = [1, 2, 3] + array2 = [1, 2, 3] + + func compare_arrays(): + print(array1 == array2) # Will print true. + + dir1 = {"a": 1, "b": 2, "c": 3} + dir2 = {"a": 1, "b": 2, "c": 3} + + func compare_dictionaries(): + print(dir1 == dir2) # Will NOT print true. + [/codeblock] + You need to first calculate the dictionary's hash with [method hash] before you can compare them: + [codeblock] + dir1 = {"a": 1, "b": 2, "c": 3} + dir2 = {"a": 1, "b": 2, "c": 3} + + func compare_dictionaries(): + print(dir1.hash() == dir2.hash()) # Will print true. [/codeblock] </description> <tutorials> diff --git a/doc/classes/EditorInspectorPlugin.xml b/doc/classes/EditorInspectorPlugin.xml index a713e06585..3d2af0545e 100644 --- a/doc/classes/EditorInspectorPlugin.xml +++ b/doc/classes/EditorInspectorPlugin.xml @@ -100,7 +100,7 @@ <argument index="5" name="usage" type="int"> </argument> <description> - Called to allow adding property specific editors to the inspector. Usually these inherit [EditorProperty] + Called to allow adding property specific editors to the inspector. Usually these inherit [EditorProperty]. </description> </method> </methods> diff --git a/doc/classes/EditorSpatialGizmoPlugin.xml b/doc/classes/EditorSpatialGizmoPlugin.xml index 777d558a8e..de497fd6af 100644 --- a/doc/classes/EditorSpatialGizmoPlugin.xml +++ b/doc/classes/EditorSpatialGizmoPlugin.xml @@ -49,7 +49,7 @@ <argument index="0" name="spatial" type="Spatial"> </argument> <description> - Override this method to return a custom [EditorSpatialGizmo] for the spatial nodes of your choice, return [code]null[/code] for the rest of nodes. (See also [method has_gizmo]) + Override this method to return a custom [EditorSpatialGizmo] for the spatial nodes of your choice, return [code]null[/code] for the rest of nodes. See also [method has_gizmo]. </description> </method> <method name="create_handle_material"> diff --git a/doc/classes/EditorVCSInterface.xml b/doc/classes/EditorVCSInterface.xml index 23d608dea8..c32dbd5e4a 100644 --- a/doc/classes/EditorVCSInterface.xml +++ b/doc/classes/EditorVCSInterface.xml @@ -51,14 +51,14 @@ <return type="String"> </return> <description> - Return the project name of the VCS working directory + Returns the project name of the VCS working directory. </description> </method> <method name="get_vcs_name"> <return type="String"> </return> <description> - Return the name of the VCS if the VCS has been initialized, else return an empty string. + Returns the name of the VCS if the VCS has been initialized, else return an empty string. </description> </method> <method name="initialize"> @@ -67,7 +67,7 @@ <argument index="0" name="project_root_path" type="String"> </argument> <description> - Initialize the VCS addon if not already. Uses the argument value as the path to the working directory of the project. Creates the initial commit if required. Returns [code]true[/code] if no failure occurs, else returns [code]false[/code]. + Initializes the VCS addon if not already. Uses the argument value as the path to the working directory of the project. Creates the initial commit if required. Returns [code]true[/code] if no failure occurs, else returns [code]false[/code]. </description> </method> <method name="is_addon_ready"> @@ -97,7 +97,7 @@ <argument index="0" name="file_path" type="String"> </argument> <description> - Stage the file which should be committed when [method EditorVCSInterface.commit] is called. Argument should contain the absolute path. + Stages the file which should be committed when [method EditorVCSInterface.commit] is called. Argument should contain the absolute path. </description> </method> <method name="unstage_file"> @@ -106,7 +106,7 @@ <argument index="0" name="file_path" type="String"> </argument> <description> - Unstage the file which was staged previously to be committed, so that it is no longer committed when [method EditorVCSInterface.commit] is called. Argument should contain the absolute path. + Unstages the file which was staged previously to be committed, so that it is no longer committed when [method EditorVCSInterface.commit] is called. Argument should contain the absolute path. </description> </method> </methods> diff --git a/doc/classes/GIProbe.xml b/doc/classes/GIProbe.xml index a9192d1942..41f4b4f962 100644 --- a/doc/classes/GIProbe.xml +++ b/doc/classes/GIProbe.xml @@ -1,8 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="GIProbe" inherits="VisualInstance" category="Core" version="3.2"> <brief_description> + Real-time global illumination (GI) probe. </brief_description> <description> + [GIProbe]s are used to provide high-quality real-time indirect light to scenes. They precompute the effect of objects that emit light and the effect of static geometry to simulate the behavior of complex light in real-time. [GIProbe]s need to be baked before using, however, once baked, dynamic objects will receive light from them. Further, lights can be fully dynamic or baked. + Having [GIProbe]s in a scene can be expensive, the quality of the probe can be turned down in exchange for better performance in the [ProjectSettings] using [member ProjectSettings.rendering/quality/voxel_cone_tracing/high_quality]. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/3d/gi_probes.html</link> @@ -16,45 +19,62 @@ <argument index="1" name="create_visual_debug" type="bool" default="false"> </argument> <description> + Bakes the effect from all [GeometryInstance]s marked with [member GeometryInstance.use_in_baked_light] and [Light]s marked with either [constant Light.BAKE_INDIRECT] or [constant Light.BAKE_ALL]. If [code]create_visual_debug[/code] is [code]true[/code], after baking the light, this will generate a [MultiMesh] that has a cube representing each solid cell with each cube colored to the cell's albedo color. This can be used to visualize the [GIProbe]'s data and debug any issues that may be occurring. </description> </method> <method name="debug_bake"> <return type="void"> </return> <description> + Calls [method bake] with [code]create_visual_debug[/code] enabled. </description> </method> </methods> <members> <member name="bias" type="float" setter="set_bias" getter="get_bias" default="1.5"> + Offsets the lookup of the light contribution from the [GIProbe]. This can be used to avoid self-shadowing, but may introduce light leaking at higher values. This and [member normal_bias] should be played around with to minimize self-shadowing and light leaking. + [b]Note:[/b] [code]bias[/code] should usually be above 1.0 as that is the size of the voxels. </member> <member name="compress" type="bool" setter="set_compress" getter="is_compressed" default="false"> + If [code]true[/code], the data for this [GIProbe] will be compressed. Compression saves space, but results in far worse visual quality. </member> <member name="data" type="GIProbeData" setter="set_probe_data" getter="get_probe_data"> + The [GIProbeData] resource that holds the data for this [GIProbe]. </member> <member name="dynamic_range" type="int" setter="set_dynamic_range" getter="get_dynamic_range" default="4"> + The maximum brightness that the [GIProbe] will recognize. Brightness will be scaled within this range. </member> <member name="energy" type="float" setter="set_energy" getter="get_energy" default="1.0"> + Energy multiplier. Makes the lighting contribution from the [GIProbe] brighter. </member> <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 10, 10, 10 )"> + The size of the area covered by the [GIProbe]. If you make the extents larger without increasing the subdivisions with [member subdiv], the size of each cell will increase and result in lower detailed lighting. </member> <member name="interior" type="bool" setter="set_interior" getter="is_interior" default="false"> + If [code]true[/code], ignores the sky contribution when calculating lighting. </member> <member name="normal_bias" type="float" setter="set_normal_bias" getter="get_normal_bias" default="0.0"> + Offsets the lookup into the [GIProbe] based on the object's normal direction. Can be used to reduce some self-shadowing artifacts. </member> <member name="propagation" type="float" setter="set_propagation" getter="get_propagation" default="0.7"> + How much light propagates through the probe internally. A higher value allows light to spread further. </member> <member name="subdiv" type="int" setter="set_subdiv" getter="get_subdiv" enum="GIProbe.Subdiv" default="1"> + Number of times to subdivide the grid that the [GIProbe] operates on. A higher number results in finer detail and thus higher visual quality, while lower numbers result in better performance. </member> </members> <constants> <constant name="SUBDIV_64" value="0" enum="Subdiv"> + Use 64 subdivisions. This is the lowest quality setting, but the fastest. Use it if you can, but especially use it on lower-end hardware. </constant> <constant name="SUBDIV_128" value="1" enum="Subdiv"> + Use 128 subdivisions. This is the default quality setting. </constant> <constant name="SUBDIV_256" value="2" enum="Subdiv"> + Use 256 subdivisions. </constant> <constant name="SUBDIV_512" value="3" enum="Subdiv"> + Use 512 subdivisions. This is the highest quality setting, but the slowest. On lower-end hardware this could cause the GPU to stall. </constant> <constant name="SUBDIV_MAX" value="4" enum="Subdiv"> Represents the size of the [enum Subdiv] enum. diff --git a/doc/classes/Geometry.xml b/doc/classes/Geometry.xml index dbc06f7c4f..a8ea3e1de3 100644 --- a/doc/classes/Geometry.xml +++ b/doc/classes/Geometry.xml @@ -115,7 +115,7 @@ <argument index="2" name="s2" type="Vector3"> </argument> <description> - Returns the 3d point on the 3d segment ([code]s1[/code], [code]s2[/code]) that is closest to [code]point[/code]. The returned point will always be inside the specified segment. + Returns the 3D point on the 3D segment ([code]s1[/code], [code]s2[/code]) that is closest to [code]point[/code]. The returned point will always be inside the specified segment. </description> </method> <method name="get_closest_point_to_segment_2d"> @@ -128,7 +128,7 @@ <argument index="2" name="s2" type="Vector2"> </argument> <description> - Returns the 2d point on the 2d segment ([code]s1[/code], [code]s2[/code]) that is closest to [code]point[/code]. The returned point will always be inside the specified segment. + Returns the 2D point on the 2D segment ([code]s1[/code], [code]s2[/code]) that is closest to [code]point[/code]. The returned point will always be inside the specified segment. </description> </method> <method name="get_closest_point_to_segment_uncapped"> @@ -141,7 +141,7 @@ <argument index="2" name="s2" type="Vector3"> </argument> <description> - Returns the 3d point on the 3d line defined by ([code]s1[/code], [code]s2[/code]) that is closest to [code]point[/code]. The returned point can be inside the segment ([code]s1[/code], [code]s2[/code]) or outside of it, i.e. somewhere on the line extending from the segment. + Returns the 3D point on the 3D line defined by ([code]s1[/code], [code]s2[/code]) that is closest to [code]point[/code]. The returned point can be inside the segment ([code]s1[/code], [code]s2[/code]) or outside of it, i.e. somewhere on the line extending from the segment. </description> </method> <method name="get_closest_point_to_segment_uncapped_2d"> @@ -154,7 +154,7 @@ <argument index="2" name="s2" type="Vector2"> </argument> <description> - Returns the 2d point on the 2d line defined by ([code]s1[/code], [code]s2[/code]) that is closest to [code]point[/code]. The returned point can be inside the segment ([code]s1[/code], [code]s2[/code]) or outside of it, i.e. somewhere on the line extending from the segment. + Returns the 2D point on the 2D line defined by ([code]s1[/code], [code]s2[/code]) that is closest to [code]point[/code]. The returned point can be inside the segment ([code]s1[/code], [code]s2[/code]) or outside of it, i.e. somewhere on the line extending from the segment. </description> </method> <method name="get_closest_points_between_segments"> @@ -169,7 +169,7 @@ <argument index="3" name="q2" type="Vector3"> </argument> <description> - Given the two 3d segments ([code]p1[/code], [code]p2[/code]) and ([code]q1[/code], [code]q2[/code]), finds those two points on the two segments that are closest to each other. Returns a [PoolVector3Array] that contains this point on ([code]p1[/code], [code]p2[/code]) as well the accompanying point on ([code]q1[/code], [code]q2[/code]). + Given the two 3D segments ([code]p1[/code], [code]p2[/code]) and ([code]q1[/code], [code]q2[/code]), finds those two points on the two segments that are closest to each other. Returns a [PoolVector3Array] that contains this point on ([code]p1[/code], [code]p2[/code]) as well the accompanying point on ([code]q1[/code], [code]q2[/code]). </description> </method> <method name="get_closest_points_between_segments_2d"> @@ -184,7 +184,7 @@ <argument index="3" name="q2" type="Vector2"> </argument> <description> - Given the two 2d segments ([code]p1[/code], [code]p2[/code]) and ([code]q1[/code], [code]q2[/code]), finds those two points on the two segments that are closest to each other. Returns a [PoolVector2Array] that contains this point on ([code]p1[/code], [code]p2[/code]) as well the accompanying point on ([code]q1[/code], [code]q2[/code]). + Given the two 2D segments ([code]p1[/code], [code]p2[/code]) and ([code]q1[/code], [code]q2[/code]), finds those two points on the two segments that are closest to each other. Returns a [PoolVector2Array] that contains this point on ([code]p1[/code], [code]p2[/code]) as well the accompanying point on ([code]q1[/code], [code]q2[/code]). </description> </method> <method name="get_uv84_normal_bit"> @@ -350,7 +350,7 @@ <argument index="4" name="c" type="Vector3"> </argument> <description> - Tests if the 3d ray starting at [code]from[/code] with the direction of [code]dir[/code] intersects the triangle specified by [code]a[/code], [code]b[/code] and [code]c[/code]. If yes, returns the point of intersection as [Vector3]. If no intersection takes place, an empty [Variant] is returned. + Tests if the 3D ray starting at [code]from[/code] with the direction of [code]dir[/code] intersects the triangle specified by [code]a[/code], [code]b[/code] and [code]c[/code]. If yes, returns the point of intersection as [Vector3]. If no intersection takes place, an empty [Variant] is returned. </description> </method> <method name="segment_intersects_circle"> @@ -365,7 +365,7 @@ <argument index="3" name="circle_radius" type="float"> </argument> <description> - Given the 2d segment ([code]segment_from[/code], [code]segment_to[/code]), returns the position on the segment (as a number between 0 and 1) at which the segment hits the circle that is located at position [code]circle_position[/code] and has radius [code]circle_radius[/code]. If the segment does not intersect the circle, -1 is returned (this is also the case if the line extending the segment would intersect the circle, but the segment does not). + Given the 2D segment ([code]segment_from[/code], [code]segment_to[/code]), returns the position on the segment (as a number between 0 and 1) at which the segment hits the circle that is located at position [code]circle_position[/code] and has radius [code]circle_radius[/code]. If the segment does not intersect the circle, -1 is returned (this is also the case if the line extending the segment would intersect the circle, but the segment does not). </description> </method> <method name="segment_intersects_convex"> diff --git a/doc/classes/GraphNode.xml b/doc/classes/GraphNode.xml index 1729d20e54..09f8b12ab7 100644 --- a/doc/classes/GraphNode.xml +++ b/doc/classes/GraphNode.xml @@ -4,8 +4,8 @@ A GraphNode is a container with potentially several input and output slots allowing connections between GraphNodes. Slots can have different, incompatible types. </brief_description> <description> - A GraphNode is a container. Each GraphNode can have several input and output slots, sometimes refered to as ports, allowing connections between GraphNodes. To add a slot to GraphNode, add any [Control]-derived child node to it. - After adding at least one child to GraphNode new sections will be automatically created in the Inspector called 'Slot'. When 'Slot' is expanded you will see list with index number for each slot. You can click on each of them to expand further. + A GraphNode is a container. Each GraphNode can have several input and output slots, sometimes refered to as ports, allowing connections between GraphNodes. To add a slot to GraphNode, add any [Control]-derived child node to it. + After adding at least one child to GraphNode new sections will be automatically created in the Inspector called 'Slot'. When 'Slot' is expanded you will see list with index number for each slot. You can click on each of them to expand further. In the Inspector you can enable (show) or disable (hide) slots. By default all slots are disabled so you may not see any slots on your GraphNode initially. You can assign a type to each slot. Only slots of the same type will be able to connect to each other. You can also assign colors to slots. A tuple of input and output slots is defined for each GUI element included in the GraphNode. Input connections are on the left and output connections are on the right side of GraphNode. Only enabled slots are counted as connections. </description> <tutorials> diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml index 3a63b2dc07..ad0db3205a 100644 --- a/doc/classes/HTTPClient.xml +++ b/doc/classes/HTTPClient.xml @@ -100,7 +100,7 @@ <return type="int" enum="Error"> </return> <description> - This needs to be called in order to have any request processed. Check results with [method get_status] + This needs to be called in order to have any request processed. Check results with [method get_status]. </description> </method> <method name="query_string_from_dict"> diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index 748ed504c3..c61e17dd1c 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -170,7 +170,7 @@ Request exceeded its maximum size limit, see [member body_size_limit]. </constant> <constant name="RESULT_REQUEST_FAILED" value="8" enum="Result"> - Request failed. (Unused) + Request failed (currently unused). </constant> <constant name="RESULT_DOWNLOAD_FILE_CANT_OPEN" value="9" enum="Result"> HTTPRequest couldn't open the download file. diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index 3f94ad2d2c..b827c5a49b 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Input" inherits="Object" category="Core" version="3.2"> <brief_description> - A Singleton that deals with inputs. + A singleton that deals with inputs. </brief_description> <description> - A Singleton that deals with inputs. This includes key presses, mouse buttons and movement, joypads, and input actions. Actions and their events can be set in the [b]Input Map[/b] tab in the [b]Project > Project Settings[/b], or with the [InputMap] class. + A singleton that deals with inputs. This includes key presses, mouse buttons and movement, joypads, and input actions. Actions and their events can be set in the [b]Input Map[/b] tab in the [b]Project > Project Settings[/b], or with the [InputMap] class. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/inputs/index.html</link> diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml index ccb5c5400a..8ca9006564 100644 --- a/doc/classes/InputEvent.xml +++ b/doc/classes/InputEvent.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="InputEvent" inherits="Resource" category="Core" version="3.2"> <brief_description> - Generic input event + Generic input event. </brief_description> <description> Base class of all sort of input event. See [method Node._input]. diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index 7282d635b1..8463db9cd5 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -4,7 +4,8 @@ Control that provides single-line string editing. </brief_description> <description> - LineEdit provides a single-line string editor, used for text fields. It features many built-in shortcuts which will always be available: (the Ctrl here maps to Command on macOS) + LineEdit provides a single-line string editor, used for text fields. + It features many built-in shortcuts which will always be available ([code]Ctrl[/code] here maps to [code]Command[/code] on macOS): - Ctrl + C: Copy - Ctrl + X: Cut - Ctrl + V or Ctrl + Y: Paste/"yank" diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml index 642b94a047..1184cf2370 100644 --- a/doc/classes/MenuButton.xml +++ b/doc/classes/MenuButton.xml @@ -4,8 +4,8 @@ Special button that brings up a [PopupMenu] when clicked. </brief_description> <description> - Special button that brings up a [PopupMenu] when clicked. - New items can be created inside this [PopupMenu] using [code]get_popup().add_item("My Item Name")[/code]. You can also create them directly from the editor. To do so, select the MenuButton node, then in the toolbar at the top of the 2D editor, click [b]Items[/b] then click [b]Add[/b] in the popup. You will be able to give each items new properties. + Special button that brings up a [PopupMenu] when clicked. + New items can be created inside this [PopupMenu] using [code]get_popup().add_item("My Item Name")[/code]. You can also create them directly from the editor. To do so, select the [MenuButton] node, then in the toolbar at the top of the 2D editor, click [b]Items[/b] then click [b]Add[/b] in the popup. You will be able to give each items new properties. </description> <tutorials> </tutorials> @@ -23,6 +23,7 @@ <argument index="0" name="disabled" type="bool"> </argument> <description> + If [code]true[/code], shortcuts are disabled and cannot be used to trigger the button. </description> </method> </methods> @@ -32,7 +33,7 @@ <member name="flat" type="bool" setter="set_flat" getter="is_flat" override="true" default="true" /> <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="0" /> <member name="switch_on_hover" type="bool" setter="set_switch_on_hover" getter="is_switch_on_hover" default="false"> - If [code]true[/code], when the cursor hovers above another MenuButton within the same parent which also has [code]switch_on_hover[/code] enabled, it will close the current MenuButton and open the other one. + If [code]true[/code], when the cursor hovers above another [MenuButton] within the same parent which also has [code]switch_on_hover[/code] enabled, it will close the current [MenuButton] and open the other one. </member> <member name="toggle_mode" type="bool" setter="set_toggle_mode" getter="is_toggle_mode" override="true" default="true" /> </members> diff --git a/doc/classes/MeshInstance2D.xml b/doc/classes/MeshInstance2D.xml index 7f1466ccf6..467652a4cc 100644 --- a/doc/classes/MeshInstance2D.xml +++ b/doc/classes/MeshInstance2D.xml @@ -4,7 +4,7 @@ Node used for displaying a [Mesh] in 2D. </brief_description> <description> - Node used for displaying a [Mesh] in 2D. Can be constructed from an existing [Sprite] use tool in Toolbar. Select "Sprite" then "Convert to Mesh2D", select settings in popup and press "Create Mesh2D". + Node used for displaying a [Mesh] in 2D. Can be constructed from an existing [Sprite] via a tool in the editor toolbar. Select "Sprite" then "Convert to Mesh2D", select settings in popup and press "Create Mesh2D". </description> <tutorials> <link>http://docs.godotengine.org/en/latest/tutorials/2d/2d_meshes.html</link> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index e3f1165c55..f86bac943d 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -33,7 +33,7 @@ </return> <description> Called when the node is about to leave the [SceneTree] (e.g. upon freeing, scene changing, or after calling [method remove_child] in a script). If the node has children, its [method _exit_tree] callback will be called last, after all its children have left the tree. - Corresponds to the [constant NOTIFICATION_EXIT_TREE] notification in [method Object._notification] and signal [signal tree_exiting]. To get notified when the node has already left the active tree, connect to the [signal tree_exited] + Corresponds to the [constant NOTIFICATION_EXIT_TREE] notification in [method Object._notification] and signal [signal tree_exiting]. To get notified when the node has already left the active tree, connect to the [signal tree_exited]. </description> </method> <method name="_get_configuration_warning" qualifiers="virtual"> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 2c44a3dfb0..a37fb28901 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -95,7 +95,7 @@ </argument> <argument index="1" name="arguments" type="PoolStringArray"> </argument> - <argument index="2" name="blocking" type="bool"> + <argument index="2" name="blocking" type="bool" default="true"> </argument> <argument index="3" name="output" type="Array" default="[ ]"> </argument> diff --git a/doc/classes/PhysicsServer.xml b/doc/classes/PhysicsServer.xml index d7eb4c8c4f..9d688e2b53 100644 --- a/doc/classes/PhysicsServer.xml +++ b/doc/classes/PhysicsServer.xml @@ -1315,7 +1315,7 @@ If [code]true[/code], the Hinge has a maximum and a minimum rotation. </constant> <constant name="HINGE_JOINT_FLAG_ENABLE_MOTOR" value="1" enum="HingeJointFlag"> - If [code]true[/code], a motor turns the Hinge + If [code]true[/code], a motor turns the Hinge. </constant> <constant name="SLIDER_JOINT_LINEAR_LIMIT_UPPER" value="0" enum="SliderJointParam"> The maximum difference between the pivot points on their X axis before damping happens. diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 221214409f..8d3cfad5d9 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -386,6 +386,16 @@ <member name="debug/settings/visual_script/max_call_stack" type="int" setter="" getter="" default="1024"> Maximum call stack in visual scripting, to avoid infinite recursion. </member> + <member name="debug/shapes/collision/contact_color" type="Color" setter="" getter="" default="Color( 1, 0.2, 0.1, 0.8 )"> + </member> + <member name="debug/shapes/collision/max_contacts_displayed" type="int" setter="" getter="" default="10000"> + </member> + <member name="debug/shapes/collision/shape_color" type="Color" setter="" getter="" default="Color( 0, 0.6, 0.7, 0.5 )"> + </member> + <member name="debug/shapes/navigation/disabled_geometry_color" type="Color" setter="" getter="" default="Color( 1, 0.7, 0.1, 0.4 )"> + </member> + <member name="debug/shapes/navigation/geometry_color" type="Color" setter="" getter="" default="Color( 0.1, 1, 0.7, 0.4 )"> + </member> <member name="display/mouse_cursor/custom_image" type="String" setter="" getter="" default=""""> Custom image for the mouse cursor (limited to 256×256). </member> @@ -468,31 +478,33 @@ <member name="gui/timers/text_edit_idle_detect_sec" type="float" setter="" getter="" default="3"> Timer for detecting idle in the editor (in seconds). </member> - <member name="input/ui_accept" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"unicode":0,"echo":false,"script":null), Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777222,"unicode":0,"echo":false,"script":null), Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null) ]}"> + <member name="gui/timers/tooltip_delay_sec" type="float" setter="" getter="" default="0.5"> + </member> + <member name="input/ui_accept" type="Dictionary" setter="" getter=""> </member> - <member name="input/ui_cancel" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":1,"pressure":0.0,"pressed":false,"script":null) ]}"> + <member name="input/ui_cancel" type="Dictionary" setter="" getter=""> </member> - <member name="input/ui_down" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null) ]}"> + <member name="input/ui_down" type="Dictionary" setter="" getter=""> </member> - <member name="input/ui_end" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777230,"unicode":0,"echo":false,"script":null) ]}"> + <member name="input/ui_end" type="Dictionary" setter="" getter=""> </member> - <member name="input/ui_focus_next" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"unicode":0,"echo":false,"script":null) ]}"> + <member name="input/ui_focus_next" type="Dictionary" setter="" getter=""> </member> - <member name="input/ui_focus_prev" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":true,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"unicode":0,"echo":false,"script":null) ]}"> + <member name="input/ui_focus_prev" type="Dictionary" setter="" getter=""> </member> - <member name="input/ui_home" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777229,"unicode":0,"echo":false,"script":null) ]}"> + <member name="input/ui_home" type="Dictionary" setter="" getter=""> </member> - <member name="input/ui_left" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null) ]}"> + <member name="input/ui_left" type="Dictionary" setter="" getter=""> </member> - <member name="input/ui_page_down" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777236,"unicode":0,"echo":false,"script":null) ]}"> + <member name="input/ui_page_down" type="Dictionary" setter="" getter=""> </member> - <member name="input/ui_page_up" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777235,"unicode":0,"echo":false,"script":null) ]}"> + <member name="input/ui_page_up" type="Dictionary" setter="" getter=""> </member> - <member name="input/ui_right" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null) ]}"> + <member name="input/ui_right" type="Dictionary" setter="" getter=""> </member> - <member name="input/ui_select" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":3,"pressure":0.0,"pressed":false,"script":null) ]}"> + <member name="input/ui_select" type="Dictionary" setter="" getter=""> </member> - <member name="input/ui_up" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null) ]}"> + <member name="input/ui_up" type="Dictionary" setter="" getter=""> </member> <member name="input_devices/pointing/emulate_mouse_from_touch" type="bool" setter="" getter="" default="true"> If [code]true[/code], sends mouse input events when tapping or swiping on the touchscreen. @@ -730,20 +742,46 @@ <member name="node/name_num_separator" type="int" setter="" getter="" default="0"> What to use to separate node name from number. This is mostly an editor setting. </member> + <member name="physics/2d/bp_hash_table_size" type="int" setter="" getter="" default="4096"> + </member> + <member name="physics/2d/cell_size" type="int" setter="" getter="" default="128"> + </member> + <member name="physics/2d/default_angular_damp" type="float" setter="" getter="" default="1.0"> + </member> <member name="physics/2d/default_gravity" type="int" setter="" getter="" default="98"> </member> + <member name="physics/2d/default_gravity_vector" type="Vector2" setter="" getter="" default="Vector2( 0, 1 )"> + </member> + <member name="physics/2d/default_linear_damp" type="float" setter="" getter="" default="0.1"> + </member> + <member name="physics/2d/large_object_surface_threshold_in_cells" type="int" setter="" getter="" default="512"> + </member> <member name="physics/2d/physics_engine" type="String" setter="" getter="" default=""DEFAULT""> </member> + <member name="physics/2d/sleep_threshold_angular" type="float" setter="" getter="" default="0.139626"> + </member> + <member name="physics/2d/sleep_threshold_linear" type="float" setter="" getter="" default="2.0"> + </member> <member name="physics/2d/thread_model" type="int" setter="" getter="" default="1"> Sets whether physics is run on the main thread or a separate one. Running the server on a thread increases performance, but restricts API access to only physics process. </member> + <member name="physics/2d/time_before_sleep" type="float" setter="" getter="" default="0.5"> + </member> <member name="physics/3d/active_soft_world" type="bool" setter="" getter="" default="true"> </member> + <member name="physics/3d/default_angular_damp" type="float" setter="" getter="" default="0.1"> + </member> <member name="physics/3d/default_gravity" type="float" setter="" getter="" default="9.8"> </member> + <member name="physics/3d/default_gravity_vector" type="Vector3" setter="" getter="" default="Vector3( 0, -1, 0 )"> + </member> + <member name="physics/3d/default_linear_damp" type="float" setter="" getter="" default="0.1"> + </member> <member name="physics/3d/physics_engine" type="String" setter="" getter="" default=""DEFAULT""> Sets which physics engine to use. </member> + <member name="physics/common/enable_object_picking" type="bool" setter="" getter="" default="true"> + </member> <member name="physics/common/physics_fps" type="int" setter="" getter="" default="60"> Frames per second used in the physics. Physics always needs a fixed amount of frames per second. </member> @@ -753,6 +791,9 @@ <member name="rendering/environment/default_clear_color" type="Color" setter="" getter="" default="Color( 0.3, 0.3, 0.3, 1 )"> Default background clear color. Overridable per [Viewport] using its [Environment]. See [member Environment.background_mode] and [member Environment.background_color] in particular. To change this default color programmatically, use [method VisualServer.set_default_clear_color]. </member> + <member name="rendering/environment/default_environment" type="String" setter="" getter="" default=""""> + [Environment] that will be used as a fallback environment in case a scene does not specify its own environment. The default environment is loaded in at scene load time regardless of whether you have set an environment or not. If you do not rely on the fallback environment, it is best to delete [code]default_env.tres[/code], or to specify a different default environment here. + </member> <member name="rendering/limits/buffers/blend_shape_max_buffer_size_kb" type="int" setter="" getter="" default="4096"> Max buffer size for blend shapes. Any blend shape bigger than this will not work. </member> @@ -784,6 +825,12 @@ <member name="rendering/quality/2d/use_pixel_snap" type="bool" setter="" getter="" default="false"> If [code]true[/code], forces snapping of polygons to pixels in 2D rendering. May help in some pixel art styles. </member> + <member name="rendering/quality/depth/hdr" type="bool" setter="" getter="" default="true"> + If [code]true[/code], allocates the main framebuffer with high dynamic range. High dynamic range allows the use of [Color] values greater than 1. + [b]Note:[/b] Only available on the GLES3 backend. + </member> + <member name="rendering/quality/depth/hdr.mobile" type="bool" setter="" getter="" default="false"> + </member> <member name="rendering/quality/depth_prepass/disable_for_vendors" type="String" setter="" getter="" default=""PowerVR,Mali,Adreno,Apple""> Disables depth pre-pass for some GPU vendors (usually mobile), as their architecture already does this. </member> @@ -806,13 +853,24 @@ <member name="rendering/quality/filters/anisotropic_filter_level" type="int" setter="" getter="" default="4"> Maximum anisotropic filter level used for textures with anisotropy enabled. Higher values will result in sharper textures when viewed from oblique angles, at the cost of performance. Only power-of-two values are valid (2, 4, 8, 16). </member> + <member name="rendering/quality/filters/msaa" type="int" setter="" getter="" default="0"> + Sets the number of MSAA samples to use. MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware. + [b]Note:[/b] MSAA is not available on HTML5 export using the GLES2 backend. + </member> <member name="rendering/quality/filters/use_nearest_mipmap_filter" type="bool" setter="" getter="" default="false"> If [code]true[/code], uses nearest-neighbor mipmap filtering when using mipmaps (also called "bilinear filtering"), which will result in visible seams appearing between mipmap stages. This may increase performance in mobile as less memory bandwidth is used. If [code]false[/code], linear mipmap filtering (also called "trilinear filtering") is used. </member> <member name="rendering/quality/intended_usage/framebuffer_allocation" type="int" setter="" getter="" default="2"> - Strategy used for framebuffer allocation. The simpler it is, the less resources it uses (but the less features it supports). + Strategy used for framebuffer allocation. The simpler it is, the less resources it uses (but the less features it supports). If set to "2D Without Sampling" or "3D Without Effects", sample buffers will not be allocated. This means [code]SCREEN_TEXTURE[/code] and [code]DEPTH_TEXTURE[/code] will not be available in shaders and post-processing effects will not be available in the [Environment]. </member> <member name="rendering/quality/intended_usage/framebuffer_allocation.mobile" type="int" setter="" getter="" default="3"> + Same as [member rendering/quality/intended_usage/framebuffer_allocation] but for mobile defaults to "3D Without Effects". If effects are desired, set to "3D". + </member> + <member name="rendering/quality/reflections/atlas_size" type="int" setter="" getter="" default="2048"> + Size of the atlas used by reflection probes. A larger size can result in higher visual quality, while a smaller size will be faster and take up less memory. + </member> + <member name="rendering/quality/reflections/atlas_subdiv" type="int" setter="" getter="" default="8"> + Number of subdivisions to use for the reflection atlas. A higher number lowers the quality of each atlas, but allows you to use more. </member> <member name="rendering/quality/reflections/high_quality_ggx" type="bool" setter="" getter="" default="true"> If [code]true[/code], uses a high amount of samples to create blurred variants of reflection probes and panorama backgrounds (sky). Those blurred variants are used by rough materials. @@ -893,8 +951,6 @@ <member name="rendering/vram_compression/import_s3tc" type="bool" setter="" getter="" default="true"> If [code]true[/code], the texture importer will import VRAM-compressed textures using the S3 Texture Compression algorithm. This algorithm is only supported on desktop platforms and consoles. </member> - <member name="script" type="Script" setter="" getter=""> - </member> </members> <constants> </constants> diff --git a/doc/classes/ReflectionProbe.xml b/doc/classes/ReflectionProbe.xml index 0a1cf962c8..5991514e1c 100644 --- a/doc/classes/ReflectionProbe.xml +++ b/doc/classes/ReflectionProbe.xml @@ -5,6 +5,7 @@ </brief_description> <description> Capture its surroundings as a dual parabolid image, and stores versions of it with increasing levels of blur to simulate different material roughnesses. + The [ReflectionProbe] is used to create high-quality reflections at the cost of performance. It can be combined with [GIProbe]s and Screen Space Reflections to achieve high quality reflections. [ReflectionProbe]s render all objects within their [member cull_mask], so updating them can be quite expensive. It is best to update them once with the important static objects and then leave them. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/3d/reflection_probes.html</link> @@ -16,34 +17,45 @@ If [code]true[/code], enables box projection. This makes reflections look more correct in rectangle-shaped rooms by offsetting the reflection center depending on the camera's location. </member> <member name="cull_mask" type="int" setter="set_cull_mask" getter="get_cull_mask" default="1048575"> + Sets the cull mask which determines what objects are drawn by this probe. Every [VisualInstance] with a layer included in this cull mask will be rendered by the probe. It is best to only include large objects which are likely to take up a lot of space in the reflection in order to save on rendering cost. </member> <member name="enable_shadows" type="bool" setter="set_enable_shadows" getter="are_shadows_enabled" default="false"> If [code]true[/code], computes shadows in the reflection probe. This makes the reflection probe slower to render; you may want to disable this if using the [constant UPDATE_ALWAYS] [member update_mode]. </member> <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 1, 1, 1 )"> + The size of the reflection probe. The larger the extents the more space covered by the probe which will lower the perceived resolution. It is best to keep the extents only as large as you need them. </member> <member name="intensity" type="float" setter="set_intensity" getter="get_intensity" default="1.0"> - Defines the reflection intensity. + Defines the reflection intensity. Intensity modulates the strength of the reflection. </member> <member name="interior_ambient_color" type="Color" setter="set_interior_ambient" getter="get_interior_ambient" default="Color( 0, 0, 0, 1 )"> + Sets the ambient light color to be used when this probe is set to [member interior_enable]. </member> <member name="interior_ambient_contrib" type="float" setter="set_interior_ambient_probe_contribution" getter="get_interior_ambient_probe_contribution" default="0.0"> + Sets the contribution value for how much the reflection affects the ambient light for this reflection probe when set to [member interior_enable]. Useful so that ambient light matches the color of the room. </member> <member name="interior_ambient_energy" type="float" setter="set_interior_ambient_energy" getter="get_interior_ambient_energy" default="1.0"> + Sets the energy multiplier for this reflection probe's ambient light contribution when set to [member interior_enable]. </member> <member name="interior_enable" type="bool" setter="set_as_interior" getter="is_set_as_interior" default="false"> + If [code]true[/code], reflections will ignore sky contribution. Ambient lighting is then controlled by the [code]interior_ambient_*[/code] properties. </member> <member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" default="0.0"> + Sets the max distance away from the probe an object can be before it is culled. </member> <member name="origin_offset" type="Vector3" setter="set_origin_offset" getter="get_origin_offset" default="Vector3( 0, 0, 0 )"> + Sets the origin offset to be used when this reflection probe is in box project mode. </member> <member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="ReflectionProbe.UpdateMode" default="0"> + Sets how frequently the probe is updated. Can be [constant UPDATE_ONCE] or [constant UPDATE_ALWAYS]. </member> </members> <constants> <constant name="UPDATE_ONCE" value="0" enum="UpdateMode"> + Update the probe once on the next frame. </constant> <constant name="UPDATE_ALWAYS" value="1" enum="UpdateMode"> + Update the probe every frame. This is needed when you want to capture dynamic objects. However, it results in an increased render time. Use [constant UPDATE_ONCE] whenever possible. </constant> </constants> </class> diff --git a/doc/classes/Shader.xml b/doc/classes/Shader.xml index 673248a3b1..1314fcb631 100644 --- a/doc/classes/Shader.xml +++ b/doc/classes/Shader.xml @@ -25,7 +25,7 @@ <return type="int" enum="Shader.Mode"> </return> <description> - Returns the shader mode for the shader, either [constant MODE_CANVAS_ITEM], [constant MODE_SPATIAL] or [constant MODE_PARTICLES] + Returns the shader mode for the shader, either [constant MODE_CANVAS_ITEM], [constant MODE_SPATIAL] or [constant MODE_PARTICLES]. </description> </method> <method name="has_param" qualifiers="const"> diff --git a/doc/classes/SpatialMaterial.xml b/doc/classes/SpatialMaterial.xml index 912161a5ae..aa8eea9a6c 100644 --- a/doc/classes/SpatialMaterial.xml +++ b/doc/classes/SpatialMaterial.xml @@ -106,7 +106,7 @@ Sets the strength of the clearcoat effect. Setting to [code]0[/code] looks the same as disabling the clearcoat effect. </member> <member name="clearcoat_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> - If [code]true[/code], clearcoat rendering is enabled. Adds a secondary transparent pass to the lighting calculation resulting in an added specular blob. This makes materials appear as if they have a clear layer on them that can either by glossy or rough. + If [code]true[/code], clearcoat rendering is enabled. Adds a secondary transparent pass to the lighting calculation resulting in an added specular blob. This makes materials appear as if they have a clear layer on them that can be either glossy or rough. </member> <member name="clearcoat_gloss" type="float" setter="set_clearcoat_gloss" getter="get_clearcoat_gloss"> Sets the roughness of the clearcoat pass. A higher value results in a smoother clearcoat while a lower value results in a rougher clearcoat. @@ -609,7 +609,8 @@ The object's X axis will always face the camera. </constant> <constant name="BILLBOARD_PARTICLES" value="3" enum="BillboardMode"> - Used for particle systems. Enables particle animation options. + Used for particle systems when assigned to [Particles] and [CPUParticles] nodes. Enables [code]particles_anim_*[/code] properties. + The [member ParticlesMaterial.anim_speed] or [member CPUParticles.anim_speed] should also be set to a positive value for the animation to play. </constant> <constant name="TEXTURE_CHANNEL_RED" value="0" enum="TextureChannel"> Used to read from the red channel of a texture. diff --git a/doc/classes/VisualInstance.xml b/doc/classes/VisualInstance.xml index 692e051674..4cf8c04898 100644 --- a/doc/classes/VisualInstance.xml +++ b/doc/classes/VisualInstance.xml @@ -4,7 +4,7 @@ Parent of all visual 3D nodes. </brief_description> <description> - The VisualInstance is used to connect a resource to a visual representation. All visual 3D nodes inherit from the VisualInstance. In general, you should not access the VisualInstance properties directly as they are accessed and managed by the nodes that inherit from VisualInstance. VisualInstance is the node representation of the [VisualServer] instance. + The [VisualInstance] is used to connect a resource to a visual representation. All visual 3D nodes inherit from the [VisualInstance]. In general, you should not access the [VisualInstance] properties directly as they are accessed and managed by the nodes that inherit from [VisualInstance]. [VisualInstance] is the node representation of the [VisualServer] instance. </description> <tutorials> </tutorials> @@ -13,21 +13,21 @@ <return type="AABB"> </return> <description> - Returns the [AABB] (also known as the bounding box) for this VisualInstance. + Returns the [AABB] (also known as the bounding box) for this [VisualInstance]. </description> </method> <method name="get_base" qualifiers="const"> <return type="RID"> </return> <description> - Returns the RID of the resource associated with this VisualInstance. For example, if the Node is a [MeshInstance], this will return the RID of the associated [Mesh]. + Returns the RID of the resource associated with this [VisualInstance]. For example, if the Node is a [MeshInstance], this will return the RID of the associated [Mesh]. </description> </method> <method name="get_instance" qualifiers="const"> <return type="RID"> </return> <description> - Returns the RID of this instance. This RID is the same as the RID returned by [method VisualServer.instance_create]. This RID is needed if you want to call [VisualServer] functions directly on this VisualInstance. + Returns the RID of this instance. This RID is the same as the RID returned by [method VisualServer.instance_create]. This RID is needed if you want to call [VisualServer] functions directly on this [VisualInstance]. </description> </method> <method name="get_layer_mask_bit" qualifiers="const"> @@ -43,8 +43,8 @@ <return type="AABB"> </return> <description> - Returns the transformed [AABB] (also known as the bounding box) for this VisualInstance. - Transformed in this case means the [AABB] plus the position, rotation, and scale of the [Spatial]s [Transform] + Returns the transformed [AABB] (also known as the bounding box) for this [VisualInstance]. + Transformed in this case means the [AABB] plus the position, rotation, and scale of the [Spatial]'s [Transform]. </description> </method> <method name="set_base"> @@ -53,7 +53,7 @@ <argument index="0" name="base" type="RID"> </argument> <description> - Sets the resource that is instantiated by this VisualInstance, which changes how the engine handles the VisualInstance under the hood. Equivalent to [method VisualServer.instance_set_base]. + Sets the resource that is instantiated by this [VisualInstance], which changes how the engine handles the [VisualInstance] under the hood. Equivalent to [method VisualServer.instance_set_base]. </description> </method> <method name="set_layer_mask_bit"> @@ -70,8 +70,8 @@ </methods> <members> <member name="layers" type="int" setter="set_layer_mask" getter="get_layer_mask" default="1"> - The render layer(s) this VisualInstance is drawn on. - This object will only be visible for [Camera]s whose cull mask includes the render object this VisualInstance is set to. + The render layer(s) this [VisualInstance] is drawn on. + This object will only be visible for [Camera]s whose cull mask includes the render object this [VisualInstance] is set to. </member> </members> <constants> diff --git a/doc/classes/VisualServer.xml b/doc/classes/VisualServer.xml index c00710ade9..dd87c53c3c 100644 --- a/doc/classes/VisualServer.xml +++ b/doc/classes/VisualServer.xml @@ -64,7 +64,7 @@ <argument index="1" name="layers" type="int"> </argument> <description> - Sets the cull mask associated with this camera. The cull mask describes which 3d layers are rendered by this camera. Equivalent to [member Camera.cull_mask]. + Sets the cull mask associated with this camera. The cull mask describes which 3D layers are rendered by this camera. Equivalent to [member Camera.cull_mask]. </description> </method> <method name="camera_set_environment"> @@ -1679,7 +1679,7 @@ <argument index="0" name="feature" type="String"> </argument> <description> - Returns [code]true[/code] if the OS supports a certain feature. Features might be s3tc, etc, etc2 and pvrtc, + Returns [code]true[/code] if the OS supports a certain feature. Features might be [code]s3tc[/code], [code]etc[/code], [code]etc2[/code] and [code]pvrtc[/code]. </description> </method> <method name="immediate_begin"> @@ -3018,7 +3018,7 @@ <argument index="0" name="particles" type="RID"> </argument> <description> - Reset the particles on the next update. Equivalent to [method Particles.restart] + Reset the particles on the next update. Equivalent to [method Particles.restart]. </description> </method> <method name="particles_set_amount"> diff --git a/doc/classes/VisualShaderNode.xml b/doc/classes/VisualShaderNode.xml index 9b0c6b2604..9f7e4573ff 100644 --- a/doc/classes/VisualShaderNode.xml +++ b/doc/classes/VisualShaderNode.xml @@ -7,6 +7,12 @@ <tutorials> </tutorials> <methods> + <method name="get_default_input_values" qualifiers="const"> + <return type="Array"> + </return> + <description> + </description> + </method> <method name="get_input_port_default_value" qualifiers="const"> <return type="Variant"> </return> @@ -15,6 +21,14 @@ <description> </description> </method> + <method name="set_default_input_values"> + <return type="void"> + </return> + <argument index="0" name="values" type="Array"> + </argument> + <description> + </description> + </method> <method name="set_input_port_default_value"> <return type="void"> </return> @@ -27,8 +41,6 @@ </method> </methods> <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" default="[ 0, Vector3( 0, 0, 0 ) ]"> - </member> <member name="output_port_for_preview" type="int" setter="set_output_port_for_preview" getter="get_output_port_for_preview" default="-1"> </member> </members> diff --git a/doc/classes/VisualShaderNodeBooleanConstant.xml b/doc/classes/VisualShaderNodeBooleanConstant.xml index 2490dbbcc0..b46905cfea 100644 --- a/doc/classes/VisualShaderNodeBooleanConstant.xml +++ b/doc/classes/VisualShaderNodeBooleanConstant.xml @@ -11,7 +11,6 @@ <members> <member name="constant" type="bool" setter="set_constant" getter="get_constant" default="false"> </member> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ ]" /> </members> <constants> </constants> diff --git a/doc/classes/VisualShaderNodeColorConstant.xml b/doc/classes/VisualShaderNodeColorConstant.xml index f58d1d8e76..282966a9ca 100644 --- a/doc/classes/VisualShaderNodeColorConstant.xml +++ b/doc/classes/VisualShaderNodeColorConstant.xml @@ -11,7 +11,6 @@ <members> <member name="constant" type="Color" setter="set_constant" getter="get_constant" default="Color( 1, 1, 1, 1 )"> </member> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ ]" /> </members> <constants> </constants> diff --git a/doc/classes/VisualShaderNodeColorOp.xml b/doc/classes/VisualShaderNodeColorOp.xml index 9997e9c83c..77c5361f4d 100644 --- a/doc/classes/VisualShaderNodeColorOp.xml +++ b/doc/classes/VisualShaderNodeColorOp.xml @@ -9,7 +9,6 @@ <methods> </methods> <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, Vector3( 0, 0, 0 ), 1, Vector3( 0, 0, 0 ) ]" /> <member name="operator" type="int" setter="set_operator" getter="get_operator" enum="VisualShaderNodeColorOp.Operator" default="0"> </member> </members> diff --git a/doc/classes/VisualShaderNodeCompare.xml b/doc/classes/VisualShaderNodeCompare.xml index b1106998e9..7edad5294d 100644 --- a/doc/classes/VisualShaderNodeCompare.xml +++ b/doc/classes/VisualShaderNodeCompare.xml @@ -11,7 +11,6 @@ <members> <member name="condition" type="int" setter="set_condition" getter="get_condition" enum="VisualShaderNodeCompare.Condition" default="0"> </member> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, 0.0, 1, 0.0, 2, 1e-05 ]" /> <member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeCompare.Function" default="0"> </member> <member name="type" type="int" setter="set_comparsion_type" getter="get_comparsion_type" enum="VisualShaderNodeCompare.ComparsionType" default="0"> diff --git a/doc/classes/VisualShaderNodeCubeMap.xml b/doc/classes/VisualShaderNodeCubeMap.xml index 29ebe95086..08528d1ca4 100644 --- a/doc/classes/VisualShaderNodeCubeMap.xml +++ b/doc/classes/VisualShaderNodeCubeMap.xml @@ -11,7 +11,6 @@ <members> <member name="cube_map" type="CubeMap" setter="set_cube_map" getter="get_cube_map"> </member> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ ]" /> <member name="source" type="int" setter="set_source" getter="get_source" enum="VisualShaderNodeCubeMap.Source" default="0"> </member> <member name="texture_type" type="int" setter="set_texture_type" getter="get_texture_type" enum="VisualShaderNodeCubeMap.TextureType" default="0"> diff --git a/doc/classes/VisualShaderNodeCustom.xml b/doc/classes/VisualShaderNodeCustom.xml index 5219dcb77b..9e58abae97 100644 --- a/doc/classes/VisualShaderNodeCustom.xml +++ b/doc/classes/VisualShaderNodeCustom.xml @@ -144,9 +144,6 @@ </description> </method> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeDeterminant.xml b/doc/classes/VisualShaderNodeDeterminant.xml index 4ea7e5ed6e..a86db216c4 100644 --- a/doc/classes/VisualShaderNodeDeterminant.xml +++ b/doc/classes/VisualShaderNodeDeterminant.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeDotProduct.xml b/doc/classes/VisualShaderNodeDotProduct.xml index 4c2bae39a1..f07827db29 100644 --- a/doc/classes/VisualShaderNodeDotProduct.xml +++ b/doc/classes/VisualShaderNodeDotProduct.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, Vector3( 0, 0, 0 ), 1, Vector3( 0, 0, 0 ) ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeFaceForward.xml b/doc/classes/VisualShaderNodeFaceForward.xml index 9c755cc6de..ea8589e6cb 100644 --- a/doc/classes/VisualShaderNodeFaceForward.xml +++ b/doc/classes/VisualShaderNodeFaceForward.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, Vector3( 0, 0, 0 ), 1, Vector3( 0, 0, 0 ), 2, Vector3( 0, 0, 0 ) ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeFresnel.xml b/doc/classes/VisualShaderNodeFresnel.xml index b71f5c6f37..2484a44fcd 100644 --- a/doc/classes/VisualShaderNodeFresnel.xml +++ b/doc/classes/VisualShaderNodeFresnel.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 2, false, 3, 1.0 ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeGroupBase.xml b/doc/classes/VisualShaderNodeGroupBase.xml index 511a56b7a6..001ed44790 100644 --- a/doc/classes/VisualShaderNodeGroupBase.xml +++ b/doc/classes/VisualShaderNodeGroupBase.xml @@ -209,7 +209,6 @@ </method> </methods> <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ ]" /> <member name="editable" type="bool" setter="set_editable" getter="is_editable" default="false"> </member> </members> diff --git a/doc/classes/VisualShaderNodeIf.xml b/doc/classes/VisualShaderNodeIf.xml index 6900cdf81b..374a1e379a 100644 --- a/doc/classes/VisualShaderNodeIf.xml +++ b/doc/classes/VisualShaderNodeIf.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, 0.0, 1, 0.0, 2, 1e-05, 3, Vector3( 0, 0, 0 ), 4, Vector3( 0, 0, 0 ), 5, Vector3( 0, 0, 0 ) ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeInput.xml b/doc/classes/VisualShaderNodeInput.xml index bfcd4c734c..f481db7f8b 100644 --- a/doc/classes/VisualShaderNodeInput.xml +++ b/doc/classes/VisualShaderNodeInput.xml @@ -15,7 +15,6 @@ </method> </methods> <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ ]" /> <member name="input_name" type="String" setter="set_input_name" getter="get_input_name" default=""[None]""> </member> </members> diff --git a/doc/classes/VisualShaderNodeIs.xml b/doc/classes/VisualShaderNodeIs.xml index c221e60b75..8db64b7cde 100644 --- a/doc/classes/VisualShaderNodeIs.xml +++ b/doc/classes/VisualShaderNodeIs.xml @@ -9,7 +9,6 @@ <methods> </methods> <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, 0.0 ]" /> <member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeIs.Function" default="0"> </member> </members> diff --git a/doc/classes/VisualShaderNodeOuterProduct.xml b/doc/classes/VisualShaderNodeOuterProduct.xml index 6111084b44..3debde0634 100644 --- a/doc/classes/VisualShaderNodeOuterProduct.xml +++ b/doc/classes/VisualShaderNodeOuterProduct.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, Vector3( 0, 0, 0 ), 1, Vector3( 0, 0, 0 ) ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeScalarClamp.xml b/doc/classes/VisualShaderNodeScalarClamp.xml index 927aeb01ce..4c5309d1e7 100644 --- a/doc/classes/VisualShaderNodeScalarClamp.xml +++ b/doc/classes/VisualShaderNodeScalarClamp.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, 0.0, 1, 0.0, 2, 1.0 ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeScalarConstant.xml b/doc/classes/VisualShaderNodeScalarConstant.xml index c4ac65aa48..0af09e74e3 100644 --- a/doc/classes/VisualShaderNodeScalarConstant.xml +++ b/doc/classes/VisualShaderNodeScalarConstant.xml @@ -11,7 +11,6 @@ <members> <member name="constant" type="float" setter="set_constant" getter="get_constant" default="0.0"> </member> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ ]" /> </members> <constants> </constants> diff --git a/doc/classes/VisualShaderNodeScalarDerivativeFunc.xml b/doc/classes/VisualShaderNodeScalarDerivativeFunc.xml index 795054637e..09e2d2fa72 100644 --- a/doc/classes/VisualShaderNodeScalarDerivativeFunc.xml +++ b/doc/classes/VisualShaderNodeScalarDerivativeFunc.xml @@ -9,7 +9,6 @@ <methods> </methods> <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, 0.0 ]" /> <member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeScalarDerivativeFunc.Function" default="0"> </member> </members> diff --git a/doc/classes/VisualShaderNodeScalarFunc.xml b/doc/classes/VisualShaderNodeScalarFunc.xml index 81ccf8aeb6..ef52086d6e 100644 --- a/doc/classes/VisualShaderNodeScalarFunc.xml +++ b/doc/classes/VisualShaderNodeScalarFunc.xml @@ -9,7 +9,6 @@ <methods> </methods> <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, 0.0 ]" /> <member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeScalarFunc.Function" default="13"> </member> </members> diff --git a/doc/classes/VisualShaderNodeScalarInterp.xml b/doc/classes/VisualShaderNodeScalarInterp.xml index 7e40304b04..9d01e20b8d 100644 --- a/doc/classes/VisualShaderNodeScalarInterp.xml +++ b/doc/classes/VisualShaderNodeScalarInterp.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, 0.0, 1, 1.0, 2, 0.5 ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeScalarOp.xml b/doc/classes/VisualShaderNodeScalarOp.xml index 3ff56bffaa..0aa692c228 100644 --- a/doc/classes/VisualShaderNodeScalarOp.xml +++ b/doc/classes/VisualShaderNodeScalarOp.xml @@ -9,7 +9,6 @@ <methods> </methods> <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, 0.0, 1, 0.0 ]" /> <member name="operator" type="int" setter="set_operator" getter="get_operator" enum="VisualShaderNodeScalarOp.Operator" default="0"> </member> </members> diff --git a/doc/classes/VisualShaderNodeScalarSmoothStep.xml b/doc/classes/VisualShaderNodeScalarSmoothStep.xml index e71bb16f6f..737c535659 100644 --- a/doc/classes/VisualShaderNodeScalarSmoothStep.xml +++ b/doc/classes/VisualShaderNodeScalarSmoothStep.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, 0.0, 1, 0.0, 2, 0.0 ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeScalarSwitch.xml b/doc/classes/VisualShaderNodeScalarSwitch.xml index 2828f42b47..80e75eec3f 100644 --- a/doc/classes/VisualShaderNodeScalarSwitch.xml +++ b/doc/classes/VisualShaderNodeScalarSwitch.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, false, 1, 1.0, 2, 0.0 ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeSwitch.xml b/doc/classes/VisualShaderNodeSwitch.xml index 704ac08adb..930d914035 100644 --- a/doc/classes/VisualShaderNodeSwitch.xml +++ b/doc/classes/VisualShaderNodeSwitch.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, false, 1, Vector3( 1, 1, 1 ), 2, Vector3( 0, 0, 0 ) ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeTexture.xml b/doc/classes/VisualShaderNodeTexture.xml index 4150b36c9c..20cbe1beee 100644 --- a/doc/classes/VisualShaderNodeTexture.xml +++ b/doc/classes/VisualShaderNodeTexture.xml @@ -9,7 +9,6 @@ <methods> </methods> <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ ]" /> <member name="source" type="int" setter="set_source" getter="get_source" enum="VisualShaderNodeTexture.Source" default="0"> </member> <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> diff --git a/doc/classes/VisualShaderNodeTransformCompose.xml b/doc/classes/VisualShaderNodeTransformCompose.xml index 0c44e6b3c5..0939eb393d 100644 --- a/doc/classes/VisualShaderNodeTransformCompose.xml +++ b/doc/classes/VisualShaderNodeTransformCompose.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, Vector3( 0, 0, 0 ), 1, Vector3( 0, 0, 0 ), 2, Vector3( 0, 0, 0 ), 3, Vector3( 0, 0, 0 ) ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeTransformConstant.xml b/doc/classes/VisualShaderNodeTransformConstant.xml index 737961f8ec..b184a3d337 100644 --- a/doc/classes/VisualShaderNodeTransformConstant.xml +++ b/doc/classes/VisualShaderNodeTransformConstant.xml @@ -11,7 +11,6 @@ <members> <member name="constant" type="Transform" setter="set_constant" getter="get_constant" default="Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )"> </member> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ ]" /> </members> <constants> </constants> diff --git a/doc/classes/VisualShaderNodeTransformDecompose.xml b/doc/classes/VisualShaderNodeTransformDecompose.xml index 911d2e953a..d986e6b7a8 100644 --- a/doc/classes/VisualShaderNodeTransformDecompose.xml +++ b/doc/classes/VisualShaderNodeTransformDecompose.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeTransformFunc.xml b/doc/classes/VisualShaderNodeTransformFunc.xml index 53b7c9f1ab..7fb17b1a79 100644 --- a/doc/classes/VisualShaderNodeTransformFunc.xml +++ b/doc/classes/VisualShaderNodeTransformFunc.xml @@ -9,7 +9,6 @@ <methods> </methods> <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) ]" /> <member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeTransformFunc.Function" default="0"> </member> </members> diff --git a/doc/classes/VisualShaderNodeTransformMult.xml b/doc/classes/VisualShaderNodeTransformMult.xml index f5368b3b1c..0406050025 100644 --- a/doc/classes/VisualShaderNodeTransformMult.xml +++ b/doc/classes/VisualShaderNodeTransformMult.xml @@ -9,7 +9,6 @@ <methods> </methods> <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ), 1, Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) ]" /> <member name="operator" type="int" setter="set_operator" getter="get_operator" enum="VisualShaderNodeTransformMult.Operator" default="0"> </member> </members> diff --git a/doc/classes/VisualShaderNodeTransformVecMult.xml b/doc/classes/VisualShaderNodeTransformVecMult.xml index 9ab9c08562..881d0cf3cf 100644 --- a/doc/classes/VisualShaderNodeTransformVecMult.xml +++ b/doc/classes/VisualShaderNodeTransformVecMult.xml @@ -9,7 +9,6 @@ <methods> </methods> <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ), 1, Vector3( 0, 0, 0 ) ]" /> <member name="operator" type="int" setter="set_operator" getter="get_operator" enum="VisualShaderNodeTransformVecMult.Operator" default="0"> </member> </members> diff --git a/doc/classes/VisualShaderNodeUniform.xml b/doc/classes/VisualShaderNodeUniform.xml index 05539294a0..6835a30baa 100644 --- a/doc/classes/VisualShaderNodeUniform.xml +++ b/doc/classes/VisualShaderNodeUniform.xml @@ -9,7 +9,6 @@ <methods> </methods> <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ ]" /> <member name="uniform_name" type="String" setter="set_uniform_name" getter="get_uniform_name" default=""""> </member> </members> diff --git a/doc/classes/VisualShaderNodeVec3Constant.xml b/doc/classes/VisualShaderNodeVec3Constant.xml index 06e033cd9d..b17f56e1f8 100644 --- a/doc/classes/VisualShaderNodeVec3Constant.xml +++ b/doc/classes/VisualShaderNodeVec3Constant.xml @@ -11,7 +11,6 @@ <members> <member name="constant" type="Vector3" setter="set_constant" getter="get_constant" default="Vector3( 0, 0, 0 )"> </member> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ ]" /> </members> <constants> </constants> diff --git a/doc/classes/VisualShaderNodeVectorClamp.xml b/doc/classes/VisualShaderNodeVectorClamp.xml index 8b9a0cacff..a5d1e94e2f 100644 --- a/doc/classes/VisualShaderNodeVectorClamp.xml +++ b/doc/classes/VisualShaderNodeVectorClamp.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, Vector3( 0, 0, 0 ), 1, Vector3( 0, 0, 0 ), 2, Vector3( 1, 1, 1 ) ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeVectorCompose.xml b/doc/classes/VisualShaderNodeVectorCompose.xml index 11eb4d2778..b7f650c82e 100644 --- a/doc/classes/VisualShaderNodeVectorCompose.xml +++ b/doc/classes/VisualShaderNodeVectorCompose.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, 0.0, 1, 0.0, 2, 0.0 ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeVectorDistance.xml b/doc/classes/VisualShaderNodeVectorDistance.xml index 3b7f743864..f7c9acecf7 100644 --- a/doc/classes/VisualShaderNodeVectorDistance.xml +++ b/doc/classes/VisualShaderNodeVectorDistance.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, Vector3( 0, 0, 0 ), 1, Vector3( 0, 0, 0 ) ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeVectorInterp.xml b/doc/classes/VisualShaderNodeVectorInterp.xml index 7aa525cd0e..2a398c653d 100644 --- a/doc/classes/VisualShaderNodeVectorInterp.xml +++ b/doc/classes/VisualShaderNodeVectorInterp.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, Vector3( 0, 0, 0 ), 1, Vector3( 1, 1, 1 ), 2, Vector3( 0.5, 0.5, 0.5 ) ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeVectorOp.xml b/doc/classes/VisualShaderNodeVectorOp.xml index d237ee56b0..0ec49a3845 100644 --- a/doc/classes/VisualShaderNodeVectorOp.xml +++ b/doc/classes/VisualShaderNodeVectorOp.xml @@ -9,7 +9,6 @@ <methods> </methods> <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, Vector3( 0, 0, 0 ), 1, Vector3( 0, 0, 0 ) ]" /> <member name="operator" type="int" setter="set_operator" getter="get_operator" enum="VisualShaderNodeVectorOp.Operator" default="0"> </member> </members> diff --git a/doc/classes/VisualShaderNodeVectorRefract.xml b/doc/classes/VisualShaderNodeVectorRefract.xml index 453c2bf02f..4df072040a 100644 --- a/doc/classes/VisualShaderNodeVectorRefract.xml +++ b/doc/classes/VisualShaderNodeVectorRefract.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, Vector3( 0, 0, 0 ), 1, Vector3( 0, 0, 0 ), 2, 0.0 ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeVectorScalarMix.xml b/doc/classes/VisualShaderNodeVectorScalarMix.xml index 4ab396a14b..d83c2e7d44 100644 --- a/doc/classes/VisualShaderNodeVectorScalarMix.xml +++ b/doc/classes/VisualShaderNodeVectorScalarMix.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, Vector3( 0, 0, 0 ), 1, Vector3( 1, 1, 1 ), 2, 0.5 ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeVectorScalarSmoothStep.xml b/doc/classes/VisualShaderNodeVectorScalarSmoothStep.xml index 2aeb8c1b53..4334eee7c1 100644 --- a/doc/classes/VisualShaderNodeVectorScalarSmoothStep.xml +++ b/doc/classes/VisualShaderNodeVectorScalarSmoothStep.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, 0.0, 1, 0.0, 2, Vector3( 0, 0, 0 ) ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeVectorScalarStep.xml b/doc/classes/VisualShaderNodeVectorScalarStep.xml index c448404b7f..ad8cac059b 100644 --- a/doc/classes/VisualShaderNodeVectorScalarStep.xml +++ b/doc/classes/VisualShaderNodeVectorScalarStep.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, 0.0, 1, Vector3( 0, 0, 0 ) ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/VisualShaderNodeVectorSmoothStep.xml b/doc/classes/VisualShaderNodeVectorSmoothStep.xml index bb80832c3c..59acff7d05 100644 --- a/doc/classes/VisualShaderNodeVectorSmoothStep.xml +++ b/doc/classes/VisualShaderNodeVectorSmoothStep.xml @@ -8,9 +8,6 @@ </tutorials> <methods> </methods> - <members> - <member name="default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values" override="true" default="[ 0, Vector3( 0, 0, 0 ), 1, Vector3( 0, 0, 0 ), 2, Vector3( 0, 0, 0 ) ]" /> - </members> <constants> </constants> </class> diff --git a/doc/classes/XMLParser.xml b/doc/classes/XMLParser.xml index 4375b2eb62..1e041b9baa 100644 --- a/doc/classes/XMLParser.xml +++ b/doc/classes/XMLParser.xml @@ -147,25 +147,25 @@ </methods> <constants> <constant name="NODE_NONE" value="0" enum="NodeType"> - There's no node (no file or buffer opened) + There's no node (no file or buffer opened). </constant> <constant name="NODE_ELEMENT" value="1" enum="NodeType"> - Element (tag) + Element (tag). </constant> <constant name="NODE_ELEMENT_END" value="2" enum="NodeType"> - End of element + End of element. </constant> <constant name="NODE_TEXT" value="3" enum="NodeType"> - Text node + Text node. </constant> <constant name="NODE_COMMENT" value="4" enum="NodeType"> - Comment node + Comment node. </constant> <constant name="NODE_CDATA" value="5" enum="NodeType"> - CDATA content + CDATA content. </constant> <constant name="NODE_UNKNOWN" value="6" enum="NodeType"> - Unknown node + Unknown node. </constant> </constants> </class> diff --git a/doc/classes/bool.xml b/doc/classes/bool.xml index ba6a932d4f..a259f97203 100644 --- a/doc/classes/bool.xml +++ b/doc/classes/bool.xml @@ -4,7 +4,7 @@ Boolean built-in type. </brief_description> <description> - Boolean is a built-in type. It can represent any data type that is either a true or false value. You can think of it as an switch with on or off (1 or 0) setting . It's often used as part of programming logic in condition statements like [code]if[/code] statements. + Boolean is a built-in type. It can represent any data type that is either a true or false value. You can think of it as an switch with on or off (1 or 0) setting. It's often used as part of programming logic in condition statements like [code]if[/code] statements. [b]Note:[/b] In a code below [code]if can_shoot[/code] is equivalent of [code]if can_shoot == true[/code]. It is good practice to follow the natural spoken language structure when possible. Use [code]if can_shoot[/code] rather than [code]if can_shoot == true[/code] and use [code]if not can_shoot[/code] rather than [code]if can_shoot == false[/code]. [codeblock] var can_shoot = true diff --git a/drivers/alsamidi/midi_driver_alsamidi.cpp b/drivers/alsamidi/midi_driver_alsamidi.cpp index 10581a460c..68a34fe485 100644 --- a/drivers/alsamidi/midi_driver_alsamidi.cpp +++ b/drivers/alsamidi/midi_driver_alsamidi.cpp @@ -43,12 +43,30 @@ static int get_message_size(uint8_t message) { case 0x90: // note on case 0xA0: // aftertouch case 0xB0: // continuous controller + case 0xE0: // pitch bend + case 0xF2: // song position pointer return 3; case 0xC0: // patch change case 0xD0: // channel pressure - case 0xE0: // pitch bend + case 0xF1: // time code quarter frame + case 0xF3: // song select return 2; + + case 0xF0: // SysEx start + case 0xF4: // reserved + case 0xF5: // reserved + case 0xF6: // tune request + case 0xF7: // SysEx end + case 0xF8: // timing clock + case 0xF9: // reserved + case 0xFA: // start + case 0xFB: // continue + case 0xFC: // stop + case 0xFD: // reserved + case 0xFE: // active sensing + case 0xFF: // reset + return 1; } return 256; @@ -83,6 +101,9 @@ void MIDIDriverALSAMidi::thread_func(void *p_udata) { bytes = 0; } expected_size = get_message_size(byte); + // After a SysEx start, all bytes are data until a SysEx end, so + // we're going to end the command at the SES, and let the common + // driver ignore the following data bytes. } if (bytes < 256) { diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp index a315684ce9..c0ba93db6a 100644 --- a/drivers/gles2/rasterizer_scene_gles2.cpp +++ b/drivers/gles2/rasterizer_scene_gles2.cpp @@ -2658,14 +2658,14 @@ void RasterizerSceneGLES2::_draw_sky(RasterizerStorageGLES2::Sky *p_sky, const C }; if (!asymmetrical) { - float vw, vh, zn; - camera.get_viewport_size(vw, vh); + Vector2 vp_he = camera.get_viewport_half_extents(); + float zn; zn = p_projection.get_z_near(); for (int i = 0; i < 4; i++) { Vector3 uv = vertices[i * 2 + 1]; - uv.x = (uv.x * 2.0 - 1.0) * vw; - uv.y = -(uv.y * 2.0 - 1.0) * vh; + uv.x = (uv.x * 2.0 - 1.0) * vp_he.x; + uv.y = -(uv.y * 2.0 - 1.0) * vp_he.y; uv.z = -zn; vertices[i * 2 + 1] = p_transform.basis.xform(uv).normalized(); vertices[i * 2 + 1].z = -vertices[i * 2 + 1].z; diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index c9ee2a18ef..27173d317b 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -2497,14 +2497,14 @@ void RasterizerSceneGLES3::_draw_sky(RasterizerStorageGLES3::Sky *p_sky, const C }; if (!asymmetrical) { - float vw, vh, zn; - camera.get_viewport_size(vw, vh); + Vector2 vp_he = camera.get_viewport_half_extents(); + float zn; zn = p_projection.get_z_near(); for (int i = 0; i < 4; i++) { Vector3 uv = vertices[i * 2 + 1]; - uv.x = (uv.x * 2.0 - 1.0) * vw; - uv.y = -(uv.y * 2.0 - 1.0) * vh; + uv.x = (uv.x * 2.0 - 1.0) * vp_he.x; + uv.y = -(uv.y * 2.0 - 1.0) * vp_he.y; uv.z = -zn; vertices[i * 2 + 1] = p_transform.basis.xform(uv).normalized(); vertices[i * 2 + 1].z = -vertices[i * 2 + 1].z; @@ -4130,11 +4130,15 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const state.ubo_data.shadow_dual_paraboloid_render_zfar = 0; state.ubo_data.opaque_prepass_threshold = 0.99; - p_cam_projection.get_viewport_size(state.ubo_data.viewport_size[0], state.ubo_data.viewport_size[1]); - if (storage->frame.current_rt) { - state.ubo_data.screen_pixel_size[0] = 1.0 / storage->frame.current_rt->width; - state.ubo_data.screen_pixel_size[1] = 1.0 / storage->frame.current_rt->height; + int viewport_width_pixels = storage->frame.current_rt->width; + int viewport_height_pixels = storage->frame.current_rt->height; + + state.ubo_data.viewport_size[0] = viewport_width_pixels; + state.ubo_data.viewport_size[1] = viewport_height_pixels; + + state.ubo_data.screen_pixel_size[0] = 1.0 / viewport_width_pixels; + state.ubo_data.screen_pixel_size[1] = 1.0 / viewport_height_pixels; } _setup_environment(env, p_cam_projection, p_cam_transform, p_reflection_probe.is_valid()); diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 0a528552cc..712120c7f4 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -1865,7 +1865,7 @@ void RasterizerStorageGLES3::sky_set_texture(RID p_sky, RID p_panorama, int p_ra glTexImage2D(GL_TEXTURE_2D, 0, internal_format, p_radiance_size, 2.0 * p_radiance_size, 0, format, type, NULL); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tmp_tex, 0); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); #ifdef DEBUG_ENABLED GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); ERR_FAIL_COND(status != GL_FRAMEBUFFER_COMPLETE); diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h index 8ce0eca8c6..c381890834 100644 --- a/drivers/unix/os_unix.h +++ b/drivers/unix/os_unix.h @@ -85,7 +85,7 @@ public: virtual void delay_usec(uint32_t p_usec) const; virtual uint64_t get_ticks_usec() const; - virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false, Mutex *p_pipe_mutex = NULL); + virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking = true, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false, Mutex *p_pipe_mutex = NULL); virtual Error kill(const ProcessID &p_pid); virtual int get_process_id() const; diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp index ea9bf508f1..26970446f5 100644 --- a/editor/doc/doc_data.cpp +++ b/editor/doc/doc_data.cpp @@ -233,6 +233,8 @@ void DocData::generate(bool p_basic_types) { List<StringName> classes; ClassDB::get_class_list(&classes); classes.sort_custom<StringName::AlphCompare>(); + // Move ProjectSettings, so that other classes can register properties there + classes.move_to_back(classes.find("ProjectSettings")); bool skip_setter_getter_methods = true; @@ -280,13 +282,27 @@ void DocData::generate(bool p_basic_types) { prop.overridden = inherited; bool default_value_valid = false; - Variant default_value = get_documentation_default_value(name, E->get().name, default_value_valid); + Variant default_value; - if (inherited) { - bool base_default_value_valid = false; - Variant base_default_value = get_documentation_default_value(ClassDB::get_parent_class(name), E->get().name, base_default_value_valid); - if (!default_value_valid || !base_default_value_valid || default_value == base_default_value) + if (name == "ProjectSettings") { + // Special case for project settings, so that settings are not taken from the current project's settings + if (E->get().name == "script" || + ProjectSettings::get_singleton()->get_order(E->get().name) >= ProjectSettings::NO_BUILTIN_ORDER_BASE) { continue; + } + if (E->get().usage & PROPERTY_USAGE_EDITOR) { + default_value = ProjectSettings::get_singleton()->property_get_revert(E->get().name); + default_value_valid = true; + } + } else { + default_value = get_documentation_default_value(name, E->get().name, default_value_valid); + + if (inherited) { + bool base_default_value_valid = false; + Variant base_default_value = get_documentation_default_value(ClassDB::get_parent_class(name), E->get().name, base_default_value_valid); + if (!default_value_valid || !base_default_value_valid || default_value == base_default_value) + continue; + } } if (default_value_valid && default_value.get_type() != Variant::OBJECT) { diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index f798714812..d3cbf2947e 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -3850,6 +3850,7 @@ void CanvasItemEditor::_notification(int p_what) { key_scale_button->set_icon(get_icon("KeyScale", "EditorIcons")); key_insert_button->set_icon(get_icon("Key", "EditorIcons")); key_auto_insert_button->set_icon(get_icon("AutoKey", "EditorIcons")); + animation_menu->set_icon(get_icon("GuiTabMenu", "EditorIcons")); zoom_minus->set_icon(get_icon("ZoomLess", "EditorIcons")); zoom_plus->set_icon(get_icon("ZoomMore", "EditorIcons")); @@ -5667,7 +5668,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { animation_hb->add_child(key_auto_insert_button); animation_menu = memnew(MenuButton); - animation_menu->set_text(TTR("Animation")); + animation_menu->set_tooltip(TTR("Animation Key and Pose Options")); animation_hb->add_child(animation_menu); animation_menu->get_popup()->connect("id_pressed", this, "_popup_callback"); animation_menu->set_switch_on_hover(true); diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index 04d595461d..35c0142d4b 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -92,6 +92,9 @@ void Polygon2DEditor::_notification(int p_what) { b_snap_grid->set_icon(get_icon("Grid", "EditorIcons")); b_snap_enable->set_icon(get_icon("SnapGrid", "EditorIcons")); uv_icon_zoom->set_texture(get_icon("Zoom", "EditorIcons")); + + uv_vscroll->set_anchors_and_margins_preset(PRESET_RIGHT_WIDE); + uv_hscroll->set_anchors_and_margins_preset(PRESET_BOTTOM_WIDE); } break; case NOTIFICATION_VISIBILITY_CHANGED: { @@ -1471,12 +1474,10 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : uv_vscroll = memnew(VScrollBar); uv_vscroll->set_step(0.001); uv_edit_draw->add_child(uv_vscroll); - uv_vscroll->set_anchors_and_margins_preset(PRESET_RIGHT_WIDE); uv_vscroll->connect("value_changed", this, "_uv_scroll_changed"); uv_hscroll = memnew(HScrollBar); uv_hscroll->set_step(0.001); uv_edit_draw->add_child(uv_hscroll); - uv_hscroll->set_anchors_and_margins_preset(PRESET_BOTTOM_WIDE); uv_hscroll->connect("value_changed", this, "_uv_scroll_changed"); bone_scroll_main_vb = memnew(VBoxContainer); diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index bf87bfc14d..31e6b65640 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -428,8 +428,7 @@ Vector3 SpatialEditorViewport::_get_screen_to_space(const Vector3 &p_vector3) { } else { cm.set_perspective(get_fov(), get_size().aspect(), get_znear() + p_vector3.z, get_zfar()); } - float screen_w, screen_h; - cm.get_viewport_size(screen_w, screen_h); + Vector2 screen_he = cm.get_viewport_half_extents(); Transform camera_transform; camera_transform.translate(cursor.pos); @@ -437,7 +436,7 @@ Vector3 SpatialEditorViewport::_get_screen_to_space(const Vector3 &p_vector3) { camera_transform.basis.rotate(Vector3(0, 1, 0), -cursor.y_rot); camera_transform.translate(0, 0, cursor.distance); - return camera_transform.xform(Vector3(((p_vector3.x / get_size().width) * 2.0 - 1.0) * screen_w, ((1.0 - (p_vector3.y / get_size().height)) * 2.0 - 1.0) * screen_h, -(get_znear() + p_vector3.z))); + return camera_transform.xform(Vector3(((p_vector3.x / get_size().width) * 2.0 - 1.0) * screen_he.x, ((1.0 - (p_vector3.y / get_size().height)) * 2.0 - 1.0) * screen_he.y, -(get_znear() + p_vector3.z))); } void SpatialEditorViewport::_select_region() { diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index ce6bb4b91a..507ea0b83d 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -736,6 +736,9 @@ void TextureRegionEditor::_notification(int p_what) { zoom_out->set_icon(get_icon("ZoomLess", "EditorIcons")); zoom_reset->set_icon(get_icon("ZoomReset", "EditorIcons")); zoom_in->set_icon(get_icon("ZoomMore", "EditorIcons")); + + vscroll->set_anchors_and_margins_preset(PRESET_RIGHT_WIDE); + hscroll->set_anchors_and_margins_preset(PRESET_BOTTOM_WIDE); } break; case NOTIFICATION_VISIBILITY_CHANGED: { if (snap_mode == SNAP_AUTOSLICE && is_visible() && autoslice_is_dirty) { @@ -1022,12 +1025,10 @@ TextureRegionEditor::TextureRegionEditor(EditorNode *p_editor) { vscroll = memnew(VScrollBar); vscroll->set_step(0.001); edit_draw->add_child(vscroll); - vscroll->set_anchors_and_margins_preset(PRESET_RIGHT_WIDE); vscroll->connect("value_changed", this, "_scroll_changed"); hscroll = memnew(HScrollBar); hscroll->set_step(0.001); edit_draw->add_child(hscroll); - hscroll->set_anchors_and_margins_preset(PRESET_BOTTOM_WIDE); hscroll->connect("value_changed", this, "_scroll_changed"); updating_scroll = false; diff --git a/modules/csg/doc_classes/CSGMesh.xml b/modules/csg/doc_classes/CSGMesh.xml index afe0bc262d..aae730aa49 100644 --- a/modules/csg/doc_classes/CSGMesh.xml +++ b/modules/csg/doc_classes/CSGMesh.xml @@ -12,9 +12,10 @@ </methods> <members> <member name="material" type="Material" setter="set_material" getter="get_material"> + The [Material] used in drawing the CSG shape. </member> <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> - The mesh resource to use as a CSG shape. + The [Mesh] resource to use as a CSG shape. </member> </members> <constants> diff --git a/modules/csg/doc_classes/CSGPrimitive.xml b/modules/csg/doc_classes/CSGPrimitive.xml index 6c2f837637..0a692ffbdb 100644 --- a/modules/csg/doc_classes/CSGPrimitive.xml +++ b/modules/csg/doc_classes/CSGPrimitive.xml @@ -4,6 +4,7 @@ Base class for CSG primitives. </brief_description> <description> + Parent class for various CSG primitives. It contains code and functionality that is common between them. It cannot be used directly. Instead use one of the various classes that inherit from it. </description> <tutorials> </tutorials> diff --git a/modules/csg/doc_classes/CSGShape.xml b/modules/csg/doc_classes/CSGShape.xml index 755d8df67e..9566c04f19 100644 --- a/modules/csg/doc_classes/CSGShape.xml +++ b/modules/csg/doc_classes/CSGShape.xml @@ -31,6 +31,7 @@ <return type="Array"> </return> <description> + Returns an [Array] with two elements, the first is the [Transform] of this node and the second is the root [Mesh] of this node. Only works when this node is the root shape. </description> </method> <method name="is_root_shape" qualifiers="const"> @@ -79,6 +80,7 @@ The operation that is performed on this shape. This is ignored for the first CSG child node as the operation is between this node and the previous child of this nodes parent. </member> <member name="snap" type="float" setter="set_snap" getter="get_snap" default="0.001"> + Snap makes the mesh snap to a given distance so that the faces of two meshes can be perfectly aligned. A lower value results in greater precision but may be harder to adjust. </member> <member name="use_collision" type="bool" setter="set_use_collision" getter="is_using_collision" default="false"> Adds a collision shape to the physics engine for our CSG shape. This will always act like a static body. Note that the collision shape is still active even if the CSG shape itself is hidden. diff --git a/modules/enet/doc_classes/NetworkedMultiplayerENet.xml b/modules/enet/doc_classes/NetworkedMultiplayerENet.xml index 9509adfb18..7c2e783a4f 100644 --- a/modules/enet/doc_classes/NetworkedMultiplayerENet.xml +++ b/modules/enet/doc_classes/NetworkedMultiplayerENet.xml @@ -67,14 +67,14 @@ <return type="int"> </return> <description> - Returns the channel of the last packet fetched via [method PacketPeer.get_packet] + Returns the channel of the last packet fetched via [method PacketPeer.get_packet]. </description> </method> <method name="get_packet_channel" qualifiers="const"> <return type="int"> </return> <description> - Returns the channel of the next packet that will be retrieved via [method PacketPeer.get_packet] + Returns the channel of the next packet that will be retrieved via [method PacketPeer.get_packet]. </description> </method> <method name="get_peer_address" qualifiers="const"> diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index aec7110ee5..d125da5b79 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -1868,6 +1868,10 @@ GDScriptParser::Node *GDScriptParser::_reduce_expression(Node *p_node, bool p_to _set_error("Can't assign to constant", tokenizer->get_token_line() - 1); error_line = op->line; return op; + } else if (op->arguments[0]->type == Node::TYPE_SELF) { + _set_error("Can't assign to self.", op->line); + error_line = op->line; + return op; } if (op->arguments[0]->type == Node::TYPE_OPERATOR) { @@ -6290,6 +6294,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) { node_type.has_type = true; node_type.kind = DataType::CLASS; node_type.class_type = current_class; + node_type.is_constant = true; } break; case Node::TYPE_IDENTIFIER: { IdentifierNode *id = static_cast<IdentifierNode *>(p_node); diff --git a/modules/mono/editor/GodotTools/GodotTools.BuildLogger/GodotTools.BuildLogger.csproj b/modules/mono/editor/GodotTools/GodotTools.BuildLogger/GodotTools.BuildLogger.csproj index 1eaa36c1aa..8fdd485209 100644 --- a/modules/mono/editor/GodotTools/GodotTools.BuildLogger/GodotTools.BuildLogger.csproj +++ b/modules/mono/editor/GodotTools/GodotTools.BuildLogger/GodotTools.BuildLogger.csproj @@ -9,7 +9,7 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>GodotTools.BuildLogger</RootNamespace> <AssemblyName>GodotTools.BuildLogger</AssemblyName> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.7</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <LangVersion>7</LangVersion> </PropertyGroup> @@ -50,11 +50,11 @@ </ProjectReference> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> </Target> <Target Name="AfterBuild"> </Target> --> -</Project>
\ No newline at end of file +</Project> diff --git a/modules/mono/editor/GodotTools/GodotTools.Core/GodotTools.Core.csproj b/modules/mono/editor/GodotTools/GodotTools.Core/GodotTools.Core.csproj index 1974220f2f..2c35ef540a 100644 --- a/modules/mono/editor/GodotTools/GodotTools.Core/GodotTools.Core.csproj +++ b/modules/mono/editor/GodotTools/GodotTools.Core/GodotTools.Core.csproj @@ -7,7 +7,7 @@ <OutputType>Library</OutputType> <RootNamespace>GodotTools.Core</RootNamespace> <AssemblyName>GodotTools.Core</AssemblyName> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.7</TargetFrameworkVersion> <LangVersion>7</LangVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> @@ -36,4 +36,4 @@ <Compile Include="StringExtensions.cs" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> -</Project>
\ No newline at end of file +</Project> diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotTools.IdeConnection.csproj b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotTools.IdeConnection.csproj index 427a26508f..8454535fba 100644 --- a/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotTools.IdeConnection.csproj +++ b/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotTools.IdeConnection.csproj @@ -9,7 +9,7 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>GodotTools.IdeConnection</RootNamespace> <AssemblyName>GodotTools.IdeConnection</AssemblyName> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.7</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <LangVersion>7</LangVersion> </PropertyGroup> @@ -50,4 +50,4 @@ <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -</Project>
\ No newline at end of file +</Project> diff --git a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/GodotTools.ProjectEditor.csproj b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/GodotTools.ProjectEditor.csproj index b6bb0aac34..b60e501beb 100644 --- a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/GodotTools.ProjectEditor.csproj +++ b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/GodotTools.ProjectEditor.csproj @@ -7,7 +7,7 @@ <OutputType>Library</OutputType> <RootNamespace>GodotTools.ProjectEditor</RootNamespace> <AssemblyName>GodotTools.ProjectEditor</AssemblyName> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.7</TargetFrameworkVersion> <BaseIntermediateOutputPath>obj</BaseIntermediateOutputPath> <LangVersion>7</LangVersion> </PropertyGroup> diff --git a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs index 82627de01a..28b7832f90 100644 --- a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs +++ b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs @@ -100,7 +100,7 @@ namespace GodotTools.ProjectEditor mainGroup.AddProperty("OutputPath", Path.Combine("bin", "$(Configuration)")); mainGroup.AddProperty("RootNamespace", IdentifierUtils.SanitizeQualifiedIdentifier(name, allowEmptyIdentifiers: true)); mainGroup.AddProperty("AssemblyName", name); - mainGroup.AddProperty("TargetFrameworkVersion", "v4.5"); + mainGroup.AddProperty("TargetFrameworkVersion", "v4.7"); mainGroup.AddProperty("GodotProjectGeneratorVersion", Assembly.GetExecutingAssembly().GetName().Version.ToString()); var debugGroup = root.AddPropertyGroup(); diff --git a/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj b/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj index 618527f916..379dfd9f7d 100644 --- a/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj +++ b/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj @@ -7,7 +7,7 @@ <OutputType>Library</OutputType> <RootNamespace>GodotTools</RootNamespace> <AssemblyName>GodotTools</AssemblyName> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.7</TargetFrameworkVersion> <GodotSourceRootPath>$(SolutionDir)/../../../../</GodotSourceRootPath> <DataDirToolsOutputPath>$(GodotSourceRootPath)/bin/GodotSharp/Tools</DataDirToolsOutputPath> <GodotApiConfiguration>Debug</GodotApiConfiguration> diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs index c5e62b77c8..d38589013e 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs @@ -387,6 +387,19 @@ namespace Godot return b; } + public Basis Slerp(Basis target, real_t t) + { + var from = new Quat(this); + var to = new Quat(target); + + var b = new Basis(from.Slerp(to, t)); + b.Row0 *= Mathf.Lerp(Row0.Length(), target.Row0.Length(), t); + b.Row1 *= Mathf.Lerp(Row1.Length(), target.Row1.Length(), t); + b.Row2 *= Mathf.Lerp(Row2.Length(), target.Row2.Length(), t); + + return b; + } + public real_t Tdotx(Vector3 with) { return this.Row0[0] * with[0] + this.Row1[0] * with[1] + this.Row2[0] * with[2]; diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Quat.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Quat.cs index 8f60867ac3..6702634c51 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Quat.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Quat.cs @@ -82,12 +82,20 @@ namespace Godot public Vector3 GetEuler() { +#if DEBUG + if (!IsNormalized()) + throw new InvalidOperationException("Quat is not normalized"); +#endif var basis = new Basis(this); return basis.GetEuler(); } public Quat Inverse() { +#if DEBUG + if (!IsNormalized()) + throw new InvalidOperationException("Quat is not normalized"); +#endif return new Quat(-x, -y, -z, w); } @@ -125,6 +133,13 @@ namespace Godot public Quat Slerp(Quat b, real_t t) { +#if DEBUG + if (!IsNormalized()) + throw new InvalidOperationException("Quat is not normalized"); + if (!b.IsNormalized()) + throw new ArgumentException("Argument is not normalized", nameof(b)); +#endif + // Calculate cosine real_t cosom = x * b.x + y * b.y + z * b.z + w * b.w; @@ -200,9 +215,13 @@ namespace Godot public Vector3 Xform(Vector3 v) { - Quat q = this * v; - q *= Inverse(); - return new Vector3(q.x, q.y, q.z); +#if DEBUG + if (!IsNormalized()) + throw new InvalidOperationException("Quat is not normalized"); +#endif + var u = new Vector3(x, y, z); + Vector3 uv = u.Cross(v); + return v + ((uv * w) + u.Cross(uv)) * 2; } // Static Readonly Properties @@ -257,8 +276,12 @@ namespace Godot public Quat(Vector3 axis, real_t angle) { +#if DEBUG + if (!axis.IsNormalized()) + throw new ArgumentException("Argument is not normalized", nameof(axis)); +#endif + real_t d = axis.Length(); - real_t angle_t = angle; if (d == 0f) { @@ -269,12 +292,14 @@ namespace Godot } else { - real_t s = Mathf.Sin(angle_t * 0.5f) / d; + real_t sinAngle = Mathf.Sin(angle * 0.5f); + real_t cosAngle = Mathf.Cos(angle * 0.5f); + real_t s = sinAngle / d; x = axis.x * s; y = axis.y * s; z = axis.z * s; - w = Mathf.Cos(angle_t * 0.5f); + w = cosAngle; } } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs index 025b09199f..fded34002d 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs @@ -255,7 +255,7 @@ namespace Godot { #if DEBUG if (!n.IsNormalized()) - throw new ArgumentException(String.Format("{0} is not normalized", n), nameof(n)); + throw new ArgumentException("Argument is not normalized", nameof(n)); #endif return 2.0f * n * Dot(n) - this; } @@ -296,6 +296,10 @@ namespace Godot public Vector3 Slerp(Vector3 b, real_t t) { +#if DEBUG + if (!IsNormalized()) + throw new InvalidOperationException("Vector3 is not normalized"); +#endif real_t theta = AngleTo(b); return Rotated(Cross(b), theta * t); } diff --git a/modules/regex/doc_classes/RegEx.xml b/modules/regex/doc_classes/RegEx.xml index 74b06039d4..0ce2acacbe 100644 --- a/modules/regex/doc_classes/RegEx.xml +++ b/modules/regex/doc_classes/RegEx.xml @@ -10,7 +10,7 @@ var regex = RegEx.new() regex.compile("\\w-(\\d+)") [/codeblock] - The search pattern must be escaped first for gdscript before it is escaped for the expression. For example, [code]compile("\\d+")[/code] would be read by RegEx as [code]\d+[/code]. Similarly, [code]compile("\"(?:\\\\.|[^\"])*\"")[/code] would be read as [code]"(?:\\.|[^"])*"[/code] + The search pattern must be escaped first for gdscript before it is escaped for the expression. For example, [code]compile("\\d+")[/code] would be read by RegEx as [code]\d+[/code]. Similarly, [code]compile("\"(?:\\\\.|[^\"])*\"")[/code] would be read as [code]"(?:\\.|[^"])*"[/code]. Using [method search] you can find the pattern within the given text. If a pattern is found, [RegExMatch] is returned and you can retrieve details of the results using functions such as [method RegExMatch.get_string] and [method RegExMatch.get_start]. [codeblock] var regex = RegEx.new() diff --git a/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml b/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml index b5b452ee47..a6febb0b1c 100644 --- a/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml +++ b/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml @@ -203,7 +203,7 @@ Deserialize a [Variant] from a [PoolByteArray] serialized using [constant VAR_TO_BYTES]. </constant> <constant name="COLORN" value="63" enum="BuiltinFunc"> - Return the [Color] with the given name and alpha ranging from 0 to 1 + Return the [Color] with the given name and alpha ranging from 0 to 1. [b]Note:[/b] Names are defined in [code]color_names.inc[/code]. </constant> <constant name="MATH_SMOOTHSTEP" value="64" enum="BuiltinFunc"> diff --git a/modules/visual_script/doc_classes/VisualScriptEngineSingleton.xml b/modules/visual_script/doc_classes/VisualScriptEngineSingleton.xml index 05bd87ec22..836eef93ab 100644 --- a/modules/visual_script/doc_classes/VisualScriptEngineSingleton.xml +++ b/modules/visual_script/doc_classes/VisualScriptEngineSingleton.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="VisualScriptEngineSingleton" inherits="VisualScriptNode" category="Core" version="3.2"> <brief_description> - A Visual Script node returning a singleton from [@GlobalScope] + A Visual Script node returning a singleton from [@GlobalScope]. </brief_description> <description> - A Visual Script node returning a singleton from [@GlobalScope] + A Visual Script node returning a singleton from [@GlobalScope]. </description> <tutorials> </tutorials> diff --git a/modules/visual_script/doc_classes/VisualScriptMathConstant.xml b/modules/visual_script/doc_classes/VisualScriptMathConstant.xml index 3be392aef5..7f926f17bf 100644 --- a/modules/visual_script/doc_classes/VisualScriptMathConstant.xml +++ b/modules/visual_script/doc_classes/VisualScriptMathConstant.xml @@ -21,28 +21,28 @@ </members> <constants> <constant name="MATH_CONSTANT_ONE" value="0" enum="MathConstant"> - Unity: [code]1[/code] + Unity: [code]1[/code]. </constant> <constant name="MATH_CONSTANT_PI" value="1" enum="MathConstant"> - Pi: [code]3.141593[/code] + Pi: [code]3.141593[/code]. </constant> <constant name="MATH_CONSTANT_HALF_PI" value="2" enum="MathConstant"> - Pi divided by two: [code]1.570796[/code] + Pi divided by two: [code]1.570796[/code]. </constant> <constant name="MATH_CONSTANT_TAU" value="3" enum="MathConstant"> - Tau: [code]6.283185[/code] + Tau: [code]6.283185[/code]. </constant> <constant name="MATH_CONSTANT_E" value="4" enum="MathConstant"> - Mathematical constant [code]e[/code], the natural log base: [code]2.718282[/code] + Mathematical constant [code]e[/code], the natural log base: [code]2.718282[/code]. </constant> <constant name="MATH_CONSTANT_SQRT2" value="5" enum="MathConstant"> - Square root of two: [code]1.414214[/code] + Square root of two: [code]1.414214[/code]. </constant> <constant name="MATH_CONSTANT_INF" value="6" enum="MathConstant"> - Infinity: [code]inf[/code] + Infinity: [code]inf[/code]. </constant> <constant name="MATH_CONSTANT_NAN" value="7" enum="MathConstant"> - Not a number: [code]nan[/code] + Not a number: [code]nan[/code]. </constant> <constant name="MATH_CONSTANT_MAX" value="8" enum="MathConstant"> Represents the size of the [enum MathConstant] enum. diff --git a/modules/webrtc/doc_classes/WebRTCMultiplayer.xml b/modules/webrtc/doc_classes/WebRTCMultiplayer.xml index 605b1ef082..f9403dac54 100644 --- a/modules/webrtc/doc_classes/WebRTCMultiplayer.xml +++ b/modules/webrtc/doc_classes/WebRTCMultiplayer.xml @@ -45,7 +45,7 @@ <return type="Dictionary"> </return> <description> - Returns a dictionary which keys are the peer ids and values the peer representation as in [method get_peer] + Returns a dictionary which keys are the peer ids and values the peer representation as in [method get_peer]. </description> </method> <method name="has_peer"> diff --git a/modules/webrtc/doc_classes/WebRTCPeerConnection.xml b/modules/webrtc/doc_classes/WebRTCPeerConnection.xml index 26082d73a8..19d13dcc66 100644 --- a/modules/webrtc/doc_classes/WebRTCPeerConnection.xml +++ b/modules/webrtc/doc_classes/WebRTCPeerConnection.xml @@ -143,7 +143,7 @@ </argument> <description> Emitted when a new in-band channel is received, i.e. when the channel was created with [code]negotiated: false[/code] (default). - The object will be an instance of [WebRTCDataChannel]. You must keep a reference of it or it will be closed automatically. See [method create_data_channel] + The object will be an instance of [WebRTCDataChannel]. You must keep a reference of it or it will be closed automatically. See [method create_data_channel]. </description> </signal> <signal name="ice_candidate_created"> diff --git a/modules/websocket/doc_classes/WebSocketPeer.xml b/modules/websocket/doc_classes/WebSocketPeer.xml index dd95f7432e..3c943ccd24 100644 --- a/modules/websocket/doc_classes/WebSocketPeer.xml +++ b/modules/websocket/doc_classes/WebSocketPeer.xml @@ -66,7 +66,7 @@ <return type="bool"> </return> <description> - Returns [code]true[/code] if the last received packet was sent as a text payload. See [enum WriteMode] + Returns [code]true[/code] if the last received packet was sent as a text payload. See [enum WriteMode]. </description> </method> </methods> diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotIO.java b/platform/android/java/lib/src/org/godotengine/godot/GodotIO.java index 271d508a4d..68ce40ba10 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/GodotIO.java +++ b/platform/android/java/lib/src/org/godotengine/godot/GodotIO.java @@ -491,9 +491,9 @@ public class GodotIO { return (int)(metrics.density * 160f); } - public void showKeyboard(String p_existing_text) { + public void showKeyboard(String p_existing_text, int p_max_input_length) { if (edit != null) - edit.showKeyboard(p_existing_text); + edit.showKeyboard(p_existing_text, p_max_input_length); //InputMethodManager inputMgr = (InputMethodManager)activity.getSystemService(Context.INPUT_METHOD_SERVICE); //inputMgr.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java b/platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java index 0d5521dd87..44998aa6c0 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java +++ b/platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java @@ -32,6 +32,7 @@ package org.godotengine.godot.input; import android.content.Context; import android.os.Handler; import android.os.Message; +import android.text.InputFilter; import android.util.AttributeSet; import android.view.KeyEvent; import android.view.inputmethod.EditorInfo; @@ -104,6 +105,7 @@ public class GodotEditText extends EditText { edit.append(text); edit.mInputWrapper.setOriginText(text); edit.addTextChangedListener(edit.mInputWrapper); + setMaxInputLength(edit, msg.arg1); final InputMethodManager imm = (InputMethodManager)mView.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(edit, 0); } @@ -120,6 +122,16 @@ public class GodotEditText extends EditText { } } + private void setMaxInputLength(EditText p_edit_text, int p_max_input_length) { + if (p_max_input_length >= 0) { + InputFilter[] filters = new InputFilter[1]; + filters[0] = new InputFilter.LengthFilter(p_max_input_length); + p_edit_text.setFilters(filters); + } else { + p_edit_text.setFilters(new InputFilter[] {}); + } + } + // =========================================================== // Getter & Setter // =========================================================== @@ -149,12 +161,13 @@ public class GodotEditText extends EditText { // =========================================================== // Methods // =========================================================== - public void showKeyboard(String p_existing_text) { + public void showKeyboard(String p_existing_text, int p_max_input_length) { this.mOriginText = p_existing_text; final Message msg = new Message(); msg.what = HANDLER_OPEN_IME_KEYBOARD; msg.obj = this; + msg.arg1 = p_max_input_length; sHandler.sendMessage(msg); } diff --git a/platform/android/java_godot_io_wrapper.cpp b/platform/android/java_godot_io_wrapper.cpp index 671d1072ea..8d075f8e97 100644 --- a/platform/android/java_godot_io_wrapper.cpp +++ b/platform/android/java_godot_io_wrapper.cpp @@ -53,7 +53,7 @@ GodotIOJavaWrapper::GodotIOJavaWrapper(JNIEnv *p_env, jobject p_godot_io_instanc _get_model = p_env->GetMethodID(cls, "getModel", "()Ljava/lang/String;"); _get_screen_DPI = p_env->GetMethodID(cls, "getScreenDPI", "()I"); _get_unique_id = p_env->GetMethodID(cls, "getUniqueID", "()Ljava/lang/String;"); - _show_keyboard = p_env->GetMethodID(cls, "showKeyboard", "(Ljava/lang/String;)V"); + _show_keyboard = p_env->GetMethodID(cls, "showKeyboard", "(Ljava/lang/String;I)V"); _hide_keyboard = p_env->GetMethodID(cls, "hideKeyboard", "()V"); _set_screen_orientation = p_env->GetMethodID(cls, "setScreenOrientation", "(I)V"); _get_system_dir = p_env->GetMethodID(cls, "getSystemDir", "(I)Ljava/lang/String;"); @@ -135,11 +135,11 @@ bool GodotIOJavaWrapper::has_vk() { return (_show_keyboard != 0) && (_hide_keyboard != 0); } -void GodotIOJavaWrapper::show_vk(const String &p_existing) { +void GodotIOJavaWrapper::show_vk(const String &p_existing, int p_max_input_length) { if (_show_keyboard) { JNIEnv *env = ThreadAndroid::get_env(); jstring jStr = env->NewStringUTF(p_existing.utf8().get_data()); - env->CallVoidMethod(godot_io_instance, _show_keyboard, jStr); + env->CallVoidMethod(godot_io_instance, _show_keyboard, jStr, p_max_input_length); } } diff --git a/platform/android/java_godot_io_wrapper.h b/platform/android/java_godot_io_wrapper.h index 9fa6f2e469..7dfed52187 100644 --- a/platform/android/java_godot_io_wrapper.h +++ b/platform/android/java_godot_io_wrapper.h @@ -73,7 +73,7 @@ public: int get_screen_dpi(); String get_unique_id(); bool has_vk(); - void show_vk(const String &p_existing); + void show_vk(const String &p_existing, int p_max_input_length); void hide_vk(); int get_vk_height(); void set_vk_height(int p_height); diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index bbea5e3699..44c5b5d6b4 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -559,10 +559,10 @@ int OS_Android::get_virtual_keyboard_height() const { // return 0; } -void OS_Android::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect) { +void OS_Android::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect, int p_max_input_length) { if (godot_io_java->has_vk()) { - godot_io_java->show_vk(p_existing_text); + godot_io_java->show_vk(p_existing_text, p_max_input_length); } else { ERR_PRINT("Virtual keyboard not available"); diff --git a/platform/android/os_android.h b/platform/android/os_android.h index 1cf64a2e84..c2f9a0992f 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -158,7 +158,7 @@ public: virtual bool has_touchscreen_ui_hint() const; virtual bool has_virtual_keyboard() const; - virtual void show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2()); + virtual void show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2(), int p_max_input_length = -1); virtual void hide_virtual_keyboard(); virtual int get_virtual_keyboard_height() const; diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index 3e5ab7b886..7a699f9b50 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -482,7 +482,7 @@ extern Error _shell_open(String p_uri); extern void _set_keep_screen_on(bool p_enabled); extern void _vibrate(); -void OSIPhone::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect) { +void OSIPhone::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect, int p_max_input_length) { _show_keyboard(p_existing_text); }; diff --git a/platform/iphone/os_iphone.h b/platform/iphone/os_iphone.h index 4668471aa9..d2d96181f5 100644 --- a/platform/iphone/os_iphone.h +++ b/platform/iphone/os_iphone.h @@ -165,7 +165,7 @@ public: virtual bool can_draw() const; virtual bool has_virtual_keyboard() const; - virtual void show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2()); + virtual void show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2(), int p_max_input_length = -1); virtual void hide_virtual_keyboard(); virtual int get_virtual_keyboard_height() const; diff --git a/platform/javascript/os_javascript.h b/platform/javascript/os_javascript.h index 2d1c765e76..5c02a292ee 100644 --- a/platform/javascript/os_javascript.h +++ b/platform/javascript/os_javascript.h @@ -141,7 +141,7 @@ public: void run_async(); bool main_loop_iterate(); - virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false, Mutex *p_pipe_mutex = NULL); + virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking = true, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false, Mutex *p_pipe_mutex = NULL); virtual Error kill(const ProcessID &p_pid); virtual int get_process_id() const; diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp index aec5da316b..d5047b53ab 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -801,7 +801,7 @@ bool OS_UWP::has_virtual_keyboard() const { return UIViewSettings::GetForCurrentView()->UserInteractionMode == UserInteractionMode::Touch; } -void OS_UWP::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect) { +void OS_UWP::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect, int p_max_input_length) { InputPane ^ pane = InputPane::GetForCurrentView(); pane->TryShow(); diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h index edc63bd637..fb43ab382e 100644 --- a/platform/uwp/os_uwp.h +++ b/platform/uwp/os_uwp.h @@ -205,7 +205,7 @@ public: virtual void delay_usec(uint32_t p_usec) const; virtual uint64_t get_ticks_usec() const; - virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false, Mutex *p_pipe_mutex = NULL); + virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking = true, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false, Mutex *p_pipe_mutex = NULL); virtual Error kill(const ProcessID &p_pid); virtual bool has_environment(const String &p_var) const; @@ -239,7 +239,7 @@ public: virtual bool has_touchscreen_ui_hint() const; virtual bool has_virtual_keyboard() const; - virtual void show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2()); + virtual void show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2(), int p_max_input_length = -1); virtual void hide_virtual_keyboard(); virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false); diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 65d08f5d36..cf16295a70 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -359,7 +359,7 @@ public: virtual void delay_usec(uint32_t p_usec) const; virtual uint64_t get_ticks_usec() const; - virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false, Mutex *p_pipe_mutex = NULL); + virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking = true, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false, Mutex *p_pipe_mutex = NULL); virtual Error kill(const ProcessID &p_pid); virtual int get_process_id() const; diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 957779ee83..bd5e5e0812 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -333,11 +333,15 @@ def configure(env): if not env['tools']: import subprocess import re - binutils_version = re.search('\s(\d+\.\d+)', str(subprocess.check_output(['ld', '-v']))).group(1) - if float(binutils_version) >= 2.30: - env.Append(LINKFLAGS=['-T', 'platform/x11/pck_embed.ld']) + linker_version_str = subprocess.check_output([env.subst(env["LINK"]), '-Wl,--version']).decode("utf-8") + gnu_ld_version = re.search('^GNU ld [^$]*(\d+\.\d+)$', linker_version_str, re.MULTILINE) + if not gnu_ld_version: + print("Warning: Creating template binaries enabled for PCK embedding is currently only supported with GNU ld") else: - env.Append(LINKFLAGS=['-T', 'platform/x11/pck_embed.legacy.ld']) + if float(gnu_ld_version.group(1)) >= 2.30: + env.Append(LINKFLAGS=['-T', 'platform/x11/pck_embed.ld']) + else: + env.Append(LINKFLAGS=['-T', 'platform/x11/pck_embed.legacy.ld']) ## Cross-compilation diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 2f0d49e6dd..57c7b0594c 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -2000,11 +2000,6 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) { if (last_is_pressed) { k->set_echo(true); } - } else { - //ignore - if (!last_is_pressed) { - return; - } } //printf("key: %x\n",k->get_scancode()); diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp index c325de00b8..f59e3461b1 100644 --- a/scene/2d/cpu_particles_2d.cpp +++ b/scene/2d/cpu_particles_2d.cpp @@ -294,15 +294,6 @@ float CPUParticles2D::get_spread() const { return spread; } -void CPUParticles2D::set_flatness(float p_flatness) { - - flatness = p_flatness; -} -float CPUParticles2D::get_flatness() const { - - return flatness; -} - void CPUParticles2D::set_param(Parameter p_param, float p_value) { ERR_FAIL_INDEX(p_param, PARAM_MAX); @@ -1169,7 +1160,6 @@ void CPUParticles2D::convert_from_particles(Node *p_particles) { Vector3 dir = material->get_direction(); set_direction(Vector2(dir.x, dir.y)); set_spread(material->get_spread()); - set_flatness(material->get_flatness()); set_color(material->get_color()); @@ -1283,9 +1273,6 @@ void CPUParticles2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_spread", "degrees"), &CPUParticles2D::set_spread); ClassDB::bind_method(D_METHOD("get_spread"), &CPUParticles2D::get_spread); - ClassDB::bind_method(D_METHOD("set_flatness", "amount"), &CPUParticles2D::set_flatness); - ClassDB::bind_method(D_METHOD("get_flatness"), &CPUParticles2D::get_flatness); - ClassDB::bind_method(D_METHOD("set_param", "param", "value"), &CPUParticles2D::set_param); ClassDB::bind_method(D_METHOD("get_param", "param"), &CPUParticles2D::get_param); @@ -1341,7 +1328,6 @@ void CPUParticles2D::_bind_methods() { ADD_GROUP("Direction", ""); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "direction"), "set_direction", "get_direction"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "spread", PROPERTY_HINT_RANGE, "0,180,0.01"), "set_spread", "get_spread"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "flatness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_flatness", "get_flatness"); ADD_GROUP("Gravity", ""); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "gravity"), "set_gravity", "get_gravity"); ADD_GROUP("Initial Velocity", "initial_"); @@ -1452,7 +1438,6 @@ CPUParticles2D::CPUParticles2D() { set_direction(Vector2(1, 0)); set_spread(45); - set_flatness(0); set_param(PARAM_INITIAL_LINEAR_VELOCITY, 0); set_param(PARAM_ANGULAR_VELOCITY, 0); set_param(PARAM_ORBIT_VELOCITY, 0); diff --git a/scene/2d/cpu_particles_2d.h b/scene/2d/cpu_particles_2d.h index cbaff70c2a..085ec99ea0 100644 --- a/scene/2d/cpu_particles_2d.h +++ b/scene/2d/cpu_particles_2d.h @@ -154,7 +154,6 @@ private: Vector2 direction; float spread; - float flatness; float parameters[PARAM_MAX]; float randomness[PARAM_MAX]; @@ -243,9 +242,6 @@ public: void set_spread(float p_spread); float get_spread() const; - void set_flatness(float p_flatness); - float get_flatness() const; - void set_param(Parameter p_param, float p_value); float get_param(Parameter p_param) const; diff --git a/scene/3d/arvr_nodes.cpp b/scene/3d/arvr_nodes.cpp index f0aaba1065..8d1556ef1c 100644 --- a/scene/3d/arvr_nodes.cpp +++ b/scene/3d/arvr_nodes.cpp @@ -85,9 +85,8 @@ Vector3 ARVRCamera::project_local_ray_normal(const Point2 &p_pos) const { Vector3 ray; CameraMatrix cm = arvr_interface->get_projection_for_eye(ARVRInterface::EYE_MONO, viewport_size.aspect(), get_znear(), get_zfar()); - float screen_w, screen_h; - cm.get_viewport_size(screen_w, screen_h); - ray = Vector3(((cpos.x / viewport_size.width) * 2.0 - 1.0) * screen_w, ((1.0 - (cpos.y / viewport_size.height)) * 2.0 - 1.0) * screen_h, -get_znear()).normalized(); + Vector2 screen_he = cm.get_viewport_half_extents(); + ray = Vector3(((cpos.x / viewport_size.width) * 2.0 - 1.0) * screen_he.x, ((1.0 - (cpos.y / viewport_size.height)) * 2.0 - 1.0) * screen_he.y, -get_znear()).normalized(); return ray; }; @@ -138,13 +137,12 @@ Vector3 ARVRCamera::project_position(const Point2 &p_point, float p_z_depth) con CameraMatrix cm = arvr_interface->get_projection_for_eye(ARVRInterface::EYE_MONO, viewport_size.aspect(), get_znear(), get_zfar()); - Size2 vp_size; - cm.get_viewport_size(vp_size.x, vp_size.y); + Vector2 vp_he = cm.get_viewport_half_extents(); Vector2 point; point.x = (p_point.x / viewport_size.x) * 2.0 - 1.0; point.y = (1.0 - (p_point.y / viewport_size.y)) * 2.0 - 1.0; - point *= vp_size; + point *= vp_he; Vector3 p(point.x, point.y, -p_z_depth); diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp index 3a30755f7f..640189a26e 100644 --- a/scene/3d/camera.cpp +++ b/scene/3d/camera.cpp @@ -291,9 +291,8 @@ Vector3 Camera::project_local_ray_normal(const Point2 &p_pos) const { } else { CameraMatrix cm; cm.set_perspective(fov, viewport_size.aspect(), near, far, keep_aspect == KEEP_WIDTH); - float screen_w, screen_h; - cm.get_viewport_size(screen_w, screen_h); - ray = Vector3(((cpos.x / viewport_size.width) * 2.0 - 1.0) * screen_w, ((1.0 - (cpos.y / viewport_size.height)) * 2.0 - 1.0) * screen_h, -near).normalized(); + Vector2 screen_he = cm.get_viewport_half_extents(); + ray = Vector3(((cpos.x / viewport_size.width) * 2.0 - 1.0) * screen_he.x, ((1.0 - (cpos.y / viewport_size.height)) * 2.0 - 1.0) * screen_he.y, -near).normalized(); } return ray; @@ -402,13 +401,12 @@ Vector3 Camera::project_position(const Point2 &p_point, float p_z_depth) const { else cm.set_perspective(fov, viewport_size.aspect(), p_z_depth, far, keep_aspect == KEEP_WIDTH); - Size2 vp_size; - cm.get_viewport_size(vp_size.x, vp_size.y); + Vector2 vp_he = cm.get_viewport_half_extents(); Vector2 point; point.x = (p_point.x / viewport_size.x) * 2.0 - 1.0; point.y = (1.0 - (p_point.y / viewport_size.y)) * 2.0 - 1.0; - point *= vp_size; + point *= vp_he; Vector3 p(point.x, point.y, -p_z_depth); diff --git a/scene/animation/animation_blend_tree.cpp b/scene/animation/animation_blend_tree.cpp index 5f606ff4c5..5c284cb483 100644 --- a/scene/animation/animation_blend_tree.cpp +++ b/scene/animation/animation_blend_tree.cpp @@ -832,8 +832,8 @@ void AnimationNodeTransition::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "xfade_time", PROPERTY_HINT_RANGE, "0,120,0.01"), "set_cross_fade_time", "get_cross_fade_time"); for (int i = 0; i < MAX_INPUTS; i++) { - ADD_PROPERTYI(PropertyInfo(Variant::STRING, "input_" + itos(i) + "/name"), "set_input_caption", "get_input_caption", i); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "input_" + itos(i) + "/auto_advance"), "set_input_as_auto_advance", "is_input_set_as_auto_advance", i); + ADD_PROPERTYI(PropertyInfo(Variant::STRING, "input_" + itos(i) + "/name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_input_caption", "get_input_caption", i); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "input_" + itos(i) + "/auto_advance", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_input_as_auto_advance", "is_input_set_as_auto_advance", i); } } diff --git a/scene/animation/skeleton_ik.cpp b/scene/animation/skeleton_ik.cpp index 518c243dd0..46028a9ce2 100644 --- a/scene/animation/skeleton_ik.cpp +++ b/scene/animation/skeleton_ik.cpp @@ -329,6 +329,17 @@ void FabrikInverseKinematic::solve(Task *p_task, real_t blending_delta, bool ove } } +void FabrikInverseKinematic::reset(Task *p_task) { + ChainItem *ci(&p_task->chain.chain_root); + while (ci) { + p_task->skeleton->set_bone_global_pose_override(ci->bone, Transform(), 0); + if (!ci->children.empty()) + ci = &ci->children.write[0]; + else + ci = NULL; + } +} + void SkeletonIK::_validate_property(PropertyInfo &property) const { if (property.name == "root_bone" || property.name == "tip_bone") { @@ -531,6 +542,8 @@ void SkeletonIK::start(bool p_one_time) { void SkeletonIK::stop() { set_process_internal(false); + if (task) + FabrikInverseKinematic::reset(task); } Transform SkeletonIK::_get_target_transform() { diff --git a/scene/animation/skeleton_ik.h b/scene/animation/skeleton_ik.h index 9ae010dc4e..8fc8a58b99 100644 --- a/scene/animation/skeleton_ik.h +++ b/scene/animation/skeleton_ik.h @@ -139,6 +139,7 @@ public: static void set_goal(Task *p_task, const Transform &p_goal); static void make_goal(Task *p_task, const Transform &p_inverse_transf, real_t blending_delta); static void solve(Task *p_task, real_t blending_delta, bool override_tip_basis, bool p_use_magnet, const Vector3 &p_magnet_position); + static void reset(Task *p_task); }; class SkeletonIK : public Node { diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 58212335c2..331a6c769c 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -827,6 +827,7 @@ bool Tween::start() { // Are there any pending updates? if (pending_update != 0) { // Start the tweens after deferring + call_deferred("start"); return true; } diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 4f499af186..ae48a1356e 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2475,9 +2475,9 @@ void Control::_window_find_focus_neighbour(const Vector2 &p_dir, Node *p_at, con Transform2D xform = c->get_global_transform(); points[0] = xform.xform(Point2()); - points[1] = xform.xform(Point2(get_size().x, 0)); - points[2] = xform.xform(get_size()); - points[3] = xform.xform(Point2(0, get_size().y)); + points[1] = xform.xform(Point2(c->get_size().x, 0)); + points[2] = xform.xform(c->get_size()); + points[3] = xform.xform(Point2(0, c->get_size().y)); float min = 1e7; diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 0f3328dac5..7afc3b0d00 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -128,7 +128,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { selection.doubleclick = false; if (OS::get_singleton()->has_virtual_keyboard()) - OS::get_singleton()->show_virtual_keyboard(text, get_global_rect()); + OS::get_singleton()->show_virtual_keyboard(text, get_global_rect(), max_length); } update(); @@ -913,7 +913,7 @@ void LineEdit::_notification(int p_what) { OS::get_singleton()->set_ime_position(get_global_position() + cursor_pos); if (OS::get_singleton()->has_virtual_keyboard()) - OS::get_singleton()->show_virtual_keyboard(text, get_global_rect()); + OS::get_singleton()->show_virtual_keyboard(text, get_global_rect(), max_length); } break; case NOTIFICATION_FOCUS_EXIT: { diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index d9caf1d657..a827793f67 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -1038,6 +1038,7 @@ void TileSet::_tile_set_shapes(int p_id, const Array &p_shapes) { } tile_map[p_id].shapes_data = shapes_data; + emit_changed(); } Array TileSet::_tile_get_shapes(int p_id) const { diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index 4d2082e3c1..a9d7cad07f 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -79,7 +79,7 @@ Vector<StringName> VisualShaderNode::get_editable_properties() const { return Vector<StringName>(); } -Array VisualShaderNode::_get_default_input_values() const { +Array VisualShaderNode::get_default_input_values() const { Array ret; for (Map<int, Variant>::Element *E = default_input_values.front(); E; E = E->next()) { @@ -88,7 +88,7 @@ Array VisualShaderNode::_get_default_input_values() const { } return ret; } -void VisualShaderNode::_set_default_input_values(const Array &p_values) { +void VisualShaderNode::set_default_input_values(const Array &p_values) { if (p_values.size() % 2 == 0) { for (int i = 0; i < p_values.size(); i += 2) { @@ -115,11 +115,11 @@ void VisualShaderNode::_bind_methods() { ClassDB::bind_method(D_METHOD("set_input_port_default_value", "port", "value"), &VisualShaderNode::set_input_port_default_value); ClassDB::bind_method(D_METHOD("get_input_port_default_value", "port"), &VisualShaderNode::get_input_port_default_value); - ClassDB::bind_method(D_METHOD("_set_default_input_values", "values"), &VisualShaderNode::_set_default_input_values); - ClassDB::bind_method(D_METHOD("_get_default_input_values"), &VisualShaderNode::_get_default_input_values); + ClassDB::bind_method(D_METHOD("set_default_input_values", "values"), &VisualShaderNode::set_default_input_values); + ClassDB::bind_method(D_METHOD("get_default_input_values"), &VisualShaderNode::get_default_input_values); ADD_PROPERTY(PropertyInfo(Variant::INT, "output_port_for_preview"), "set_output_port_for_preview", "get_output_port_for_preview"); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "default_input_values", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "_set_default_input_values", "_get_default_input_values"); + ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "default_input_values", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "set_default_input_values", "get_default_input_values"); ADD_SIGNAL(MethodInfo("editor_refresh_request")); BIND_ENUM_CONSTANT(PORT_TYPE_SCALAR); diff --git a/scene/resources/visual_shader.h b/scene/resources/visual_shader.h index b2803d1dfb..d120ea6610 100644 --- a/scene/resources/visual_shader.h +++ b/scene/resources/visual_shader.h @@ -175,9 +175,6 @@ class VisualShaderNode : public Resource { Map<int, Variant> default_input_values; - Array _get_default_input_values() const; - void _set_default_input_values(const Array &p_values); - protected: static void _bind_methods(); @@ -199,6 +196,8 @@ public: void set_input_port_default_value(int p_port, const Variant &p_value); Variant get_input_port_default_value(int p_port) const; // if NIL (default if node does not set anything) is returned, it means no default value is wanted if disconnected, thus no input var must be supplied (empty string will be supplied) + Array get_default_input_values() const; + void set_default_input_values(const Array &p_values); virtual int get_output_port_count() const = 0; virtual PortType get_output_port_type(int p_port) const = 0; diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 121519be0f..d3ecdf4e59 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -1407,21 +1407,21 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = { { "ivec4", TYPE_IVEC4, { TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, { "ivec4", TYPE_IVEC4, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, - { "uint", TYPE_UINT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec2", TYPE_UVEC2, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec2", TYPE_UVEC2, { TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec3", TYPE_UVEC3, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UVEC2, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec4", TYPE_UVEC4, { TYPE_UVEC2, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UINT, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec4", TYPE_UVEC4, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec4", TYPE_UVEC4, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "uint", TYPE_UINT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec2", TYPE_UVEC2, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec2", TYPE_UVEC2, { TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec3", TYPE_UVEC3, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UVEC2, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec4", TYPE_UVEC4, { TYPE_UVEC2, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UINT, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec4", TYPE_UVEC4, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec4", TYPE_UVEC4, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, true }, { "mat2", TYPE_MAT2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, { "mat3", TYPE_MAT3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, @@ -1435,22 +1435,22 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = { { "int", TYPE_INT, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL, false }, { "int", TYPE_INT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, - { "int", TYPE_INT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "int", TYPE_INT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, { "int", TYPE_INT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, { "float", TYPE_FLOAT, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL, false }, { "float", TYPE_FLOAT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, - { "float", TYPE_FLOAT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "float", TYPE_FLOAT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, { "float", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, - { "uint", TYPE_UINT, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL, false }, - { "uint", TYPE_UINT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, - { "uint", TYPE_UINT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "uint", TYPE_UINT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, + { "uint", TYPE_UINT, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL, true }, + { "uint", TYPE_UINT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL, true }, + { "uint", TYPE_UINT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "uint", TYPE_UINT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true }, { "bool", TYPE_BOOL, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL, false }, { "bool", TYPE_BOOL, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, - { "bool", TYPE_BOOL, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "bool", TYPE_BOOL, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, { "bool", TYPE_BOOL, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, //conversion vectors @@ -1462,57 +1462,57 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = { { "vec2", TYPE_VEC2, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL, false }, { "vec2", TYPE_VEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, - { "vec2", TYPE_VEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec2", TYPE_VEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, true }, { "vec2", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec2", TYPE_UVEC2, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec2", TYPE_UVEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec2", TYPE_UVEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec2", TYPE_UVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec2", TYPE_UVEC2, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec2", TYPE_UVEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec2", TYPE_UVEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec2", TYPE_UVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, true }, { "bvec2", TYPE_BVEC2, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL, false }, { "bvec2", TYPE_BVEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL, false }, - { "bvec2", TYPE_BVEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec2", TYPE_BVEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, true }, { "bvec2", TYPE_BVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, { "ivec3", TYPE_IVEC3, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL, false }, { "ivec3", TYPE_IVEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, - { "ivec3", TYPE_IVEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec3", TYPE_IVEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, true }, { "ivec3", TYPE_IVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, { "vec3", TYPE_VEC3, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL, false }, { "vec3", TYPE_VEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, - { "vec3", TYPE_VEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec3", TYPE_VEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, true }, { "vec3", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec3", TYPE_UVEC3, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec3", TYPE_UVEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec3", TYPE_UVEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec3", TYPE_UVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec3", TYPE_UVEC3, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec3", TYPE_UVEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec3", TYPE_UVEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec3", TYPE_UVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true }, { "bvec3", TYPE_BVEC3, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL, false }, { "bvec3", TYPE_BVEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, - { "bvec3", TYPE_BVEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec3", TYPE_BVEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, true }, { "bvec3", TYPE_BVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, { "ivec4", TYPE_IVEC4, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL, false }, { "ivec4", TYPE_IVEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "ivec4", TYPE_IVEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "ivec4", TYPE_IVEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, true }, { "ivec4", TYPE_IVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, { "vec4", TYPE_VEC4, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL, false }, { "vec4", TYPE_VEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "vec4", TYPE_VEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "vec4", TYPE_VEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, true }, { "vec4", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec4", TYPE_UVEC4, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec4", TYPE_UVEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec4", TYPE_UVEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "uvec4", TYPE_UVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "uvec4", TYPE_UVEC4, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec4", TYPE_UVEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec4", TYPE_UVEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, true }, + { "uvec4", TYPE_UVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, true }, { "bvec4", TYPE_BVEC4, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL, false }, { "bvec4", TYPE_BVEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "bvec4", TYPE_BVEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "bvec4", TYPE_BVEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, true }, { "bvec4", TYPE_BVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, false }, //conversion between matrixes @@ -1704,13 +1704,13 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = { { "min", TYPE_IVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, { "min", TYPE_IVEC4, { TYPE_IVEC4, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, - { "min", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "min", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, - { "min", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "min", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, - { "min", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "min", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "min", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "min", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "min", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "min", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "min", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "min", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "min", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, true }, + { "min", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, { "max", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, { "max", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, @@ -1728,13 +1728,13 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = { { "max", TYPE_IVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, { "max", TYPE_IVEC4, { TYPE_IVEC4, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, - { "max", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "max", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, - { "max", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "max", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, - { "max", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "max", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "max", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "max", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "max", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "max", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "max", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "max", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "max", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, true }, + { "max", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, { "clamp", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, { "clamp", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, @@ -1752,13 +1752,13 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = { { "clamp", TYPE_IVEC3, { TYPE_IVEC3, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, { "clamp", TYPE_IVEC4, { TYPE_IVEC4, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL, false }, - { "clamp", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "clamp", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, - { "clamp", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, - { "clamp", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "clamp", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "clamp", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, - { "clamp", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, false }, + { "clamp", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "clamp", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "clamp", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "clamp", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, true }, + { "clamp", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "clamp", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, + { "clamp", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL, true }, { "mix", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, { "mix", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false }, @@ -1865,9 +1865,9 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = { { "lessThan", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, { "lessThan", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "lessThan", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, - { "lessThan", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, - { "lessThan", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "lessThan", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "lessThan", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "lessThan", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, true }, { "greaterThan", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, { "greaterThan", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, @@ -1877,9 +1877,9 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = { { "greaterThan", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, { "greaterThan", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "greaterThan", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, - { "greaterThan", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, - { "greaterThan", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "greaterThan", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "greaterThan", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "greaterThan", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, true }, { "lessThanEqual", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, { "lessThanEqual", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, @@ -1889,9 +1889,9 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = { { "lessThanEqual", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, { "lessThanEqual", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "lessThanEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, - { "lessThanEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, - { "lessThanEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "lessThanEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "lessThanEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "lessThanEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, true }, { "greaterThanEqual", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, { "greaterThanEqual", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, @@ -1901,9 +1901,9 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = { { "greaterThanEqual", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, { "greaterThanEqual", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "greaterThanEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, - { "greaterThanEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, - { "greaterThanEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "greaterThanEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "greaterThanEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "greaterThanEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, true }, { "equal", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false }, { "equal", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false }, @@ -1913,9 +1913,9 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = { { "equal", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, { "equal", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "equal", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, - { "equal", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, - { "equal", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "equal", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "equal", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "equal", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, true }, { "equal", TYPE_BVEC2, { TYPE_BVEC2, TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL, false }, { "equal", TYPE_BVEC3, { TYPE_BVEC3, TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL, false }, @@ -1929,9 +1929,9 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = { { "notEqual", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL, false }, { "notEqual", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL, false }, - { "notEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, false }, - { "notEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, false }, - { "notEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, false }, + { "notEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL, true }, + { "notEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL, true }, + { "notEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL, true }, { "notEqual", TYPE_BVEC2, { TYPE_BVEC2, TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL, false }, { "notEqual", TYPE_BVEC3, { TYPE_BVEC3, TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL, false }, @@ -3857,6 +3857,10 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui DataType type = get_token_datatype(tk.type); + if (_validate_datatype(type) != OK) { + return ERR_PARSE_ERROR; + } + tk = _get_token(); Node *vardecl = NULL; @@ -4688,27 +4692,17 @@ Error ShaderLanguage::_validate_datatype(DataType p_type) { bool invalid_type = false; switch (p_type) { + case TYPE_UINT: + case TYPE_UVEC2: + case TYPE_UVEC3: + case TYPE_UVEC4: case TYPE_ISAMPLER2D: - invalid_type = true; - break; case TYPE_USAMPLER2D: - invalid_type = true; - break; case TYPE_SAMPLER3D: - invalid_type = true; - break; case TYPE_ISAMPLER3D: - invalid_type = true; - break; case TYPE_USAMPLER3D: - invalid_type = true; - break; case TYPE_SAMPLER2DARRAY: - invalid_type = true; - break; case TYPE_USAMPLER2DARRAY: - invalid_type = true; - break; case TYPE_ISAMPLER2DARRAY: invalid_type = true; break; @@ -5608,17 +5602,26 @@ Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Funct } int idx = 0; + bool low_end = VisualServer::get_singleton()->is_low_end(); while (builtin_func_defs[idx].name) { - + if (low_end && builtin_func_defs[idx].high_end) { + idx++; + continue; + } matches.insert(String(builtin_func_defs[idx].name), ScriptCodeCompletionOption::KIND_FUNCTION); idx++; } } else { // sub-class int idx = 0; + bool low_end = VisualServer::get_singleton()->is_low_end(); while (builtin_func_defs[idx].name) { + if (low_end && builtin_func_defs[idx].high_end) { + idx++; + continue; + } if (builtin_func_defs[idx].tag == completion_class) { matches.insert(String(builtin_func_defs[idx].name), ScriptCodeCompletionOption::KIND_FUNCTION); } @@ -5682,9 +5685,15 @@ Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Funct int idx = 0; String calltip; + bool low_end = VisualServer::get_singleton()->is_low_end(); while (builtin_func_defs[idx].name) { + if (low_end && builtin_func_defs[idx].high_end) { + idx++; + continue; + } + if (completion_function == builtin_func_defs[idx].name) { if (builtin_func_defs[idx].tag != completion_class) { diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp index 409a814b3b..f5767e93a2 100644 --- a/servers/visual/visual_server_scene.cpp +++ b/servers/visual/visual_server_scene.cpp @@ -1400,9 +1400,9 @@ bool VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons if (p_cam_orthogonal) { - float w, h; - p_cam_projection.get_viewport_size(w, h); - camera_matrix.set_orthogonal(w, aspect, distances[(i == 0 || !overlap) ? i : i - 1], distances[i + 1], false); + Vector2 vp_he = p_cam_projection.get_viewport_half_extents(); + + camera_matrix.set_orthogonal(vp_he.y * 2.0, aspect, distances[(i == 0 || !overlap) ? i : i - 1], distances[i + 1], false); } else { float fov = p_cam_projection.get_fov(); @@ -2090,8 +2090,8 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca float zn = p_cam_projection.get_z_near(); Plane p(cam_xf.origin + cam_xf.basis.get_axis(2) * -zn, -cam_xf.basis.get_axis(2)); //camera near plane - float vp_w, vp_h; //near plane size in screen coordinates - p_cam_projection.get_viewport_size(vp_w, vp_h); + // near plane half width and height + Vector2 vp_half_extents = p_cam_projection.get_viewport_half_extents(); switch (VSG::storage->light_get_type(ins->base)) { @@ -2117,7 +2117,7 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca } float screen_diameter = points[0].distance_to(points[1]) * 2; - coverage = screen_diameter / (vp_w + vp_h); + coverage = screen_diameter / (vp_half_extents.x + vp_half_extents.y); } break; case VS::LIGHT_SPOT: { @@ -2146,7 +2146,7 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca } float screen_diameter = points[0].distance_to(points[1]) * 2; - coverage = screen_diameter / (vp_w + vp_h); + coverage = screen_diameter / (vp_half_extents.x + vp_half_extents.y); } break; default: { |