Merge branch 'master' into container_leaks
This commit is contained in:
@@ -94,11 +94,11 @@ Variant Array::back() const {
|
||||
return Variant(v);
|
||||
}
|
||||
|
||||
int Array::find(const Variant &what, const int from) {
|
||||
int Array::find(const Variant &what, const int from) const {
|
||||
return godot::api->godot_array_find(&_godot_array, (godot_variant *)&what, from);
|
||||
}
|
||||
|
||||
int Array::find_last(const Variant &what) {
|
||||
int Array::find_last(const Variant &what) const {
|
||||
return godot::api->godot_array_find_last(&_godot_array, (godot_variant *)&what);
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ void Array::resize(const int size) {
|
||||
godot::api->godot_array_resize(&_godot_array, size);
|
||||
}
|
||||
|
||||
int Array::rfind(const Variant &what, const int from) {
|
||||
int Array::rfind(const Variant &what, const int from) const {
|
||||
return godot::api->godot_array_rfind(&_godot_array, (godot_variant *)&what, from);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
|
||||
namespace godot {
|
||||
|
||||
const Basis Basis::IDENTITY = Basis();
|
||||
const Basis Basis::FLIP_X = Basis(-1, 0, 0, 0, 1, 0, 0, 0, 1);
|
||||
const Basis Basis::FLIP_Y = Basis(1, 0, 0, 0, -1, 0, 0, 0, 1);
|
||||
const Basis Basis::FLIP_Z = Basis(1, 0, 0, 0, 1, 0, 0, 0, -1);
|
||||
|
||||
Basis::Basis(const Vector3 &row0, const Vector3 &row1, const Vector3 &row2) {
|
||||
elements[0] = row0;
|
||||
elements[1] = row1;
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
namespace godot {
|
||||
|
||||
const Quat Quat::IDENTITY = Quat();
|
||||
|
||||
// set_euler_xyz expects a vector containing the Euler angles in the format
|
||||
// (ax,ay,az), where ax is the angle of rotation around x axis,
|
||||
// and similar for other axes.
|
||||
|
||||
@@ -392,17 +392,20 @@ float String::similarity(String text) const {
|
||||
return godot::api->godot_string_similarity(&_godot_string, &text._godot_string);
|
||||
}
|
||||
|
||||
PoolStringArray String::split(String divisor, bool allow_empty) const {
|
||||
// TODO Suport allow_empty
|
||||
PoolStringArray String::split(String divisor, bool /*allow_empty*/) const {
|
||||
godot_array arr = godot::api->godot_string_split(&_godot_string, &divisor._godot_string);
|
||||
return Array(arr);
|
||||
}
|
||||
|
||||
PoolIntArray String::split_ints(String divisor, bool allow_empty) const {
|
||||
// TODO Suport allow_empty
|
||||
PoolIntArray String::split_ints(String divisor, bool /*allow_empty*/) const {
|
||||
godot_array arr = godot::api->godot_string_split_floats(&_godot_string, &divisor._godot_string);
|
||||
return Array(arr);
|
||||
}
|
||||
|
||||
PoolRealArray String::split_floats(String divisor, bool allow_empty) const {
|
||||
// TODO Suport allow_empty
|
||||
PoolRealArray String::split_floats(String divisor, bool /*allow_empty*/) const {
|
||||
// TODO The GDNative API returns godot_array, when according to the doc, it should have been godot_pool_real_array
|
||||
godot_array arr = godot::api->godot_string_split_floats(&_godot_string, &divisor._godot_string);
|
||||
Array wrapped_array(arr);
|
||||
|
||||
@@ -9,6 +9,11 @@
|
||||
|
||||
namespace godot {
|
||||
|
||||
const Transform Transform::IDENTITY = Transform();
|
||||
const Transform Transform::FLIP_X = Transform(-1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0);
|
||||
const Transform Transform::FLIP_Y = Transform(1, 0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0);
|
||||
const Transform Transform::FLIP_Z = Transform(1, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0);
|
||||
|
||||
Transform Transform::inverse_xform(const Transform &t) const {
|
||||
|
||||
Vector3 v = t.origin - origin;
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
|
||||
namespace godot {
|
||||
|
||||
const Transform2D Transform2D::IDENTITY;
|
||||
const Transform2D Transform2D::FLIP_X = Transform2D(-1, 0, 0, 1, 0, 0);
|
||||
const Transform2D Transform2D::FLIP_Y = Transform2D(1, 0, 0, -1, 0, 0);
|
||||
|
||||
Transform2D::Transform2D(real_t xx, real_t xy, real_t yx, real_t yy, real_t ox, real_t oy) {
|
||||
|
||||
elements[0][0] = xx;
|
||||
|
||||
@@ -6,6 +6,15 @@
|
||||
|
||||
namespace godot {
|
||||
|
||||
const Vector2 Vector2::ZERO;
|
||||
const Vector2 Vector2::ONE;
|
||||
const Vector2 Vector2::INF;
|
||||
|
||||
const Vector2 Vector2::LEFT = Vector2(-1, 0);
|
||||
const Vector2 Vector2::RIGHT = Vector2(1, 0);
|
||||
const Vector2 Vector2::UP = Vector2(0, -1);
|
||||
const Vector2 Vector2::DOWN = Vector2(0, 1);
|
||||
|
||||
bool Vector2::operator==(const Vector2 &p_vec2) const {
|
||||
return x == p_vec2.x && y == p_vec2.y;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,17 @@
|
||||
|
||||
namespace godot {
|
||||
|
||||
const Vector3 Vector3::ZERO = Vector3();
|
||||
const Vector3 Vector3::ONE = Vector3();
|
||||
const Vector3 Vector3::INF = Vector3(INFINITY, INFINITY, INFINITY);
|
||||
|
||||
const Vector3 Vector3::LEFT = Vector3(-1, 0, 0);
|
||||
const Vector3 Vector3::RIGHT = Vector3(1, 0, 0);
|
||||
const Vector3 Vector3::UP = Vector3(0, 1, 0);
|
||||
const Vector3 Vector3::DOWN = Vector3(0, -1, 0);
|
||||
const Vector3 Vector3::FORWARD = Vector3(0, 0, -1);
|
||||
const Vector3 Vector3::BACK = Vector3(0, 0, 1);
|
||||
|
||||
bool Vector3::operator<(const Vector3 &p_v) const {
|
||||
if (x == p_v.x) {
|
||||
if (y == p_v.y)
|
||||
|
||||
Reference in New Issue
Block a user