mirror of https://github.com/godotengine/godot
Merge pull request #99545 from KoBeWi/Vector4.0
Fix stringification of Vector4
This commit is contained in:
commit
9b5c7e9efa
|
|
@ -213,7 +213,7 @@ Vector4 Vector4::clampf(real_t p_min, real_t p_max) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector4::operator String() const {
|
Vector4::operator String() const {
|
||||||
return "(" + String::num_real(x, false) + ", " + String::num_real(y, false) + ", " + String::num_real(z, false) + ", " + String::num_real(w, false) + ")";
|
return "(" + String::num_real(x, true) + ", " + String::num_real(y, true) + ", " + String::num_real(z, true) + ", " + String::num_real(w, true) + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
static_assert(sizeof(Vector4) == 4 * sizeof(real_t));
|
static_assert(sizeof(Vector4) == 4 * sizeof(real_t));
|
||||||
|
|
|
||||||
|
|
@ -4,15 +4,18 @@ func test():
|
||||||
print(-1.25, 0.25, 1.25)
|
print(-1.25, 0.25, 1.25)
|
||||||
print("hello world")
|
print("hello world")
|
||||||
|
|
||||||
print(Vector2(0.25, 0.25))
|
print(Vector2(0.25, 1))
|
||||||
print(Vector2i(0, 0))
|
print(Vector2i(0, 0))
|
||||||
|
|
||||||
print(Rect2(0.25, 0.25, 0.5, 0.5))
|
print(Rect2(0.25, 0.25, 0.5, 1))
|
||||||
print(Rect2i(0, 0, 0, 0))
|
print(Rect2i(0, 0, 0, 0))
|
||||||
|
|
||||||
print(Vector3(0.25, 0.25, 0.25))
|
print(Vector3(0.25, 0.25, 1))
|
||||||
print(Vector3i(0, 0, 0))
|
print(Vector3i(0, 0, 0))
|
||||||
|
|
||||||
|
print(Vector4(0.25, 0.25, 0.25, 1))
|
||||||
|
print(Vector4i(0, 0, 0, 0))
|
||||||
|
|
||||||
print(Transform2D.IDENTITY)
|
print(Transform2D.IDENTITY)
|
||||||
print(Plane(1, 2, 3, 4))
|
print(Plane(1, 2, 3, 4))
|
||||||
print(Quaternion(1, 2, 3, 4))
|
print(Quaternion(1, 2, 3, 4))
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,14 @@ truefalse
|
||||||
-101
|
-101
|
||||||
-1.250.251.25
|
-1.250.251.25
|
||||||
hello world
|
hello world
|
||||||
(0.25, 0.25)
|
(0.25, 1.0)
|
||||||
(0, 0)
|
(0, 0)
|
||||||
[P: (0.25, 0.25), S: (0.5, 0.5)]
|
[P: (0.25, 0.25), S: (0.5, 1.0)]
|
||||||
[P: (0, 0), S: (0, 0)]
|
[P: (0, 0), S: (0, 0)]
|
||||||
(0.25, 0.25, 0.25)
|
(0.25, 0.25, 1.0)
|
||||||
(0, 0, 0)
|
(0, 0, 0)
|
||||||
|
(0.25, 0.25, 0.25, 1.0)
|
||||||
|
(0, 0, 0, 0)
|
||||||
[X: (1.0, 0.0), Y: (0.0, 1.0), O: (0.0, 0.0)]
|
[X: (1.0, 0.0), Y: (0.0, 1.0), O: (0.0, 0.0)]
|
||||||
[N: (1.0, 2.0, 3.0), D: 4]
|
[N: (1.0, 2.0, 3.0), D: 4]
|
||||||
(1, 2, 3, 4)
|
(1, 2, 3, 4)
|
||||||
|
|
@ -32,4 +34,4 @@ Node::[signal]property_list_changed
|
||||||
[(1.0, 1.0), (0.0, 0.0)]
|
[(1.0, 1.0), (0.0, 0.0)]
|
||||||
[(1.0, 1.0, 1.0), (0.0, 0.0, 0.0)]
|
[(1.0, 1.0, 1.0), (0.0, 0.0, 0.0)]
|
||||||
[(1.0, 0.0, 0.0, 1.0), (0.0, 0.0, 1.0, 1.0), (0.0, 1.0, 0.0, 1.0)]
|
[(1.0, 0.0, 0.0, 1.0), (0.0, 0.0, 1.0, 1.0), (0.0, 1.0, 0.0, 1.0)]
|
||||||
[(1, 1, 1, 1), (0, 0, 0, 0)]
|
[(1.0, 1.0, 1.0, 1.0), (0.0, 0.0, 0.0, 0.0)]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue