Merge pull request #688 from zhehangd/master
commit
917b0c2ca3
|
@ -153,6 +153,7 @@ public:
|
|||
real_t aspect() const { return width / height; }
|
||||
|
||||
operator String() const;
|
||||
operator Vector2i() const;
|
||||
|
||||
inline Vector2() {}
|
||||
inline Vector2(real_t p_x, real_t p_y) {
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <godot_cpp/core/error_macros.hpp>
|
||||
#include <godot_cpp/variant/string.hpp>
|
||||
#include <godot_cpp/variant/vector2.hpp>
|
||||
#include <godot_cpp/variant/vector2i.hpp>
|
||||
|
||||
namespace godot {
|
||||
|
||||
|
@ -38,6 +39,10 @@ Vector2::operator String() const {
|
|||
return String::num(x, 5) + ", " + String::num(y, 5);
|
||||
}
|
||||
|
||||
Vector2::operator Vector2i() const {
|
||||
return Vector2i(x, y);
|
||||
}
|
||||
|
||||
real_t Vector2::angle() const {
|
||||
return Math::atan2(y, x);
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <godot_cpp/core/error_macros.hpp>
|
||||
#include <godot_cpp/variant/basis.hpp>
|
||||
#include <godot_cpp/variant/vector3.hpp>
|
||||
#include <godot_cpp/variant/vector3i.hpp>
|
||||
|
||||
namespace godot {
|
||||
|
||||
|
@ -121,4 +122,8 @@ Vector3::operator String() const {
|
|||
return (String::num(x, 5) + ", " + String::num(y, 5) + ", " + String::num(z, 5));
|
||||
}
|
||||
|
||||
Vector3::operator Vector3i() const {
|
||||
return Vector3i(x, y, z);
|
||||
}
|
||||
|
||||
} // namespace godot
|
||||
|
|
Loading…
Reference in New Issue