mirror of
https://github.com/godotengine/godot.git
synced 2024-11-10 14:12:51 +00:00
Merge pull request #87589 from YuriSizov/4.2-cherrypicks
Cherry-picks for the 4.2 branch (future 4.2.2) - 2nd batch
This commit is contained in:
commit
7ecb58dfc5
@ -473,7 +473,7 @@ License: Expat
|
||||
|
||||
Files: ./thirdparty/thorvg/
|
||||
Comment: ThorVG
|
||||
Copyright: 2020-2023, The ThorVG Project
|
||||
Copyright: 2020-2024, The ThorVG Project
|
||||
License: Expat
|
||||
|
||||
Files: ./thirdparty/tinyexr/
|
||||
|
@ -742,14 +742,19 @@ Dictionary GDExtensionAPIDump::generate_extension_api(bool p_include_docs) {
|
||||
Dictionary d2;
|
||||
String operator_name = Variant::get_operator_name(Variant::Operator(k));
|
||||
d2["name"] = operator_name;
|
||||
if (k != Variant::OP_NEGATE && k != Variant::OP_POSITIVE && k != Variant::OP_NOT && k != Variant::OP_BIT_NEGATE) {
|
||||
d2["right_type"] = get_builtin_or_variant_type_name(Variant::Type(j));
|
||||
|
||||
String right_type_name = get_builtin_or_variant_type_name(Variant::Type(j));
|
||||
bool is_unary = k == Variant::OP_NEGATE || k == Variant::OP_POSITIVE || k == Variant::OP_NOT || k == Variant::OP_BIT_NEGATE;
|
||||
if (!is_unary) {
|
||||
d2["right_type"] = right_type_name;
|
||||
}
|
||||
|
||||
d2["return_type"] = get_builtin_or_variant_type_name(Variant::get_operator_return_type(Variant::Operator(k), type, Variant::Type(j)));
|
||||
|
||||
if (p_include_docs && builtin_doc != nullptr) {
|
||||
for (const DocData::MethodDoc &operator_doc : builtin_doc->operators) {
|
||||
if (operator_doc.name == "operator " + operator_name) {
|
||||
if (operator_doc.name == "operator " + operator_name &&
|
||||
(is_unary || operator_doc.arguments[0].type == right_type_name)) {
|
||||
d2["description"] = fix_doc_description(operator_doc.description);
|
||||
break;
|
||||
}
|
||||
|
@ -192,6 +192,7 @@ void Input::get_argument_options(const StringName &p_function, int p_idx, List<S
|
||||
r_options->push_back(name.quote());
|
||||
}
|
||||
}
|
||||
Object::get_argument_options(p_function, p_idx, r_options);
|
||||
}
|
||||
|
||||
void Input::VelocityTrack::update(const Vector2 &p_delta_p) {
|
||||
|
@ -327,7 +327,7 @@ uint64_t FileAccessPack::get_buffer(uint8_t *p_dst, uint64_t p_length) const {
|
||||
to_read = (int64_t)pf.size - (int64_t)pos;
|
||||
}
|
||||
|
||||
pos += p_length;
|
||||
pos += to_read;
|
||||
|
||||
if (to_read <= 0) {
|
||||
return 0;
|
||||
|
@ -1454,8 +1454,10 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons
|
||||
fw.unref();
|
||||
|
||||
Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
|
||||
da->remove(p_path);
|
||||
da->rename(p_path + ".depren", p_path);
|
||||
if (da->exists(p_path + ".depren")) {
|
||||
da->remove(p_path);
|
||||
da->rename(p_path + ".depren", p_path);
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
@ -200,11 +200,11 @@ inline bool AABB::encloses(const AABB &p_aabb) const {
|
||||
|
||||
return (
|
||||
(src_min.x <= dst_min.x) &&
|
||||
(src_max.x > dst_max.x) &&
|
||||
(src_max.x >= dst_max.x) &&
|
||||
(src_min.y <= dst_min.y) &&
|
||||
(src_max.y > dst_max.y) &&
|
||||
(src_max.y >= dst_max.y) &&
|
||||
(src_min.z <= dst_min.z) &&
|
||||
(src_max.z > dst_max.z));
|
||||
(src_max.z >= dst_max.z));
|
||||
}
|
||||
|
||||
Vector3 AABB::get_support(const Vector3 &p_normal) const {
|
||||
|
@ -70,6 +70,7 @@ typedef Vector<int32_t> PackedInt32Array;
|
||||
typedef Vector<int64_t> PackedInt64Array;
|
||||
typedef Vector<float> PackedFloat32Array;
|
||||
typedef Vector<double> PackedFloat64Array;
|
||||
typedef Vector<real_t> PackedRealArray;
|
||||
typedef Vector<String> PackedStringArray;
|
||||
typedef Vector<Vector2> PackedVector2Array;
|
||||
typedef Vector<Vector3> PackedVector3Array;
|
||||
|
@ -234,20 +234,9 @@
|
||||
|
||||
var b = clamp(8.1, 0.9, 5.5)
|
||||
# b is 5.5
|
||||
|
||||
var c = clamp(Vector2(-3.5, -4), Vector2(-3.2, -2), Vector2(2, 6.5))
|
||||
# c is (-3.2, -2)
|
||||
|
||||
var d = clamp(Vector2i(7, 8), Vector2i(-3, -2), Vector2i(2, 6))
|
||||
# d is (2, 6)
|
||||
|
||||
var e = clamp(Vector3(-7, 8.5, -3.8), Vector3(-3, -2, 5.4), Vector3(-2, 6, -4.1))
|
||||
# e is (-3, -2, 5.4)
|
||||
|
||||
var f = clamp(Vector3i(-7, -8, -9), Vector3i(-1, 2, 3), Vector3i(-4, -5, -6))
|
||||
# f is (-4, -5, -6)
|
||||
[/codeblock]
|
||||
[b]Note:[/b] For better type safety, use [method clampf], [method clampi], [method Vector2.clamp], [method Vector2i.clamp], [method Vector3.clamp], [method Vector3i.clamp], [method Vector4.clamp], [method Vector4i.clamp], or [method Color.clamp].
|
||||
[b]Note:[/b] For better type safety, use [method clampf], [method clampi], [method Vector2.clamp], [method Vector2i.clamp], [method Vector3.clamp], [method Vector3i.clamp], [method Vector4.clamp], [method Vector4i.clamp], or [method Color.clamp] (not currently supported by this method).
|
||||
[b]Note:[/b] When using this on vectors it will [i]not[/i] perform component-wise clamping, and will pick [param min] if [code]value < min[/code] or [param max] if [code]value > max[/code]. To perform component-wise clamping use the methods listed above.
|
||||
</description>
|
||||
</method>
|
||||
<method name="clampf">
|
||||
@ -1439,6 +1428,7 @@
|
||||
<description>
|
||||
Encodes a [Variant] value to a byte array, without encoding objects. Deserialization can be done with [method bytes_to_var].
|
||||
[b]Note:[/b] If you need object serialization, see [method var_to_bytes_with_objects].
|
||||
[b]Note:[/b] Encoding [Callable] is not supported and will result in an empty value, regardless of the data.
|
||||
</description>
|
||||
</method>
|
||||
<method name="var_to_bytes_with_objects">
|
||||
@ -1446,6 +1436,7 @@
|
||||
<param index="0" name="variable" type="Variant" />
|
||||
<description>
|
||||
Encodes a [Variant] value to a byte array. Encoding objects is allowed (and can potentially include executable code). Deserialization can be done with [method bytes_to_var_with_objects].
|
||||
[b]Note:[/b] Encoding [Callable] is not supported and will result in an empty value, regardless of the data.
|
||||
</description>
|
||||
</method>
|
||||
<method name="var_to_str">
|
||||
|
@ -4,10 +4,10 @@
|
||||
A 3D axis-aligned bounding box.
|
||||
</brief_description>
|
||||
<description>
|
||||
[AABB] consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.
|
||||
It uses floating-point coordinates. The 2D counterpart to [AABB] is [Rect2].
|
||||
Negative values for [member size] are not supported and will not work for most methods. Use [method abs] to get an AABB with a positive size.
|
||||
[b]Note:[/b] Unlike [Rect2], [AABB] does not have a variant that uses integer coordinates.
|
||||
The [AABB] built-in [Variant] type represents an axis-aligned bounding box in a 3D space. It is defined by its [member position] and [member size], which are [Vector3]. It is frequently used for fast overlap tests (see [method intersects]). Although [AABB] itself is axis-aligned, it can be combined with [Transform3D] to represent a rotated or skewed bounding box.
|
||||
It uses floating-point coordinates. The 2D counterpart to [AABB] is [Rect2]. There is no version of [AABB] that uses integer coordinates.
|
||||
[b]Note:[/b] Negative values for [member size] are not supported. With negative size, most [AABB] methods do not work correctly. Use [method abs] to get an equivalent [AABB] with a non-negative size.
|
||||
[b]Note:[/b] In a boolean context, a [AABB] evaluates to [code]false[/code] if both [member position] and [member size] are zero (equal to [constant Vector3.ZERO]). Otherwise, it always evaluates to [code]true[/code].
|
||||
</description>
|
||||
<tutorials>
|
||||
<link title="Math documentation index">$DOCS_URL/tutorials/math/index.html</link>
|
||||
@ -18,7 +18,7 @@
|
||||
<constructor name="AABB">
|
||||
<return type="AABB" />
|
||||
<description>
|
||||
Constructs a default-initialized [AABB] with default (zero) values of [member position] and [member size].
|
||||
Constructs an [AABB] with its [member position] and [member size] set to [constant Vector3.ZERO].
|
||||
</description>
|
||||
</constructor>
|
||||
<constructor name="AABB">
|
||||
@ -33,7 +33,7 @@
|
||||
<param index="0" name="position" type="Vector3" />
|
||||
<param index="1" name="size" type="Vector3" />
|
||||
<description>
|
||||
Constructs an [AABB] from a position and size.
|
||||
Constructs an [AABB] by [param position] and [param size].
|
||||
</description>
|
||||
</constructor>
|
||||
</constructors>
|
||||
@ -41,34 +41,78 @@
|
||||
<method name="abs" qualifiers="const">
|
||||
<return type="AABB" />
|
||||
<description>
|
||||
Returns an AABB with equivalent position and size, modified so that the most-negative corner is the origin and the size is positive.
|
||||
Returns an [AABB] equivalent to this bounding box, with its width, height, and depth modified to be non-negative values.
|
||||
[codeblocks]
|
||||
[gdscript]
|
||||
var box = AABB(Vector3(5, 0, 5), Vector3(-20, -10, -5))
|
||||
var absolute = box.abs()
|
||||
print(absolute.position) # Prints (-15, -10, 0)
|
||||
print(absolute.size) # Prints (20, 10, 5)
|
||||
[/gdscript]
|
||||
[csharp]
|
||||
var box = new Aabb(new Vector3(5, 0, 5), new Vector3(-20, -10, -5));
|
||||
var absolute = box.Abs();
|
||||
GD.Print(absolute.Position); // Prints (-15, -10, 0)
|
||||
GD.Print(absolute.Size); // Prints (20, 10, 5)
|
||||
[/csharp]
|
||||
[/codeblocks]
|
||||
[b]Note:[/b] It's recommended to use this method when [member size] is negative, as most other methods in Godot assume that the [member size]'s components are greater than [code]0[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="encloses" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<param index="0" name="with" type="AABB" />
|
||||
<description>
|
||||
Returns [code]true[/code] if this [AABB] completely encloses another one.
|
||||
Returns [code]true[/code] if this bounding box [i]completely[/i] encloses the [param with] box. The edges of both boxes are included.
|
||||
[codeblocks]
|
||||
[gdscript]
|
||||
var a = AABB(Vector3(0, 0, 0), Vector3(4, 4, 4))
|
||||
var b = AABB(Vector3(1, 1, 1), Vector3(3, 3, 3))
|
||||
var c = AABB(Vector3(2, 2, 2), Vector3(8, 8, 8))
|
||||
|
||||
print(a.encloses(a)) # Prints true
|
||||
print(a.encloses(b)) # Prints true
|
||||
print(a.encloses(c)) # Prints false
|
||||
[/gdscript]
|
||||
[csharp]
|
||||
var a = new Aabb(new Vector3(0, 0, 0), new Vector3(4, 4, 4));
|
||||
var b = new Aabb(new Vector3(1, 1, 1), new Vector3(3, 3, 3));
|
||||
var c = new Aabb(new Vector3(2, 2, 2), new Vector3(8, 8, 8));
|
||||
|
||||
GD.Print(a.Encloses(a)); // Prints True
|
||||
GD.Print(a.Encloses(b)); // Prints True
|
||||
GD.Print(a.Encloses(c)); // Prints False
|
||||
[/csharp]
|
||||
[/codeblocks]
|
||||
</description>
|
||||
</method>
|
||||
<method name="expand" qualifiers="const">
|
||||
<return type="AABB" />
|
||||
<param index="0" name="to_point" type="Vector3" />
|
||||
<description>
|
||||
Returns a copy of this [AABB] expanded to include a given point.
|
||||
[b]Example:[/b]
|
||||
Returns a copy of this bounding box expanded to align the edges with the given [param to_point], if necessary.
|
||||
[codeblocks]
|
||||
[gdscript]
|
||||
# position (-3, 2, 0), size (1, 1, 1)
|
||||
var box = AABB(Vector3(-3, 2, 0), Vector3(1, 1, 1))
|
||||
# position (-3, -1, 0), size (3, 4, 2), so we fit both the original AABB and Vector3(0, -1, 2)
|
||||
var box2 = box.expand(Vector3(0, -1, 2))
|
||||
var box = AABB(Vector3(0, 0, 0), Vector3(5, 2, 5))
|
||||
|
||||
box = box.expand(Vector3(10, 0, 0))
|
||||
print(box.position) # Prints (0, 0, 0)
|
||||
print(box.size) # Prints (10, 2, 5)
|
||||
|
||||
box = box.expand(Vector3(-5, 0, 5))
|
||||
print(box.position) # Prints (-5, 0, 0)
|
||||
print(box.size) # Prints (15, 2, 5)
|
||||
[/gdscript]
|
||||
[csharp]
|
||||
// position (-3, 2, 0), size (1, 1, 1)
|
||||
var box = new Aabb(new Vector3(-3, 2, 0), new Vector3(1, 1, 1));
|
||||
// position (-3, -1, 0), size (3, 4, 2), so we fit both the original AABB and Vector3(0, -1, 2)
|
||||
var box2 = box.Expand(new Vector3(0, -1, 2));
|
||||
var box = new Aabb(new Vector3(0, 0, 0), new Vector3(5, 2, 5));
|
||||
|
||||
box = box.Expand(new Vector3(10, 0, 0));
|
||||
GD.Print(box.Position); // Prints (0, 0, 0)
|
||||
GD.Print(box.Size); // Prints (10, 2, 5)
|
||||
|
||||
box = box.Expand(new Vector3(-5, 0, 5));
|
||||
GD.Print(box.Position); // Prints (-5, 0, 0)
|
||||
GD.Print(box.Size); // Prints (15, 2, 5)
|
||||
[/csharp]
|
||||
[/codeblocks]
|
||||
</description>
|
||||
@ -76,111 +120,188 @@
|
||||
<method name="get_center" qualifiers="const">
|
||||
<return type="Vector3" />
|
||||
<description>
|
||||
Returns the center of the [AABB], which is equal to [member position] + ([member size] / 2).
|
||||
Returns the center point of the bounding box. This is the same as [code]position + (size / 2.0)[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_endpoint" qualifiers="const">
|
||||
<return type="Vector3" />
|
||||
<param index="0" name="idx" type="int" />
|
||||
<description>
|
||||
Gets the position of the 8 endpoints of the [AABB] in space.
|
||||
Returns the position of one of the 8 vertices that compose this bounding box. With a [param idx] of [code]0[/code] this is the same as [member position], and a [param idx] of [code]7[/code] is the same as [member end].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_longest_axis" qualifiers="const">
|
||||
<return type="Vector3" />
|
||||
<description>
|
||||
Returns the normalized longest axis of the [AABB].
|
||||
Returns the longest normalized axis of this bounding box's [member size], as a [Vector3] ([constant Vector3.RIGHT], [constant Vector3.UP], or [constant Vector3.BACK]).
|
||||
[codeblocks]
|
||||
[gdscript]
|
||||
var box = AABB(Vector3(0, 0, 0), Vector3(2, 4, 8))
|
||||
|
||||
print(box.get_longest_axis()) # Prints (0, 0, 1)
|
||||
print(box.get_longest_axis_index()) # Prints 2
|
||||
print(box.get_longest_axis_size()) # Prints 8
|
||||
[/gdscript]
|
||||
[csharp]
|
||||
var box = new Aabb(new Vector3(0, 0, 0), new Vector3(2, 4, 8));
|
||||
|
||||
GD.Print(box.GetLongestAxis()); // Prints (0, 0, 1)
|
||||
GD.Print(box.GetLongestAxisIndex()); // Prints 2
|
||||
GD.Print(box.GetLongestAxisSize()); // Prints 8
|
||||
[/csharp]
|
||||
[/codeblocks]
|
||||
See also [method get_longest_axis_index] and [method get_longest_axis_size].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_longest_axis_index" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
Returns the index of the longest axis of the [AABB] (according to [Vector3]'s [code]AXIS_*[/code] constants).
|
||||
Returns the index to the longest axis of this bounding box's [member size] (see [constant Vector3.AXIS_X], [constant Vector3.AXIS_Y], and [constant Vector3.AXIS_Z]).
|
||||
For an example, see [method get_longest_axis].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_longest_axis_size" qualifiers="const">
|
||||
<return type="float" />
|
||||
<description>
|
||||
Returns the scalar length of the longest axis of the [AABB].
|
||||
Returns the longest dimension of this bounding box's [member size].
|
||||
For an example, see [method get_longest_axis].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_shortest_axis" qualifiers="const">
|
||||
<return type="Vector3" />
|
||||
<description>
|
||||
Returns the normalized shortest axis of the [AABB].
|
||||
Returns the shortest normaalized axis of this bounding box's [member size], as a [Vector3] ([constant Vector3.RIGHT], [constant Vector3.UP], or [constant Vector3.BACK]).
|
||||
[codeblocks]
|
||||
[gdscript]
|
||||
var box = AABB(Vector3(0, 0, 0), Vector3(2, 4, 8))
|
||||
|
||||
print(box.get_shortest_axis()) # Prints (1, 0, 0)
|
||||
print(box.get_shortest_axis_index()) # Prints 0
|
||||
print(box.get_shortest_axis_size()) # Prints 2
|
||||
[/gdscript]
|
||||
[csharp]
|
||||
var box = new Aabb(new Vector3(0, 0, 0), new Vector3(2, 4, 8));
|
||||
|
||||
GD.Print(box.GetShortestAxis()); // Prints (1, 0, 0)
|
||||
GD.Print(box.GetShortestAxisIndex()); // Prints 0
|
||||
GD.Print(box.GetShortestAxisSize()); // Prints 2
|
||||
[/csharp]
|
||||
[/codeblocks]
|
||||
See also [method get_shortest_axis_index] and [method get_shortest_axis_size].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_shortest_axis_index" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
Returns the index of the shortest axis of the [AABB] (according to [Vector3]::AXIS* enum).
|
||||
Returns the index to the shortest axis of this bounding box's [member size] (see [constant Vector3.AXIS_X], [constant Vector3.AXIS_Y], and [constant Vector3.AXIS_Z]).
|
||||
For an example, see [method get_shortest_axis].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_shortest_axis_size" qualifiers="const">
|
||||
<return type="float" />
|
||||
<description>
|
||||
Returns the scalar length of the shortest axis of the [AABB].
|
||||
Returns the shortest dimension of this bounding box's [member size].
|
||||
For an example, see [method get_shortest_axis].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_support" qualifiers="const">
|
||||
<return type="Vector3" />
|
||||
<param index="0" name="dir" type="Vector3" />
|
||||
<description>
|
||||
Returns the vertex of the AABB that's the farthest in a given direction. This point is commonly known as the support point in collision detection algorithms.
|
||||
Returns the vertex's position of this bounding box that's the farthest in the given direction. This point is commonly known as the support point in collision detection algorithms.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_volume" qualifiers="const">
|
||||
<return type="float" />
|
||||
<description>
|
||||
Returns the volume of the [AABB].
|
||||
Returns the bounding box's volume. This is equivalent to [code]size.x * size.y * size.z[/code]. See also [method has_volume].
|
||||
</description>
|
||||
</method>
|
||||
<method name="grow" qualifiers="const">
|
||||
<return type="AABB" />
|
||||
<param index="0" name="by" type="float" />
|
||||
<description>
|
||||
Returns a copy of the [AABB] grown a given number of units towards all the sides.
|
||||
Returns a copy of this bounding box extended on all sides by the given amount [param by]. A negative amount shrinks the box instead.
|
||||
[codeblocks]
|
||||
[gdscript]
|
||||
var a = AABB(Vector3(4, 4, 4), Vector3(8, 8, 8)).grow(4)
|
||||
print(a.position) # Prints (0, 0, 0)
|
||||
print(a.size) # Prints (16, 16, 16)
|
||||
|
||||
var b = AABB(Vector3(0, 0, 0), Vector3(8, 4, 2)).grow(2)
|
||||
print(b.position) # Prints (-2, -2, -2)
|
||||
print(b.size) # Prints (12, 8, 6)
|
||||
[/gdscript]
|
||||
[csharp]
|
||||
var a = new Aabb(new Vector3(4, 4, 4), new Vector3(8, 8, 8)).Grow(4);
|
||||
GD.Print(a.Position); // Prints (0, 0, 0)
|
||||
GD.Print(a.Size); // Prints (16, 16, 16)
|
||||
|
||||
var b = new Aabb(new Vector3(0, 0, 0), new Vector3(8, 4, 2)).Grow(2);
|
||||
GD.Print(b.Position); // Prints (-2, -2, -2)
|
||||
GD.Print(b.Size); // Prints (12, 8, 6)
|
||||
[/csharp]
|
||||
[/codeblocks]
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_point" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<param index="0" name="point" type="Vector3" />
|
||||
<description>
|
||||
Returns [code]true[/code] if the [AABB] contains a point. Points on the faces of the AABB are considered included, though float-point precision errors may impact the accuracy of such checks.
|
||||
[b]Note:[/b] This method is not reliable for [AABB] with a [i]negative size[/i]. Use [method abs] to get a positive sized equivalent [AABB] to check for contained points.
|
||||
Returns [code]true[/code] if the bounding box contains the given [param point]. By convention, points exactly on the right, top, and front sides are [b]not[/b] included.
|
||||
[b]Note:[/b] This method is not reliable for [AABB] with a [i]negative[/i] [member size]. Use [method abs] first to get a valid bounding box.
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_surface" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<description>
|
||||
Returns [code]true[/code] if the [AABB] has a surface or a length, and [code]false[/code] if the [AABB] is empty (all components of [member size] are zero or negative).
|
||||
Returns [code]true[/code] if this bounding box has a surface or a length, that is, at least one component of [member size] is greater than [code]0[/code]. Otherwise, returns [code]false[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_volume" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<description>
|
||||
Returns [code]true[/code] if the [AABB] has a volume, and [code]false[/code] if the [AABB] is flat, empty, or has a negative [member size].
|
||||
Returns [code]true[/code] if this bounding box's width, height, and depth are all positive. See also [method get_volume].
|
||||
</description>
|
||||
</method>
|
||||
<method name="intersection" qualifiers="const">
|
||||
<return type="AABB" />
|
||||
<param index="0" name="with" type="AABB" />
|
||||
<description>
|
||||
Returns the intersection between two [AABB]. An empty AABB (size [code](0, 0, 0)[/code]) is returned on failure.
|
||||
Returns the intersection between this bounding box and [param with]. If the boxes do not intersect, returns an empty [AABB]. If the boxes intersect at the edge, returns a flat [AABB] with no volume (see [method has_surface] and [method has_volume]).
|
||||
[codeblocks]
|
||||
[gdscript]
|
||||
var box1 = AABB(Vector3(0, 0, 0), Vector3(5, 2, 8))
|
||||
var box2 = AABB(Vector3(2, 0, 2), Vector3(8, 4, 4))
|
||||
|
||||
var intersection = box1.intersection(box2)
|
||||
print(intersection.position) # Prints (2, 0, 2)
|
||||
print(intersection.size) # Prints (3, 2, 4)
|
||||
[/gdscript]
|
||||
[csharp]
|
||||
var box1 = new Aabb(new Vector3(0, 0, 0), new Vector3(5, 2, 8));
|
||||
var box2 = new Aabb(new Vector3(2, 0, 2), new Vector3(8, 4, 4));
|
||||
|
||||
var intersection = box1.Intersection(box2);
|
||||
GD.Print(intersection.Position); // Prints (2, 0, 2)
|
||||
GD.Print(intersection.Size); // Prints (3, 2, 4)
|
||||
[/csharp]
|
||||
[/codeblocks]
|
||||
[b]Note:[/b] If you only need to know whether two bounding boxes are intersecting, use [method intersects], instead.
|
||||
</description>
|
||||
</method>
|
||||
<method name="intersects" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<param index="0" name="with" type="AABB" />
|
||||
<description>
|
||||
Returns [code]true[/code] if the [AABB] overlaps with another.
|
||||
Returns [code]true[/code] if this bounding box overlaps with the box [param with]. The edges of both boxes are [i]always[/i] excluded.
|
||||
</description>
|
||||
</method>
|
||||
<method name="intersects_plane" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<param index="0" name="plane" type="Plane" />
|
||||
<description>
|
||||
Returns [code]true[/code] if the [AABB] is on both sides of a plane.
|
||||
Returns [code]true[/code] if this bounding box is on both sides of the given [param plane].
|
||||
</description>
|
||||
</method>
|
||||
<method name="intersects_ray" qualifiers="const">
|
||||
@ -188,7 +309,8 @@
|
||||
<param index="0" name="from" type="Vector3" />
|
||||
<param index="1" name="dir" type="Vector3" />
|
||||
<description>
|
||||
Returns the point of intersection of the given ray with this [AABB] or [code]null[/code] if there is no intersection. Ray length is infinite.
|
||||
Returns the first point where this bounding box and the given ray intersect, as a [Vector3]. If no intersection occurs, returns [code]null[/code].
|
||||
The ray begin at [param from], faces [param dir] and extends towards infinity.
|
||||
</description>
|
||||
</method>
|
||||
<method name="intersects_segment" qualifiers="const">
|
||||
@ -196,40 +318,41 @@
|
||||
<param index="0" name="from" type="Vector3" />
|
||||
<param index="1" name="to" type="Vector3" />
|
||||
<description>
|
||||
Returns the point of intersection between [param from] and [param to] with this [AABB] or [code]null[/code] if there is no intersection.
|
||||
Returns the first point where this bounding box and the given segment intersect, as a [Vector3]. If no intersection occurs, returns [code]null[/code].
|
||||
The segment begins at [param from] and ends at [param to].
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_equal_approx" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<param index="0" name="aabb" type="AABB" />
|
||||
<description>
|
||||
Returns [code]true[/code] if this [AABB] and [param aabb] are approximately equal, by calling [method @GlobalScope.is_equal_approx] on each component.
|
||||
Returns [code]true[/code] if this bounding box and [param aabb] are approximately equal, by calling [method Vector2.is_equal_approx] on the [member position] and the [member size].
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_finite" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<description>
|
||||
Returns [code]true[/code] if this [AABB] is finite, by calling [method @GlobalScope.is_finite] on each component.
|
||||
Returns [code]true[/code] if this bounding box's values are finite, by calling [method Vector2.is_finite] on the [member position] and the [member size].
|
||||
</description>
|
||||
</method>
|
||||
<method name="merge" qualifiers="const">
|
||||
<return type="AABB" />
|
||||
<param index="0" name="with" type="AABB" />
|
||||
<description>
|
||||
Returns a larger [AABB] that contains both this [AABB] and [param with].
|
||||
Returns an [AABB] that encloses both this bounding box and [param with] around the edges. See also [method encloses].
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="end" type="Vector3" setter="" getter="" default="Vector3(0, 0, 0)">
|
||||
Ending corner. This is calculated as [code]position + size[/code]. Setting this value will change the size.
|
||||
The ending point. This is usually the corner on the top-right and forward of the bounding box, and is equivalent to [code]position + size[/code]. Setting this point affects the [member size].
|
||||
</member>
|
||||
<member name="position" type="Vector3" setter="" getter="" default="Vector3(0, 0, 0)">
|
||||
Beginning corner. Typically has values lower than [member end].
|
||||
The origin point. This is usually the corner on the bottom-left and back of the bounding box.
|
||||
</member>
|
||||
<member name="size" type="Vector3" setter="" getter="" default="Vector3(0, 0, 0)">
|
||||
Size from [member position] to [member end]. Typically, all components are positive.
|
||||
If the size is negative, you can use [method abs] to fix it.
|
||||
The bounding box's width, height, and depth starting from [member position]. Setting this value also affects the [member end] point.
|
||||
[b]Note:[/b] It's recommended setting the width, height, and depth to non-negative values. This is because most methods in Godot assume that the [member position] is the bottom-left-back corner, and the [member end] is the top-right-forward corner. To get an equivalent bounding box with non-negative size, use [method abs].
|
||||
</member>
|
||||
</members>
|
||||
<operators>
|
||||
@ -237,7 +360,7 @@
|
||||
<return type="bool" />
|
||||
<param index="0" name="right" type="AABB" />
|
||||
<description>
|
||||
Returns [code]true[/code] if the AABBs are not equal.
|
||||
Returns [code]true[/code] if the [member position] or [member size] of both bounding boxes are not equal.
|
||||
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
|
||||
</description>
|
||||
</operator>
|
||||
@ -254,7 +377,7 @@
|
||||
<return type="bool" />
|
||||
<param index="0" name="right" type="AABB" />
|
||||
<description>
|
||||
Returns [code]true[/code] if the AABBs are exactly equal.
|
||||
Returns [code]true[/code] if both [member position] and [member size] of the bounding boxes are exactly equal, respectively.
|
||||
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
|
||||
</description>
|
||||
</operator>
|
||||
|
@ -181,7 +181,7 @@
|
||||
Seeking to the beginning is treated as seeking to the beginning of the animation in the current state. Transition to the end state, or the absence of transitions in each state, is treated as exiting the state machine.
|
||||
</constant>
|
||||
<constant name="STATE_MACHINE_TYPE_GROUPED" value="2" enum="StateMachineType">
|
||||
This is a grouped state machine that can be controlled from a parent state machine. It does not work on standalone. There must be a state machine with [member state_machine_type] of [constant STATE_MACHINE_TYPE_ROOT] or [constant STATE_MACHINE_TYPE_NESTED] in the parent or ancestor.
|
||||
This is a grouped state machine that can be controlled from a parent state machine. It does not work independently. There must be a state machine with [member state_machine_type] of [constant STATE_MACHINE_TYPE_ROOT] or [constant STATE_MACHINE_TYPE_NESTED] in the parent or ancestor.
|
||||
</constant>
|
||||
</constants>
|
||||
</class>
|
||||
|
@ -479,7 +479,7 @@
|
||||
<return type="Variant" />
|
||||
<param index="0" name="position" type="int" />
|
||||
<description>
|
||||
Removes and returns the element of the array at index [param position]. If negative, [param position] is considered relative to the end of the array. Leaves the array untouched and returns [code]null[/code] if the array is empty or if it's accessed out of bounds. An error message is printed when the array is accessed out of bounds, but not when the array is empty.
|
||||
Removes and returns the element of the array at index [param position]. If negative, [param position] is considered relative to the end of the array. Leaves the array unchanged and returns [code]null[/code] if the array is empty or if it's accessed out of bounds. An error message is printed when the array is accessed out of bounds, but not when the array is empty.
|
||||
[b]Note:[/b] On large arrays, this method can be slower than [method pop_back] as it will reindex the array's elements that are located after the removed element. The larger the array and the lower the index of the removed element, the slower [method pop_at] will be.
|
||||
</description>
|
||||
</method>
|
||||
@ -544,6 +544,7 @@
|
||||
<param index="0" name="size" type="int" />
|
||||
<description>
|
||||
Resizes the array to contain a different number of elements. If the array size is smaller, elements are cleared, if bigger, new elements are [code]null[/code]. Returns [constant OK] on success, or one of the other [enum Error] values if the operation failed.
|
||||
Calling [method resize] once and assigning the new values is faster than adding new elements one by one.
|
||||
[b]Note:[/b] This method acts in-place and doesn't return a modified array.
|
||||
</description>
|
||||
</method>
|
||||
|
@ -18,7 +18,7 @@
|
||||
The oversampling factor to use. Higher values result in better quality, but are more demanding on the CPU and may cause audio cracking if the CPU can't keep up.
|
||||
</member>
|
||||
<member name="pitch_scale" type="float" setter="set_pitch_scale" getter="get_pitch_scale" default="1.0">
|
||||
The pitch scale to use. [code]1.0[/code] is the default pitch and plays sounds unaltered. [member pitch_scale] can range from [code]0.0[/code] (infinitely low pitch, inaudible) to [code]16[/code] (16 times higher than the initial pitch).
|
||||
The pitch scale to use. [code]1.0[/code] is the default pitch and plays sounds unaffected. [member pitch_scale] can range from [code]0.0[/code] (infinitely low pitch, inaudible) to [code]16[/code] (16 times higher than the initial pitch).
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
|
@ -383,7 +383,7 @@
|
||||
If [code]true[/code], enables subsurface scattering transmittance. Only effective if [member subsurf_scatter_enabled] is [code]true[/code]. See also [member backlight_enabled].
|
||||
</member>
|
||||
<member name="subsurf_scatter_transmittance_texture" type="Texture2D" setter="set_texture" getter="get_texture">
|
||||
The texture to use for multiplying the intensity of the subsurface scattering transmitteance intensity. See also [member subsurf_scatter_texture]. Ignored if [member subsurf_scatter_skin_mode] is [code]true[/code].
|
||||
The texture to use for multiplying the intensity of the subsurface scattering transmittance intensity. See also [member subsurf_scatter_texture]. Ignored if [member subsurf_scatter_skin_mode] is [code]true[/code].
|
||||
</member>
|
||||
<member name="texture_filter" type="int" setter="set_texture_filter" getter="get_texture_filter" enum="BaseMaterial3D.TextureFilter" default="3">
|
||||
Filter flags for the texture. See [enum TextureFilter] for options.
|
||||
|
@ -7,7 +7,7 @@
|
||||
A 3×3 matrix used for representing 3D rotation and scale. Usually used as an orthogonal basis for a [Transform3D].
|
||||
Contains 3 vector fields X, Y and Z as its columns, which are typically interpreted as the local basis vectors of a transformation. For such use, it is composed of a scaling and a rotation matrix, in that order (M = R.S).
|
||||
Basis can also be accessed as an array of 3D vectors. These vectors are usually orthogonal to each other, but are not necessarily normalized (due to scaling).
|
||||
For more information, read the "Matrices and transforms" documentation article.
|
||||
For a general introduction, see the [url=$DOCS_URL/tutorials/math/matrices_and_transforms.html]Matrices and transforms[/url] tutorial.
|
||||
</description>
|
||||
<tutorials>
|
||||
<link title="Math documentation index">$DOCS_URL/tutorials/math/index.html</link>
|
||||
|
@ -17,7 +17,7 @@
|
||||
The minimum sensitivity (in ISO) used when calculating auto exposure. When calculating scene average luminance, color values will be clamped to at least this value. This limits the auto-exposure from exposing above a certain brightness, resulting in a cut off point where the scene will remain dark.
|
||||
</member>
|
||||
<member name="dof_blur_amount" type="float" setter="set_dof_blur_amount" getter="get_dof_blur_amount" default="0.1">
|
||||
Sets the maximum amount of blur. When using physically-based blur amounts, will instead act as a multiplier. High values lead to an increased amount of bluriness, but can be much more expensive to calculate. It is best to keep this as low as possible for a given art style.
|
||||
Sets the maximum amount of blur. When using physically-based blur amounts, will instead act as a multiplier. High values lead to an increased amount of blurriness, but can be much more expensive to calculate. It is best to keep this as low as possible for a given art style.
|
||||
</member>
|
||||
<member name="dof_blur_far_distance" type="float" setter="set_dof_blur_far_distance" getter="get_dof_blur_far_distance" default="10.0">
|
||||
Objects further from the [Camera3D] by this amount will be blurred by the depth of field effect. Measured in meters.
|
||||
|
@ -501,7 +501,7 @@
|
||||
<method name="is_visible_in_tree" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<description>
|
||||
Returns [code]true[/code] if the node is present in the [SceneTree], its [member visible] property is [code]true[/code] and all its ancestors are also visible. If any ancestor is hidden, this node will not be visible in the scene tree, and is consequently not drawn (see [method _draw]).
|
||||
Returns [code]true[/code] if the node is present in the [SceneTree], its [member visible] property is [code]true[/code] and all its ancestors are also visible. If any ancestor is hidden, this node will not be visible in the scene tree, and is therefore not drawn (see [method _draw]).
|
||||
</description>
|
||||
</method>
|
||||
<method name="make_canvas_position_local" qualifiers="const">
|
||||
|
@ -5,7 +5,7 @@
|
||||
</brief_description>
|
||||
<description>
|
||||
[CanvasTexture] is an alternative to [ImageTexture] for 2D rendering. It allows using normal maps and specular maps in any node that inherits from [CanvasItem]. [CanvasTexture] also allows overriding the texture's filter and repeat mode independently of the node's properties (or the project settings).
|
||||
[b]Note:[/b] [CanvasTexture] cannot be used in 3D rendering. For physically-based materials in 3D, use [BaseMaterial3D] instead.
|
||||
[b]Note:[/b] [CanvasTexture] cannot be used in 3D. It will not display correctly when applied to any [VisualInstance3D], such as [Sprite3D] or [Decal]. For physically-based materials in 3D, use [BaseMaterial3D] instead.
|
||||
</description>
|
||||
<tutorials>
|
||||
<link title="2D Lights and Shadows">$DOCS_URL/tutorials/2d/2d_lights_and_shadows.html</link>
|
||||
|
@ -4,7 +4,7 @@
|
||||
An optionally compressed [Cubemap].
|
||||
</brief_description>
|
||||
<description>
|
||||
A cubemap that is loaded from a [code].ccube[/code] file. This file format is internal to Godot; it is created by importing other image formats with the import system. [CompressedCubemap] can use one of 4 compresson methods:
|
||||
A cubemap that is loaded from a [code].ccube[/code] file. This file format is internal to Godot; it is created by importing other image formats with the import system. [CompressedCubemap] can use one of 4 compression methods:
|
||||
- Lossless (WebP or PNG, uncompressed on the GPU)
|
||||
- Lossy (WebP, uncompressed on the GPU)
|
||||
- VRAM Compressed (compressed on the GPU)
|
||||
|
@ -4,7 +4,7 @@
|
||||
An optionally compressed [CubemapArray].
|
||||
</brief_description>
|
||||
<description>
|
||||
A cubemap array that is loaded from a [code].ccubearray[/code] file. This file format is internal to Godot; it is created by importing other image formats with the import system. [CompressedCubemapArray] can use one of 4 compresson methods:
|
||||
A cubemap array that is loaded from a [code].ccubearray[/code] file. This file format is internal to Godot; it is created by importing other image formats with the import system. [CompressedCubemapArray] can use one of 4 compression methods:
|
||||
- Lossless (WebP or PNG, uncompressed on the GPU)
|
||||
- Lossy (WebP, uncompressed on the GPU)
|
||||
- VRAM Compressed (compressed on the GPU)
|
||||
|
@ -4,7 +4,7 @@
|
||||
Array of 2-dimensional textures, optionally compressed.
|
||||
</brief_description>
|
||||
<description>
|
||||
A texture array that is loaded from a [code].ctexarray[/code] file. This file format is internal to Godot; it is created by importing other image formats with the import system. [CompressedTexture2DArray] can use one of 4 compresson methods:
|
||||
A texture array that is loaded from a [code].ctexarray[/code] file. This file format is internal to Godot; it is created by importing other image formats with the import system. [CompressedTexture2DArray] can use one of 4 compression methods:
|
||||
- Lossless (WebP or PNG, uncompressed on the GPU)
|
||||
- Lossy (WebP, uncompressed on the GPU)
|
||||
- VRAM Compressed (compressed on the GPU)
|
||||
|
@ -1713,7 +1713,7 @@
|
||||
The ID of the main window spawned by the engine, which can be passed to methods expecting a [code]window_id[/code].
|
||||
</constant>
|
||||
<constant name="INVALID_WINDOW_ID" value="-1">
|
||||
The ID that refers to a nonexisting window. This is be returned by some [DisplayServer] methods if no window matches the requested result.
|
||||
The ID that refers to a nonexistent window. This is returned by some [DisplayServer] methods if no window matches the requested result.
|
||||
</constant>
|
||||
<constant name="SCREEN_LANDSCAPE" value="0" enum="ScreenOrientation">
|
||||
Default landscape orientation.
|
||||
@ -1914,16 +1914,16 @@
|
||||
[b]Note:[/b] This flag is implemented only on macOS.
|
||||
</constant>
|
||||
<constant name="VSYNC_DISABLED" value="0" enum="VSyncMode">
|
||||
No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible). Framerate is unlimited (notwithstanding [member Engine.max_fps]).
|
||||
No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible). Framerate is unlimited (regardless of [member Engine.max_fps]).
|
||||
</constant>
|
||||
<constant name="VSYNC_ENABLED" value="1" enum="VSyncMode">
|
||||
Default vertical synchronization mode, the image is displayed only on vertical blanking intervals (no tearing is visible). Framerate is limited by the monitor refresh rate (notwithstanding [member Engine.max_fps]).
|
||||
Default vertical synchronization mode, the image is displayed only on vertical blanking intervals (no tearing is visible). Framerate is limited by the monitor refresh rate (regardless of [member Engine.max_fps]).
|
||||
</constant>
|
||||
<constant name="VSYNC_ADAPTIVE" value="2" enum="VSyncMode">
|
||||
Behaves like [constant VSYNC_DISABLED] when the framerate drops below the screen's refresh rate to reduce stuttering (tearing may be visible). Otherwise, vertical synchronization is enabled to avoid tearing. Framerate is limited by the monitor refresh rate (notwithstanding [member Engine.max_fps]). Behaves like [constant VSYNC_ENABLED] when using the Compatibility rendering method.
|
||||
Behaves like [constant VSYNC_DISABLED] when the framerate drops below the screen's refresh rate to reduce stuttering (tearing may be visible). Otherwise, vertical synchronization is enabled to avoid tearing. Framerate is limited by the monitor refresh rate (regardless of [member Engine.max_fps]). Behaves like [constant VSYNC_ENABLED] when using the Compatibility rendering method.
|
||||
</constant>
|
||||
<constant name="VSYNC_MAILBOX" value="3" enum="VSyncMode">
|
||||
Displays the most recent image in the queue on vertical blanking intervals, while rendering to the other images (no tearing is visible). Framerate is unlimited (notwithstanding [member Engine.max_fps]).
|
||||
Displays the most recent image in the queue on vertical blanking intervals, while rendering to the other images (no tearing is visible). Framerate is unlimited (regardless of [member Engine.max_fps]).
|
||||
Although not guaranteed, the images can be rendered as fast as possible, which may reduce input lag (also called "Fast" V-Sync mode). [constant VSYNC_MAILBOX] works best when at least twice as many frames as the display refresh rate are rendered. Behaves like [constant VSYNC_ENABLED] when using the Compatibility rendering method.
|
||||
</constant>
|
||||
<constant name="DISPLAY_HANDLE" value="0" enum="HandleType">
|
||||
|
@ -327,7 +327,7 @@
|
||||
<param index="0" name="object" type="Object" />
|
||||
<description>
|
||||
Implement this function if your plugin edits a specific type of object (Resource or Node). If you return [code]true[/code], then you will get the functions [method _edit] and [method _make_visible] called when the editor requests them. If you have declared the methods [method _forward_canvas_gui_input] and [method _forward_3d_gui_input] these will be called too.
|
||||
[b]Note:[/b] Each plugin should handle only one type of objects at a time. If a plugin handes more types of objects and they are edited at the same time, it will result in errors.
|
||||
[b]Note:[/b] Each plugin should handle only one type of objects at a time. If a plugin handles more types of objects and they are edited at the same time, it will result in errors.
|
||||
</description>
|
||||
</method>
|
||||
<method name="_has_main_screen" qualifiers="virtual const">
|
||||
|
@ -293,7 +293,7 @@
|
||||
Controls the maximum number of physics steps that can be simulated each rendered frame. The default value is tuned to avoid "spiral of death" situations where expensive physics simulations trigger more expensive simulations indefinitely. However, the game will appear to slow down if the rendering FPS is less than [code]1 / max_physics_steps_per_frame[/code] of [member physics_ticks_per_second]. This occurs even if [code]delta[/code] is consistently used in physics calculations. To avoid this, increase [member max_physics_steps_per_frame] if you have increased [member physics_ticks_per_second] significantly above its default value.
|
||||
</member>
|
||||
<member name="physics_jitter_fix" type="float" setter="set_physics_jitter_fix" getter="get_physics_jitter_fix" default="0.5">
|
||||
Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of the in-game clock and real clock but smooth out framerate jitters. The default value of 0.5 should be fine for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended.
|
||||
Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of the in-game clock and real clock but smooth out framerate jitters. The default value of 0.5 should be good enough for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended.
|
||||
[b]Note:[/b] For best results, when using a custom physics interpolation solution, the physics jitter fix should be disabled by setting [member physics_jitter_fix] to [code]0[/code].
|
||||
</member>
|
||||
<member name="physics_ticks_per_second" type="int" setter="set_physics_ticks_per_second" getter="get_physics_ticks_per_second" default="60">
|
||||
|
@ -34,7 +34,7 @@
|
||||
The selected shadow casting flag. See [enum ShadowCastingSetting] for possible values.
|
||||
</member>
|
||||
<member name="custom_aabb" type="AABB" setter="set_custom_aabb" getter="get_custom_aabb" default="AABB(0, 0, 0, 0, 0, 0)">
|
||||
Overrides the bounding box of this node with a custom one. This can be used to avoid the expensive [AABB] recalculation that happens when a skeleton is used with a [MeshInstance3D] or to have fine control over the [MeshInstance3D]'s bounding box. To use the default AABB, set value to an [AABB] with all fields set to [code]0.0[/code]. To avoid frustum culling, set [member custom_aabb] to a very large AABB that covers your entire game world such as [code]AABB(-10000, -10000, -10000, 20000, 20000, 20000)[/code]. To disable all forms of culling (including occlusion culling), call [method RenderingServer.instance_set_ignore_culling] on the [GeometryInstance3D]'s [RID].
|
||||
Overrides the bounding box of this node with a custom one. This can be used to avoid the expensive [AABB] recalculation that happens when a skeleton is used with a [MeshInstance3D] or to have precise control over the [MeshInstance3D]'s bounding box. To use the default AABB, set value to an [AABB] with all fields set to [code]0.0[/code]. To avoid frustum culling, set [member custom_aabb] to a very large AABB that covers your entire game world such as [code]AABB(-10000, -10000, -10000, 20000, 20000, 20000)[/code]. To disable all forms of culling (including occlusion culling), call [method RenderingServer.instance_set_ignore_culling] on the [GeometryInstance3D]'s [RID].
|
||||
</member>
|
||||
<member name="extra_cull_margin" type="float" setter="set_extra_cull_margin" getter="get_extra_cull_margin" default="0.0">
|
||||
The extra distance added to the GeometryInstance3D's bounding box ([AABB]) to increase its cull box.
|
||||
|
@ -154,7 +154,7 @@
|
||||
<method name="get_connection_list" qualifiers="const">
|
||||
<return type="Dictionary[]" />
|
||||
<description>
|
||||
Returns an Array containing the list of connections. A connection consists in a structure of the form [code]{ from_port: 0, from: "GraphNode name 0", to_port: 1, to: "GraphNode name 1" }[/code].
|
||||
Returns an Array containing the list of connections. A connection consists in a structure of the form [code]{ from_port: 0, from_node: "GraphNode name 0", to_port: 1, to_node: "GraphNode name 1" }[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_menu_hbox">
|
||||
@ -298,7 +298,7 @@
|
||||
<signals>
|
||||
<signal name="begin_node_move">
|
||||
<description>
|
||||
Emitted at the beginning of a GraphNode movement.
|
||||
Emitted at the beginning of a [GraphElement]'s movement.
|
||||
</description>
|
||||
</signal>
|
||||
<signal name="connection_drag_ended">
|
||||
@ -341,13 +341,14 @@
|
||||
</signal>
|
||||
<signal name="copy_nodes_request">
|
||||
<description>
|
||||
Emitted when the user presses [kbd]Ctrl + C[/kbd].
|
||||
Emitted when this [GraphEdit] captures a [code]ui_copy[/code] action ([kbd]Ctrl + C[/kbd] by default). In general, this signal indicates that the selected [GraphElement]s should be copied.
|
||||
</description>
|
||||
</signal>
|
||||
<signal name="delete_nodes_request">
|
||||
<param index="0" name="nodes" type="StringName[]" />
|
||||
<description>
|
||||
Emitted when attempting to remove a GraphNode from the GraphEdit. Provides a list of node names to be removed (all selected nodes, excluding nodes without closing button).
|
||||
Emitted when this [GraphEdit] captures a [code]ui_graph_delete[/code] action ([kbd]Delete[/kbd] by default).
|
||||
[param nodes] is an array of node names that should be removed. These usually include all selected nodes.
|
||||
</description>
|
||||
</signal>
|
||||
<signal name="disconnection_request">
|
||||
@ -361,28 +362,29 @@
|
||||
</signal>
|
||||
<signal name="duplicate_nodes_request">
|
||||
<description>
|
||||
Emitted when a GraphNode is attempted to be duplicated in the GraphEdit.
|
||||
Emitted when this [GraphEdit] captures a [code]ui_graph_duplicate[/code] action ([kbd]Ctrl + D[/kbd] by default). In general, this signal indicates that the selected [GraphElement]s should be duplicated.
|
||||
</description>
|
||||
</signal>
|
||||
<signal name="end_node_move">
|
||||
<description>
|
||||
Emitted at the end of a GraphNode movement.
|
||||
Emitted at the end of a [GraphElement]'s movement.
|
||||
</description>
|
||||
</signal>
|
||||
<signal name="node_deselected">
|
||||
<param index="0" name="node" type="Node" />
|
||||
<description>
|
||||
Emitted when the given [GraphElement] node is deselected.
|
||||
</description>
|
||||
</signal>
|
||||
<signal name="node_selected">
|
||||
<param index="0" name="node" type="Node" />
|
||||
<description>
|
||||
Emitted when a GraphNode is selected.
|
||||
Emitted when the given [GraphElement] node is selected.
|
||||
</description>
|
||||
</signal>
|
||||
<signal name="paste_nodes_request">
|
||||
<description>
|
||||
Emitted when the user presses [kbd]Ctrl + V[/kbd].
|
||||
Emitted when this [GraphEdit] captures a [code]ui_paste[/code] action ([kbd]Ctrl + V[/kbd] by default). In general, this signal indicates that previously copied [GraphElement]s should be pasted.
|
||||
</description>
|
||||
</signal>
|
||||
<signal name="popup_request">
|
||||
|
@ -736,7 +736,7 @@
|
||||
On the other hand, if the image already has mipmaps, they will be used, and a new set will be generated for the resulting image.
|
||||
</constant>
|
||||
<constant name="INTERPOLATE_LANCZOS" value="4" enum="Interpolation">
|
||||
Performs Lanczos interpolation. This is the slowest image resizing mode, but it typically gives the best results, especially when downscalng images.
|
||||
Performs Lanczos interpolation. This is the slowest image resizing mode, but it typically gives the best results, especially when downscaling images.
|
||||
</constant>
|
||||
<constant name="ALPHA_NONE" value="0" enum="AlphaMode">
|
||||
Image does not have alpha.
|
||||
|
@ -75,7 +75,7 @@
|
||||
If the message is [constant MIDI_MESSAGE_CONTROL_CHANGE], this indicates the controller value, otherwise this is zero. Controllers include devices such as pedals and levers.
|
||||
</member>
|
||||
<member name="instrument" type="int" setter="set_instrument" getter="get_instrument" default="0">
|
||||
The instrument of this input event. This value ranges from 0 to 127. Refer to the instrument list on the General MIDI wikipedia article to see a list of instruments, except that this value is 0-index, so subtract one from every number on that chart. A standard piano will have an instrument number of 0.
|
||||
The instrument of this input event. This value ranges from 0 to 127. Refer to the instrument list for [url=https://en.wikipedia.org/wiki/General_MIDI#Program_change_events]General MIDI[/url] to see a list of instruments, except that this value is 0-index, so subtract one from every number on that chart. A standard piano will have an instrument number of 0.
|
||||
</member>
|
||||
<member name="message" type="int" setter="set_message" getter="get_message" enum="MIDIMessage" default="0">
|
||||
Returns a value indicating the type of message for this MIDI signal. This is a member of the [enum MIDIMessage] enum.
|
||||
|
@ -117,6 +117,7 @@
|
||||
<theme_item name="outline_size" data_type="constant" type="int" default="0">
|
||||
Text outline size.
|
||||
[b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
|
||||
[b]Note:[/b] Using a value that is larger than half the font size is not recommended, as the font outline may fail to be fully closed in this case.
|
||||
</theme_item>
|
||||
<theme_item name="shadow_offset_x" data_type="constant" type="int" default="1">
|
||||
The horizontal offset of the text's shadow.
|
||||
|
@ -5,7 +5,7 @@
|
||||
</brief_description>
|
||||
<description>
|
||||
[MainLoop] is the abstract base class for a Godot project's game loop. It is inherited by [SceneTree], which is the default game loop implementation used in Godot projects, though it is also possible to write and use one's own [MainLoop] subclass instead of the scene tree.
|
||||
Upon the application start, a [MainLoop] implementation must be provided to the OS; otherwise, the application will exit. This happens automatically (and a [SceneTree] is created) unless a [MainLoop] [Script] is provided from the command line (with e.g. [code]godot -s my_loop.gd[/code] or the "Main Loop Type" project setting is overwritten.
|
||||
Upon the application start, a [MainLoop] implementation must be provided to the OS; otherwise, the application will exit. This happens automatically (and a [SceneTree] is created) unless a [MainLoop] [Script] is provided from the command line (with e.g. [code]godot -s my_loop.gd[/code]) or the "Main Loop Type" project setting is overwritten.
|
||||
Here is an example script implementing a simple [MainLoop]:
|
||||
[codeblocks]
|
||||
[gdscript]
|
||||
|
@ -372,7 +372,7 @@
|
||||
<description>
|
||||
This function immediately forces synchronization of the specified navigation [param map] [RID]. By default navigation maps are only synchronized at the end of each physics frame. This function can be used to immediately (re)calculate all the navigation meshes and region connections of the navigation map. This makes it possible to query a navigation path for a changed map immediately and in the same frame (multiple times if needed).
|
||||
Due to technical restrictions the current NavigationServer command queue will be flushed. This means all already queued update commands for this physics frame will be executed, even those intended for other maps, regions and agents not part of the specified map. The expensive computation of the navigation meshes and region connections of a map will only be done for the specified map. Other maps will receive the normal synchronization at the end of the physics frame. Should the specified map receive changes after the forced update it will update again as well when the other maps receive their update.
|
||||
Avoidance processing and dispatch of the [code]safe_velocity[/code] signals is untouched by this function and continues to happen for all maps and agents at the end of the physics frame.
|
||||
Avoidance processing and dispatch of the [code]safe_velocity[/code] signals is unaffected by this function and continues to happen for all maps and agents at the end of the physics frame.
|
||||
[b]Note:[/b] With great power comes great responsibility. This function should only be used by users that really know what they are doing and have a good reason for it. Forcing an immediate update of a navigation map requires locking the NavigationServer and flushing the entire NavigationServer command queue. Not only can this severely impact the performance of a game but it can also introduce bugs if used inappropriately without much foresight.
|
||||
</description>
|
||||
</method>
|
||||
|
@ -187,7 +187,7 @@
|
||||
<param index="1" name="enabled" type="bool" />
|
||||
<description>
|
||||
Sets if the agent uses the 2D avoidance or the 3D avoidance while avoidance is enabled.
|
||||
If [code]true[/code] the agent calculates avoidance velocities in 3D for the xyz-axis, e.g. for games that take place in air, unterwater or space. The 3D using agent only avoids other 3D avoidance using agent's. The 3D using agent only reacts to radius based avoidance obstacles. The 3D using agent ignores any vertices based obstacles. The 3D using agent only avoids other 3D using agent's.
|
||||
If [code]true[/code] the agent calculates avoidance velocities in 3D for the xyz-axis, e.g. for games that take place in air, underwater or space. The 3D using agent only avoids other 3D avoidance using agent's. The 3D using agent only reacts to radius based avoidance obstacles. The 3D using agent ignores any vertices based obstacles. The 3D using agent only avoids other 3D using agent's.
|
||||
If [code]false[/code] the agent calculates avoidance velocities in 2D along the xz-axis ignoring the y-axis. The 2D using agent only avoids other 2D avoidance using agent's. The 2D using agent reacts to radius avoidance obstacles. The 2D using agent reacts to vertices based avoidance obstacles. The 2D using agent only avoids other 2D using agent's. 2D using agents will ignore other 2D using agents or obstacles that are below their current position or above their current position including the agents height in 2D avoidance.
|
||||
</description>
|
||||
</method>
|
||||
@ -404,7 +404,7 @@
|
||||
<description>
|
||||
This function immediately forces synchronization of the specified navigation [param map] [RID]. By default navigation maps are only synchronized at the end of each physics frame. This function can be used to immediately (re)calculate all the navigation meshes and region connections of the navigation map. This makes it possible to query a navigation path for a changed map immediately and in the same frame (multiple times if needed).
|
||||
Due to technical restrictions the current NavigationServer command queue will be flushed. This means all already queued update commands for this physics frame will be executed, even those intended for other maps, regions and agents not part of the specified map. The expensive computation of the navigation meshes and region connections of a map will only be done for the specified map. Other maps will receive the normal synchronization at the end of the physics frame. Should the specified map receive changes after the forced update it will update again as well when the other maps receive their update.
|
||||
Avoidance processing and dispatch of the [code]safe_velocity[/code] signals is untouched by this function and continues to happen for all maps and agents at the end of the physics frame.
|
||||
Avoidance processing and dispatch of the [code]safe_velocity[/code] signals is unaffected by this function and continues to happen for all maps and agents at the end of the physics frame.
|
||||
[b]Note:[/b] With great power comes great responsibility. This function should only be used by users that really know what they are doing and have a good reason for it. Forcing an immediate update of a navigation map requires locking the NavigationServer and flushing the entire NavigationServer command queue. Not only can this severely impact the performance of a game but it can also introduce bugs if used inappropriately without much foresight.
|
||||
</description>
|
||||
</method>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -314,7 +314,7 @@
|
||||
{
|
||||
if (property["name"].AsStringName() == PropertyName.Number && IsNumberEditable)
|
||||
{
|
||||
var usage = property["usage"].As>PropertyUsageFlags<() | PropertyUsageFlags.ReadOnly;
|
||||
var usage = property["usage"].As<PropertyUsageFlags>() | PropertyUsageFlags.ReadOnly;
|
||||
property["usage"] = (int)usage;
|
||||
}
|
||||
}
|
||||
|
@ -399,7 +399,7 @@
|
||||
<return type="int" />
|
||||
<param index="0" name="new_size" type="int" />
|
||||
<description>
|
||||
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
|
||||
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. Calling [method resize] once and assigning the new values is faster than adding new elements one by one.
|
||||
</description>
|
||||
</method>
|
||||
<method name="reverse">
|
||||
|
@ -131,7 +131,7 @@
|
||||
<return type="int" />
|
||||
<param index="0" name="new_size" type="int" />
|
||||
<description>
|
||||
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
|
||||
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. Calling [method resize] once and assigning the new values is faster than adding new elements one by one.
|
||||
</description>
|
||||
</method>
|
||||
<method name="reverse">
|
||||
|
@ -132,7 +132,7 @@
|
||||
<return type="int" />
|
||||
<param index="0" name="new_size" type="int" />
|
||||
<description>
|
||||
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
|
||||
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. Calling [method resize] once and assigning the new values is faster than adding new elements one by one.
|
||||
</description>
|
||||
</method>
|
||||
<method name="reverse">
|
||||
|
@ -132,7 +132,7 @@
|
||||
<return type="int" />
|
||||
<param index="0" name="new_size" type="int" />
|
||||
<description>
|
||||
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
|
||||
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. Calling [method resize] once and assigning the new values is faster than adding new elements one by one.
|
||||
</description>
|
||||
</method>
|
||||
<method name="reverse">
|
||||
|
@ -128,7 +128,7 @@
|
||||
<return type="int" />
|
||||
<param index="0" name="new_size" type="int" />
|
||||
<description>
|
||||
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
|
||||
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. Calling [method resize] once and assigning the new values is faster than adding new elements one by one.
|
||||
</description>
|
||||
</method>
|
||||
<method name="reverse">
|
||||
|
@ -128,7 +128,7 @@
|
||||
<return type="int" />
|
||||
<param index="0" name="new_size" type="int" />
|
||||
<description>
|
||||
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
|
||||
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. Calling [method resize] once and assigning the new values is faster than adding new elements one by one.
|
||||
</description>
|
||||
</method>
|
||||
<method name="reverse">
|
||||
|
@ -134,7 +134,7 @@
|
||||
<return type="int" />
|
||||
<param index="0" name="new_size" type="int" />
|
||||
<description>
|
||||
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
|
||||
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. Calling [method resize] once and assigning the new values is faster than adding new elements one by one.
|
||||
</description>
|
||||
</method>
|
||||
<method name="reverse">
|
||||
|
@ -136,7 +136,7 @@
|
||||
<return type="int" />
|
||||
<param index="0" name="new_size" type="int" />
|
||||
<description>
|
||||
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
|
||||
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. Calling [method resize] once and assigning the new values is faster than adding new elements one by one.
|
||||
</description>
|
||||
</method>
|
||||
<method name="reverse">
|
||||
|
@ -135,7 +135,7 @@
|
||||
<return type="int" />
|
||||
<param index="0" name="new_size" type="int" />
|
||||
<description>
|
||||
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
|
||||
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. Calling [method resize] once and assigning the new values is faster than adding new elements one by one.
|
||||
</description>
|
||||
</method>
|
||||
<method name="reverse">
|
||||
|
@ -6,7 +6,7 @@
|
||||
<description>
|
||||
[ProceduralSkyMaterial] provides a way to create an effective background quickly by defining procedural parameters for the sun, the sky and the ground. The sky and ground are defined by a main color, a color at the horizon, and an easing curve to interpolate between them. Suns are described by a position in the sky, a color, and a max angle from the sun at which the easing curve ends. The max angle therefore defines the size of the sun in the sky.
|
||||
[ProceduralSkyMaterial] supports up to 4 suns, using the color, and energy, direction, and angular distance of the first four [DirectionalLight3D] nodes in the scene. This means that the suns are defined individually by the properties of their corresponding [DirectionalLight3D]s and globally by [member sun_angle_max] and [member sun_curve].
|
||||
[ProceduralSkyMaterial] uses a lightweight shader to draw the sky and is therefore suited for real time updates. This makes it a great option for a sky that is simple and computationally cheap, but unrealistic. If you need a more realistic procedural option, use [PhysicalSkyMaterial].
|
||||
[ProceduralSkyMaterial] uses a lightweight shader to draw the sky and is therefore suited for real-time updates. This makes it a great option for a sky that is simple and computationally cheap, but unrealistic. If you need a more realistic procedural option, use [PhysicalSkyMaterial].
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
@ -406,7 +406,7 @@
|
||||
[b]Note:[/b] Enabling TTS can cause addition idle CPU usage and interfere with the sleep mode, so consider disabling it if TTS is not used.
|
||||
</member>
|
||||
<member name="audio/video/video_delay_compensation_ms" type="int" setter="" getter="" default="0">
|
||||
Setting to hardcode audio delay when playing video. Best to leave this untouched unless you know what you are doing.
|
||||
Setting to hardcode audio delay when playing video. Best to leave this unchanged unless you know what you are doing.
|
||||
</member>
|
||||
<member name="collada/use_ambient" type="bool" setter="" getter="" default="false">
|
||||
If [code]true[/code], ambient lights will be imported from COLLADA models as [DirectionalLight3D]. If [code]false[/code], ambient lights will be ignored.
|
||||
@ -1110,7 +1110,7 @@
|
||||
[b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified.
|
||||
</member>
|
||||
<member name="input/ui_swap_input_direction" type="Dictionary" setter="" getter="">
|
||||
Default [InputEventAction] to swap input direction, i.e. change between left-to-right to right-to-left modes. Affects text-editting controls ([LineEdit], [TextEdit]).
|
||||
Default [InputEventAction] to swap input direction, i.e. change between left-to-right to right-to-left modes. Affects text-editing controls ([LineEdit], [TextEdit]).
|
||||
</member>
|
||||
<member name="input/ui_text_add_selection_for_next_occurrence" type="Dictionary" setter="" getter="">
|
||||
If a selection is currently active with the last caret in text fields, searches for the next occurrence of the selection, adds a caret and selects the next occurrence.
|
||||
@ -1221,15 +1221,15 @@
|
||||
[b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified.
|
||||
</member>
|
||||
<member name="input/ui_text_completion_accept" type="Dictionary" setter="" getter="">
|
||||
Default [InputEventAction] to accept an autocompetion hint.
|
||||
Default [InputEventAction] to accept an autocompletion hint.
|
||||
[b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified.
|
||||
</member>
|
||||
<member name="input/ui_text_completion_query" type="Dictionary" setter="" getter="">
|
||||
Default [InputEventAction] to request autocompetion.
|
||||
Default [InputEventAction] to request autocompletion.
|
||||
[b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified.
|
||||
</member>
|
||||
<member name="input/ui_text_completion_replace" type="Dictionary" setter="" getter="">
|
||||
Default [InputEventAction] to accept an autocompetion hint, replacing existing text.
|
||||
Default [InputEventAction] to accept an autocompletion hint, replacing existing text.
|
||||
[b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified.
|
||||
</member>
|
||||
<member name="input/ui_text_dedent" type="Dictionary" setter="" getter="">
|
||||
@ -2213,7 +2213,7 @@
|
||||
[b]Note:[/b] This property is only read when the project starts. To change the maximum number of simulated physics steps per frame at runtime, set [member Engine.max_physics_steps_per_frame] instead.
|
||||
</member>
|
||||
<member name="physics/common/physics_jitter_fix" type="float" setter="" getter="" default="0.5">
|
||||
Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of in-game clock and real clock, but allows smoothing out framerate jitters. The default value of 0.5 should be fine for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended.
|
||||
Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of in-game clock and real clock, but allows smoothing out framerate jitters. The default value of 0.5 should be good enough for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended.
|
||||
[b]Note:[/b] For best results, when using a custom physics interpolation solution, the physics jitter fix should be disabled by setting [member physics/common/physics_jitter_fix] to [code]0[/code].
|
||||
[b]Note:[/b] This property is only read when the project starts. To change the physics jitter fix at runtime, set [member Engine.physics_jitter_fix] instead.
|
||||
</member>
|
||||
|
@ -79,6 +79,7 @@
|
||||
<method name="exp" qualifiers="const">
|
||||
<return type="Quaternion" />
|
||||
<description>
|
||||
Returns the exponential of this quaternion. The rotation axis of the result is the normalized rotation axis of this quaternion, the angle of the result is the length of the vector part of this quaternion.
|
||||
</description>
|
||||
</method>
|
||||
<method name="from_euler" qualifiers="static">
|
||||
@ -91,11 +92,14 @@
|
||||
<method name="get_angle" qualifiers="const">
|
||||
<return type="float" />
|
||||
<description>
|
||||
Returns the angle of the rotation represented by this quaternion.
|
||||
[b]Note:[/b] The quaternion must be normalized.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_axis" qualifiers="const">
|
||||
<return type="Vector3" />
|
||||
<description>
|
||||
Returns the rotation axis of the rotation represented by this quaternion.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_euler" qualifiers="const">
|
||||
@ -145,6 +149,7 @@
|
||||
<method name="log" qualifiers="const">
|
||||
<return type="Quaternion" />
|
||||
<description>
|
||||
Returns the logarithm of this quaternion. The vector part of the result is the rotation axis of this quaternion multiplied by its rotation angle, the real part of the result is zero.
|
||||
</description>
|
||||
</method>
|
||||
<method name="normalized" qualifiers="const">
|
||||
|
@ -10,47 +10,67 @@
|
||||
</tutorials>
|
||||
<members>
|
||||
<member name="back_op_compare" type="int" setter="set_back_op_compare" getter="get_back_op_compare" enum="RenderingDevice.CompareOperator" default="7">
|
||||
The method used for comparing the previous back stencil value and [member back_op_reference].
|
||||
</member>
|
||||
<member name="back_op_compare_mask" type="int" setter="set_back_op_compare_mask" getter="get_back_op_compare_mask" default="0">
|
||||
Selects which bits from the back stencil value will be compared.
|
||||
</member>
|
||||
<member name="back_op_depth_fail" type="int" setter="set_back_op_depth_fail" getter="get_back_op_depth_fail" enum="RenderingDevice.StencilOperation" default="1">
|
||||
The operation to perform on the stencil buffer for back pixels that pass the stencil test but fail the depth test.
|
||||
</member>
|
||||
<member name="back_op_fail" type="int" setter="set_back_op_fail" getter="get_back_op_fail" enum="RenderingDevice.StencilOperation" default="1">
|
||||
The operation to perform on the stencil buffer for back pixels that fail the stencil test
|
||||
</member>
|
||||
<member name="back_op_pass" type="int" setter="set_back_op_pass" getter="get_back_op_pass" enum="RenderingDevice.StencilOperation" default="1">
|
||||
The operation to perform on the stencil buffer for back pixels that pass the stencil test.
|
||||
</member>
|
||||
<member name="back_op_reference" type="int" setter="set_back_op_reference" getter="get_back_op_reference" default="0">
|
||||
The value the previous back stencil value will be compared to.
|
||||
</member>
|
||||
<member name="back_op_write_mask" type="int" setter="set_back_op_write_mask" getter="get_back_op_write_mask" default="0">
|
||||
Selects which bits from the back stencil value will be changed.
|
||||
</member>
|
||||
<member name="depth_compare_operator" type="int" setter="set_depth_compare_operator" getter="get_depth_compare_operator" enum="RenderingDevice.CompareOperator" default="7">
|
||||
The method used for comparing the previous and current depth values.
|
||||
</member>
|
||||
<member name="depth_range_max" type="float" setter="set_depth_range_max" getter="get_depth_range_max" default="0.0">
|
||||
The maximum depth that returns true for [member enable_depth_range].
|
||||
</member>
|
||||
<member name="depth_range_min" type="float" setter="set_depth_range_min" getter="get_depth_range_min" default="0.0">
|
||||
The minimum depth that returns true for [member enable_depth_range].
|
||||
</member>
|
||||
<member name="enable_depth_range" type="bool" setter="set_enable_depth_range" getter="get_enable_depth_range" default="false">
|
||||
If [code]true[/code], each depth value will be tested to see if it is between [member depth_range_min] and [member depth_range_max]. If it is outside of these values, it is discarded.
|
||||
</member>
|
||||
<member name="enable_depth_test" type="bool" setter="set_enable_depth_test" getter="get_enable_depth_test" default="false">
|
||||
If [code]true[/code], enables depth testing which allows objects to be automatically occluded by other objects based on their depth. This also allows objects to be partially occluded by other objects. If [code]false[/code], objects will appear in the order they were drawn (like in Godot's 2D renderer).
|
||||
</member>
|
||||
<member name="enable_depth_write" type="bool" setter="set_enable_depth_write" getter="get_enable_depth_write" default="false">
|
||||
If [code]true[/code], writes to the depth buffer whenever the depth test returns true. Only works when enable_depth_test is also true.
|
||||
</member>
|
||||
<member name="enable_stencil" type="bool" setter="set_enable_stencil" getter="get_enable_stencil" default="false">
|
||||
If [code]true[/code], enables stencil testing. There are separate stencil buffers for front-facing triangles and back-facing triangles. See properties that begin with "front_op" and properties with "back_op" for each.
|
||||
</member>
|
||||
<member name="front_op_compare" type="int" setter="set_front_op_compare" getter="get_front_op_compare" enum="RenderingDevice.CompareOperator" default="7">
|
||||
The method used for comparing the previous front stencil value and [member front_op_reference].
|
||||
</member>
|
||||
<member name="front_op_compare_mask" type="int" setter="set_front_op_compare_mask" getter="get_front_op_compare_mask" default="0">
|
||||
Selects which bits from the front stencil value will be compared.
|
||||
</member>
|
||||
<member name="front_op_depth_fail" type="int" setter="set_front_op_depth_fail" getter="get_front_op_depth_fail" enum="RenderingDevice.StencilOperation" default="1">
|
||||
The operation to perform on the stencil buffer for front pixels that pass the stencil test but fail the depth test.
|
||||
</member>
|
||||
<member name="front_op_fail" type="int" setter="set_front_op_fail" getter="get_front_op_fail" enum="RenderingDevice.StencilOperation" default="1">
|
||||
The operation to perform on the stencil buffer for front pixels that fail the stencil test.
|
||||
</member>
|
||||
<member name="front_op_pass" type="int" setter="set_front_op_pass" getter="get_front_op_pass" enum="RenderingDevice.StencilOperation" default="1">
|
||||
The operation to perform on the stencil buffer for front pixels that pass the stencil test.
|
||||
</member>
|
||||
<member name="front_op_reference" type="int" setter="set_front_op_reference" getter="get_front_op_reference" default="0">
|
||||
The value the previous front stencil value will be compared to.
|
||||
</member>
|
||||
<member name="front_op_write_mask" type="int" setter="set_front_op_write_mask" getter="get_front_op_write_mask" default="0">
|
||||
Selects which bits from the front stencil value will be changed.
|
||||
</member>
|
||||
</members>
|
||||
</class>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<description>
|
||||
RandomNumberGenerator is a class for generating pseudo-random numbers. It currently uses [url=https://www.pcg-random.org/]PCG32[/url].
|
||||
[b]Note:[/b] The underlying algorithm is an implementation detail and should not be depended upon.
|
||||
To generate a random float number (within a given range) based on a time-dependant seed:
|
||||
To generate a random float number (within a given range) based on a time-dependent seed:
|
||||
[codeblock]
|
||||
var rng = RandomNumberGenerator.new()
|
||||
func _ready():
|
||||
|
@ -205,7 +205,7 @@
|
||||
A simple drawing operation might look like this (code is not a complete example):
|
||||
[codeblock]
|
||||
var rd = RenderingDevice.new()
|
||||
var clear_colors = PackedColorArray([Color(0, 0, 0, 0), Color(0, 0, 0, 0), Color(0, 0, 0, 0)]
|
||||
var clear_colors = PackedColorArray([Color(0, 0, 0, 0), Color(0, 0, 0, 0), Color(0, 0, 0, 0)])
|
||||
var draw_list = rd.draw_list_begin(framebuffers[i], RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_READ, RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_DISCARD, clear_colors)
|
||||
|
||||
# Draw opaque.
|
||||
|
@ -1370,7 +1370,7 @@
|
||||
<param index="0" name="swap_buffers" type="bool" default="true" />
|
||||
<param index="1" name="frame_step" type="float" default="0.0" />
|
||||
<description>
|
||||
Forces redrawing of all viewports at once.
|
||||
Forces redrawing of all viewports at once. Must be called from the main thread.
|
||||
</description>
|
||||
</method>
|
||||
<method name="force_sync">
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="ResourceImporterOBJ" inherits="ResourceImporter" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
|
||||
<brief_description>
|
||||
Imports an OBJ 3D model as a standalone [Mesh] or scene.
|
||||
Imports an OBJ 3D model as an independent [Mesh] or scene.
|
||||
</brief_description>
|
||||
<description>
|
||||
Unlike [ResourceImporterScene], [ResourceImporterOBJ] will import a single [Mesh] resource by default instead of importing a [PackedScene]. This makes it easier to use the [Mesh] resource in nodes that expect direct [Mesh] resources, such as [GridMap], [GPUParticles3D] or [CPUParticles3D]. Note that it is still possible to save mesh resources from 3D scenes using the [b]Advanced Import Settings[/b] dialog, regardless of the source format.
|
||||
|
@ -4,7 +4,7 @@
|
||||
Imports a glTF, FBX, Collada or Blender 3D scene.
|
||||
</brief_description>
|
||||
<description>
|
||||
See also [ResourceImporterOBJ], which is used for OBJ models that can be imported as a standalone [Mesh] or a scene.
|
||||
See also [ResourceImporterOBJ], which is used for OBJ models that can be imported as an independent [Mesh] or a scene.
|
||||
Additional options (such as extracting individual meshes or materials to files) are available in the [b]Advanced Import Settings[/b] dialog. This dialog can be accessed by double-clicking a 3D scene in the FileSystem dock or by selecting a 3D scene in the FileSystem dock, going to the Import dock and choosing [b]Advanced[/b].
|
||||
[b]Note:[/b] [ResourceImporterScene] is [i]not[/i] used for [PackedScene]s, such as [code].tscn[/code] and [code].scn[/code] files.
|
||||
</description>
|
||||
|
@ -310,12 +310,14 @@
|
||||
[b]Note:[/b] Unless this value is [code]1.0[/code], the key value in animation will not match the actual position value.
|
||||
</member>
|
||||
<member name="show_rest_only" type="bool" setter="set_show_rest_only" getter="is_show_rest_only" default="false">
|
||||
If [code]true[/code], forces the bones in their default rest pose, regardless of their values. In the editor, this also prevents the bones from being edited.
|
||||
</member>
|
||||
</members>
|
||||
<signals>
|
||||
<signal name="bone_enabled_changed">
|
||||
<param index="0" name="bone_idx" type="int" />
|
||||
<description>
|
||||
Emitted when the bone at [param bone_idx] is toggled with [method set_bone_enabled]. Use [method is_bone_enabled] to check the new value.
|
||||
</description>
|
||||
</signal>
|
||||
<signal name="bone_pose_changed">
|
||||
@ -326,15 +328,19 @@
|
||||
</signal>
|
||||
<signal name="pose_updated">
|
||||
<description>
|
||||
Emitted when the pose is updated, after [constant NOTIFICATION_UPDATE_SKELETON] is received.
|
||||
</description>
|
||||
</signal>
|
||||
<signal name="show_rest_only_changed">
|
||||
<description>
|
||||
Emitted when the value of [member show_rest_only] changes.
|
||||
</description>
|
||||
</signal>
|
||||
</signals>
|
||||
<constants>
|
||||
<constant name="NOTIFICATION_UPDATE_SKELETON" value="50">
|
||||
Notification received when this skeleton's pose needs to be updated.
|
||||
This notification is received [i]before[/i] the related [signal pose_updated] signal.
|
||||
</constant>
|
||||
</constants>
|
||||
</class>
|
||||
|
@ -60,13 +60,13 @@
|
||||
If [code]true[/code], texture is flipped vertically.
|
||||
</member>
|
||||
<member name="frame" type="int" setter="set_frame" getter="get_frame" default="0">
|
||||
Current frame to display from sprite sheet. [member hframes] or [member vframes] must be greater than 1.
|
||||
Current frame to display from sprite sheet. [member hframes] or [member vframes] must be greater than 1. This property is automatically adjusted when [member hframes] or [member vframes] are changed to keep pointing to the same visual frame (same column and row). If that's impossible, this value is reset to [code]0[/code].
|
||||
</member>
|
||||
<member name="frame_coords" type="Vector2i" setter="set_frame_coords" getter="get_frame_coords" default="Vector2i(0, 0)">
|
||||
Coordinates of the frame to display from sprite sheet. This is as an alias for the [member frame] property. [member hframes] or [member vframes] must be greater than 1.
|
||||
</member>
|
||||
<member name="hframes" type="int" setter="set_hframes" getter="get_hframes" default="1">
|
||||
The number of columns in the sprite sheet.
|
||||
The number of columns in the sprite sheet. When this property is changed, [member frame] is adjusted so that the same visual frame is maintained (same row and column). If that's impossible, [member frame] is reset to [code]0[/code].
|
||||
</member>
|
||||
<member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)">
|
||||
The texture's drawing offset.
|
||||
@ -84,7 +84,7 @@
|
||||
[Texture2D] object to draw.
|
||||
</member>
|
||||
<member name="vframes" type="int" setter="set_vframes" getter="get_vframes" default="1">
|
||||
The number of rows in the sprite sheet.
|
||||
The number of rows in the sprite sheet. When this property is changed, [member frame] is adjusted so that the same visual frame is maintained (same row and column). If that's impossible, [member frame] is reset to [code]0[/code].
|
||||
</member>
|
||||
</members>
|
||||
<signals>
|
||||
|
@ -10,13 +10,13 @@
|
||||
</tutorials>
|
||||
<members>
|
||||
<member name="frame" type="int" setter="set_frame" getter="get_frame" default="0">
|
||||
Current frame to display from sprite sheet. [member hframes] or [member vframes] must be greater than 1.
|
||||
Current frame to display from sprite sheet. [member hframes] or [member vframes] must be greater than 1. This property is automatically adjusted when [member hframes] or [member vframes] are changed to keep pointing to the same visual frame (same column and row). If that's impossible, this value is reset to [code]0[/code].
|
||||
</member>
|
||||
<member name="frame_coords" type="Vector2i" setter="set_frame_coords" getter="get_frame_coords" default="Vector2i(0, 0)">
|
||||
Coordinates of the frame to display from sprite sheet. This is as an alias for the [member frame] property. [member hframes] or [member vframes] must be greater than 1.
|
||||
</member>
|
||||
<member name="hframes" type="int" setter="set_hframes" getter="get_hframes" default="1">
|
||||
The number of columns in the sprite sheet.
|
||||
The number of columns in the sprite sheet. When this property is changed, [member frame] is adjusted so that the same visual frame is maintained (same row and column). If that's impossible, [member frame] is reset to [code]0[/code].
|
||||
</member>
|
||||
<member name="region_enabled" type="bool" setter="set_region_enabled" getter="is_region_enabled" default="false">
|
||||
If [code]true[/code], the sprite will use [member region_rect] and display only the specified part of its texture.
|
||||
@ -28,7 +28,7 @@
|
||||
[Texture2D] object to draw. If [member GeometryInstance3D.material_override] is used, this will be overridden. The size information is still used.
|
||||
</member>
|
||||
<member name="vframes" type="int" setter="set_vframes" getter="get_vframes" default="1">
|
||||
The number of rows in the sprite sheet.
|
||||
The number of rows in the sprite sheet. When this property is changed, [member frame] is adjusted so that the same visual frame is maintained (same row and column). If that's impossible, [member frame] is reset to [code]0[/code].
|
||||
</member>
|
||||
</members>
|
||||
<signals>
|
||||
|
@ -319,7 +319,7 @@
|
||||
<return type="int" />
|
||||
<description>
|
||||
Returns the 32-bit hash value representing the string's contents.
|
||||
[b]Note:[/b] Strings with equal hash values are [i]not[/i] guaranteed to be the same, as a result of hash collisions. On the countrary, strings with different hash values are guaranteed to be different.
|
||||
[b]Note:[/b] Strings with equal hash values are [i]not[/i] guaranteed to be the same, as a result of hash collisions. On the contrary, strings with different hash values are guaranteed to be different.
|
||||
</description>
|
||||
</method>
|
||||
<method name="hex_decode" qualifiers="const">
|
||||
|
@ -303,7 +303,7 @@
|
||||
<return type="int" />
|
||||
<description>
|
||||
Returns the 32-bit hash value representing the string's contents.
|
||||
[b]Note:[/b] Strings with equal hash values are [i]not[/i] guaranteed to be the same, as a result of hash collisions. On the countrary, strings with different hash values are guaranteed to be different.
|
||||
[b]Note:[/b] Strings with equal hash values are [i]not[/i] guaranteed to be the same, as a result of hash collisions. On the contrary, strings with different hash values are guaranteed to be different.
|
||||
</description>
|
||||
</method>
|
||||
<method name="hex_decode" qualifiers="const">
|
||||
|
@ -125,7 +125,7 @@
|
||||
<param index="1" name="target_index_count" type="int" default="3" />
|
||||
<description>
|
||||
Generates a LOD for a given [param nd_threshold] in linear units (square root of quadric error metric), using at most [param target_index_count] indices.
|
||||
[i]Deprecated.[/i] Unused internally and neglects to preserve normals or UVs. Consider using [method ImporterMesh.generate_lods] instead.
|
||||
[i]Deprecated.[/i] Unused internally and fails to preserve normals or UVs. Consider using [method ImporterMesh.generate_lods] instead.
|
||||
</description>
|
||||
</method>
|
||||
<method name="generate_normals">
|
||||
|
@ -7,7 +7,7 @@
|
||||
[SystemFont] loads a font from a system font with the first matching name from [member font_names].
|
||||
It will attempt to match font style, but it's not guaranteed.
|
||||
The returned font might be part of a font collection or be a variable font with OpenType "weight", "width" and/or "italic" features set.
|
||||
You can create [FontVariation] of the system font for fine control over its features.
|
||||
You can create [FontVariation] of the system font for precise control over its features.
|
||||
[b]Note:[/b] This class is implemented on iOS, Linux, macOS and Windows, on other platforms it will fallback to default theme font.
|
||||
</description>
|
||||
<tutorials>
|
||||
|
@ -1106,7 +1106,7 @@
|
||||
</member>
|
||||
<member name="caret_move_on_right_click" type="bool" setter="set_move_caret_on_right_click_enabled" getter="is_move_caret_on_right_click_enabled" default="true">
|
||||
If [code]true[/code], a right-click moves the caret at the mouse position before displaying the context menu.
|
||||
If [code]false[/code], the context menu disregards mouse location.
|
||||
If [code]false[/code], the context menu ignores mouse location.
|
||||
</member>
|
||||
<member name="caret_multiple" type="bool" setter="set_multiple_carets_enabled" getter="is_multiple_carets_enabled" default="true">
|
||||
Sets if multiple carets are allowed.
|
||||
|
@ -123,6 +123,7 @@
|
||||
<return type="Image" />
|
||||
<description>
|
||||
Returns an [Image] that is a copy of data from this [Texture2D] (a new [Image] is created each time). [Image]s can be accessed and manipulated directly.
|
||||
[b]Note:[/b] This will return [code]null[/code] if this [Texture2D] is invalid.
|
||||
[b]Note:[/b] This will fetch the texture data from the GPU, which might cause performance problems when overused.
|
||||
</description>
|
||||
</method>
|
||||
|
@ -5,7 +5,7 @@
|
||||
</brief_description>
|
||||
<description>
|
||||
A 2×3 matrix (2 rows, 3 columns) used for 2D linear transformations. It can represent transformations such as translation, rotation, and scaling. It consists of three [Vector2] values: [member x], [member y], and the [member origin].
|
||||
For more information, read the "Matrices and transforms" documentation article.
|
||||
For a general introduction, see the [url=$DOCS_URL/tutorials/math/matrices_and_transforms.html]Matrices and transforms[/url] tutorial.
|
||||
</description>
|
||||
<tutorials>
|
||||
<link title="Math documentation index">$DOCS_URL/tutorials/math/index.html</link>
|
||||
|
@ -5,7 +5,7 @@
|
||||
</brief_description>
|
||||
<description>
|
||||
A 3×4 matrix (3 rows, 4 columns) used for 3D linear transformations. It can represent transformations such as translation, rotation, and scaling. It consists of a [member basis] (first 3 columns) and a [Vector3] for the [member origin] (last column).
|
||||
For more information, read the "Matrices and transforms" documentation article.
|
||||
For a general introduction, see the [url=$DOCS_URL/tutorials/math/matrices_and_transforms.html]Matrices and transforms[/url] tutorial.
|
||||
</description>
|
||||
<tutorials>
|
||||
<link title="Math documentation index">$DOCS_URL/tutorials/math/index.html</link>
|
||||
|
@ -5,7 +5,7 @@
|
||||
</brief_description>
|
||||
<description>
|
||||
Tweens are mostly useful for animations requiring a numerical property to be interpolated over a range of values. The name [i]tween[/i] comes from [i]in-betweening[/i], an animation technique where you specify [i]keyframes[/i] and the computer interpolates the frames that appear between them. Animating something with a [Tween] is called tweening.
|
||||
[Tween] is more suited than [AnimationPlayer] for animations where you don't know the final values in advance. For example, interpolating a dynamically-chosen camera zoom value is best done with a [Tween]; it would be difficult to do the same thing with an [AnimationPlayer] node. Tweens are also more light-weight than [AnimationPlayer], so they are very much suited for simple animations or general tasks that don't require visual tweaking provided by the editor. They can be used in a fire-and-forget manner for some logic that normally would be done by code. You can e.g. make something shoot periodically by using a looped [CallbackTweener] with a delay.
|
||||
[Tween] is more suited than [AnimationPlayer] for animations where you don't know the final values in advance. For example, interpolating a dynamically-chosen camera zoom value is best done with a [Tween]; it would be difficult to do the same thing with an [AnimationPlayer] node. Tweens are also more light-weight than [AnimationPlayer], so they are very much suited for simple animations or general tasks that don't require visual tweaking provided by the editor. They can be used in a "fire-and-forget" manner for some logic that normally would be done by code. You can e.g. make something shoot periodically by using a looped [CallbackTweener] with a delay.
|
||||
A [Tween] can be created by using either [method SceneTree.create_tween] or [method Node.create_tween]. [Tween]s created manually (i.e. by using [code]Tween.new()[/code]) are invalid and can't be used for tweening values.
|
||||
A tween animation is created by adding [Tweener]s to the [Tween] object, using [method tween_property], [method tween_interval], [method tween_callback] or [method tween_method]:
|
||||
[codeblocks]
|
||||
|
@ -2766,6 +2766,15 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params,
|
||||
prev_index_array_gl = 0;
|
||||
}
|
||||
|
||||
bool use_wireframe = false;
|
||||
if (p_params->force_wireframe) {
|
||||
GLuint wireframe_index_array_gl = mesh_storage->mesh_surface_get_index_buffer_wireframe(mesh_surface);
|
||||
if (wireframe_index_array_gl) {
|
||||
index_array_gl = wireframe_index_array_gl;
|
||||
use_wireframe = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool use_index_buffer = index_array_gl != 0;
|
||||
if (prev_index_array_gl != index_array_gl) {
|
||||
if (index_array_gl != 0) {
|
||||
@ -2956,6 +2965,11 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params,
|
||||
count = mesh_storage->mesh_surface_get_vertices_drawn_count(mesh_surface);
|
||||
}
|
||||
|
||||
if (use_wireframe) {
|
||||
// In this case we are using index count, and we need double the indices for the wireframe mesh.
|
||||
count = count * 2;
|
||||
}
|
||||
|
||||
if constexpr (p_pass_mode != PASS_MODE_DEPTH) {
|
||||
// Don't count draw calls during depth pre-pass to match the RD renderers.
|
||||
if (p_render_data->render_info) {
|
||||
@ -3010,17 +3024,25 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params,
|
||||
glVertexAttribI4ui(15, default_color, default_color, default_custom, default_custom);
|
||||
}
|
||||
|
||||
if (use_index_buffer) {
|
||||
glDrawElementsInstanced(primitive_gl, count, mesh_storage->mesh_surface_get_index_type(mesh_surface), 0, inst->instance_count);
|
||||
if (use_wireframe) {
|
||||
glDrawElementsInstanced(GL_LINES, count, GL_UNSIGNED_INT, 0, inst->instance_count);
|
||||
} else {
|
||||
glDrawArraysInstanced(primitive_gl, 0, count, inst->instance_count);
|
||||
if (use_index_buffer) {
|
||||
glDrawElementsInstanced(primitive_gl, count, mesh_storage->mesh_surface_get_index_type(mesh_surface), 0, inst->instance_count);
|
||||
} else {
|
||||
glDrawArraysInstanced(primitive_gl, 0, count, inst->instance_count);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Using regular Mesh.
|
||||
if (use_index_buffer) {
|
||||
glDrawElements(primitive_gl, count, mesh_storage->mesh_surface_get_index_type(mesh_surface), 0);
|
||||
if (use_wireframe) {
|
||||
glDrawElements(GL_LINES, count, GL_UNSIGNED_INT, 0);
|
||||
} else {
|
||||
glDrawArrays(primitive_gl, 0, count);
|
||||
if (use_index_buffer) {
|
||||
glDrawElements(primitive_gl, count, mesh_storage->mesh_surface_get_index_type(mesh_surface), 0);
|
||||
} else {
|
||||
glDrawArrays(primitive_gl, 0, count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -587,6 +587,9 @@ void main() {
|
||||
|
||||
if (normal_used || (using_light && bool(read_draw_data_flags & FLAGS_DEFAULT_NORMAL_MAP_USED))) {
|
||||
normal.xy = texture(normal_texture, uv).xy * vec2(2.0, -2.0) - vec2(1.0, -1.0);
|
||||
if (bool(read_draw_data_flags & FLAGS_TRANSPOSE_RECT)) {
|
||||
normal.xy = normal.yx;
|
||||
}
|
||||
if (bool(read_draw_data_flags & FLAGS_FLIP_H)) {
|
||||
normal.x = -normal.x;
|
||||
}
|
||||
|
@ -63,8 +63,7 @@ public:
|
||||
int64_t max_renderable_lights = 0;
|
||||
int64_t max_lights_per_object = 0;
|
||||
|
||||
// TODO implement wireframe in OpenGL
|
||||
// bool generate_wireframes;
|
||||
bool generate_wireframes = false;
|
||||
|
||||
HashSet<String> extensions;
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
#ifdef GLES3_ENABLED
|
||||
|
||||
#include "mesh_storage.h"
|
||||
#include "config.h"
|
||||
#include "material_storage.h"
|
||||
#include "utilities.h"
|
||||
|
||||
@ -285,6 +286,69 @@ void MeshStorage::mesh_add_surface(RID p_mesh, const RS::SurfaceData &p_surface)
|
||||
|
||||
ERR_FAIL_COND_MSG(!new_surface.index_count && !new_surface.vertex_count, "Meshes must contain a vertex array, an index array, or both");
|
||||
|
||||
if (GLES3::Config::get_singleton()->generate_wireframes && s->primitive == RS::PRIMITIVE_TRIANGLES) {
|
||||
// Generate wireframes. This is mostly used by the editor.
|
||||
s->wireframe = memnew(Mesh::Surface::Wireframe);
|
||||
Vector<uint32_t> wf_indices;
|
||||
uint32_t &wf_index_count = s->wireframe->index_count;
|
||||
uint32_t *wr = nullptr;
|
||||
|
||||
if (new_surface.format & RS::ARRAY_FORMAT_INDEX) {
|
||||
wf_index_count = s->index_count * 2;
|
||||
wf_indices.resize(wf_index_count);
|
||||
|
||||
Vector<uint8_t> ir = new_surface.index_data;
|
||||
wr = wf_indices.ptrw();
|
||||
|
||||
if (new_surface.vertex_count < (1 << 16)) {
|
||||
// Read 16 bit indices.
|
||||
const uint16_t *src_idx = (const uint16_t *)ir.ptr();
|
||||
for (uint32_t i = 0; i + 5 < wf_index_count; i += 6) {
|
||||
// We use GL_LINES instead of GL_TRIANGLES for drawing these primitives later,
|
||||
// so we need double the indices for each triangle.
|
||||
wr[i + 0] = src_idx[i / 2];
|
||||
wr[i + 1] = src_idx[i / 2 + 1];
|
||||
wr[i + 2] = src_idx[i / 2 + 1];
|
||||
wr[i + 3] = src_idx[i / 2 + 2];
|
||||
wr[i + 4] = src_idx[i / 2 + 2];
|
||||
wr[i + 5] = src_idx[i / 2];
|
||||
}
|
||||
|
||||
} else {
|
||||
// Read 32 bit indices.
|
||||
const uint32_t *src_idx = (const uint32_t *)ir.ptr();
|
||||
for (uint32_t i = 0; i + 5 < wf_index_count; i += 6) {
|
||||
wr[i + 0] = src_idx[i / 2];
|
||||
wr[i + 1] = src_idx[i / 2 + 1];
|
||||
wr[i + 2] = src_idx[i / 2 + 1];
|
||||
wr[i + 3] = src_idx[i / 2 + 2];
|
||||
wr[i + 4] = src_idx[i / 2 + 2];
|
||||
wr[i + 5] = src_idx[i / 2];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Not using indices.
|
||||
wf_index_count = s->vertex_count * 2;
|
||||
wf_indices.resize(wf_index_count);
|
||||
wr = wf_indices.ptrw();
|
||||
|
||||
for (uint32_t i = 0; i + 5 < wf_index_count; i += 6) {
|
||||
wr[i + 0] = i / 2;
|
||||
wr[i + 1] = i / 2 + 1;
|
||||
wr[i + 2] = i / 2 + 1;
|
||||
wr[i + 3] = i / 2 + 2;
|
||||
wr[i + 4] = i / 2 + 2;
|
||||
wr[i + 5] = i / 2;
|
||||
}
|
||||
}
|
||||
|
||||
s->wireframe->index_buffer_size = wf_index_count * sizeof(uint32_t);
|
||||
glGenBuffers(1, &s->wireframe->index_buffer);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, s->wireframe->index_buffer);
|
||||
GLES3::Utilities::get_singleton()->buffer_allocate_data(GL_ELEMENT_ARRAY_BUFFER, s->wireframe->index_buffer, s->wireframe->index_buffer_size, wr, GL_STATIC_DRAW, "Mesh wireframe index buffer");
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); // unbind
|
||||
}
|
||||
|
||||
s->aabb = new_surface.aabb;
|
||||
s->bone_aabbs = new_surface.bone_aabbs; //only really useful for returning them.
|
||||
s->mesh_to_skeleton_xform = p_surface.mesh_to_skeleton_xform;
|
||||
@ -725,6 +789,11 @@ void MeshStorage::mesh_clear(RID p_mesh) {
|
||||
memfree(s.versions); //reallocs, so free with memfree.
|
||||
}
|
||||
|
||||
if (s.wireframe) {
|
||||
GLES3::Utilities::get_singleton()->buffer_free_data(s.wireframe->index_buffer);
|
||||
memdelete(s.wireframe);
|
||||
}
|
||||
|
||||
if (s.lod_count) {
|
||||
for (uint32_t j = 0; j < s.lod_count; j++) {
|
||||
if (s.lods[j].index_buffer != 0) {
|
||||
|
@ -84,6 +84,14 @@ struct Mesh {
|
||||
uint32_t index_count = 0;
|
||||
uint32_t index_buffer_size = 0;
|
||||
|
||||
struct Wireframe {
|
||||
GLuint index_buffer = 0;
|
||||
uint32_t index_count = 0;
|
||||
uint32_t index_buffer_size = 0;
|
||||
};
|
||||
|
||||
Wireframe *wireframe = nullptr;
|
||||
|
||||
struct LOD {
|
||||
float edge_length = 0.0;
|
||||
uint32_t index_count = 0;
|
||||
@ -380,6 +388,16 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ GLuint mesh_surface_get_index_buffer_wireframe(void *p_surface) const {
|
||||
Mesh::Surface *s = reinterpret_cast<Mesh::Surface *>(p_surface);
|
||||
|
||||
if (s->wireframe) {
|
||||
return s->wireframe->index_buffer;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ GLenum mesh_surface_get_index_type(void *p_surface) const {
|
||||
Mesh::Surface *s = reinterpret_cast<Mesh::Surface *>(p_surface);
|
||||
|
||||
|
@ -327,6 +327,8 @@ void Utilities::update_dirty_resources() {
|
||||
}
|
||||
|
||||
void Utilities::set_debug_generate_wireframes(bool p_generate) {
|
||||
Config *config = Config::get_singleton();
|
||||
config->generate_wireframes = p_generate;
|
||||
}
|
||||
|
||||
bool Utilities::has_os_feature(const String &p_feature) const {
|
||||
|
@ -751,11 +751,26 @@ String OS_Unix::get_executable_path() const {
|
||||
return OS::get_executable_path();
|
||||
}
|
||||
return b;
|
||||
#elif defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
#elif defined(__OpenBSD__)
|
||||
char resolved_path[MAXPATHLEN];
|
||||
|
||||
realpath(OS::get_executable_path().utf8().get_data(), resolved_path);
|
||||
|
||||
return String(resolved_path);
|
||||
#elif defined(__NetBSD__)
|
||||
int mib[4] = { CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME };
|
||||
char buf[MAXPATHLEN];
|
||||
size_t len = sizeof(buf);
|
||||
if (sysctl(mib, 4, buf, &len, nullptr, 0) != 0) {
|
||||
WARN_PRINT("Couldn't get executable path from sysctl");
|
||||
return OS::get_executable_path();
|
||||
}
|
||||
|
||||
// NetBSD does not always return a normalized path. For example if argv[0] is "./a.out" then executable path is "/home/netbsd/./a.out". Normalize with realpath:
|
||||
char resolved_path[MAXPATHLEN];
|
||||
|
||||
realpath(buf, resolved_path);
|
||||
|
||||
return String(resolved_path);
|
||||
#elif defined(__FreeBSD__)
|
||||
int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
|
||||
|
@ -306,10 +306,14 @@ bool AnimationTrackKeyEdit::_set(const StringName &p_name, const Variant &p_valu
|
||||
|
||||
setting = true;
|
||||
undo_redo->create_action(TTR("Animation Change Keyframe Value"), UndoRedo::MERGE_ENDS);
|
||||
int prev = animation->bezier_track_get_key_handle_mode(track, key);
|
||||
undo_redo->add_do_method(this, "_bezier_track_set_key_handle_mode", animation.ptr(), track, key, value);
|
||||
undo_redo->add_undo_method(this, "_bezier_track_set_key_handle_mode", animation.ptr(), track, key, prev);
|
||||
int prev_mode = animation->bezier_track_get_key_handle_mode(track, key);
|
||||
Vector2 prev_in_handle = animation->bezier_track_get_key_in_handle(track, key);
|
||||
Vector2 prev_out_handle = animation->bezier_track_get_key_out_handle(track, key);
|
||||
undo_redo->add_do_method(editor, "_bezier_track_set_key_handle_mode", animation.ptr(), track, key, value);
|
||||
undo_redo->add_do_method(this, "_update_obj", animation);
|
||||
undo_redo->add_undo_method(editor, "_bezier_track_set_key_handle_mode", animation.ptr(), track, key, prev_mode);
|
||||
undo_redo->add_undo_method(animation.ptr(), "bezier_track_set_key_in_handle", track, key, prev_in_handle);
|
||||
undo_redo->add_undo_method(animation.ptr(), "bezier_track_set_key_out_handle", track, key, prev_out_handle);
|
||||
undo_redo->add_undo_method(this, "_update_obj", animation);
|
||||
undo_redo->commit_action();
|
||||
|
||||
@ -857,8 +861,8 @@ bool AnimationMultiTrackKeyEdit::_set(const StringName &p_name, const Variant &p
|
||||
undo_redo->create_action(TTR("Animation Multi Change Keyframe Value"), UndoRedo::MERGE_ENDS);
|
||||
}
|
||||
Vector2 prev = animation->bezier_track_get_key_in_handle(track, key);
|
||||
undo_redo->add_do_method(this, "_bezier_track_set_key_in_handle", track, key, value);
|
||||
undo_redo->add_undo_method(this, "_bezier_track_set_key_in_handle", track, key, prev);
|
||||
undo_redo->add_do_method(animation.ptr(), "bezier_track_set_key_in_handle", track, key, value);
|
||||
undo_redo->add_undo_method(animation.ptr(), "bezier_track_set_key_in_handle", track, key, prev);
|
||||
update_obj = true;
|
||||
} else if (name == "out_handle") {
|
||||
const Variant &value = p_value;
|
||||
@ -878,9 +882,13 @@ bool AnimationMultiTrackKeyEdit::_set(const StringName &p_name, const Variant &p
|
||||
setting = true;
|
||||
undo_redo->create_action(TTR("Animation Multi Change Keyframe Value"), UndoRedo::MERGE_ENDS);
|
||||
}
|
||||
int prev = animation->bezier_track_get_key_handle_mode(track, key);
|
||||
undo_redo->add_do_method(this, "_bezier_track_set_key_handle_mode", animation.ptr(), track, key, value);
|
||||
undo_redo->add_undo_method(this, "_bezier_track_set_key_handle_mode", animation.ptr(), track, key, prev);
|
||||
int prev_mode = animation->bezier_track_get_key_handle_mode(track, key);
|
||||
Vector2 prev_in_handle = animation->bezier_track_get_key_in_handle(track, key);
|
||||
Vector2 prev_out_handle = animation->bezier_track_get_key_out_handle(track, key);
|
||||
undo_redo->add_do_method(editor, "_bezier_track_set_key_handle_mode", animation.ptr(), track, key, value);
|
||||
undo_redo->add_undo_method(editor, "_bezier_track_set_key_handle_mode", animation.ptr(), track, key, prev_mode);
|
||||
undo_redo->add_undo_method(animation.ptr(), "bezier_track_set_key_in_handle", track, key, prev_in_handle);
|
||||
undo_redo->add_undo_method(animation.ptr(), "bezier_track_set_key_out_handle", track, key, prev_out_handle);
|
||||
update_obj = true;
|
||||
}
|
||||
} break;
|
||||
@ -5175,6 +5183,7 @@ void AnimationTrackEditor::_update_key_edit() {
|
||||
key_edit->animation_read_only = read_only;
|
||||
key_edit->track = selection.front()->key().track;
|
||||
key_edit->use_fps = timeline->is_using_fps();
|
||||
key_edit->editor = this;
|
||||
|
||||
int key_id = selection.front()->key().key;
|
||||
if (key_id >= animation->track_get_key_count(key_edit->track)) {
|
||||
@ -5194,6 +5203,7 @@ void AnimationTrackEditor::_update_key_edit() {
|
||||
multi_key_edit = memnew(AnimationMultiTrackKeyEdit);
|
||||
multi_key_edit->animation = animation;
|
||||
multi_key_edit->animation_read_only = read_only;
|
||||
multi_key_edit->editor = this;
|
||||
|
||||
RBMap<int, List<float>> key_ofs_map;
|
||||
RBMap<int, NodePath> base_map;
|
||||
|
@ -68,6 +68,7 @@ public:
|
||||
PropertyInfo hint;
|
||||
NodePath base;
|
||||
bool use_fps = false;
|
||||
AnimationTrackEditor *editor = nullptr;
|
||||
|
||||
bool _hide_script_from_inspector() { return true; }
|
||||
bool _hide_metadata_from_inspector() { return true; }
|
||||
@ -105,6 +106,7 @@ public:
|
||||
Node *root_path = nullptr;
|
||||
|
||||
bool use_fps = false;
|
||||
AnimationTrackEditor *editor = nullptr;
|
||||
|
||||
bool _hide_script_from_inspector() { return true; }
|
||||
bool _hide_metadata_from_inspector() { return true; }
|
||||
|
@ -912,6 +912,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
|
||||
vb->add_child(effects);
|
||||
effects->connect("item_edited", callable_mp(this, &EditorAudioBus::_effect_edited));
|
||||
effects->connect("cell_selected", callable_mp(this, &EditorAudioBus::_effect_selected));
|
||||
effects->connect("focus_exited", callable_mp(effects, &Tree::deselect_all));
|
||||
effects->set_edit_checkbox_cell_only_when_checkbox_is_pressed(true);
|
||||
SET_DRAG_FORWARDING_GCD(effects, EditorAudioBus);
|
||||
effects->connect("item_mouse_selected", callable_mp(this, &EditorAudioBus::_effect_rmb));
|
||||
|
@ -6582,6 +6582,23 @@ void EditorNode::_renderer_selected(int p_which) {
|
||||
_update_renderer_color();
|
||||
}
|
||||
|
||||
void EditorNode::_add_renderer_entry(const String &p_renderer_name, bool p_mark_overridden) {
|
||||
String item_text;
|
||||
if (p_renderer_name == "forward_plus") {
|
||||
item_text = TTR("Forward+");
|
||||
}
|
||||
if (p_renderer_name == "mobile") {
|
||||
item_text = TTR("Mobile");
|
||||
}
|
||||
if (p_renderer_name == "gl_compatibility") {
|
||||
item_text = TTR("Compatibility");
|
||||
}
|
||||
if (p_mark_overridden) {
|
||||
item_text += " " + TTR("(Overridden)");
|
||||
}
|
||||
renderer->add_item(item_text);
|
||||
}
|
||||
|
||||
void EditorNode::_resource_saved(Ref<Resource> p_resource, const String &p_path) {
|
||||
if (singleton->saving_resources_in_path.has(p_resource)) {
|
||||
// This is going to be handled by save_resource_in_path when the time is right.
|
||||
@ -6844,7 +6861,9 @@ EditorNode::EditorNode() {
|
||||
// Define a minimum window size to prevent UI elements from overlapping or being cut off.
|
||||
Window *w = Object::cast_to<Window>(SceneTree::get_singleton()->get_root());
|
||||
if (w) {
|
||||
w->set_min_size(Size2(1024, 600) * EDSCALE);
|
||||
const Size2 minimum_size = Size2(1024, 600) * EDSCALE;
|
||||
w->set_min_size(minimum_size); // Calling it this early doesn't sync the property with DS.
|
||||
DisplayServer::get_singleton()->window_set_min_size(minimum_size);
|
||||
}
|
||||
|
||||
EditorFileDialog::set_default_show_hidden_files(EDITOR_GET("filesystem/file_dialog/show_hidden_files"));
|
||||
@ -7506,7 +7525,6 @@ EditorNode::EditorNode() {
|
||||
renderer->set_flat(true);
|
||||
renderer->set_fit_to_longest_item(false);
|
||||
renderer->set_focus_mode(Control::FOCUS_NONE);
|
||||
renderer->connect("item_selected", callable_mp(this, &EditorNode::_renderer_selected));
|
||||
renderer->add_theme_font_override("font", theme->get_font(SNAME("bold"), EditorStringName(EditorFonts)));
|
||||
renderer->add_theme_font_size_override("font_size", theme->get_font_size(SNAME("bold_size"), EditorStringName(EditorFonts)));
|
||||
renderer->set_tooltip_text(TTR("Choose a rendering method.\n\nNotes:\n- On mobile platforms, the Mobile rendering method is used if Forward+ is selected here.\n- On the web platform, the Compatibility rendering method is always used."));
|
||||
@ -7520,36 +7538,33 @@ EditorNode::EditorNode() {
|
||||
title_bar->add_child(right_menu_spacer);
|
||||
}
|
||||
|
||||
String current_renderer = GLOBAL_GET("rendering/renderer/rendering_method");
|
||||
String current_renderer_ps = GLOBAL_GET("rendering/renderer/rendering_method");
|
||||
current_renderer_ps = current_renderer_ps.to_lower();
|
||||
String current_renderer_os = OS::get_singleton()->get_current_rendering_method().to_lower();
|
||||
|
||||
PackedStringArray renderers = ProjectSettings::get_singleton()->get_custom_property_info().get(StringName("rendering/renderer/rendering_method")).hint_string.split(",", false);
|
||||
|
||||
// As we are doing string comparisons, keep in standard case to prevent problems with capitals
|
||||
// "vulkan" in particular uses lowercase "v" in the code, and uppercase in the UI.
|
||||
current_renderer = current_renderer.to_lower();
|
||||
|
||||
for (int i = 0; i < renderers.size(); i++) {
|
||||
String rendering_method = renderers[i];
|
||||
|
||||
// Add the renderers name to the UI.
|
||||
if (rendering_method == "forward_plus") {
|
||||
renderer->add_item(TTR("Forward+"));
|
||||
}
|
||||
if (rendering_method == "mobile") {
|
||||
renderer->add_item(TTR("Mobile"));
|
||||
}
|
||||
if (rendering_method == "gl_compatibility") {
|
||||
renderer->add_item(TTR("Compatibility"));
|
||||
}
|
||||
renderer->set_item_metadata(i, rendering_method);
|
||||
|
||||
// Lowercase for standard comparison.
|
||||
rendering_method = rendering_method.to_lower();
|
||||
|
||||
if (current_renderer == rendering_method) {
|
||||
renderer->select(i);
|
||||
renderer_current = i;
|
||||
// Add the renderers name to the UI.
|
||||
if (current_renderer_ps == current_renderer_os) {
|
||||
renderer->connect("item_selected", callable_mp(this, &EditorNode::_renderer_selected));
|
||||
// As we are doing string comparisons, keep in standard case to prevent problems with capitals
|
||||
// "vulkan" in particular uses lowercase "v" in the code, and uppercase in the UI.
|
||||
PackedStringArray renderers = ProjectSettings::get_singleton()->get_custom_property_info().get(StringName("rendering/renderer/rendering_method")).hint_string.split(",", false);
|
||||
for (int i = 0; i < renderers.size(); i++) {
|
||||
String rendering_method = renderers[i];
|
||||
_add_renderer_entry(rendering_method, false);
|
||||
renderer->set_item_metadata(i, rendering_method);
|
||||
// Lowercase for standard comparison.
|
||||
rendering_method = rendering_method.to_lower();
|
||||
if (current_renderer_ps == rendering_method) {
|
||||
renderer->select(i);
|
||||
renderer_current = i;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// It's an CLI-overridden rendering method.
|
||||
_add_renderer_entry(current_renderer_os, true);
|
||||
renderer->set_item_metadata(0, current_renderer_os);
|
||||
renderer->select(0);
|
||||
renderer_current = 0;
|
||||
}
|
||||
_update_renderer_color();
|
||||
|
||||
|
@ -612,6 +612,7 @@ private:
|
||||
|
||||
void _renderer_selected(int);
|
||||
void _update_renderer_color();
|
||||
void _add_renderer_entry(const String &p_renderer_name, bool p_mark_overridden);
|
||||
|
||||
void _exit_editor(int p_exit_code);
|
||||
|
||||
|
@ -632,9 +632,9 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
|
||||
|
||||
// Use a similar color to the 2D editor selection.
|
||||
EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d/selection_box_color", Color(1.0, 0.5, 0), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
|
||||
_initial_set("editors/3d_gizmos/gizmo_colors/instantiated", Color(0.7, 0.7, 0.7, 0.6));
|
||||
_initial_set("editors/3d_gizmos/gizmo_colors/joint", Color(0.5, 0.8, 1));
|
||||
_initial_set("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1));
|
||||
EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/instantiated", Color(0.7, 0.7, 0.7, 0.6), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
|
||||
EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/joint", Color(0.5, 0.8, 1), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
|
||||
EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
|
||||
|
||||
// If a line is a multiple of this, it uses the primary grid color.
|
||||
// Use a power of 2 value by default as it's more common to use powers of 2 in level design.
|
||||
@ -884,6 +884,10 @@ bool EditorSettings::_is_default_text_editor_theme(String p_theme_name) {
|
||||
return p_theme_name == "default" || p_theme_name == "godot 2" || p_theme_name == "custom";
|
||||
}
|
||||
|
||||
const String EditorSettings::_get_project_metadata_path() const {
|
||||
return EditorPaths::get_singleton()->get_project_settings_dir().path_join("project_metadata.cfg");
|
||||
}
|
||||
|
||||
// PUBLIC METHODS
|
||||
|
||||
EditorSettings *EditorSettings::get_singleton() {
|
||||
@ -1126,8 +1130,8 @@ Variant _EDITOR_DEF(const String &p_setting, const Variant &p_default, bool p_re
|
||||
ret = EDITOR_GET(p_setting);
|
||||
} else {
|
||||
EditorSettings::get_singleton()->set_manually(p_setting, p_default);
|
||||
EditorSettings::get_singleton()->set_restart_if_changed(p_setting, p_restart_if_changed);
|
||||
}
|
||||
EditorSettings::get_singleton()->set_restart_if_changed(p_setting, p_restart_if_changed);
|
||||
|
||||
if (!EditorSettings::get_singleton()->has_default_value(p_setting)) {
|
||||
EditorSettings::get_singleton()->set_initial_value(p_setting, p_default);
|
||||
@ -1171,24 +1175,31 @@ void EditorSettings::add_property_hint(const PropertyInfo &p_hint) {
|
||||
// Metadata
|
||||
|
||||
void EditorSettings::set_project_metadata(const String &p_section, const String &p_key, Variant p_data) {
|
||||
Ref<ConfigFile> cf = memnew(ConfigFile);
|
||||
String path = EditorPaths::get_singleton()->get_project_settings_dir().path_join("project_metadata.cfg");
|
||||
Error err;
|
||||
err = cf->load(path);
|
||||
ERR_FAIL_COND_MSG(err != OK && err != ERR_FILE_NOT_FOUND, "Cannot load editor settings from file '" + path + "'.");
|
||||
cf->set_value(p_section, p_key, p_data);
|
||||
err = cf->save(path);
|
||||
ERR_FAIL_COND_MSG(err != OK, "Cannot save editor settings to file '" + path + "'.");
|
||||
const String path = _get_project_metadata_path();
|
||||
|
||||
if (project_metadata.is_null()) {
|
||||
project_metadata.instantiate();
|
||||
|
||||
Error err = project_metadata->load(path);
|
||||
if (err != OK && err != ERR_FILE_NOT_FOUND) {
|
||||
ERR_PRINT("Cannot load project metadata from file '" + path + "'.");
|
||||
}
|
||||
}
|
||||
project_metadata->set_value(p_section, p_key, p_data);
|
||||
|
||||
Error err = project_metadata->save(path);
|
||||
ERR_FAIL_COND_MSG(err != OK, "Cannot save project metadata to file '" + path + "'.");
|
||||
}
|
||||
|
||||
Variant EditorSettings::get_project_metadata(const String &p_section, const String &p_key, Variant p_default) const {
|
||||
Ref<ConfigFile> cf = memnew(ConfigFile);
|
||||
String path = EditorPaths::get_singleton()->get_project_settings_dir().path_join("project_metadata.cfg");
|
||||
Error err = cf->load(path);
|
||||
if (err != OK) {
|
||||
return p_default;
|
||||
if (project_metadata.is_null()) {
|
||||
project_metadata.instantiate();
|
||||
|
||||
const String path = _get_project_metadata_path();
|
||||
Error err = project_metadata->load(path);
|
||||
ERR_FAIL_COND_V_MSG(err != OK && err != ERR_FILE_NOT_FOUND, p_default, "Cannot load project metadata from file '" + path + "'.");
|
||||
}
|
||||
return cf->get_value(p_section, p_key, p_default);
|
||||
return project_metadata->get_value(p_section, p_key, p_default);
|
||||
}
|
||||
|
||||
void EditorSettings::set_favorites(const Vector<String> &p_favorites) {
|
||||
|
@ -79,6 +79,7 @@ private:
|
||||
|
||||
HashSet<String> changed_settings;
|
||||
|
||||
mutable Ref<ConfigFile> project_metadata;
|
||||
HashMap<String, PropertyInfo> hints;
|
||||
HashMap<String, VariantContainer> props;
|
||||
int last_order;
|
||||
@ -106,6 +107,7 @@ private:
|
||||
void _load_godot2_text_editor_theme();
|
||||
bool _save_text_editor_theme(String p_file);
|
||||
bool _is_default_text_editor_theme(String p_theme_name);
|
||||
const String _get_project_metadata_path() const;
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
@ -1274,6 +1274,7 @@ ProjectExportDialog::ProjectExportDialog() {
|
||||
server_strip_message = memnew(Label);
|
||||
server_strip_message->set_visible(false);
|
||||
server_strip_message->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
|
||||
server_strip_message->set_custom_minimum_size(Size2(300 * EDSCALE, 1));
|
||||
resources_vb->add_child(server_strip_message);
|
||||
|
||||
{
|
||||
|
@ -859,18 +859,7 @@ void FileSystemDock::_search(EditorFileSystemDirectory *p_path, List<FileInfo> *
|
||||
|
||||
struct FileSystemDock::FileInfoTypeComparator {
|
||||
bool operator()(const FileInfo &p_a, const FileInfo &p_b) const {
|
||||
// Uses the extension, then the icon name to distinguish file types.
|
||||
String icon_path_a = "";
|
||||
String icon_path_b = "";
|
||||
Ref<Texture2D> icon_a = EditorNode::get_singleton()->get_class_icon(p_a.type);
|
||||
if (icon_a.is_valid()) {
|
||||
icon_path_a = icon_a->get_name();
|
||||
}
|
||||
Ref<Texture2D> icon_b = EditorNode::get_singleton()->get_class_icon(p_b.type);
|
||||
if (icon_b.is_valid()) {
|
||||
icon_path_b = icon_b->get_name();
|
||||
}
|
||||
return NaturalNoCaseComparator()(p_a.name.get_extension() + icon_path_a + p_a.name.get_basename(), p_b.name.get_extension() + icon_path_b + p_b.name.get_basename());
|
||||
return NaturalNoCaseComparator()(p_a.name.get_extension() + p_a.type + p_a.name.get_basename(), p_b.name.get_extension() + p_b.type + p_b.name.get_basename());
|
||||
}
|
||||
};
|
||||
|
||||
@ -1308,6 +1297,13 @@ void FileSystemDock::_fs_changed() {
|
||||
_update_file_list(true);
|
||||
}
|
||||
|
||||
if (!select_after_scan.is_empty()) {
|
||||
_navigate_to_path(select_after_scan);
|
||||
select_after_scan.clear();
|
||||
import_dock_needs_update = true;
|
||||
_update_import_dock();
|
||||
}
|
||||
|
||||
set_process(false);
|
||||
}
|
||||
|
||||
@ -1487,8 +1483,6 @@ void FileSystemDock::_try_duplicate_item(const FileOrFolder &p_item, const Strin
|
||||
EditorNode::get_singleton()->add_io_error(TTR("Cannot move a folder into itself.") + "\n" + old_path + "\n");
|
||||
return;
|
||||
}
|
||||
const_cast<FileSystemDock *>(this)->current_path = new_path;
|
||||
|
||||
Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
|
||||
|
||||
if (p_item.is_file) {
|
||||
@ -1928,6 +1922,7 @@ void FileSystemDock::_move_operation_confirm(const String &p_to_path, bool p_cop
|
||||
for (int i = 0; i < to_move.size(); i++) {
|
||||
if (to_move[i].path != new_paths[i]) {
|
||||
_try_duplicate_item(to_move[i], new_paths[i]);
|
||||
select_after_scan = new_paths[i];
|
||||
is_copied = true;
|
||||
}
|
||||
}
|
||||
|
@ -225,6 +225,7 @@ private:
|
||||
int history_max_size;
|
||||
|
||||
String current_path;
|
||||
String select_after_scan;
|
||||
|
||||
bool initialized = false;
|
||||
|
||||
|
@ -117,7 +117,7 @@ void GroupDialog::_load_nodes(Node *p_current) {
|
||||
|
||||
if (!can_edit(p_current, selected_group)) {
|
||||
node->set_selectable(0, false);
|
||||
node->set_custom_color(0, groups->get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor)));
|
||||
node->set_custom_color(0, get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -211,8 +211,8 @@ void GroupDialog::_add_group(String p_name) {
|
||||
|
||||
TreeItem *new_group = groups->create_item(groups_root);
|
||||
new_group->set_text(0, name);
|
||||
new_group->add_button(0, groups->get_editor_theme_icon(SNAME("Remove")), DELETE_GROUP);
|
||||
new_group->add_button(0, groups->get_editor_theme_icon(SNAME("ActionCopy")), COPY_GROUP);
|
||||
new_group->add_button(0, get_editor_theme_icon(SNAME("Remove")), DELETE_GROUP);
|
||||
new_group->add_button(0, get_editor_theme_icon(SNAME("ActionCopy")), COPY_GROUP);
|
||||
new_group->set_editable(0, true);
|
||||
new_group->select(0);
|
||||
groups->ensure_cursor_is_visible();
|
||||
@ -391,20 +391,17 @@ void GroupDialog::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_TRANSLATION_CHANGED:
|
||||
case Control::NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
if (is_layout_rtl()) {
|
||||
add_button->set_icon(groups->get_editor_theme_icon(SNAME("Back")));
|
||||
remove_button->set_icon(groups->get_editor_theme_icon(SNAME("Forward")));
|
||||
add_button->set_icon(get_editor_theme_icon(SNAME("Back")));
|
||||
remove_button->set_icon(get_editor_theme_icon(SNAME("Forward")));
|
||||
} else {
|
||||
add_button->set_icon(groups->get_editor_theme_icon(SNAME("Forward")));
|
||||
remove_button->set_icon(groups->get_editor_theme_icon(SNAME("Back")));
|
||||
add_button->set_icon(get_editor_theme_icon(SNAME("Forward")));
|
||||
remove_button->set_icon(get_editor_theme_icon(SNAME("Back")));
|
||||
}
|
||||
|
||||
add_filter->set_right_icon(groups->get_editor_theme_icon(SNAME("Search")));
|
||||
add_filter->set_clear_button_enabled(true);
|
||||
remove_filter->set_right_icon(groups->get_editor_theme_icon(SNAME("Search")));
|
||||
remove_filter->set_clear_button_enabled(true);
|
||||
add_filter->set_right_icon(get_editor_theme_icon(SNAME("Search")));
|
||||
remove_filter->set_right_icon(get_editor_theme_icon(SNAME("Search")));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
@ -512,6 +509,7 @@ GroupDialog::GroupDialog() {
|
||||
add_filter = memnew(LineEdit);
|
||||
add_filter->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
add_filter->set_placeholder(TTR("Filter Nodes"));
|
||||
add_filter->set_clear_button_enabled(true);
|
||||
add_filter_hbc->add_child(add_filter);
|
||||
add_filter->connect("text_changed", callable_mp(this, &GroupDialog::_add_filter_changed));
|
||||
|
||||
@ -562,6 +560,7 @@ GroupDialog::GroupDialog() {
|
||||
remove_filter = memnew(LineEdit);
|
||||
remove_filter->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
remove_filter->set_placeholder(TTR("Filter Nodes"));
|
||||
remove_filter->set_clear_button_enabled(true);
|
||||
remove_filter_hbc->add_child(remove_filter);
|
||||
remove_filter->connect("text_changed", callable_mp(this, &GroupDialog::_remove_filter_changed));
|
||||
|
||||
|
1
editor/icons/Texture2D.svg
Normal file
1
editor/icons/Texture2D.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><g fill="#808080"><path d="M2 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zm1 2h10v8H3z"/><path d="M3.5 3.5h9v7h-9" fill-opacity=".2"/></g></svg>
|
After Width: | Height: | Size: 250 B |
1
editor/icons/Texture3D.svg
Normal file
1
editor/icons/Texture3D.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><g fill="gray"><path d="M1 14a1 1 0 0 0 1 1h9.5a1 1 0 0 0 .707-.293l2.5-2.5A1 1 0 0 0 15 11.5V2a1 1 0 0 0-1-1H4.5a1 1 0 0 0-.707.293l-2.5 2.5A1 1 0 0 0 1 4.5zm1.25-9H11v7H2.25zm10 6.25v-6.5L14 3v6.5zm-1-7.5H3L4.75 2H13z"/><path d="M2.75 5.5h7.75v6H2.75" fill-opacity=".2"/></g></svg>
|
After Width: | Height: | Size: 367 B |
@ -1345,6 +1345,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() {
|
||||
page2_description->set_text(TTR("Add font size, and variation coordinates, and select glyphs to pre-render:"));
|
||||
page2_description->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
page2_description->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
|
||||
page2_description->set_custom_minimum_size(Size2(300 * EDSCALE, 1));
|
||||
page2_vb->add_child(page2_description);
|
||||
|
||||
HSplitContainer *page2_hb = memnew(HSplitContainer);
|
||||
@ -1418,6 +1419,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() {
|
||||
page2_0_description->set_text(TTR("Select translations to add all required glyphs to pre-render list:"));
|
||||
page2_0_description->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
page2_0_description->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
|
||||
page2_0_description->set_custom_minimum_size(Size2(300 * EDSCALE, 1));
|
||||
page2_0_vb->add_child(page2_0_description);
|
||||
|
||||
locale_tree = memnew(Tree);
|
||||
@ -1449,6 +1451,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() {
|
||||
page2_1_description->set_text(TTR("Enter a text and select OpenType features to shape and add all required glyphs to pre-render list:"));
|
||||
page2_1_description->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
page2_1_description->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
|
||||
page2_1_description->set_custom_minimum_size(Size2(300 * EDSCALE, 1));
|
||||
page2_1_vb->add_child(page2_1_description);
|
||||
|
||||
HSplitContainer *page2_1_hb = memnew(HSplitContainer);
|
||||
@ -1486,6 +1489,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() {
|
||||
page2_2_description->set_text(TTR("Add or remove glyphs from the character map to pre-render list:\nNote: Some stylistic alternatives and glyph variants do not have one-to-one correspondence to character, and not shown in this map, use \"Glyphs from the text\" tab to add these."));
|
||||
page2_2_description->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
page2_2_description->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
|
||||
page2_2_description->set_custom_minimum_size(Size2(300 * EDSCALE, 1));
|
||||
page2_2_vb->add_child(page2_2_description);
|
||||
|
||||
HSplitContainer *glyphs_split = memnew(HSplitContainer);
|
||||
|
@ -139,8 +139,8 @@ void InspectorDock::_menu_option_confirm(int p_option, bool p_confirmed) {
|
||||
}
|
||||
}
|
||||
|
||||
unique_resources_list_tree->clear();
|
||||
if (resource_propnames.size()) {
|
||||
unique_resources_list_tree->clear();
|
||||
TreeItem *root = unique_resources_list_tree->create_item();
|
||||
|
||||
for (int i = 0; i < resource_propnames.size(); i++) {
|
||||
|
@ -67,14 +67,23 @@ void NodeDock::update_lists() {
|
||||
connections->update_tree();
|
||||
}
|
||||
|
||||
void NodeDock::_on_node_tree_exited() {
|
||||
set_node(nullptr);
|
||||
}
|
||||
|
||||
void NodeDock::set_node(Node *p_node) {
|
||||
connections->set_node(p_node);
|
||||
groups->set_current(p_node);
|
||||
if (p_node) {
|
||||
last_valid_node = p_node;
|
||||
if (last_valid_node) {
|
||||
last_valid_node->disconnect("tree_exited", callable_mp(this, &NodeDock::_on_node_tree_exited));
|
||||
last_valid_node = nullptr;
|
||||
}
|
||||
|
||||
connections->set_node(p_node);
|
||||
groups->set_current(p_node);
|
||||
|
||||
if (p_node) {
|
||||
last_valid_node = p_node;
|
||||
last_valid_node->connect("tree_exited", callable_mp(this, &NodeDock::_on_node_tree_exited));
|
||||
|
||||
if (connections_button->is_pressed()) {
|
||||
connections->show();
|
||||
} else {
|
||||
|
@ -58,6 +58,7 @@ public:
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
void _notification(int p_what);
|
||||
void _on_node_tree_exited();
|
||||
|
||||
public:
|
||||
void set_node(Node *p_node);
|
||||
|
@ -62,7 +62,7 @@ void PluginConfigDialog::_on_confirmed() {
|
||||
int lang_idx = script_option_edit->get_selected();
|
||||
String ext = ScriptServer::get_language(lang_idx)->get_extension();
|
||||
String script_name = script_edit->get_text().is_empty() ? _get_subfolder() : script_edit->get_text();
|
||||
if (script_name.get_extension().is_empty()) {
|
||||
if (script_name.get_extension() != ext) {
|
||||
script_name += "." + ext;
|
||||
}
|
||||
String script_path = path.path_join(script_name);
|
||||
@ -152,7 +152,7 @@ void PluginConfigDialog::config(const String &p_config_path) {
|
||||
ERR_FAIL_COND_MSG(err != OK, "Cannot load config file from path '" + p_config_path + "'.");
|
||||
|
||||
name_edit->set_text(cf->get_value("plugin", "name", ""));
|
||||
subfolder_edit->set_text(p_config_path.get_base_dir().get_basename().get_file());
|
||||
subfolder_edit->set_text(p_config_path.get_base_dir().get_file());
|
||||
desc_edit->set_text(cf->get_value("plugin", "description", ""));
|
||||
author_edit->set_text(cf->get_value("plugin", "author", ""));
|
||||
version_edit->set_text(cf->get_value("plugin", "version", ""));
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include "scene/3d/audio_stream_player_3d.h"
|
||||
|
||||
AudioStreamPlayer3DGizmoPlugin::AudioStreamPlayer3DGizmoPlugin() {
|
||||
Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/stream_player_3d", Color(0.4, 0.8, 1));
|
||||
Color gizmo_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/stream_player_3d", Color(0.4, 0.8, 1));
|
||||
|
||||
create_icon_material("stream_player_3d_icon", EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Gizmo3DSamplePlayer"), EditorStringName(EditorIcons)));
|
||||
create_material("stream_player_3d_material_primary", gizmo_color);
|
||||
|
@ -39,7 +39,7 @@
|
||||
#include "scene/3d/camera_3d.h"
|
||||
|
||||
Camera3DGizmoPlugin::Camera3DGizmoPlugin() {
|
||||
Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/camera", Color(0.8, 0.4, 0.8));
|
||||
Color gizmo_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/camera", Color(0.8, 0.4, 0.8));
|
||||
|
||||
create_material("camera_material", gizmo_color);
|
||||
create_icon_material("camera_icon", EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("GizmoCamera3D"), EditorStringName(EditorIcons)));
|
||||
|
@ -40,7 +40,7 @@
|
||||
|
||||
DecalGizmoPlugin::DecalGizmoPlugin() {
|
||||
helper.instantiate();
|
||||
Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/decal", Color(0.6, 0.5, 1.0));
|
||||
Color gizmo_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/decal", Color(0.6, 0.5, 1.0));
|
||||
|
||||
create_icon_material("decal_icon", EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("GizmoDecal"), EditorStringName(EditorIcons)));
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include "scene/3d/fog_volume.h"
|
||||
|
||||
FogVolumeGizmoPlugin::FogVolumeGizmoPlugin() {
|
||||
Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/fog_volume", Color(0.5, 0.7, 1));
|
||||
Color gizmo_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/fog_volume", Color(0.5, 0.7, 1));
|
||||
create_material("shape_material", gizmo_color);
|
||||
gizmo_color.a = 0.15;
|
||||
create_material("shape_material_internal", gizmo_color);
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include "scene/3d/gpu_particles_3d.h"
|
||||
|
||||
GPUParticles3DGizmoPlugin::GPUParticles3DGizmoPlugin() {
|
||||
Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/particles", Color(0.8, 0.7, 0.4));
|
||||
Color gizmo_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/particles", Color(0.8, 0.7, 0.4));
|
||||
create_material("particles_material", gizmo_color);
|
||||
gizmo_color.a = MAX((gizmo_color.a - 0.2) * 0.02, 0.0);
|
||||
create_material("particles_solid_material", gizmo_color);
|
||||
|
@ -39,12 +39,12 @@
|
||||
GPUParticlesCollision3DGizmoPlugin::GPUParticlesCollision3DGizmoPlugin() {
|
||||
helper.instantiate();
|
||||
|
||||
Color gizmo_color_attractor = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/particle_attractor", Color(1, 0.7, 0.5));
|
||||
Color gizmo_color_attractor = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/particle_attractor", Color(1, 0.7, 0.5));
|
||||
create_material("shape_material_attractor", gizmo_color_attractor);
|
||||
gizmo_color_attractor.a = 0.15;
|
||||
create_material("shape_material_attractor_internal", gizmo_color_attractor);
|
||||
|
||||
Color gizmo_color_collision = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/particle_collision", Color(0.5, 0.7, 1));
|
||||
Color gizmo_color_collision = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/particle_collision", Color(0.5, 0.7, 1));
|
||||
create_material("shape_material_collision", gizmo_color_collision);
|
||||
gizmo_color_collision.a = 0.15;
|
||||
create_material("shape_material_collision_internal", gizmo_color_collision);
|
||||
|
@ -276,8 +276,8 @@ void JointGizmosDrawer::draw_cone(const Transform3D &p_offset, const Basis &p_ba
|
||||
|
||||
Joint3DGizmoPlugin::Joint3DGizmoPlugin() {
|
||||
create_material("joint_material", EDITOR_GET("editors/3d_gizmos/gizmo_colors/joint"));
|
||||
create_material("joint_body_a_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/joint_body_a", Color(0.6, 0.8, 1)));
|
||||
create_material("joint_body_b_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/joint_body_b", Color(0.6, 0.9, 1)));
|
||||
create_material("joint_body_a_material", EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/joint_body_a", Color(0.6, 0.8, 1)));
|
||||
create_material("joint_body_b_material", EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/joint_body_b", Color(0.6, 0.9, 1)));
|
||||
|
||||
update_timer = memnew(Timer);
|
||||
update_timer->set_name("JointGizmoUpdateTimer");
|
||||
|
@ -37,7 +37,7 @@
|
||||
#include "scene/3d/lightmap_gi.h"
|
||||
|
||||
LightmapGIGizmoPlugin::LightmapGIGizmoPlugin() {
|
||||
Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/lightmap_lines", Color(0.5, 0.6, 1));
|
||||
Color gizmo_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/lightmap_lines", Color(0.5, 0.6, 1));
|
||||
|
||||
gizmo_color.a = 0.1;
|
||||
create_material("lightmap_lines", gizmo_color);
|
||||
|
@ -39,7 +39,7 @@
|
||||
LightmapProbeGizmoPlugin::LightmapProbeGizmoPlugin() {
|
||||
create_icon_material("lightmap_probe_icon", EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("GizmoLightmapProbe"), EditorStringName(EditorIcons)));
|
||||
|
||||
Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/lightprobe_lines", Color(0.5, 0.6, 1));
|
||||
Color gizmo_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/lightprobe_lines", Color(0.5, 0.6, 1));
|
||||
|
||||
gizmo_color.a = 0.3;
|
||||
create_material("lightprobe_lines", gizmo_color);
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include "scene/3d/occluder_instance_3d.h"
|
||||
|
||||
OccluderInstance3DGizmoPlugin::OccluderInstance3DGizmoPlugin() {
|
||||
create_material("line_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/occluder", Color(0.8, 0.5, 1)));
|
||||
create_material("line_material", EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/occluder", Color(0.8, 0.5, 1)));
|
||||
create_handle_material("handles");
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
||||
|
||||
ReflectionProbeGizmoPlugin::ReflectionProbeGizmoPlugin() {
|
||||
helper.instantiate();
|
||||
Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/reflection_probe", Color(0.6, 1, 0.5));
|
||||
Color gizmo_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/reflection_probe", Color(0.6, 1, 0.5));
|
||||
|
||||
create_material("reflection_probe_material", gizmo_color);
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include "scene/3d/visible_on_screen_notifier_3d.h"
|
||||
|
||||
VisibleOnScreenNotifier3DGizmoPlugin::VisibleOnScreenNotifier3DGizmoPlugin() {
|
||||
Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/visibility_notifier", Color(0.8, 0.5, 0.7));
|
||||
Color gizmo_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/visibility_notifier", Color(0.8, 0.5, 0.7));
|
||||
create_material("visibility_notifier_material", gizmo_color);
|
||||
gizmo_color.a = 0.1;
|
||||
create_material("visibility_notifier_solid_material", gizmo_color);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user