Now Vector4, Vector4i, Projection, PoolVector4Array, PoolVector4iArray, are built in variant types. Also reordered the Variant's Type enum, renamed _RID in it to RID, fixed a few smaller issues and removed some very old compat code.

This commit is contained in:
Relintai 2022-08-16 21:55:56 +02:00
parent 8c2e76840c
commit e71e3ed897
107 changed files with 4263 additions and 1776 deletions

View File

@ -650,35 +650,42 @@ void register_global_constants() {
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_INT", Variant::INT);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_REAL", Variant::REAL);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_STRING", Variant::STRING);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2", Variant::VECTOR2); // 5
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2I", Variant::VECTOR2I);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RECT2", Variant::RECT2);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RECT2", Variant::RECT2); // 5
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RECT2I", Variant::RECT2I);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2", Variant::VECTOR2);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2I", Variant::VECTOR2I);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR3", Variant::VECTOR3);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR3I", Variant::VECTOR3I); //10
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_TRANSFORM2D", Variant::TRANSFORM2D);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR3I", Variant::VECTOR3I); // 10
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR4", Variant::VECTOR4);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR4I", Variant::VECTOR4I);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_PLANE", Variant::PLANE);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_QUATERNION", Variant::QUATERNION);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_AABB", Variant::AABB);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_BASIS", Variant::BASIS); //15
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_AABB", Variant::AABB); // 15
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_BASIS", Variant::BASIS);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_TRANSFORM", Variant::TRANSFORM);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_COLOR", Variant::COLOR);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_TRANSFORM2D", Variant::TRANSFORM2D);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_PROJECTION", Variant::PROJECTION);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_COLOR", Variant::COLOR); // 20
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_NODE_PATH", Variant::NODE_PATH);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RID", Variant::_RID);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_OBJECT", Variant::OBJECT); // 20
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RID", Variant::RID);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_OBJECT", Variant::OBJECT);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_STRING_NAME", Variant::STRING_NAME);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_DICTIONARY", Variant::DICTIONARY);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_DICTIONARY", Variant::DICTIONARY); //25
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_ARRAY", Variant::ARRAY);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RAW_ARRAY", Variant::POOL_BYTE_ARRAY);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_INT_ARRAY", Variant::POOL_INT_ARRAY); //25
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_INT_ARRAY", Variant::POOL_INT_ARRAY);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_REAL_ARRAY", Variant::POOL_REAL_ARRAY);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_STRING_ARRAY", Variant::POOL_STRING_ARRAY);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_STRING_ARRAY", Variant::POOL_STRING_ARRAY); //30
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2_ARRAY", Variant::POOL_VECTOR2_ARRAY);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2I_ARRAY", Variant::POOL_VECTOR2I_ARRAY);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR3_ARRAY", Variant::POOL_VECTOR3_ARRAY); //30
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR3_ARRAY", Variant::POOL_VECTOR3_ARRAY);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR3I_ARRAY", Variant::POOL_VECTOR3I_ARRAY);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR4_ARRAY", Variant::POOL_VECTOR4_ARRAY); //35
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR4I_ARRAY", Variant::POOL_VECTOR4I_ARRAY);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_COLOR_ARRAY", Variant::POOL_COLOR_ARRAY);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_MAX", Variant::VARIANT_MAX);
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_MAX", Variant::VARIANT_MAX); // 38
//comparison
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_EQUAL", Variant::OP_EQUAL);

View File

@ -334,6 +334,7 @@ struct HashMapHasherDefault {
static _FORCE_INLINE_ uint32_t hash(const int16_t p_int) { return hash_fmix32(p_int); }
static _FORCE_INLINE_ uint32_t hash(const uint8_t p_int) { return hash_fmix32(p_int); }
static _FORCE_INLINE_ uint32_t hash(const int8_t p_int) { return hash_fmix32(p_int); }
static _FORCE_INLINE_ uint32_t hash(const Vector2i &p_vec) {
uint32_t h = hash_murmur3_one_32(p_vec.x);
h = hash_murmur3_one_32(p_vec.y, h);

View File

@ -176,30 +176,6 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
} break;
// math types
case Variant::VECTOR2: {
ERR_FAIL_COND_V(len < 4 * 2, ERR_INVALID_DATA);
Vector2 val;
val.x = decode_float(&buf[0]);
val.y = decode_float(&buf[4]);
r_variant = val;
if (r_len) {
(*r_len) += 4 * 2;
}
} break; // 5
case Variant::VECTOR2I: {
ERR_FAIL_COND_V(len < 4 * 2, ERR_INVALID_DATA);
Vector2i val;
val.x = decode_uint32(&buf[0]);
val.y = decode_uint32(&buf[4]);
r_variant = val;
if (r_len) {
(*r_len) += 4 * 2;
}
} break;
case Variant::RECT2: {
ERR_FAIL_COND_V(len < 4 * 4, ERR_INVALID_DATA);
Rect2 val;
@ -227,6 +203,30 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
(*r_len) += 4 * 4;
}
} break;
case Variant::VECTOR2: {
ERR_FAIL_COND_V(len < 4 * 2, ERR_INVALID_DATA);
Vector2 val;
val.x = decode_float(&buf[0]);
val.y = decode_float(&buf[4]);
r_variant = val;
if (r_len) {
(*r_len) += 4 * 2;
}
} break; // 5
case Variant::VECTOR2I: {
ERR_FAIL_COND_V(len < 4 * 2, ERR_INVALID_DATA);
Vector2i val;
val.x = decode_uint32(&buf[0]);
val.y = decode_uint32(&buf[4]);
r_variant = val;
if (r_len) {
(*r_len) += 4 * 2;
}
} break;
case Variant::VECTOR3: {
ERR_FAIL_COND_V(len < 4 * 3, ERR_INVALID_DATA);
@ -254,22 +254,35 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
}
} break;
case Variant::TRANSFORM2D: {
ERR_FAIL_COND_V(len < 4 * 6, ERR_INVALID_DATA);
Transform2D val;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
val.columns[i][j] = decode_float(&buf[(i * 2 + j) * 4]);
}
}
case Variant::VECTOR4: {
ERR_FAIL_COND_V(len < 4 * 4, ERR_INVALID_DATA);
Vector4 val;
val.x = decode_float(&buf[0]);
val.y = decode_float(&buf[4]);
val.z = decode_float(&buf[8]);
val.w = decode_float(&buf[12]);
r_variant = val;
if (r_len) {
(*r_len) += 4 * 6;
(*r_len) += 4 * 3;
}
} break;
case Variant::VECTOR4I: {
ERR_FAIL_COND_V(len < 4 * 4, ERR_INVALID_DATA);
Vector4i val;
val.x = decode_uint32(&buf[0]);
val.y = decode_uint32(&buf[4]);
val.z = decode_uint32(&buf[8]);
val.w = decode_uint32(&buf[12]);
r_variant = val;
if (r_len) {
(*r_len) += 4 * 3;
}
} break;
case Variant::PLANE: {
ERR_FAIL_COND_V(len < 4 * 4, ERR_INVALID_DATA);
Plane val;
@ -348,6 +361,38 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
(*r_len) += 4 * 12;
}
} break;
case Variant::TRANSFORM2D: {
ERR_FAIL_COND_V(len < 4 * 6, ERR_INVALID_DATA);
Transform2D val;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
val.columns[i][j] = decode_float(&buf[(i * 2 + j) * 4]);
}
}
r_variant = val;
if (r_len) {
(*r_len) += 4 * 6;
}
} break;
case Variant::PROJECTION: {
Projection val;
ERR_FAIL_COND_V((size_t)len < sizeof(float) * 62, ERR_INVALID_DATA);
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
val.matrix[i][j] = decode_float(&buf[(i * 4 + j) * sizeof(float)]);
}
}
if (r_len) {
(*r_len) += sizeof(float) * 16;
}
r_variant = val;
} break;
// misc types
@ -415,7 +460,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
}
} break;
case Variant::_RID: {
case Variant::RID: {
r_variant = RID();
} break;
case Variant::OBJECT: {
@ -815,6 +860,78 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
r_variant = varray;
} break;
case Variant::POOL_VECTOR4_ARRAY: {
ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA);
int32_t count = decode_uint32(buf);
buf += 4;
len -= 4;
ERR_FAIL_MUL_OF(count, 4 * 4, ERR_INVALID_DATA);
ERR_FAIL_COND_V(count < 0 || count * 4 * 4 > len, ERR_INVALID_DATA);
PoolVector<Vector4> varray;
if (r_len) {
(*r_len) += 4;
}
if (count) {
varray.resize(count);
PoolVector<Vector4>::Write w = varray.write();
for (int32_t i = 0; i < count; i++) {
w[i].x = decode_float(buf + i * 4 * 4 + 4 * 0);
w[i].y = decode_float(buf + i * 4 * 4 + 4 * 1);
w[i].z = decode_float(buf + i * 4 * 4 + 4 * 2);
w[i].w = decode_float(buf + i * 4 * 4 + 4 * 2);
}
int adv = 4 * 4 * count;
if (r_len) {
(*r_len) += adv;
}
}
r_variant = varray;
} break;
case Variant::POOL_VECTOR4I_ARRAY: {
ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA);
int32_t count = decode_uint32(buf);
buf += 4;
len -= 4;
ERR_FAIL_MUL_OF(count, 4 * 4, ERR_INVALID_DATA);
ERR_FAIL_COND_V(count < 0 || count * 4 * 4 > len, ERR_INVALID_DATA);
PoolVector<Vector4i> varray;
if (r_len) {
(*r_len) += 4;
}
if (count) {
varray.resize(count);
PoolVector<Vector4i>::Write w = varray.write();
for (int32_t i = 0; i < count; i++) {
w[i].x = decode_uint32(buf + i * 4 * 4 + 4 * 0);
w[i].y = decode_uint32(buf + i * 4 * 4 + 4 * 1);
w[i].z = decode_uint32(buf + i * 4 * 4 + 4 * 2);
w[i].w = decode_uint32(buf + i * 4 * 4 + 4 * 2);
}
int adv = 4 * 4 * count;
if (r_len) {
(*r_len) += adv;
}
}
r_variant = varray;
} break;
case Variant::POOL_COLOR_ARRAY: {
ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA);
@ -970,80 +1087,13 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
r_len += 4;
}
} break;
case Variant::NODE_PATH: {
NodePath np = p_variant;
if (buf) {
encode_uint32(uint32_t(np.get_name_count()) | 0x80000000, buf); //for compatibility with the old format
encode_uint32(np.get_subname_count(), buf + 4);
uint32_t np_flags = 0;
if (np.is_absolute()) {
np_flags |= 1;
}
encode_uint32(np_flags, buf + 8);
buf += 12;
}
r_len += 12;
int total = np.get_name_count() + np.get_subname_count();
for (int i = 0; i < total; i++) {
String str;
if (i < np.get_name_count()) {
str = np.get_name(i);
} else {
str = np.get_subname(i - np.get_name_count());
}
CharString utf8 = str.utf8();
int pad = 0;
if (utf8.length() % 4) {
pad = 4 - utf8.length() % 4;
}
if (buf) {
encode_uint32(utf8.length(), buf);
buf += 4;
memcpy(buf, utf8.get_data(), utf8.length());
buf += pad + utf8.length();
}
r_len += 4 + utf8.length() + pad;
}
} break;
case Variant::STRING: {
_encode_string(p_variant, buf, r_len);
} break;
// math types
case Variant::VECTOR2: {
if (buf) {
Vector2 v2 = p_variant;
encode_float(v2.x, &buf[0]);
encode_float(v2.y, &buf[4]);
}
r_len += 2 * 4;
} break; // 5
case Variant::VECTOR2I: {
if (buf) {
Vector2i v2 = p_variant;
encode_uint32(v2.x, &buf[0]);
encode_uint32(v2.y, &buf[4]);
}
r_len += 2 * 4;
} break;
// math types
case Variant::RECT2: {
if (buf) {
Rect2 r2 = p_variant;
@ -1065,6 +1115,26 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
}
r_len += 4 * 4;
} break;
case Variant::VECTOR2: {
if (buf) {
Vector2 v2 = p_variant;
encode_float(v2.x, &buf[0]);
encode_float(v2.y, &buf[4]);
}
r_len += 2 * 4;
} break; // 5
case Variant::VECTOR2I: {
if (buf) {
Vector2i v2 = p_variant;
encode_uint32(v2.x, &buf[0]);
encode_uint32(v2.y, &buf[4]);
}
r_len += 2 * 4;
} break;
case Variant::VECTOR3: {
if (buf) {
@ -1088,19 +1158,31 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
r_len += 3 * 4;
} break;
case Variant::TRANSFORM2D: {
case Variant::VECTOR4: {
if (buf) {
Transform2D val = p_variant;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
memcpy(&buf[(i * 2 + j) * 4], &val.columns[i][j], sizeof(float));
}
}
Vector4 v4 = p_variant;
encode_float(v4.x, &buf[0]);
encode_float(v4.y, &buf[4]);
encode_float(v4.z, &buf[8]);
encode_float(v4.w, &buf[12]);
}
r_len += 6 * 4;
r_len += 4 * 4;
} break;
case Variant::VECTOR4I: {
if (buf) {
Vector4i v4 = p_variant;
encode_uint32(v4.x, &buf[0]);
encode_uint32(v4.y, &buf[4]);
encode_uint32(v4.z, &buf[8]);
encode_uint32(v4.w, &buf[12]);
}
r_len += 4 * 4;
} break;
case Variant::PLANE: {
if (buf) {
Plane p = p_variant;
@ -1168,6 +1250,32 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
r_len += 12 * 4;
} break;
case Variant::TRANSFORM2D: {
if (buf) {
Transform2D val = p_variant;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
memcpy(&buf[(i * 2 + j) * 4], &val.columns[i][j], sizeof(float));
}
}
}
r_len += 6 * 4;
} break;
case Variant::PROJECTION: {
if (buf) {
Projection val = p_variant;
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
memcpy(&buf[(i * 4 + j) * sizeof(real_t)], &val.matrix[i][j], sizeof(real_t));
}
}
}
r_len += 16 * sizeof(real_t);
} break;
// misc types
@ -1183,7 +1291,54 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
r_len += 4 * 4;
} break;
case Variant::_RID: {
case Variant::NODE_PATH: {
NodePath np = p_variant;
if (buf) {
encode_uint32(uint32_t(np.get_name_count()) | 0x80000000, buf); //for compatibility with the old format
encode_uint32(np.get_subname_count(), buf + 4);
uint32_t np_flags = 0;
if (np.is_absolute()) {
np_flags |= 1;
}
encode_uint32(np_flags, buf + 8);
buf += 12;
}
r_len += 12;
int total = np.get_name_count() + np.get_subname_count();
for (int i = 0; i < total; i++) {
String str;
if (i < np.get_name_count()) {
str = np.get_name(i);
} else {
str = np.get_subname(i - np.get_name_count());
}
CharString utf8 = str.utf8();
int pad = 0;
if (utf8.length() % 4) {
pad = 4 - utf8.length() % 4;
}
if (buf) {
encode_uint32(utf8.length(), buf);
buf += 4;
memcpy(buf, utf8.get_data(), utf8.length());
buf += pad + utf8.length();
}
r_len += 4 + utf8.length() + pad;
}
} break;
case Variant::RID: {
} break;
case Variant::OBJECT: {
if (p_full_objects) {
@ -1317,6 +1472,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
}
} break;
// arrays
case Variant::POOL_BYTE_ARRAY: {
PoolVector<uint8_t> data = p_variant;
@ -1502,6 +1658,58 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
r_len += 4 * 3 * len;
} break;
case Variant::POOL_VECTOR4_ARRAY: {
PoolVector<Vector4> data = p_variant;
int len = data.size();
if (buf) {
encode_uint32(len, buf);
buf += 4;
}
r_len += 4;
if (buf) {
for (int i = 0; i < len; i++) {
Vector4 v = data.get(i);
encode_float(v.x, &buf[0]);
encode_float(v.y, &buf[4]);
encode_float(v.z, &buf[8]);
encode_float(v.w, &buf[12]);
buf += 4 * 4;
}
}
r_len += 4 * 4 * len;
} break;
case Variant::POOL_VECTOR4I_ARRAY: {
PoolVector<Vector4i> data = p_variant;
int len = data.size();
if (buf) {
encode_uint32(len, buf);
buf += 4;
}
r_len += 4;
if (buf) {
for (int i = 0; i < len; i++) {
Vector4i v = data.get(i);
encode_uint32(v.x, &buf[0]);
encode_uint32(v.y, &buf[4]);
encode_uint32(v.z, &buf[8]);
encode_uint32(v.z, &buf[12]);
buf += 4 * 4;
}
}
r_len += 4 * 4 * len;
} break;
case Variant::POOL_COLOR_ARRAY: {
PoolVector<Color> data = p_variant;

View File

@ -79,13 +79,12 @@ enum {
VARIANT_VECTOR3I_ARRAY = 45,
VARIANT_VECTOR2I_ARRAY = 46,
VARIANT_STRING_NAME = 47,
#ifndef DISABLE_DEPRECATED
VARIANT_IMAGE = 21, // - no longer variant type
IMAGE_ENCODING_EMPTY = 0,
IMAGE_ENCODING_RAW = 1,
IMAGE_ENCODING_LOSSLESS = 2,
IMAGE_ENCODING_LOSSY = 3,
#endif
VARIANT_VECTOR4 = 48,
VARIANT_VECTOR4I = 49,
VARIANT_PROJECTION = 50,
VARIANT_VECTOR4_ARRAY = 51,
VARIANT_VECTOR4I_ARRAY = 52,
OBJECT_EMPTY = 0,
OBJECT_EXTERNAL_RESOURCE = 1,
OBJECT_INTERNAL_RESOURCE = 2,
@ -152,20 +151,6 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
case VARIANT_STRING: {
r_v = get_unicode_string();
} break;
case VARIANT_VECTOR2: {
Vector2 v;
v.x = f->get_real();
v.y = f->get_real();
r_v = v;
} break;
case VARIANT_VECTOR2I: {
Vector2i v;
v.x = f->get_32();
v.y = f->get_32();
r_v = v;
} break;
case VARIANT_RECT2: {
Rect2 v;
v.position.x = f->get_real();
@ -183,6 +168,20 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
v.size.y = f->get_32();
r_v = v;
} break;
case VARIANT_VECTOR2: {
Vector2 v;
v.x = f->get_real();
v.y = f->get_real();
r_v = v;
} break;
case VARIANT_VECTOR2I: {
Vector2i v;
v.x = f->get_32();
v.y = f->get_32();
r_v = v;
} break;
case VARIANT_VECTOR3: {
Vector3 v;
@ -198,6 +197,22 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
v.z = f->get_32();
r_v = v;
} break;
case VARIANT_VECTOR4: {
Vector4 v;
v.x = f->get_real();
v.y = f->get_real();
v.z = f->get_real();
v.w = f->get_real();
r_v = v;
} break;
case VARIANT_VECTOR4I: {
Vector4i v;
v.x = f->get_32();
v.y = f->get_32();
v.z = f->get_32();
v.w = f->get_32();
r_v = v;
} break;
case VARIANT_PLANE: {
Plane v;
v.normal.x = f->get_real();
@ -225,17 +240,6 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
v.size.z = f->get_real();
r_v = v;
} break;
case VARIANT_MATRIX32: {
Transform2D v;
v.columns[0].x = f->get_real();
v.columns[0].y = f->get_real();
v.columns[1].x = f->get_real();
v.columns[1].y = f->get_real();
v.columns[2].x = f->get_real();
v.columns[2].y = f->get_real();
r_v = v;
} break;
case VARIANT_MATRIX3: {
Basis v;
@ -267,6 +271,37 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
v.origin.z = f->get_real();
r_v = v;
} break;
case VARIANT_MATRIX32: {
Transform2D v;
v.columns[0].x = f->get_real();
v.columns[0].y = f->get_real();
v.columns[1].x = f->get_real();
v.columns[1].y = f->get_real();
v.columns[2].x = f->get_real();
v.columns[2].y = f->get_real();
r_v = v;
} break;
case VARIANT_PROJECTION: {
Projection v;
v.matrix[0].x = f->get_real();
v.matrix[0].y = f->get_real();
v.matrix[0].z = f->get_real();
v.matrix[0].w = f->get_real();
v.matrix[1].x = f->get_real();
v.matrix[1].y = f->get_real();
v.matrix[1].z = f->get_real();
v.matrix[1].w = f->get_real();
v.matrix[2].x = f->get_real();
v.matrix[2].y = f->get_real();
v.matrix[2].z = f->get_real();
v.matrix[2].w = f->get_real();
v.matrix[3].x = f->get_real();
v.matrix[3].y = f->get_real();
v.matrix[3].z = f->get_real();
v.matrix[3].w = f->get_real();
r_v = v;
} break;
case VARIANT_COLOR: {
Color v;
v.r = f->get_real();
@ -276,7 +311,6 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
r_v = v;
} break;
case VARIANT_NODE_PATH: {
Vector<StringName> names;
Vector<StringName> subnames;
@ -571,6 +605,54 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
r_v = array;
} break;
case VARIANT_VECTOR4_ARRAY: {
uint32_t len = f->get_32();
PoolVector<Vector4> array;
array.resize(len);
PoolVector<Vector4>::Write w = array.write();
if (sizeof(Vector4) == 16) {
f->get_buffer((uint8_t *)w.ptr(), len * sizeof(real_t) * 4);
#ifdef BIG_ENDIAN_ENABLED
{
uint32_t *ptr = (uint32_t *)w.ptr();
for (int i = 0; i < len * 4; i++) {
ptr[i] = BSWAP32(ptr[i]);
}
}
#endif
} else {
ERR_FAIL_V_MSG(ERR_UNAVAILABLE, "Vector4 size is NOT 16!");
}
w.release();
r_v = array;
} break;
case VARIANT_VECTOR4I_ARRAY: {
uint32_t len = f->get_32();
PoolVector<Vector4i> array;
array.resize(len);
PoolVector<Vector4i>::Write w = array.write();
if (sizeof(Vector4i) == 16) {
f->get_buffer((uint8_t *)w.ptr(), len * sizeof(uint32_t) * 4);
#ifdef BIG_ENDIAN_ENABLED
{
uint32_t *ptr = (uint32_t *)w.ptr();
for (int i = 0; i < len * 4; i++) {
ptr[i] = BSWAP32(ptr[i]);
}
}
#endif
} else {
ERR_FAIL_V_MSG(ERR_UNAVAILABLE, "Vector4i size is NOT 16!");
}
w.release();
r_v = array;
} break;
case VARIANT_COLOR_ARRAY: {
uint32_t len = f->get_32();
@ -595,66 +677,6 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
w.release();
r_v = array;
} break;
#ifndef DISABLE_DEPRECATED
case VARIANT_IMAGE: {
uint32_t encoding = f->get_32();
if (encoding == IMAGE_ENCODING_EMPTY) {
r_v = Ref<Image>();
break;
} else if (encoding == IMAGE_ENCODING_RAW) {
uint32_t width = f->get_32();
uint32_t height = f->get_32();
uint32_t mipmaps = f->get_32();
uint32_t format = f->get_32();
const uint32_t format_version_shift = 24;
const uint32_t format_version_mask = format_version_shift - 1;
uint32_t format_version = format >> format_version_shift;
const uint32_t current_version = 0;
if (format_version > current_version) {
ERR_PRINT("Format version for encoded binary image is too new.");
return ERR_PARSE_ERROR;
}
Image::Format fmt = Image::Format(format & format_version_mask); //if format changes, we can add a compatibility bit on top
uint32_t datalen = f->get_32();
PoolVector<uint8_t> imgdata;
imgdata.resize(datalen);
PoolVector<uint8_t>::Write w = imgdata.write();
f->get_buffer(w.ptr(), datalen);
_advance_padding(datalen);
w.release();
Ref<Image> image;
image.instance();
image->create(width, height, mipmaps, fmt, imgdata);
r_v = image;
} else {
//compressed
PoolVector<uint8_t> data;
data.resize(f->get_32());
PoolVector<uint8_t>::Write w = data.write();
f->get_buffer(w.ptr(), data.size());
w.release();
Ref<Image> image;
if (encoding == IMAGE_ENCODING_LOSSY && Image::webp_unpacker) {
image = Image::webp_unpacker(data); // IMAGE_ENCODING_LOSSY always meant WebP
} else if (encoding == IMAGE_ENCODING_LOSSLESS && Image::png_unpacker) {
image = Image::png_unpacker(data); // IMAGE_ENCODING_LOSSLESS always meant png
}
_advance_padding(data.size());
r_v = image;
}
} break;
#endif
default: {
ERR_FAIL_V(ERR_FILE_CORRUPT);
} break;
@ -1343,20 +1365,6 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia
String val = p_property;
save_unicode_string(f, val);
} break;
case Variant::VECTOR2: {
f->store_32(VARIANT_VECTOR2);
Vector2 val = p_property;
f->store_real(val.x);
f->store_real(val.y);
} break;
case Variant::VECTOR2I: {
f->store_32(VARIANT_VECTOR2I);
Vector2i val = p_property;
f->store_32(val.x);
f->store_32(val.y);
} break;
case Variant::RECT2: {
f->store_32(VARIANT_RECT2);
@ -1375,6 +1383,20 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia
f->store_32(val.size.x);
f->store_32(val.size.y);
} break;
case Variant::VECTOR2: {
f->store_32(VARIANT_VECTOR2);
Vector2 val = p_property;
f->store_real(val.x);
f->store_real(val.y);
} break;
case Variant::VECTOR2I: {
f->store_32(VARIANT_VECTOR2I);
Vector2i val = p_property;
f->store_32(val.x);
f->store_32(val.y);
} break;
case Variant::VECTOR3: {
f->store_32(VARIANT_VECTOR3);
@ -1392,18 +1414,24 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia
f->store_32(val.z);
} break;
case Variant::TRANSFORM2D: {
f->store_32(VARIANT_MATRIX32);
Transform2D val = p_property;
f->store_real(val.columns[0].x);
f->store_real(val.columns[0].y);
f->store_real(val.columns[1].x);
f->store_real(val.columns[1].y);
f->store_real(val.columns[2].x);
f->store_real(val.columns[2].y);
case Variant::VECTOR4: {
f->store_32(VARIANT_VECTOR4);
Vector4 val = p_property;
f->store_real(val.x);
f->store_real(val.y);
f->store_real(val.z);
f->store_real(val.w);
} break;
case Variant::VECTOR4I: {
f->store_32(VARIANT_VECTOR4I);
Vector4i val = p_property;
f->store_32(val.x);
f->store_32(val.y);
f->store_32(val.z);
f->store_32(val.w);
} break;
case Variant::PLANE: {
f->store_32(VARIANT_PLANE);
Plane val = p_property;
@ -1447,7 +1475,6 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia
f->store_real(val.rows[2].z);
} break;
case Variant::TRANSFORM: {
f->store_32(VARIANT_TRANSFORM);
Transform val = p_property;
@ -1464,6 +1491,38 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia
f->store_real(val.origin.y);
f->store_real(val.origin.z);
} break;
case Variant::TRANSFORM2D: {
f->store_32(VARIANT_MATRIX32);
Transform2D val = p_property;
f->store_real(val.columns[0].x);
f->store_real(val.columns[0].y);
f->store_real(val.columns[1].x);
f->store_real(val.columns[1].y);
f->store_real(val.columns[2].x);
f->store_real(val.columns[2].y);
} break;
case Variant::PROJECTION: {
f->store_32(VARIANT_PROJECTION);
Projection val = p_property;
f->store_real(val.matrix[0].x);
f->store_real(val.matrix[0].y);
f->store_real(val.matrix[0].z);
f->store_real(val.matrix[0].w);
f->store_real(val.matrix[1].x);
f->store_real(val.matrix[1].y);
f->store_real(val.matrix[1].z);
f->store_real(val.matrix[1].w);
f->store_real(val.matrix[2].x);
f->store_real(val.matrix[2].y);
f->store_real(val.matrix[2].z);
f->store_real(val.matrix[2].w);
f->store_real(val.matrix[3].x);
f->store_real(val.matrix[3].y);
f->store_real(val.matrix[3].z);
f->store_real(val.matrix[3].w);
} break;
case Variant::COLOR: {
f->store_32(VARIANT_COLOR);
@ -1474,7 +1533,6 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia
f->store_real(val.a);
} break;
case Variant::NODE_PATH: {
f->store_32(VARIANT_NODE_PATH);
NodePath np = p_property;
@ -1500,7 +1558,7 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia
}
} break;
case Variant::_RID: {
case Variant::RID: {
f->store_32(VARIANT_RID);
WARN_PRINT("Can't save RIDs.");
RID val = p_property;
@ -1655,6 +1713,35 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia
f->store_32(r[i].z);
}
} break;
case Variant::POOL_VECTOR4_ARRAY: {
f->store_32(VARIANT_VECTOR4_ARRAY);
PoolVector<Vector4> arr = p_property;
int len = arr.size();
f->store_32(len);
PoolVector<Vector4>::Read r = arr.read();
for (int i = 0; i < len; i++) {
f->store_real(r[i].x);
f->store_real(r[i].y);
f->store_real(r[i].z);
f->store_real(r[i].w);
}
} break;
case Variant::POOL_VECTOR4I_ARRAY: {
f->store_32(VARIANT_VECTOR4I_ARRAY);
PoolVector<Vector4i> arr = p_property;
int len = arr.size();
f->store_32(len);
PoolVector<Vector4i>::Read r = arr.read();
for (int i = 0; i < len; i++) {
f->store_32(r[i].x);
f->store_32(r[i].y);
f->store_32(r[i].z);
f->store_32(r[i].w);
}
} break;
case Variant::POOL_COLOR_ARRAY: {
f->store_32(VARIANT_COLOR_ARRAY);

View File

@ -48,16 +48,6 @@ Variant fieldwise_assign(const Variant &p_target, const Variant &p_source, const
switch (p_source.get_type()) {
case Variant::VECTOR2: {
SETUP_TYPE(Vector2)
/**/ TRY_TRANSFER_FIELD("x", x)
else TRY_TRANSFER_FIELD("y", y)
return target;
}
case Variant::RECT2: {
SETUP_TYPE(Rect2)
@ -70,6 +60,38 @@ Variant fieldwise_assign(const Variant &p_target, const Variant &p_source, const
return target;
}
case Variant::RECT2I: {
SETUP_TYPE(Rect2i)
/**/ TRY_TRANSFER_FIELD("x", position.x)
else TRY_TRANSFER_FIELD("y", position.y)
else TRY_TRANSFER_FIELD("w", size.x)
else TRY_TRANSFER_FIELD("h", size.y)
return target;
}
case Variant::VECTOR2: {
SETUP_TYPE(Vector2)
/**/ TRY_TRANSFER_FIELD("x", x)
else TRY_TRANSFER_FIELD("y", y)
return target;
}
case Variant::VECTOR2I: {
SETUP_TYPE(Vector2i)
/**/ TRY_TRANSFER_FIELD("x", x)
else TRY_TRANSFER_FIELD("y", y)
return target;
}
case Variant::VECTOR3: {
SETUP_TYPE(Vector3)
@ -81,6 +103,39 @@ Variant fieldwise_assign(const Variant &p_target, const Variant &p_source, const
return target;
}
case Variant::VECTOR3I: {
SETUP_TYPE(Vector3i)
/**/ TRY_TRANSFER_FIELD("x", x)
else TRY_TRANSFER_FIELD("y", y)
else TRY_TRANSFER_FIELD("z", z)
return target;
}
case Variant::VECTOR4: {
SETUP_TYPE(Vector4)
/**/ TRY_TRANSFER_FIELD("x", x)
else TRY_TRANSFER_FIELD("y", y)
else TRY_TRANSFER_FIELD("z", z)
else TRY_TRANSFER_FIELD("w", w)
return target;
}
case Variant::VECTOR4I: {
SETUP_TYPE(Vector4i)
/**/ TRY_TRANSFER_FIELD("x", x)
else TRY_TRANSFER_FIELD("y", y)
else TRY_TRANSFER_FIELD("z", z)
else TRY_TRANSFER_FIELD("w", w)
return target;
}
case Variant::PLANE: {
SETUP_TYPE(Plane)
@ -119,20 +174,6 @@ Variant fieldwise_assign(const Variant &p_target, const Variant &p_source, const
return target;
}
case Variant::TRANSFORM2D: {
SETUP_TYPE(Transform2D)
/**/ TRY_TRANSFER_FIELD("xx", columns[0][0])
else TRY_TRANSFER_FIELD("xy", columns[0][1])
else TRY_TRANSFER_FIELD("yx", columns[1][0])
else TRY_TRANSFER_FIELD("yy", columns[1][1])
else TRY_TRANSFER_FIELD("ox", columns[2][0])
else TRY_TRANSFER_FIELD("oy", columns[2][1])
return target;
}
case Variant::BASIS: {
SETUP_TYPE(Basis)
@ -170,6 +211,20 @@ Variant fieldwise_assign(const Variant &p_target, const Variant &p_source, const
return target;
}
case Variant::TRANSFORM2D: {
SETUP_TYPE(Transform2D)
/**/ TRY_TRANSFER_FIELD("xx", columns[0][0])
else TRY_TRANSFER_FIELD("xy", columns[0][1])
else TRY_TRANSFER_FIELD("yx", columns[1][0])
else TRY_TRANSFER_FIELD("yy", columns[1][1])
else TRY_TRANSFER_FIELD("ox", columns[2][0])
else TRY_TRANSFER_FIELD("oy", columns[2][1])
return target;
}
default: {
ERR_FAIL_V(p_target);
}

View File

@ -30,12 +30,14 @@
#include "projection.h"
#include "core/array.h"
#include "core/math/aabb.h"
#include "core/math/math_funcs.h"
#include "core/math/plane.h"
#include "core/math/rect2.h"
#include "core/math/transform.h"
#include "core/print_string.h"
#include "core/variant.h"
float Projection::determinant() const {
return matrix[0][3] * matrix[1][2] * matrix[2][1] * matrix[3][0] - matrix[0][2] * matrix[1][3] * matrix[2][1] * matrix[3][0] -
@ -68,31 +70,6 @@ void Projection::set_zero() {
}
}
Plane Projection::xform4(const Plane &p_vec4) const {
Plane ret;
ret.normal.x = matrix[0][0] * p_vec4.normal.x + matrix[1][0] * p_vec4.normal.y + matrix[2][0] * p_vec4.normal.z + matrix[3][0] * p_vec4.d;
ret.normal.y = matrix[0][1] * p_vec4.normal.x + matrix[1][1] * p_vec4.normal.y + matrix[2][1] * p_vec4.normal.z + matrix[3][1] * p_vec4.d;
ret.normal.z = matrix[0][2] * p_vec4.normal.x + matrix[1][2] * p_vec4.normal.y + matrix[2][2] * p_vec4.normal.z + matrix[3][2] * p_vec4.d;
ret.d = matrix[0][3] * p_vec4.normal.x + matrix[1][3] * p_vec4.normal.y + matrix[2][3] * p_vec4.normal.z + matrix[3][3] * p_vec4.d;
return ret;
}
Vector4 Projection::xform(const Vector4 &p_vec4) const {
return Vector4(
matrix[0][0] * p_vec4.x + matrix[1][0] * p_vec4.y + matrix[2][0] * p_vec4.z + matrix[3][0] * p_vec4.w,
matrix[0][1] * p_vec4.x + matrix[1][1] * p_vec4.y + matrix[2][1] * p_vec4.z + matrix[3][1] * p_vec4.w,
matrix[0][2] * p_vec4.x + matrix[1][2] * p_vec4.y + matrix[2][2] * p_vec4.z + matrix[3][2] * p_vec4.w,
matrix[0][3] * p_vec4.x + matrix[1][3] * p_vec4.y + matrix[2][3] * p_vec4.z + matrix[3][3] * p_vec4.w);
}
Vector4 Projection::xform_inv(const Vector4 &p_vec4) const {
return Vector4(
matrix[0][0] * p_vec4.x + matrix[0][1] * p_vec4.y + matrix[0][2] * p_vec4.z + matrix[0][3] * p_vec4.w,
matrix[1][0] * p_vec4.x + matrix[1][1] * p_vec4.y + matrix[1][2] * p_vec4.z + matrix[1][3] * p_vec4.w,
matrix[2][0] * p_vec4.x + matrix[2][1] * p_vec4.y + matrix[2][2] * p_vec4.z + matrix[2][3] * p_vec4.w,
matrix[3][0] * p_vec4.x + matrix[3][1] * p_vec4.y + matrix[3][2] * p_vec4.z + matrix[3][3] * p_vec4.w);
}
void Projection::adjust_perspective_znear(real_t p_new_znear) {
real_t zfar = get_z_far();
real_t znear = p_new_znear;
@ -587,6 +564,88 @@ Vector<Plane> Projection::get_projection_planes(const Transform &p_transform) co
return planes;
}
Array Projection::get_projection_planes_array(const Transform &p_transform) const {
/** Fast Plane Extraction from combined modelview/projection matrices.
* References:
* https://web.archive.org/web/20011221205252/https://www.markmorley.com/opengl/frustumculling.html
* https://web.archive.org/web/20061020020112/https://www2.ravensoft.com/users/ggribb/plane%20extraction.pdf
*/
Array planes;
const real_t *matrix = (const real_t *)this->matrix;
Plane new_plane;
///////--- Near Plane ---///////
new_plane = Plane(matrix[3] + matrix[2],
matrix[7] + matrix[6],
matrix[11] + matrix[10],
matrix[15] + matrix[14]);
new_plane.normal = -new_plane.normal;
new_plane.normalize();
planes.push_back(p_transform.xform(new_plane));
///////--- Far Plane ---///////
new_plane = Plane(matrix[3] - matrix[2],
matrix[7] - matrix[6],
matrix[11] - matrix[10],
matrix[15] - matrix[14]);
new_plane.normal = -new_plane.normal;
new_plane.normalize();
planes.push_back(p_transform.xform(new_plane));
///////--- Left Plane ---///////
new_plane = Plane(matrix[3] + matrix[0],
matrix[7] + matrix[4],
matrix[11] + matrix[8],
matrix[15] + matrix[12]);
new_plane.normal = -new_plane.normal;
new_plane.normalize();
planes.push_back(p_transform.xform(new_plane));
///////--- Top Plane ---///////
new_plane = Plane(matrix[3] - matrix[1],
matrix[7] - matrix[5],
matrix[11] - matrix[9],
matrix[15] - matrix[13]);
new_plane.normal = -new_plane.normal;
new_plane.normalize();
planes.push_back(p_transform.xform(new_plane));
///////--- Right Plane ---///////
new_plane = Plane(matrix[3] - matrix[0],
matrix[7] - matrix[4],
matrix[11] - matrix[8],
matrix[15] - matrix[12]);
new_plane.normal = -new_plane.normal;
new_plane.normalize();
planes.push_back(p_transform.xform(new_plane));
///////--- Bottom Plane ---///////
new_plane = Plane(matrix[3] + matrix[1],
matrix[7] + matrix[5],
matrix[11] + matrix[9],
matrix[15] + matrix[13]);
new_plane.normal = -new_plane.normal;
new_plane.normalize();
planes.push_back(p_transform.xform(new_plane));
return planes;
}
Projection Projection::inverse() const {
Projection cm = *this;
cm.invert();
@ -780,6 +839,32 @@ void Projection::set_light_atlas_rect(const Rect2 &p_rect) {
m[15] = 1.0;
}
Vector4 Projection::xform(const Vector4 &p_vec4) const {
return Vector4(
matrix[0][0] * p_vec4.x + matrix[1][0] * p_vec4.y + matrix[2][0] * p_vec4.z + matrix[3][0] * p_vec4.w,
matrix[0][1] * p_vec4.x + matrix[1][1] * p_vec4.y + matrix[2][1] * p_vec4.z + matrix[3][1] * p_vec4.w,
matrix[0][2] * p_vec4.x + matrix[1][2] * p_vec4.y + matrix[2][2] * p_vec4.z + matrix[3][2] * p_vec4.w,
matrix[0][3] * p_vec4.x + matrix[1][3] * p_vec4.y + matrix[2][3] * p_vec4.z + matrix[3][3] * p_vec4.w);
}
Vector4 Projection::xform_inv(const Vector4 &p_vec4) const {
return Vector4(
matrix[0][0] * p_vec4.x + matrix[0][1] * p_vec4.y + matrix[0][2] * p_vec4.z + matrix[0][3] * p_vec4.w,
matrix[1][0] * p_vec4.x + matrix[1][1] * p_vec4.y + matrix[1][2] * p_vec4.z + matrix[1][3] * p_vec4.w,
matrix[2][0] * p_vec4.x + matrix[2][1] * p_vec4.y + matrix[2][2] * p_vec4.z + matrix[2][3] * p_vec4.w,
matrix[3][0] * p_vec4.x + matrix[3][1] * p_vec4.y + matrix[3][2] * p_vec4.z + matrix[3][3] * p_vec4.w);
}
Plane Projection::xform(const Plane &p_vec4) const {
Plane ret;
ret.normal.x = matrix[0][0] * p_vec4.normal.x + matrix[1][0] * p_vec4.normal.y + matrix[2][0] * p_vec4.normal.z + matrix[3][0] * p_vec4.d;
ret.normal.y = matrix[0][1] * p_vec4.normal.x + matrix[1][1] * p_vec4.normal.y + matrix[2][1] * p_vec4.normal.z + matrix[3][1] * p_vec4.d;
ret.normal.z = matrix[0][2] * p_vec4.normal.x + matrix[1][2] * p_vec4.normal.y + matrix[2][2] * p_vec4.normal.z + matrix[3][2] * p_vec4.d;
ret.d = matrix[0][3] * p_vec4.normal.x + matrix[1][3] * p_vec4.normal.y + matrix[2][3] * p_vec4.normal.z + matrix[3][3] * p_vec4.d;
return ret;
}
Projection::operator String() const {
String str;
for (int i = 0; i < 4; i++) {
@ -899,6 +984,11 @@ Projection::operator Transform() const {
return tr;
}
void Projection::set_frustum2(real_t p_size, real_t p_aspect, Vector2 p_offset, real_t p_near, real_t p_far, bool p_flip_fov) {
set_frustum(p_size, p_aspect, p_offset, p_near, p_far, p_flip_fov);
}
Projection::Projection(const Vector4 &p_x, const Vector4 &p_y, const Vector4 &p_z, const Vector4 &p_w) {
matrix[0] = p_x;
matrix[1] = p_y;

View File

@ -36,6 +36,7 @@
#include "core/math/vector4.h"
#include "core/vector.h"
class Array;
class AABB;
class Plane;
struct Rect2;
@ -90,8 +91,9 @@ struct Projection {
static Projection create_frustum(real_t p_left, real_t p_right, real_t p_bottom, real_t p_top, real_t p_near, real_t p_far);
static Projection create_frustum_aspect(real_t p_size, real_t p_aspect, Vector2 p_offset, real_t p_near, real_t p_far, bool p_flip_fov = false);
static Projection create_fit_aabb(const AABB &p_aabb);
Projection perspective_znear_adjusted(real_t p_new_znear) const;
Plane get_projection_plane(Planes p_plane) const;
Plane get_projection_plane(Projection::Planes p_plane) const;
Projection flipped_y() const;
Projection jitter_offseted(const Vector2 &p_offset) const;
@ -99,6 +101,10 @@ struct Projection {
return Math::rad2deg(Math::atan(p_aspect * Math::tan(Math::deg2rad(p_fovx) * 0.5)) * 2.0);
}
real_t calculate_fovy(real_t p_fovx, real_t p_aspect) {
return Math::rad2deg(Math::atan(p_aspect * Math::tan(Math::deg2rad(p_fovx) * 0.5)) * 2.0);
}
real_t get_z_far() const;
real_t get_z_near() const;
real_t get_aspect() const;
@ -106,6 +112,7 @@ struct Projection {
bool is_orthogonal() const;
Vector<Plane> get_projection_planes(const Transform &p_transform) const;
Array get_projection_planes_array(const Transform &p_transform) const;
bool get_endpoints(const Transform &p_transform, Vector3 *p_8points) const;
Vector2 get_viewport_half_extents() const;
@ -116,12 +123,12 @@ struct Projection {
Projection operator*(const Projection &p_matrix) const;
Plane xform4(const Plane &p_vec4) const;
_FORCE_INLINE_ Vector3 xform(const Vector3 &p_vec3) const;
Vector4 xform(const Vector4 &p_vec4) const;
Vector4 xform_inv(const Vector4 &p_vec4) const;
_FORCE_INLINE_ Vector3 xform(const Vector3 &p_vector) const;
Plane xform(const Plane &p_plane) const;
operator String() const;
void scale_translate_to_fit(const AABB &p_aabb);
@ -149,6 +156,24 @@ struct Projection {
float get_lod_multiplier() const;
_FORCE_INLINE_ void set_perspective1(real_t p_fovy_degrees, real_t p_aspect, real_t p_z_near, real_t p_z_far, bool p_flip_fov = false) {
set_perspective(p_fovy_degrees, p_aspect, p_z_near, p_z_far, p_flip_fov);
}
_FORCE_INLINE_ void set_perspective2(real_t p_fovy_degrees, real_t p_aspect, real_t p_z_near, real_t p_z_far, bool p_flip_fov, int p_eye, real_t p_intraocular_dist, real_t p_convergence_dist) {
set_perspective(p_fovy_degrees, p_aspect, p_z_near, p_z_far, p_flip_fov, p_eye, p_intraocular_dist, p_convergence_dist);
}
_FORCE_INLINE_ void set_orthogonal1(real_t p_left, real_t p_right, real_t p_bottom, real_t p_top, real_t p_znear, real_t p_zfar) {
set_orthogonal(p_left, p_right, p_bottom, p_top, p_znear, p_zfar);
}
_FORCE_INLINE_ void set_orthogonal2(real_t p_size, real_t p_aspect, real_t p_znear, real_t p_zfar, bool p_flip_fov = false) {
set_orthogonal(p_size, p_aspect, p_znear, p_zfar, p_flip_fov);
}
_FORCE_INLINE_ void set_frustum1(real_t p_left, real_t p_right, real_t p_bottom, real_t p_top, real_t p_near, real_t p_far) {
set_frustum(p_left, p_right, p_bottom, p_top, p_near, p_far);
}
//Vector2 is incomplete here
void set_frustum2(real_t p_size, real_t p_aspect, Vector2 p_offset, real_t p_near, real_t p_far, bool p_flip_fov = false);
Projection();
Projection(const Vector4 &p_x, const Vector4 &p_y, const Vector4 &p_z, const Vector4 &p_w);
Projection(const Transform &p_transform);

View File

@ -33,7 +33,6 @@
#include "core/math/math_defs.h"
#include "core/math/math_funcs.h"
#include "core/math/vector3.h"
#include "core/ustring.h"
struct _NO_DISCARD_CLASS_ Vector4 {

View File

@ -83,9 +83,11 @@ Vector4i::operator Vector4() const {
return Vector4(x, y, z, w);
}
/*
Vector4i::Vector4i(const Vector4 &p_vec4) {
x = p_vec4.x;
y = p_vec4.y;
z = p_vec4.z;
w = p_vec4.w;
}
*/

View File

@ -120,7 +120,7 @@ struct _NO_DISCARD_CLASS_ Vector4i {
w = 0;
}
Vector4i(const Vector4 &p_vec4);
//Vector4i(const Vector4 &p_vec4);
_FORCE_INLINE_ Vector4i(const int32_t p_x, const int32_t p_y, const int32_t p_z, const int32_t p_w) {
x = p_x;

View File

@ -164,10 +164,14 @@ struct VariantObjectClassChecker<Control *> {
// some helpers
VARIANT_ENUM_CAST(Vector3::Axis);
VARIANT_ENUM_CAST(Vector3i::Axis);
VARIANT_ENUM_CAST(Vector2::Axis);
VARIANT_ENUM_CAST(Vector2i::Axis);
VARIANT_ENUM_CAST(Vector3::Axis);
VARIANT_ENUM_CAST(Vector3i::Axis);
VARIANT_ENUM_CAST(Vector4::Axis);
VARIANT_ENUM_CAST(Vector4i::Axis);
VARIANT_ENUM_CAST(Projection::Planes);
VARIANT_ENUM_CAST(Error);
VARIANT_ENUM_CAST(Margin);

View File

@ -114,18 +114,22 @@ MAKE_PTRARG(double);
MAKE_PTRARG(String);
MAKE_PTRARG(StringName);
MAKE_PTRARG(Vector2);
MAKE_PTRARG(Vector2i);
MAKE_PTRARG(Rect2);
MAKE_PTRARG(Rect2i);
MAKE_PTRARG(Vector2);
MAKE_PTRARG(Vector2i);
MAKE_PTRARG_BY_REFERENCE(Vector3);
MAKE_PTRARG_BY_REFERENCE(Vector3i);
MAKE_PTRARG(Transform2D);
MAKE_PTRARG_BY_REFERENCE(Vector4);
MAKE_PTRARG_BY_REFERENCE(Vector4i);
MAKE_PTRARG_BY_REFERENCE(Plane);
MAKE_PTRARG(Quaternion);
MAKE_PTRARG_BY_REFERENCE(AABB);
MAKE_PTRARG_BY_REFERENCE(Basis);
MAKE_PTRARG_BY_REFERENCE(Transform);
MAKE_PTRARG(Transform2D);
MAKE_PTRARG(Projection);
MAKE_PTRARG_BY_REFERENCE(Color);
MAKE_PTRARG(NodePath);
MAKE_PTRARG(RID);
@ -266,6 +270,8 @@ MAKE_VECARG(Vector2);
MAKE_VECARG(Vector2i);
MAKE_VECARG(Vector3);
MAKE_VECARG(Vector3i);
MAKE_VECARG(Vector4);
MAKE_VECARG(Vector4i);
MAKE_VECARG(Color);
MAKE_VECARG_ALT(String, StringName);

View File

@ -250,7 +250,7 @@ uint32_t PackedDataContainer::_pack(const Variant &p_data, Vector<uint8_t> &tmpd
} break;
// misc types
case Variant::_RID:
case Variant::RID:
case Variant::OBJECT: {
return _pack(Variant(), tmpdata, string_cache);
} break;

View File

@ -137,21 +137,24 @@ MAKE_TYPE_INFO_WITH_META(float, Variant::REAL, PandemoniumTypeInfo::METADATA_REA
MAKE_TYPE_INFO_WITH_META(double, Variant::REAL, PandemoniumTypeInfo::METADATA_REAL_IS_DOUBLE)
MAKE_TYPE_INFO(String, Variant::STRING)
MAKE_TYPE_INFO(Vector2, Variant::VECTOR2)
MAKE_TYPE_INFO(Vector2i, Variant::VECTOR2I)
MAKE_TYPE_INFO(Rect2, Variant::RECT2)
MAKE_TYPE_INFO(Rect2i, Variant::RECT2I)
MAKE_TYPE_INFO(Vector2, Variant::VECTOR2)
MAKE_TYPE_INFO(Vector2i, Variant::VECTOR2I)
MAKE_TYPE_INFO(Vector3, Variant::VECTOR3)
MAKE_TYPE_INFO(Vector3i, Variant::VECTOR3I)
MAKE_TYPE_INFO(Transform2D, Variant::TRANSFORM2D)
MAKE_TYPE_INFO(Vector4, Variant::VECTOR4)
MAKE_TYPE_INFO(Vector4i, Variant::VECTOR4I)
MAKE_TYPE_INFO(Plane, Variant::PLANE)
MAKE_TYPE_INFO(Quaternion, Variant::QUATERNION)
MAKE_TYPE_INFO(AABB, Variant::AABB)
MAKE_TYPE_INFO(Basis, Variant::BASIS)
MAKE_TYPE_INFO(Transform, Variant::TRANSFORM)
MAKE_TYPE_INFO(Transform2D, Variant::TRANSFORM2D)
MAKE_TYPE_INFO(Projection, Variant::PROJECTION)
MAKE_TYPE_INFO(Color, Variant::COLOR)
MAKE_TYPE_INFO(NodePath, Variant::NODE_PATH)
MAKE_TYPE_INFO(RID, Variant::_RID)
MAKE_TYPE_INFO(RID, Variant::RID)
MAKE_TYPE_INFO(Dictionary, Variant::DICTIONARY)
MAKE_TYPE_INFO(Array, Variant::ARRAY)
MAKE_TYPE_INFO(PoolByteArray, Variant::POOL_BYTE_ARRAY)
@ -162,6 +165,8 @@ MAKE_TYPE_INFO(PoolVector2Array, Variant::POOL_VECTOR2_ARRAY)
MAKE_TYPE_INFO(PoolVector2iArray, Variant::POOL_VECTOR2I_ARRAY)
MAKE_TYPE_INFO(PoolVector3Array, Variant::POOL_VECTOR3_ARRAY)
MAKE_TYPE_INFO(PoolVector3iArray, Variant::POOL_VECTOR3I_ARRAY)
MAKE_TYPE_INFO(PoolVector4Array, Variant::POOL_VECTOR4_ARRAY)
MAKE_TYPE_INFO(PoolVector4iArray, Variant::POOL_VECTOR4I_ARRAY)
MAKE_TYPE_INFO(PoolColorArray, Variant::POOL_COLOR_ARRAY)
MAKE_TYPE_INFO(StringName, Variant::STRING_NAME)
@ -233,6 +238,8 @@ MAKE_TEMPLATE_TYPE_INFO(Vector, Vector2, Variant::POOL_VECTOR2_ARRAY)
MAKE_TEMPLATE_TYPE_INFO(Vector, Vector2i, Variant::POOL_VECTOR2I_ARRAY)
MAKE_TEMPLATE_TYPE_INFO(Vector, Vector3, Variant::POOL_VECTOR3_ARRAY)
MAKE_TEMPLATE_TYPE_INFO(Vector, Vector3i, Variant::POOL_VECTOR3I_ARRAY)
MAKE_TEMPLATE_TYPE_INFO(Vector, Vector4, Variant::POOL_VECTOR4_ARRAY)
MAKE_TEMPLATE_TYPE_INFO(Vector, Vector4i, Variant::POOL_VECTOR4I_ARRAY)
MAKE_TEMPLATE_TYPE_INFO(Vector, Color, Variant::POOL_COLOR_ARRAY)
MAKE_TEMPLATE_TYPE_INFO(Vector, Variant, Variant::ARRAY)

File diff suppressed because it is too large Load Diff

View File

@ -38,11 +38,14 @@
#include "core/math/basis.h"
#include "core/math/face3.h"
#include "core/math/plane.h"
#include "core/math/projection.h"
#include "core/math/quaternion.h"
#include "core/math/transform.h"
#include "core/math/transform_2d.h"
#include "core/math/vector3.h"
#include "core/math/vector3i.h"
#include "core/math/vector4.h"
#include "core/math/vector4i.h"
#include "core/node_path.h"
#include "core/object_id.h"
#include "core/pool_vector.h"
@ -66,6 +69,8 @@ typedef PoolVector<Vector2> PoolVector2Array;
typedef PoolVector<Vector2i> PoolVector2iArray;
typedef PoolVector<Vector3> PoolVector3Array;
typedef PoolVector<Vector3i> PoolVector3iArray;
typedef PoolVector<Vector4> PoolVector4Array;
typedef PoolVector<Vector4i> PoolVector4iArray;
typedef PoolVector<Color> PoolColorArray;
// Temporary workaround until c++11 alignas()
@ -96,41 +101,46 @@ public:
STRING,
// math types
VECTOR2, // 5
VECTOR2I,
RECT2,
RECT2, // 5
RECT2I,
VECTOR2,
VECTOR2I,
VECTOR3,
VECTOR3I, //10
TRANSFORM2D,
VECTOR3I, // 10
VECTOR4,
VECTOR4I,
PLANE,
QUATERNION,
AABB,
BASIS, //15
AABB, // 15
BASIS,
TRANSFORM,
TRANSFORM2D,
PROJECTION,
// misc types
COLOR,
NODE_PATH,
_RID,
OBJECT, //20
COLOR, // 20
NODE_PATH,
RID,
OBJECT,
STRING_NAME,
DICTIONARY,
DICTIONARY, // 25
ARRAY,
// arrays
POOL_BYTE_ARRAY,
POOL_INT_ARRAY, //25
POOL_REAL_ARRAY,
POOL_STRING_ARRAY,
POOL_BYTE_ARRAY,
POOL_INT_ARRAY,
POOL_REAL_ARRAY,
POOL_STRING_ARRAY, //30
POOL_VECTOR2_ARRAY,
POOL_VECTOR2I_ARRAY,
POOL_VECTOR3_ARRAY, //30
POOL_VECTOR3I_ARRAY,
POOL_VECTOR3_ARRAY,
POOL_VECTOR3I_ARRAY,
POOL_VECTOR4_ARRAY, //35
POOL_VECTOR4I_ARRAY,
POOL_COLOR_ARRAY,
VARIANT_MAX // 33
VARIANT_MAX // 38
};
@ -166,6 +176,7 @@ private:
::AABB *_aabb;
Basis *_basis;
Transform *_transform;
Projection *_projection;
void *_ptr; //generic pointer
uint8_t _mem[sizeof(ObjData) > (sizeof(real_t) * 4) ? sizeof(ObjData) : (sizeof(real_t) * 4)];
} _data GCC_ALIGNED_8;
@ -210,23 +221,26 @@ public:
operator double() const;
operator String() const;
operator StringName() const;
operator Vector2() const;
operator Vector2i() const;
operator Rect2() const;
operator Rect2i() const;
operator Vector2() const;
operator Vector2i() const;
operator Vector3() const;
operator Vector3i() const;
operator Vector4() const;
operator Vector4i() const;
operator Plane() const;
operator ::AABB() const;
operator Quaternion() const;
operator Basis() const;
operator Transform() const;
operator Transform2D() const;
operator Projection() const;
operator Color() const;
operator NodePath() const;
operator RefPtr() const;
operator RID() const;
operator ::RID() const;
operator Object *() const;
operator Node *() const;
@ -243,6 +257,8 @@ public:
operator PoolVector<Vector2i>() const;
operator PoolVector<Vector3>() const;
operator PoolVector<Vector3i>() const;
operator PoolVector<Vector4>() const;
operator PoolVector<Vector4i>() const;
operator PoolVector<Color>() const;
operator PoolVector<Plane>() const;
operator PoolVector<Face3>() const;
@ -255,11 +271,13 @@ public:
operator Vector<StringName>() const;
operator Vector<Vector3>() const;
operator Vector<Vector3i>() const;
operator Vector<Vector4>() const;
operator Vector<Vector4i>() const;
operator Vector<Color>() const;
operator Vector<RID>() const;
operator Vector<::RID>() const;
operator Vector<Vector2>() const;
operator Vector<Vector2i>() const;
operator Vector<Plane>() const;
// some core type enums to convert to
@ -295,6 +313,9 @@ public:
Variant(const Rect2i &p_rect2);
Variant(const Vector3 &p_vector3);
Variant(const Vector3i &p_vector3);
Variant(const Vector4 &p_vector4);
Variant(const Vector4i &p_vector4);
Variant(const Projection &p_projection);
Variant(const Plane &p_plane);
Variant(const ::AABB &p_aabb);
Variant(const Quaternion &p_quat);
@ -304,12 +325,12 @@ public:
Variant(const Color &p_color);
Variant(const NodePath &p_node_path);
Variant(const RefPtr &p_resource);
Variant(const RID &p_rid);
Variant(const ::RID &p_rid);
Variant(const Object *p_object);
Variant(const Dictionary &p_dictionary);
Variant(const Array &p_array);
Variant(const PoolVector<Plane> &p_array); // helper
Variant(const PoolVector<Plane> &p_array);
Variant(const PoolVector<uint8_t> &p_raw_array);
Variant(const PoolVector<int> &p_int_array);
Variant(const PoolVector<real_t> &p_real_array);
@ -318,8 +339,10 @@ public:
Variant(const PoolVector<Vector3i> &p_vector3_array);
Variant(const PoolVector<Color> &p_color_array);
Variant(const PoolVector<Face3> &p_face_array);
Variant(const PoolVector<Vector2> &p_vector2_array); // helper
Variant(const PoolVector<Vector2i> &p_vector2_array); // helper
Variant(const PoolVector<Vector2> &p_vector2_array);
Variant(const PoolVector<Vector2i> &p_vector2_array);
Variant(const PoolVector<Vector4> &p_vector4_array);
Variant(const PoolVector<Vector4i> &p_vector4_array);
Variant(const Vector<Variant> &p_array);
Variant(const Vector<uint8_t> &p_array);
@ -330,10 +353,12 @@ public:
Variant(const Vector<Vector3> &p_array);
Variant(const Vector<Vector3i> &p_array);
Variant(const Vector<Color> &p_array);
Variant(const Vector<Plane> &p_array); // helper
Variant(const Vector<RID> &p_array); // helper
Variant(const Vector<Vector2> &p_array); // helper
Variant(const Vector<Vector2i> &p_array); // helper
Variant(const Vector<Plane> &p_array);
Variant(const Vector<::RID> &p_array);
Variant(const Vector<Vector2> &p_array);
Variant(const Vector<Vector2i> &p_array);
Variant(const Vector<Vector4> &p_array);
Variant(const Vector<Vector4i> &p_array);
Variant(const IP_Address &p_address);
@ -458,7 +483,9 @@ public:
void operator=(const Variant &p_variant); // only this is enough for all the other types
Variant(const Variant &p_variant);
_FORCE_INLINE_ Variant() { type = NIL; }
_FORCE_INLINE_ Variant() {
type = NIL;
}
_FORCE_INLINE_ ~Variant() {
if (type != Variant::NIL) {
clear();

View File

@ -149,7 +149,7 @@ struct _VariantCall {
#endif
}
static void addfunc(bool p_const, Variant::Type p_type, Variant::Type p_return, bool p_has_return, const StringName &p_name, VariantFunc p_func, const Vector<Variant> &p_defaultarg, const Arg &p_argtype1 = Arg(), const Arg &p_argtype2 = Arg(), const Arg &p_argtype3 = Arg(), const Arg &p_argtype4 = Arg(), const Arg &p_argtype5 = Arg()) {
static void addfunc(bool p_const, Variant::Type p_type, Variant::Type p_return, bool p_has_return, const StringName &p_name, VariantFunc p_func, const Vector<Variant> &p_defaultarg, const Arg &p_argtype1 = Arg(), const Arg &p_argtype2 = Arg(), const Arg &p_argtype3 = Arg(), const Arg &p_argtype4 = Arg(), const Arg &p_argtype5 = Arg(), const Arg &p_argtype6 = Arg(), const Arg &p_argtype7 = Arg(), const Arg &p_argtype8 = Arg()) {
FuncData funcdata;
funcdata.func = p_func;
funcdata.default_args = p_defaultarg;
@ -205,6 +205,33 @@ struct _VariantCall {
goto end;
}
if (p_argtype6.name) {
funcdata.arg_types.push_back(p_argtype6.type);
#ifdef DEBUG_ENABLED
funcdata.arg_names.push_back(p_argtype6.name);
#endif
} else {
goto end;
}
if (p_argtype7.name) {
funcdata.arg_types.push_back(p_argtype7.type);
#ifdef DEBUG_ENABLED
funcdata.arg_names.push_back(p_argtype7.name);
#endif
} else {
goto end;
}
if (p_argtype8.name) {
funcdata.arg_types.push_back(p_argtype8.type);
#ifdef DEBUG_ENABLED
funcdata.arg_names.push_back(p_argtype8.name);
#endif
} else {
goto end;
}
end:
funcdata.arg_count = funcdata.arg_types.size();
@ -664,6 +691,46 @@ struct _VariantCall {
VCALL_LOCALMEM2R(Vector3i, clamp);
VCALL_LOCALMEM2R(Vector3i, linear_interpolate);
VCALL_LOCALMEM1(Vector4, set_all);
VCALL_LOCALMEM2(Vector4, set_axis);
VCALL_LOCALMEM1R(Vector4, get_axis);
VCALL_LOCALMEM0R(Vector4, min_axis);
VCALL_LOCALMEM0R(Vector4, max_axis);
VCALL_LOCALMEM0R(Vector4, length_squared);
VCALL_LOCALMEM1R(Vector4, is_equal_approx);
VCALL_LOCALMEM0R(Vector4, length);
VCALL_LOCALMEM0(Vector4, normalize);
VCALL_LOCALMEM0R(Vector4, normalized);
VCALL_LOCALMEM0R(Vector4, is_normalized);
VCALL_LOCALMEM1R(Vector4, distance_to);
VCALL_LOCALMEM1R(Vector4, distance_squared_to);
VCALL_LOCALMEM1R(Vector4, direction_to);
VCALL_LOCALMEM0R(Vector4, abs);
VCALL_LOCALMEM0R(Vector4, sign);
VCALL_LOCALMEM0R(Vector4, floor);
VCALL_LOCALMEM0R(Vector4, ceil);
VCALL_LOCALMEM0R(Vector4, round);
VCALL_LOCALMEM2R(Vector4, lerp);
VCALL_LOCALMEM4R(Vector4, cubic_interpolate);
VCALL_LOCALMEM1R(Vector4, posmod);
VCALL_LOCALMEM1R(Vector4, posmodv);
VCALL_LOCALMEM1(Vector4, snap);
VCALL_LOCALMEM1R(Vector4, snapped);
VCALL_LOCALMEM2R(Vector4, clamp);
VCALL_LOCALMEM0R(Vector4, inverse);
VCALL_LOCALMEM1R(Vector4, dot);
VCALL_LOCALMEM2(Vector4i, set_axis);
VCALL_LOCALMEM1R(Vector4i, get_axis);
VCALL_LOCALMEM0R(Vector4i, min_axis);
VCALL_LOCALMEM0R(Vector4i, max_axis);
VCALL_LOCALMEM0R(Vector4i, length_squared);
VCALL_LOCALMEM0R(Vector4i, length);
VCALL_LOCALMEM0(Vector4i, zero);
VCALL_LOCALMEM0R(Vector4i, abs);
VCALL_LOCALMEM0R(Vector4i, sign);
VCALL_LOCALMEM2R(Vector4i, clamp);
VCALL_LOCALMEM1(Plane, set_normal);
VCALL_LOCALMEM0R(Plane, get_normal);
VCALL_LOCALMEM0(Plane, normalize);
@ -1104,6 +1171,46 @@ struct _VariantCall {
VCALL_LOCALMEM0(PoolVector3iArray, clear);
VCALL_LOCALMEM0(PoolVector3iArray, sort);
VCALL_LOCALMEM0R(PoolVector4Array, size);
VCALL_LOCALMEM0R(PoolVector4Array, empty);
VCALL_LOCALMEM2(PoolVector4Array, set);
VCALL_LOCALMEM1R(PoolVector4Array, get);
VCALL_LOCALMEM1(PoolVector4Array, push_back);
VCALL_LOCALMEM1(PoolVector4Array, fill);
VCALL_LOCALMEM1(PoolVector4Array, resize);
VCALL_LOCALMEM2R(PoolVector4Array, insert);
VCALL_LOCALMEM1(PoolVector4Array, remove);
VCALL_LOCALMEM1(PoolVector4Array, append);
VCALL_LOCALMEM1(PoolVector4Array, append_array);
VCALL_LOCALMEM0(PoolVector4Array, invert);
VCALL_LOCALMEM1R(PoolVector4Array, contains);
VCALL_LOCALMEM2R(PoolVector4Array, find);
VCALL_LOCALMEM2R(PoolVector4Array, rfind);
VCALL_LOCALMEM1R(PoolVector4Array, count);
VCALL_LOCALMEM1R(PoolVector4Array, has);
VCALL_LOCALMEM0(PoolVector4Array, clear);
VCALL_LOCALMEM0(PoolVector4Array, sort);
VCALL_LOCALMEM0R(PoolVector4iArray, size);
VCALL_LOCALMEM0R(PoolVector4iArray, empty);
VCALL_LOCALMEM2(PoolVector4iArray, set);
VCALL_LOCALMEM1R(PoolVector4iArray, get);
VCALL_LOCALMEM1(PoolVector4iArray, push_back);
VCALL_LOCALMEM1(PoolVector4iArray, fill);
VCALL_LOCALMEM1(PoolVector4iArray, resize);
VCALL_LOCALMEM2R(PoolVector4iArray, insert);
VCALL_LOCALMEM1(PoolVector4iArray, remove);
VCALL_LOCALMEM1(PoolVector4iArray, append);
VCALL_LOCALMEM1(PoolVector4iArray, append_array);
VCALL_LOCALMEM0(PoolVector4iArray, invert);
VCALL_LOCALMEM1R(PoolVector4iArray, contains);
VCALL_LOCALMEM2R(PoolVector4iArray, find);
VCALL_LOCALMEM2R(PoolVector4iArray, rfind);
VCALL_LOCALMEM1R(PoolVector4iArray, count);
VCALL_LOCALMEM1R(PoolVector4iArray, has);
VCALL_LOCALMEM0(PoolVector4iArray, clear);
VCALL_LOCALMEM0(PoolVector4iArray, sort);
VCALL_LOCALMEM0R(PoolColorArray, size);
VCALL_LOCALMEM0R(PoolColorArray, empty);
VCALL_LOCALMEM2(PoolColorArray, set);
@ -1172,6 +1279,14 @@ struct _VariantCall {
static void _call_##m_type##_##m_method(Variant &r_ret, Variant &p_self, const Variant **p_args) { \
r_ret = reinterpret_cast<m_type *>(p_self._data._ptr)->m_method(*p_args[0], *p_args[1], *p_args[2], *p_args[3], *p_args[4]); \
}
#define VCALL_PTR6(m_type, m_method) \
static void _call_##m_type##_##m_method(Variant &r_ret, Variant &p_self, const Variant **p_args) { \
reinterpret_cast<m_type *>(p_self._data._ptr)->m_method(*p_args[0], *p_args[1], *p_args[2], *p_args[3], *p_args[4], *p_args[5]); \
}
#define VCALL_PTR8(m_type, m_method) \
static void _call_##m_type##_##m_method(Variant &r_ret, Variant &p_self, const Variant **p_args) { \
reinterpret_cast<m_type *>(p_self._data._ptr)->m_method(*p_args[0], *p_args[1], *p_args[2], *p_args[3], *p_args[4], *p_args[5], *p_args[6], *p_args[7]); \
}
VCALL_PTR0R(AABB, get_volume);
VCALL_PTR0R(AABB, has_no_volume);
@ -1259,18 +1374,18 @@ struct _VariantCall {
static void _call_Transform2D_xform(Variant &r_ret, Variant &p_self, const Variant **p_args) {
switch (p_args[0]->type) {
case Variant::VECTOR2:
r_ret = reinterpret_cast<Transform2D *>(p_self._data._ptr)->xform(p_args[0]->operator Vector2());
return;
case Variant::VECTOR2I:
r_ret = reinterpret_cast<Transform2D *>(p_self._data._ptr)->xform(p_args[0]->operator Vector2i());
return;
case Variant::RECT2:
r_ret = reinterpret_cast<Transform2D *>(p_self._data._ptr)->xform(p_args[0]->operator Rect2());
return;
case Variant::RECT2I:
r_ret = reinterpret_cast<Transform2D *>(p_self._data._ptr)->xform(p_args[0]->operator Rect2i());
return;
case Variant::VECTOR2:
r_ret = reinterpret_cast<Transform2D *>(p_self._data._ptr)->xform(p_args[0]->operator Vector2());
return;
case Variant::VECTOR2I:
r_ret = reinterpret_cast<Transform2D *>(p_self._data._ptr)->xform(p_args[0]->operator Vector2i());
return;
case Variant::POOL_VECTOR2_ARRAY:
r_ret = reinterpret_cast<Transform2D *>(p_self._data._ptr)->xform(p_args[0]->operator PoolVector2Array());
return;
@ -1284,18 +1399,18 @@ struct _VariantCall {
static void _call_Transform2D_xform_inv(Variant &r_ret, Variant &p_self, const Variant **p_args) {
switch (p_args[0]->type) {
case Variant::VECTOR2:
r_ret = reinterpret_cast<Transform2D *>(p_self._data._ptr)->xform_inv(p_args[0]->operator Vector2());
return;
case Variant::VECTOR2I:
r_ret = reinterpret_cast<Transform2D *>(p_self._data._ptr)->xform_inv(p_args[0]->operator Vector2i());
return;
case Variant::RECT2:
r_ret = reinterpret_cast<Transform2D *>(p_self._data._ptr)->xform_inv(p_args[0]->operator Rect2());
return;
case Variant::RECT2I:
r_ret = reinterpret_cast<Transform2D *>(p_self._data._ptr)->xform_inv(p_args[0]->operator Rect2i());
return;
case Variant::VECTOR2:
r_ret = reinterpret_cast<Transform2D *>(p_self._data._ptr)->xform_inv(p_args[0]->operator Vector2());
return;
case Variant::VECTOR2I:
r_ret = reinterpret_cast<Transform2D *>(p_self._data._ptr)->xform_inv(p_args[0]->operator Vector2i());
return;
case Variant::POOL_VECTOR2_ARRAY:
r_ret = reinterpret_cast<Transform2D *>(p_self._data._ptr)->xform_inv(p_args[0]->operator PoolVector2Array());
return;
@ -1518,6 +1633,69 @@ struct _VariantCall {
}
}
VCALL_PTR0R(Projection, determinant);
VCALL_PTR0(Projection, set_identity);
VCALL_PTR0(Projection, set_zero);
VCALL_PTR0(Projection, set_light_bias);
VCALL_PTR1(Projection, set_depth_correction);
VCALL_PTR1(Projection, set_light_atlas_rect);
VCALL_PTR5(Projection, set_perspective1);
VCALL_PTR8(Projection, set_perspective2);
VCALL_PTR8(Projection, set_for_hmd);
VCALL_PTR6(Projection, set_orthogonal1);
VCALL_PTR5(Projection, set_orthogonal2);
VCALL_PTR6(Projection, set_frustum1);
VCALL_PTR6(Projection, set_frustum2);
VCALL_PTR1(Projection, adjust_perspective_znear);
VCALL_PTR1R(Projection, perspective_znear_adjusted);
//TODO figure out why this doesn't work
//VCALL_PTR1R(Projection, get_projection_plane);
VCALL_PTR0R(Projection, flipped_y);
VCALL_PTR1R(Projection, jitter_offseted);
VCALL_PTR2R(Projection, calculate_fovy);
VCALL_PTR0R(Projection, get_z_far);
VCALL_PTR0R(Projection, get_z_near);
VCALL_PTR0R(Projection, get_aspect);
VCALL_PTR0R(Projection, get_fov);
VCALL_PTR0R(Projection, is_orthogonal);
VCALL_PTR1R(Projection, get_projection_planes_array);
VCALL_PTR0R(Projection, get_viewport_half_extents);
VCALL_PTR0R(Projection, get_far_plane_half_extents);
VCALL_PTR0(Projection, invert);
VCALL_PTR0R(Projection, inverse);
VCALL_PTR1(Projection, scale_translate_to_fit);
VCALL_PTR1(Projection, add_jitter_offset);
VCALL_PTR1(Projection, make_scale);
VCALL_PTR1R(Projection, get_pixels_per_meter);
VCALL_PTR0(Projection, flip_y);
VCALL_PTR0R(Projection, get_lod_multiplier);
static void _call_Projection_xform(Variant &r_ret, Variant &p_self, const Variant **p_args) {
switch (p_args[0]->type) {
case Variant::VECTOR4:
r_ret = reinterpret_cast<Projection *>(p_self._data._ptr)->xform(p_args[0]->operator Vector4());
return;
case Variant::VECTOR3:
r_ret = reinterpret_cast<Projection *>(p_self._data._ptr)->xform(p_args[0]->operator Vector3());
return;
case Variant::PLANE:
r_ret = reinterpret_cast<Projection *>(p_self._data._ptr)->xform(p_args[0]->operator Plane());
return;
default:
r_ret = Variant();
}
}
static void _call_Projection_xform_inv(Variant &r_ret, Variant &p_self, const Variant **p_args) {
switch (p_args[0]->type) {
case Variant::VECTOR4:
r_ret = reinterpret_cast<Projection *>(p_self._data._ptr)->xform_inv(p_args[0]->operator Vector4());
return;
default:
r_ret = Variant();
}
}
struct ConstructData {
int arg_count;
Vector<Variant::Type> arg_types;
@ -1531,14 +1709,6 @@ struct _VariantCall {
static ConstructFunc *construct_funcs;
static void Vector2_init1(Variant &r_ret, const Variant **p_args) {
r_ret = Vector2(*p_args[0], *p_args[1]);
}
static void Vector2i_init1(Variant &r_ret, const Variant **p_args) {
r_ret = Vector2i(*p_args[0], *p_args[1]);
}
static void Rect2_init1(Variant &r_ret, const Variant **p_args) {
r_ret = Rect2(*p_args[0], *p_args[1]);
}
@ -1555,17 +1725,12 @@ struct _VariantCall {
r_ret = Rect2i(*p_args[0], *p_args[1], *p_args[2], *p_args[3]);
}
static void Transform2D_init2(Variant &r_ret, const Variant **p_args) {
Transform2D m(*p_args[0], *p_args[1]);
r_ret = m;
static void Vector2_init1(Variant &r_ret, const Variant **p_args) {
r_ret = Vector2(*p_args[0], *p_args[1]);
}
static void Transform2D_init3(Variant &r_ret, const Variant **p_args) {
Transform2D m;
m[0] = *p_args[0];
m[1] = *p_args[1];
m[2] = *p_args[2];
r_ret = m;
static void Vector2i_init1(Variant &r_ret, const Variant **p_args) {
r_ret = Vector2i(*p_args[0], *p_args[1]);
}
static void Vector3_init1(Variant &r_ret, const Variant **p_args) {
@ -1576,6 +1741,14 @@ struct _VariantCall {
r_ret = Vector3i(*p_args[0], *p_args[1], *p_args[2]);
}
static void Vector4_init1(Variant &r_ret, const Variant **p_args) {
r_ret = Vector4(*p_args[0], *p_args[1], *p_args[2], *p_args[3]);
}
static void Vector4i_init1(Variant &r_ret, const Variant **p_args) {
r_ret = Vector4i(*p_args[0], *p_args[1], *p_args[2], *p_args[3]);
}
static void Plane_init1(Variant &r_ret, const Variant **p_args) {
r_ret = Plane(*p_args[0], *p_args[1], *p_args[2], *p_args[3]);
}
@ -1603,22 +1776,6 @@ struct _VariantCall {
r_ret = Quaternion(((Vector3)(*p_args[0])));
}
static void Color_init1(Variant &r_ret, const Variant **p_args) {
r_ret = Color(*p_args[0], *p_args[1], *p_args[2], *p_args[3]);
}
static void Color_init2(Variant &r_ret, const Variant **p_args) {
r_ret = Color(*p_args[0], *p_args[1], *p_args[2]);
}
static void Color_init3(Variant &r_ret, const Variant **p_args) {
r_ret = Color::html(*p_args[0]);
}
static void Color_init4(Variant &r_ret, const Variant **p_args) {
r_ret = Color::hex(*p_args[0]);
}
static void AABB_init1(Variant &r_ret, const Variant **p_args) {
r_ret = ::AABB(*p_args[0], *p_args[1]);
}
@ -1648,6 +1805,35 @@ struct _VariantCall {
r_ret = Transform(p_args[0]->operator Basis(), p_args[1]->operator Vector3());
}
static void Transform2D_init2(Variant &r_ret, const Variant **p_args) {
Transform2D m(*p_args[0], *p_args[1]);
r_ret = m;
}
static void Transform2D_init3(Variant &r_ret, const Variant **p_args) {
Transform2D m;
m[0] = *p_args[0];
m[1] = *p_args[1];
m[2] = *p_args[2];
r_ret = m;
}
static void Color_init1(Variant &r_ret, const Variant **p_args) {
r_ret = Color(*p_args[0], *p_args[1], *p_args[2], *p_args[3]);
}
static void Color_init2(Variant &r_ret, const Variant **p_args) {
r_ret = Color(*p_args[0], *p_args[1], *p_args[2]);
}
static void Color_init3(Variant &r_ret, const Variant **p_args) {
r_ret = Color::html(*p_args[0]);
}
static void Color_init4(Variant &r_ret, const Variant **p_args) {
r_ret = Color::hex(*p_args[0]);
}
static void add_constructor(VariantConstructFunc p_func, const Variant::Type p_type,
const String &p_name1 = "", const Variant::Type p_type1 = Variant::NIL,
const String &p_name2 = "", const Variant::Type p_type2 = Variant::NIL,
@ -1790,54 +1976,61 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i
case STRING:
return String();
// math types
case VECTOR2:
return Vector2(); // 5
case VECTOR2I:
return Vector2i();
case RECT2:
// math types
case RECT2: // 5
return Rect2();
case RECT2I:
return Rect2i();
case VECTOR2:
return Vector2();
case VECTOR2I:
return Vector2i();
case VECTOR3:
return Vector3();
case VECTOR3I:
case VECTOR3I: // 10
return Vector3i();
case TRANSFORM2D:
return Transform2D();
case VECTOR4:
return Vector4();
case VECTOR4I:
return Vector4i();
case PLANE:
return Plane();
case QUATERNION:
return Quaternion();
case AABB:
return ::AABB(); // 10
case AABB: // 15
return ::AABB();
case BASIS:
return Basis();
case TRANSFORM:
return Transform();
case TRANSFORM2D:
return Transform2D();
case PROJECTION:
return Projection();
// misc types
case COLOR:
case COLOR: // 20
return Color();
case NODE_PATH:
return NodePath(); // 15
case _RID:
return RID();
return NodePath();
case RID:
return ::RID();
case OBJECT:
return (Object *)nullptr;
case STRING_NAME:
return StringName();
case DICTIONARY:
case DICTIONARY: // 25
return Dictionary();
case ARRAY:
return Array(); // 20
return Array();
case POOL_BYTE_ARRAY:
return PoolByteArray();
case POOL_INT_ARRAY:
return PoolIntArray();
case POOL_REAL_ARRAY:
return PoolRealArray();
case POOL_STRING_ARRAY:
case POOL_STRING_ARRAY: //30
return PoolStringArray();
case POOL_VECTOR2_ARRAY:
return PoolVector2Array();
@ -1847,6 +2040,10 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i
return PoolVector3Array();
case POOL_VECTOR3I_ARRAY:
return PoolVector3iArray();
case POOL_VECTOR4_ARRAY: //35
return PoolVector4Array();
case POOL_VECTOR4I_ARRAY:
return PoolVector4iArray();
case POOL_COLOR_ARRAY:
return PoolColorArray();
default:
@ -1874,6 +2071,11 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i
case STRING: {
return String(*p_args[0]);
}
case RECT2:
return (Rect2(*p_args[0]));
case RECT2I:
//TODO Don't cast like this
return (Rect2i(Rect2(*p_args[0])));
case VECTOR2: {
return Vector2(*p_args[0]);
}
@ -1881,17 +2083,14 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i
//TODO Don't cast like this
return Vector2i(Vector2(*p_args[0]));
}
case RECT2:
return (Rect2(*p_args[0]));
case RECT2I:
//TODO Don't cast like this
return (Rect2i(Rect2(*p_args[0])));
case VECTOR3:
return (Vector3(*p_args[0]));
case VECTOR3I:
return (Vector3i(*p_args[0]));
case TRANSFORM2D:
return (Transform2D(p_args[0]->operator Transform2D()));
case VECTOR4:
return (Vector4(*p_args[0]));
case VECTOR4I:
return (Vector4i(*p_args[0]));
case PLANE:
return (Plane(*p_args[0]));
case QUATERNION:
@ -1902,14 +2101,18 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i
return (Basis(p_args[0]->operator Basis()));
case TRANSFORM:
return (Transform(p_args[0]->operator Transform()));
case TRANSFORM2D:
return (Transform2D(p_args[0]->operator Transform2D()));
case PROJECTION:
return (Projection(p_args[0]->operator Projection()));
// misc types
case COLOR:
return p_args[0]->type == Variant::STRING ? Color::html(*p_args[0]) : Color::hex(*p_args[0]);
case NODE_PATH:
return (NodePath(p_args[0]->operator NodePath())); // 15
case _RID:
return (RID(*p_args[0]));
case RID:
return (::RID(*p_args[0]));
case OBJECT:
return ((Object *)(p_args[0]->operator Object *()));
case STRING_NAME:
@ -1936,6 +2139,10 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i
return (PoolVector3Array(*p_args[0]));
case POOL_VECTOR3I_ARRAY:
return (PoolVector3iArray(*p_args[0]));
case POOL_VECTOR4_ARRAY:
return (PoolVector4Array(*p_args[0]));
case POOL_VECTOR4I_ARRAY:
return (PoolVector4iArray(*p_args[0]));
case POOL_COLOR_ARRAY:
return (PoolColorArray(*p_args[0]));
default:
@ -2230,6 +2437,13 @@ void register_variant_methods() {
#define ADDFUNC4NC(m_vtype, m_ret, m_class, m_method, m_arg1, m_argname1, m_arg2, m_argname2, m_arg3, m_argname3, m_arg4, m_argname4, m_defarg) \
_VariantCall::addfunc(false, Variant::m_vtype, Variant::m_ret, false, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2)), _VariantCall::Arg(Variant::m_arg3, _scs_create(m_argname3)), _VariantCall::Arg(Variant::m_arg4, _scs_create(m_argname4)));
#define ADDFUNC5(m_vtype, m_ret, m_class, m_method, m_arg1, m_argname1, m_arg2, m_argname2, m_arg3, m_argname3, m_arg4, m_argname4, m_arg5, m_argname5, m_defarg) \
_VariantCall::addfunc(true, Variant::m_vtype, Variant::m_ret, false, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2)), _VariantCall::Arg(Variant::m_arg3, _scs_create(m_argname3)), _VariantCall::Arg(Variant::m_arg4, _scs_create(m_argname4)), _VariantCall::Arg(Variant::m_arg5, _scs_create(m_argname5)));
#define ADDFUNC6(m_vtype, m_ret, m_class, m_method, m_arg1, m_argname1, m_arg2, m_argname2, m_arg3, m_argname3, m_arg4, m_argname4, m_arg5, m_argname5, m_arg6, m_argname6, m_defarg) \
_VariantCall::addfunc(true, Variant::m_vtype, Variant::m_ret, false, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2)), _VariantCall::Arg(Variant::m_arg3, _scs_create(m_argname3)), _VariantCall::Arg(Variant::m_arg4, _scs_create(m_argname4)), _VariantCall::Arg(Variant::m_arg5, _scs_create(m_argname5)), _VariantCall::Arg(Variant::m_arg6, _scs_create(m_argname6)));
#define ADDFUNC8(m_vtype, m_ret, m_class, m_method, m_arg1, m_argname1, m_arg2, m_argname2, m_arg3, m_argname3, m_arg4, m_argname4, m_arg5, m_argname5, m_arg6, m_argname6, m_arg7, m_argname7, m_arg8, m_argname8, m_defarg) \
_VariantCall::addfunc(true, Variant::m_vtype, Variant::m_ret, false, _scs_create(#m_method), VCALL(m_class, m_method), m_defarg, _VariantCall::Arg(Variant::m_arg1, _scs_create(m_argname1)), _VariantCall::Arg(Variant::m_arg2, _scs_create(m_argname2)), _VariantCall::Arg(Variant::m_arg3, _scs_create(m_argname3)), _VariantCall::Arg(Variant::m_arg4, _scs_create(m_argname4)), _VariantCall::Arg(Variant::m_arg5, _scs_create(m_argname5)), _VariantCall::Arg(Variant::m_arg6, _scs_create(m_argname6)), _VariantCall::Arg(Variant::m_arg7, _scs_create(m_argname7)), _VariantCall::Arg(Variant::m_arg8, _scs_create(m_argname8)));
/* STRING */
ADDFUNC1(STRING, NIL, String, remove, INT, "index", varray());
@ -2565,6 +2779,46 @@ void register_variant_methods() {
ADDFUNC2R(VECTOR3I, VECTOR3I, Vector3i, clamp, VECTOR3I, "min", VECTOR3I, "max", varray());
ADDFUNC2R(VECTOR3I, VECTOR3I, Vector3i, linear_interpolate, VECTOR3I, "to", REAL, "weight", varray());
ADDFUNC1(VECTOR4, NIL, Vector4, set_all, REAL, "value", varray());
ADDFUNC2(VECTOR4, NIL, Vector4, set_axis, INT, "axis", REAL, "value", varray());
ADDFUNC1R(VECTOR4, INT, Vector4, get_axis, INT, "axis", varray());
ADDFUNC0R(VECTOR4, INT, Vector4, min_axis, varray());
ADDFUNC0R(VECTOR4, INT, Vector4, max_axis, varray());
ADDFUNC0R(VECTOR4, REAL, Vector4, length_squared, varray());
ADDFUNC1R(VECTOR4, BOOL, Vector4, is_equal_approx, VECTOR4, "v", varray());
ADDFUNC0R(VECTOR4, REAL, Vector4, length, varray());
ADDFUNC0(VECTOR4, NIL, Vector4, normalize, varray());
ADDFUNC0R(VECTOR4, VECTOR4, Vector4, normalized, varray());
ADDFUNC0R(VECTOR4, BOOL, Vector4, is_normalized, varray());
ADDFUNC1R(VECTOR4, REAL, Vector4, distance_to, VECTOR4, "b", varray());
ADDFUNC1R(VECTOR4, REAL, Vector4, distance_squared_to, VECTOR4, "b", varray());
ADDFUNC1R(VECTOR4, VECTOR4, Vector4, direction_to, VECTOR4, "b", varray());
ADDFUNC0R(VECTOR4, VECTOR4, Vector4, abs, varray());
ADDFUNC0R(VECTOR4, VECTOR4, Vector4, sign, varray());
ADDFUNC0R(VECTOR4, VECTOR4, Vector4, floor, varray());
ADDFUNC0R(VECTOR4, VECTOR4, Vector4, ceil, varray());
ADDFUNC0R(VECTOR4, VECTOR4, Vector4, round, varray());
ADDFUNC2R(VECTOR4, VECTOR4, Vector4, lerp, VECTOR4, "to", REAL, "weight", varray());
ADDFUNC4R(VECTOR4, VECTOR4, Vector4, cubic_interpolate, VECTOR4, "b", VECTOR4, "pre_a", VECTOR4, "post_b", REAL, "weight", varray());
ADDFUNC1R(VECTOR4, VECTOR4, Vector4, posmod, REAL, "mod", varray());
ADDFUNC1R(VECTOR4, VECTOR4, Vector4, posmodv, VECTOR4, "modv", varray());
ADDFUNC1(VECTOR4, NIL, Vector4, snap, VECTOR4, "val", varray());
ADDFUNC1R(VECTOR4, VECTOR4, Vector4, snapped, VECTOR4, "by", varray());
ADDFUNC2R(VECTOR4, VECTOR4, Vector4, clamp, VECTOR4, "min", VECTOR4, "max", varray());
ADDFUNC0R(VECTOR4, VECTOR4, Vector4, inverse, varray());
ADDFUNC1R(VECTOR4, REAL, Vector4, dot, VECTOR4, "b", varray());
ADDFUNC2(VECTOR4I, NIL, Vector4i, set_axis, INT, "axis", INT, "value", varray());
ADDFUNC1R(VECTOR4I, INT, Vector4i, get_axis, INT, "axis", varray());
ADDFUNC0R(VECTOR4I, INT, Vector4i, min_axis, varray());
ADDFUNC0R(VECTOR4I, INT, Vector4i, max_axis, varray());
ADDFUNC0R(VECTOR4I, REAL, Vector4i, length_squared, varray());
ADDFUNC0R(VECTOR4I, REAL, Vector4i, length, varray());
ADDFUNC0(VECTOR4I, NIL, Vector4i, zero, varray());
ADDFUNC0R(VECTOR4I, VECTOR4I, Vector4i, abs, varray());
ADDFUNC0R(VECTOR4I, VECTOR4I, Vector4i, sign, varray());
ADDFUNC2R(VECTOR4I, VECTOR4I, Vector4i, clamp, VECTOR4I, "min", VECTOR4I, "max", varray());
ADDFUNC1(PLANE, NIL, Plane, set_normal, VECTOR3, "normal", varray());
ADDFUNC0R(PLANE, VECTOR3, Plane, get_normal, varray());
ADDFUNC0(PLANE, NIL, Plane, normalize, varray());
@ -2646,7 +2900,7 @@ void register_variant_methods() {
ADDFUNC1(COLOR, NIL, Color, set_s, INT, "s", varray());
ADDFUNC1(COLOR, NIL, Color, set_v, INT, "v", varray());
ADDFUNC0R(_RID, INT, RID, get_id, varray());
ADDFUNC0R(RID, INT, RID, get_id, varray());
ADDFUNC0R(NODE_PATH, BOOL, NodePath, is_absolute, varray());
ADDFUNC0R(NODE_PATH, INT, NodePath, get_name_count, varray());
@ -2867,6 +3121,44 @@ void register_variant_methods() {
ADDFUNC0(POOL_VECTOR3I_ARRAY, NIL, PoolVector3iArray, clear, varray());
ADDFUNC0(POOL_VECTOR3I_ARRAY, NIL, PoolVector3iArray, sort, varray());
ADDFUNC0R(POOL_VECTOR4_ARRAY, INT, PoolVector4Array, size, varray());
ADDFUNC0R(POOL_VECTOR4_ARRAY, BOOL, PoolVector4Array, empty, varray());
ADDFUNC2(POOL_VECTOR4_ARRAY, NIL, PoolVector4Array, set, INT, "idx", VECTOR4, "vector4", varray());
ADDFUNC1(POOL_VECTOR4_ARRAY, NIL, PoolVector4Array, push_back, VECTOR4, "vector4", varray());
ADDFUNC1(POOL_VECTOR4_ARRAY, NIL, PoolVector4Array, fill, VECTOR4, "vector4", varray());
ADDFUNC1(POOL_VECTOR4_ARRAY, NIL, PoolVector4Array, append, VECTOR4, "vector4", varray());
ADDFUNC1(POOL_VECTOR4_ARRAY, NIL, PoolVector4Array, append_array, POOL_VECTOR4_ARRAY, "array", varray());
ADDFUNC1(POOL_VECTOR4_ARRAY, NIL, PoolVector4Array, remove, INT, "idx", varray());
ADDFUNC2R(POOL_VECTOR4_ARRAY, INT, PoolVector4Array, insert, INT, "idx", VECTOR4, "vector4", varray());
ADDFUNC1(POOL_VECTOR4_ARRAY, NIL, PoolVector4Array, resize, INT, "idx", varray());
ADDFUNC0(POOL_VECTOR4_ARRAY, NIL, PoolVector4Array, invert, varray());
ADDFUNC1R(POOL_VECTOR4_ARRAY, BOOL, PoolVector4Array, contains, VECTOR4, "value", varray())
ADDFUNC2R(POOL_VECTOR4_ARRAY, INT, PoolVector4Array, find, VECTOR4, "value", INT, "from", varray(0))
ADDFUNC2R(POOL_VECTOR4_ARRAY, INT, PoolVector4Array, rfind, VECTOR4, "value", INT, "from", varray(-1));
ADDFUNC1R(POOL_VECTOR4_ARRAY, INT, PoolVector4Array, count, VECTOR4, "value", varray());
ADDFUNC1R(POOL_VECTOR4_ARRAY, BOOL, PoolVector4Array, has, VECTOR4, "value", varray());
ADDFUNC0(POOL_VECTOR4_ARRAY, NIL, PoolVector4Array, clear, varray());
ADDFUNC0(POOL_VECTOR4_ARRAY, NIL, PoolVector4Array, sort, varray());
ADDFUNC0R(POOL_VECTOR4I_ARRAY, INT, PoolVector4iArray, size, varray());
ADDFUNC0R(POOL_VECTOR4I_ARRAY, BOOL, PoolVector4iArray, empty, varray());
ADDFUNC2(POOL_VECTOR4I_ARRAY, NIL, PoolVector4iArray, set, INT, "idx", VECTOR4I, "vector4i", varray());
ADDFUNC1(POOL_VECTOR4I_ARRAY, NIL, PoolVector4iArray, push_back, VECTOR4I, "vector4i", varray());
ADDFUNC1(POOL_VECTOR4I_ARRAY, NIL, PoolVector4iArray, fill, VECTOR4I, "vector4i", varray());
ADDFUNC1(POOL_VECTOR4I_ARRAY, NIL, PoolVector4iArray, append, VECTOR4I, "vector4i", varray());
ADDFUNC1(POOL_VECTOR4I_ARRAY, NIL, PoolVector4iArray, append_array, POOL_VECTOR4I_ARRAY, "array", varray());
ADDFUNC1(POOL_VECTOR4I_ARRAY, NIL, PoolVector4iArray, remove, INT, "idx", varray());
ADDFUNC2R(POOL_VECTOR4I_ARRAY, INT, PoolVector4iArray, insert, INT, "idx", VECTOR4I, "vector4i", varray());
ADDFUNC1(POOL_VECTOR4I_ARRAY, NIL, PoolVector4iArray, resize, INT, "idx", varray());
ADDFUNC0(POOL_VECTOR4I_ARRAY, NIL, PoolVector4iArray, invert, varray());
ADDFUNC1R(POOL_VECTOR4I_ARRAY, BOOL, PoolVector4iArray, contains, VECTOR4I, "value", varray())
ADDFUNC2R(POOL_VECTOR4I_ARRAY, INT, PoolVector4iArray, find, VECTOR4I, "value", INT, "from", varray(0))
ADDFUNC2R(POOL_VECTOR4I_ARRAY, INT, PoolVector4iArray, rfind, VECTOR4I, "value", INT, "from", varray(-1));
ADDFUNC1R(POOL_VECTOR4I_ARRAY, INT, PoolVector4iArray, count, VECTOR4I, "value", varray());
ADDFUNC1R(POOL_VECTOR4I_ARRAY, BOOL, PoolVector4iArray, has, VECTOR4I, "value", varray());
ADDFUNC0(POOL_VECTOR4I_ARRAY, NIL, PoolVector4iArray, clear, varray());
ADDFUNC0(POOL_VECTOR4I_ARRAY, NIL, PoolVector4iArray, sort, varray());
ADDFUNC0R(POOL_COLOR_ARRAY, INT, PoolColorArray, size, varray());
ADDFUNC0R(POOL_COLOR_ARRAY, BOOL, PoolColorArray, empty, varray());
ADDFUNC2(POOL_COLOR_ARRAY, NIL, PoolColorArray, set, INT, "idx", COLOR, "color", varray());
@ -3089,6 +3381,57 @@ void register_variant_methods() {
ADDFUNC1R(TRANSFORM, NIL, Transform, xform, NIL, "v", varray());
ADDFUNC1R(TRANSFORM, NIL, Transform, xform_inv, NIL, "v", varray());
ADDFUNC0R(PROJECTION, REAL, Projection, determinant, varray());
ADDFUNC0(PROJECTION, NIL, Projection, set_identity, varray());
ADDFUNC0(PROJECTION, NIL, Projection, set_zero, varray());
ADDFUNC0(PROJECTION, NIL, Projection, set_light_bias, varray());
ADDFUNC1(PROJECTION, NIL, Projection, set_depth_correction, BOOL, "flip_y", varray(true));
ADDFUNC1(PROJECTION, NIL, Projection, set_light_atlas_rect, RECT2, "rect", varray());
ADDFUNC5(PROJECTION, NIL, Projection, set_perspective1, REAL, "fovy_degrees", REAL, "aspect", REAL, "z_near", REAL, "z_far", BOOL, "flip_fov", varray(false));
ADDFUNC8(PROJECTION, NIL, Projection, set_perspective2, REAL, "fovy_degrees", REAL, "aspect", REAL, "z_near", REAL, "z_far", BOOL, "flip_fov", INT, "eye", REAL, "intraocular_dist", REAL, "convergence_dist", varray());
ADDFUNC8(PROJECTION, NIL, Projection, set_for_hmd, INT, "eye", REAL, "aspect", REAL, "intraocular_dist", REAL, "display_width", REAL, "display_to_lens", REAL, "oversample", REAL, "z_near", REAL, "z_far", varray());
ADDFUNC6(PROJECTION, NIL, Projection, set_orthogonal1, REAL, "left", REAL, "right", REAL, "bottom", REAL, "top", REAL, "znear", REAL, "zfar", varray());
ADDFUNC5(PROJECTION, NIL, Projection, set_orthogonal2, REAL, "size", REAL, "aspect", REAL, "znear", REAL, "zfar", BOOL, "flip_fov", varray(false));
ADDFUNC6(PROJECTION, NIL, Projection, set_frustum1, REAL, "left", REAL, "right", REAL, "bottom", REAL, "top", REAL, "near", REAL, "far", varray());
ADDFUNC6(PROJECTION, NIL, Projection, set_frustum2, REAL, "size", REAL, "aspect", VECTOR2, "offset", REAL, "near", REAL, "far", BOOL, "flip_fov", varray(false));
ADDFUNC1(PROJECTION, NIL, Projection, adjust_perspective_znear, REAL, "new_znear", varray());
ADDFUNC1R(PROJECTION, PROJECTION, Projection, perspective_znear_adjusted, REAL, "new_znear", varray());
//TODO
//ADDFUNC1R(PROJECTION, PLANE, Projection, get_projection_plane, INT, "plane", varray());
ADDFUNC0R(PROJECTION, PROJECTION, Projection, flipped_y, varray());
ADDFUNC1R(PROJECTION, PROJECTION, Projection, jitter_offseted, VECTOR2, "offset", varray());
ADDFUNC2R(PROJECTION, REAL, Projection, calculate_fovy, REAL, "fovx", REAL, "aspect", varray());
ADDFUNC0R(PROJECTION, REAL, Projection, get_z_far, varray());
ADDFUNC0R(PROJECTION, REAL, Projection, get_z_near, varray());
ADDFUNC0R(PROJECTION, REAL, Projection, get_aspect, varray());
ADDFUNC0R(PROJECTION, REAL, Projection, get_fov, varray());
ADDFUNC0R(PROJECTION, BOOL, Projection, is_orthogonal, varray());
ADDFUNC1R(PROJECTION, ARRAY, Projection, get_projection_planes_array, TRANSFORM, "transform", varray());
ADDFUNC0R(PROJECTION, VECTOR2, Projection, get_viewport_half_extents, varray());
ADDFUNC0R(PROJECTION, VECTOR2, Projection, get_far_plane_half_extents, varray());
ADDFUNC0(PROJECTION, NIL, Projection, invert, varray());
ADDFUNC0R(PROJECTION, PROJECTION, Projection, inverse, varray());
ADDFUNC1(PROJECTION, NIL, Projection, scale_translate_to_fit, AABB, "aabb", varray());
ADDFUNC1(PROJECTION, NIL, Projection, add_jitter_offset, VECTOR2, "offset", varray());
ADDFUNC1(PROJECTION, NIL, Projection, make_scale, VECTOR3, "scale", varray());
ADDFUNC1R(PROJECTION, INT, Projection, get_pixels_per_meter, INT, "for_pixel_width", varray());
ADDFUNC0(PROJECTION, NIL, Projection, flip_y, varray());
ADDFUNC0R(PROJECTION, REAL, Projection, get_lod_multiplier, varray());
ADDFUNC1R(PROJECTION, NIL, Projection, xform, NIL, "v4_v3_plane", varray());
ADDFUNC1R(PROJECTION, NIL, Projection, xform_inv, VECTOR4, "v", varray());
/* REGISTER CONSTRUCTORS */
_VariantCall::add_constructor(_VariantCall::Vector2_init1, Variant::VECTOR2, "x", Variant::REAL, "y", Variant::REAL);
@ -3105,6 +3448,10 @@ void register_variant_methods() {
_VariantCall::add_constructor(_VariantCall::Vector3i_init1, Variant::VECTOR3I, "x", Variant::INT, "y", Variant::INT, "z", Variant::INT);
_VariantCall::add_constructor(_VariantCall::Vector4_init1, Variant::VECTOR4, "x", Variant::REAL, "y", Variant::REAL, "z", Variant::REAL, "w", Variant::REAL);
_VariantCall::add_constructor(_VariantCall::Vector4i_init1, Variant::VECTOR4I, "x", Variant::INT, "y", Variant::INT, "z", Variant::INT, "w", Variant::INT);
_VariantCall::add_constructor(_VariantCall::Plane_init1, Variant::PLANE, "a", Variant::REAL, "b", Variant::REAL, "c", Variant::REAL, "d", Variant::REAL);
_VariantCall::add_constructor(_VariantCall::Plane_init2, Variant::PLANE, "v1", Variant::VECTOR3, "v2", Variant::VECTOR3, "v3", Variant::VECTOR3);
_VariantCall::add_constructor(_VariantCall::Plane_init3, Variant::PLANE, "normal", Variant::VECTOR3, "d", Variant::REAL);
@ -3131,6 +3478,27 @@ void register_variant_methods() {
_VariantCall::add_variant_constant(Variant::COLOR, color->key(), color->value());
}
_VariantCall::add_constant(Variant::VECTOR2, "AXIS_X", Vector2::AXIS_X);
_VariantCall::add_constant(Variant::VECTOR2, "AXIS_Y", Vector2::AXIS_Y);
_VariantCall::add_variant_constant(Variant::VECTOR2, "ZERO", Vector2(0, 0));
_VariantCall::add_variant_constant(Variant::VECTOR2, "ONE", Vector2(1, 1));
_VariantCall::add_variant_constant(Variant::VECTOR2, "INF", Vector2(Math_INF, Math_INF));
_VariantCall::add_variant_constant(Variant::VECTOR2, "LEFT", Vector2(-1, 0));
_VariantCall::add_variant_constant(Variant::VECTOR2, "RIGHT", Vector2(1, 0));
_VariantCall::add_variant_constant(Variant::VECTOR2, "UP", Vector2(0, -1));
_VariantCall::add_variant_constant(Variant::VECTOR2, "DOWN", Vector2(0, 1));
_VariantCall::add_constant(Variant::VECTOR2I, "AXIS_X", Vector2i::AXIS_X);
_VariantCall::add_constant(Variant::VECTOR2I, "AXIS_Y", Vector2i::AXIS_Y);
_VariantCall::add_variant_constant(Variant::VECTOR2I, "ZERO", Vector2i(0, 0));
_VariantCall::add_variant_constant(Variant::VECTOR2I, "ONE", Vector2i(1, 1));
_VariantCall::add_variant_constant(Variant::VECTOR2I, "LEFT", Vector2i(-1, 0));
_VariantCall::add_variant_constant(Variant::VECTOR2I, "RIGHT", Vector2i(1, 0));
_VariantCall::add_variant_constant(Variant::VECTOR2I, "UP", Vector2i(0, -1));
_VariantCall::add_variant_constant(Variant::VECTOR2I, "DOWN", Vector2i(0, 1));
_VariantCall::add_constant(Variant::VECTOR3, "AXIS_X", Vector3::AXIS_X);
_VariantCall::add_constant(Variant::VECTOR3, "AXIS_Y", Vector3::AXIS_Y);
_VariantCall::add_constant(Variant::VECTOR3, "AXIS_Z", Vector3::AXIS_Z);
@ -3158,26 +3526,15 @@ void register_variant_methods() {
_VariantCall::add_variant_constant(Variant::VECTOR3I, "FORWARD", Vector3i(0, 0, -1));
_VariantCall::add_variant_constant(Variant::VECTOR3I, "BACK", Vector3i(0, 0, 1));
_VariantCall::add_constant(Variant::VECTOR2, "AXIS_X", Vector2::AXIS_X);
_VariantCall::add_constant(Variant::VECTOR2, "AXIS_Y", Vector2::AXIS_Y);
_VariantCall::add_constant(Variant::VECTOR4, "AXIS_X", Vector4::AXIS_X);
_VariantCall::add_constant(Variant::VECTOR4, "AXIS_Y", Vector4::AXIS_Y);
_VariantCall::add_constant(Variant::VECTOR4, "AXIS_Z", Vector4::AXIS_Z);
_VariantCall::add_constant(Variant::VECTOR4, "AXIS_W", Vector4::AXIS_W);
_VariantCall::add_variant_constant(Variant::VECTOR2, "ZERO", Vector2(0, 0));
_VariantCall::add_variant_constant(Variant::VECTOR2, "ONE", Vector2(1, 1));
_VariantCall::add_variant_constant(Variant::VECTOR2, "INF", Vector2(Math_INF, Math_INF));
_VariantCall::add_variant_constant(Variant::VECTOR2, "LEFT", Vector2(-1, 0));
_VariantCall::add_variant_constant(Variant::VECTOR2, "RIGHT", Vector2(1, 0));
_VariantCall::add_variant_constant(Variant::VECTOR2, "UP", Vector2(0, -1));
_VariantCall::add_variant_constant(Variant::VECTOR2, "DOWN", Vector2(0, 1));
_VariantCall::add_constant(Variant::VECTOR2I, "AXIS_X", Vector2i::AXIS_X);
_VariantCall::add_constant(Variant::VECTOR2I, "AXIS_Y", Vector2i::AXIS_Y);
_VariantCall::add_variant_constant(Variant::VECTOR2I, "ZERO", Vector2i(0, 0));
_VariantCall::add_variant_constant(Variant::VECTOR2I, "ONE", Vector2i(1, 1));
_VariantCall::add_variant_constant(Variant::VECTOR2I, "LEFT", Vector2i(-1, 0));
_VariantCall::add_variant_constant(Variant::VECTOR2I, "RIGHT", Vector2i(1, 0));
_VariantCall::add_variant_constant(Variant::VECTOR2I, "UP", Vector2i(0, -1));
_VariantCall::add_variant_constant(Variant::VECTOR2I, "DOWN", Vector2i(0, 1));
_VariantCall::add_constant(Variant::VECTOR4I, "AXIS_X", Vector4i::AXIS_X);
_VariantCall::add_constant(Variant::VECTOR4I, "AXIS_Y", Vector4i::AXIS_Y);
_VariantCall::add_constant(Variant::VECTOR4I, "AXIS_Z", Vector4i::AXIS_Z);
_VariantCall::add_constant(Variant::VECTOR4I, "AXIS_W", Vector4i::AXIS_W);
_VariantCall::add_variant_constant(Variant::TRANSFORM2D, "IDENTITY", Transform2D());
_VariantCall::add_variant_constant(Variant::TRANSFORM2D, "FLIP_X", Transform2D(-1, 0, 0, 1, 0, 0));
@ -3192,6 +3549,18 @@ void register_variant_methods() {
_VariantCall::add_variant_constant(Variant::TRANSFORM, "FLIP_Y", flip_y_transform);
_VariantCall::add_variant_constant(Variant::TRANSFORM, "FLIP_Z", flip_z_transform);
_VariantCall::add_constant(Variant::PROJECTION, "PLANE_NEAR", Projection::PLANE_NEAR);
_VariantCall::add_constant(Variant::PROJECTION, "PLANE_FAR", Projection::PLANE_FAR);
_VariantCall::add_constant(Variant::PROJECTION, "PLANE_LEFT", Projection::PLANE_LEFT);
_VariantCall::add_constant(Variant::PROJECTION, "PLANE_TOP", Projection::PLANE_TOP);
_VariantCall::add_constant(Variant::PROJECTION, "PLANE_RIGHT", Projection::PLANE_RIGHT);
_VariantCall::add_constant(Variant::PROJECTION, "PLANE_BOTTOM", Projection::PLANE_BOTTOM);
Projection p;
_VariantCall::add_variant_constant(Variant::PROJECTION, "IDENTITY", p);
p.set_zero();
_VariantCall::add_variant_constant(Variant::PROJECTION, "ZERO", p);
Basis identity_basis = Basis();
Basis flip_x_basis = Basis(-1, 0, 0, 0, 1, 0, 0, 0, 1);
Basis flip_y_basis = Basis(1, 0, 0, 0, -1, 0, 0, 0, 1);

File diff suppressed because it is too large Load Diff

View File

@ -538,32 +538,6 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
value = -Math_INF;
} else if (id == "nan") {
value = Math_NAN;
} else if (id == "Vector2") {
Vector<float> args;
Error err = _parse_construct<float>(p_stream, args, line, r_err_str);
if (err) {
return err;
}
if (args.size() != 2) {
r_err_str = "Expected 2 arguments for constructor";
return ERR_PARSE_ERROR;
}
value = Vector2(args[0], args[1]);
} else if (id == "Vector2i") {
Vector<int> args;
Error err = _parse_construct<int>(p_stream, args, line, r_err_str);
if (err) {
return err;
}
if (args.size() != 2) {
r_err_str = "Expected 2 arguments for constructor";
return ERR_PARSE_ERROR;
}
value = Vector2i(args[0], args[1]);
} else if (id == "Rect2") {
Vector<float> args;
Error err = _parse_construct<float>(p_stream, args, line, r_err_str);
@ -590,6 +564,32 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
}
value = Rect2i(args[0], args[1], args[2], args[3]);
} else if (id == "Vector2") {
Vector<float> args;
Error err = _parse_construct<float>(p_stream, args, line, r_err_str);
if (err) {
return err;
}
if (args.size() != 2) {
r_err_str = "Expected 2 arguments for constructor";
return ERR_PARSE_ERROR;
}
value = Vector2(args[0], args[1]);
} else if (id == "Vector2i") {
Vector<int> args;
Error err = _parse_construct<int>(p_stream, args, line, r_err_str);
if (err) {
return err;
}
if (args.size() != 2) {
r_err_str = "Expected 2 arguments for constructor";
return ERR_PARSE_ERROR;
}
value = Vector2i(args[0], args[1]);
} else if (id == "Vector3") {
Vector<float> args;
Error err = _parse_construct<float>(p_stream, args, line, r_err_str);
@ -616,23 +616,32 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
}
value = Vector3i(args[0], args[1], args[2]);
} else if (id == "Transform2D" || id == "Matrix32") { //compatibility
} else if (id == "Vector4") {
Vector<float> args;
Error err = _parse_construct<float>(p_stream, args, line, r_err_str);
if (err) {
return err;
}
if (args.size() != 6) {
r_err_str = "Expected 6 arguments for constructor";
if (args.size() != 4) {
r_err_str = "Expected 4 arguments for constructor";
return ERR_PARSE_ERROR;
}
Transform2D m;
m[0] = Vector2(args[0], args[1]);
m[1] = Vector2(args[2], args[3]);
m[2] = Vector2(args[4], args[5]);
value = m;
value = Vector4(args[0], args[1], args[2], args[3]);
} else if (id == "Vector4i") {
Vector<int> args;
Error err = _parse_construct<int>(p_stream, args, line, r_err_str);
if (err) {
return err;
}
if (args.size() != 4) {
r_err_str = "Expected 4 arguments for constructor";
return ERR_PARSE_ERROR;
}
value = Vector4i(args[0], args[1], args[2], args[3]);
} else if (id == "Plane") {
Vector<float> args;
Error err = _parse_construct<float>(p_stream, args, line, r_err_str);
@ -672,7 +681,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
}
value = AABB(Vector3(args[0], args[1], args[2]), Vector3(args[3], args[4], args[5]));
} else if (id == "Basis" || id == "Matrix3") { //compatibility
} else if (id == "Basis") {
Vector<float> args;
Error err = _parse_construct<float>(p_stream, args, line, r_err_str);
if (err) {
@ -698,6 +707,36 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
}
value = Transform(Basis(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]), Vector3(args[9], args[10], args[11]));
} else if (id == "Transform2D") {
Vector<float> args;
Error err = _parse_construct<float>(p_stream, args, line, r_err_str);
if (err) {
return err;
}
if (args.size() != 6) {
r_err_str = "Expected 6 arguments for constructor";
return ERR_PARSE_ERROR;
}
Transform2D m;
m[0] = Vector2(args[0], args[1]);
m[1] = Vector2(args[2], args[3]);
m[2] = Vector2(args[4], args[5]);
value = m;
} else if (id == "Projection") {
Vector<real_t> args;
Error err = _parse_construct<real_t>(p_stream, args, line, r_err_str);
if (err) {
return err;
}
if (args.size() != 16) {
r_err_str = "Expected 16 arguments for constructor";
return ERR_PARSE_ERROR;
}
value = Projection(Vector4(args[0], args[1], args[2], args[3]), Vector4(args[4], args[5], args[6], args[7]), Vector4(args[8], args[9], args[10], args[11]), Vector4(args[12], args[13], args[14], args[15]));
} else if (id == "Color") {
Vector<float> args;
Error err = _parse_construct<float>(p_stream, args, line, r_err_str);
@ -900,189 +939,6 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
return ERR_PARSE_ERROR;
}
}
#ifndef DISABLE_DEPRECATED
} else if (id == "InputEvent") {
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_PARENTHESIS_OPEN) {
r_err_str = "Expected '('";
return ERR_PARSE_ERROR;
}
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_IDENTIFIER) {
r_err_str = "Expected identifier";
return ERR_PARSE_ERROR;
}
String id2 = token.value;
Ref<InputEvent> ie;
if (id2 == "NONE") {
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_PARENTHESIS_CLOSE) {
r_err_str = "Expected ')'";
return ERR_PARSE_ERROR;
}
} else if (id2 == "KEY") {
Ref<InputEventKey> key;
key.instance();
ie = key;
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_COMMA) {
r_err_str = "Expected ','";
return ERR_PARSE_ERROR;
}
get_token(p_stream, token, line, r_err_str);
if (token.type == TK_IDENTIFIER) {
String name = token.value;
key->set_scancode(find_keycode(name));
} else if (token.type == TK_NUMBER) {
key->set_scancode(token.value);
} else {
r_err_str = "Expected string or integer for keycode";
return ERR_PARSE_ERROR;
}
get_token(p_stream, token, line, r_err_str);
if (token.type == TK_COMMA) {
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_IDENTIFIER) {
r_err_str = "Expected identifier with modifier flas";
return ERR_PARSE_ERROR;
}
String mods = token.value;
if (mods.findn("C") != -1) {
key->set_control(true);
}
if (mods.findn("A") != -1) {
key->set_alt(true);
}
if (mods.findn("S") != -1) {
key->set_shift(true);
}
if (mods.findn("M") != -1) {
key->set_metakey(true);
}
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_PARENTHESIS_CLOSE) {
r_err_str = "Expected ')'";
return ERR_PARSE_ERROR;
}
} else if (token.type != TK_PARENTHESIS_CLOSE) {
r_err_str = "Expected ')' or modifier flags.";
return ERR_PARSE_ERROR;
}
} else if (id2 == "MBUTTON") {
Ref<InputEventMouseButton> mb;
mb.instance();
ie = mb;
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_COMMA) {
r_err_str = "Expected ','";
return ERR_PARSE_ERROR;
}
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_NUMBER) {
r_err_str = "Expected button index";
return ERR_PARSE_ERROR;
}
mb->set_button_index(token.value);
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_PARENTHESIS_CLOSE) {
r_err_str = "Expected ')'";
return ERR_PARSE_ERROR;
}
} else if (id2 == "JBUTTON") {
Ref<InputEventJoypadButton> jb;
jb.instance();
ie = jb;
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_COMMA) {
r_err_str = "Expected ','";
return ERR_PARSE_ERROR;
}
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_NUMBER) {
r_err_str = "Expected button index";
return ERR_PARSE_ERROR;
}
jb->set_button_index(token.value);
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_PARENTHESIS_CLOSE) {
r_err_str = "Expected ')'";
return ERR_PARSE_ERROR;
}
} else if (id2 == "JAXIS") {
Ref<InputEventJoypadMotion> jm;
jm.instance();
ie = jm;
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_COMMA) {
r_err_str = "Expected ','";
return ERR_PARSE_ERROR;
}
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_NUMBER) {
r_err_str = "Expected axis index";
return ERR_PARSE_ERROR;
}
jm->set_axis(token.value);
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_COMMA) {
r_err_str = "Expected ',' after axis index";
return ERR_PARSE_ERROR;
}
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_NUMBER) {
r_err_str = "Expected axis sign";
return ERR_PARSE_ERROR;
}
jm->set_axis_value(token.value);
get_token(p_stream, token, line, r_err_str);
if (token.type != TK_PARENTHESIS_CLOSE) {
r_err_str = "Expected ')' for jaxis";
return ERR_PARSE_ERROR;
}
} else {
r_err_str = "Invalid input event type.";
return ERR_PARSE_ERROR;
}
value = ie;
#endif
} else if (id == "PoolByteArray" || id == "ByteArray") {
Vector<uint8_t> args;
Error err = _parse_construct<uint8_t>(p_stream, args, line, r_err_str);
@ -1263,6 +1119,44 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
value = arr;
} else if (id == "PoolVector4Array" || id == "Vector4Array") {
Vector<float> args;
Error err = _parse_construct<float>(p_stream, args, line, r_err_str);
if (err) {
return err;
}
PoolVector<Vector4> arr;
{
int len = args.size() / 3;
arr.resize(len);
PoolVector<Vector4>::Write w = arr.write();
for (int i = 0; i < len; i++) {
w[i] = Vector4(args[i * 4 + 0], args[i * 4 + 1], args[i * 4 + 2], args[i * 4 + 3]);
}
}
value = arr;
} else if (id == "PoolVector4iArray" || id == "Vector4iArray") {
Vector<int> args;
Error err = _parse_construct<int>(p_stream, args, line, r_err_str);
if (err) {
return err;
}
PoolVector<Vector4i> arr;
{
int len = args.size() / 3;
arr.resize(len);
PoolVector<Vector4i>::Write w = arr.write();
for (int i = 0; i < len; i++) {
w[i] = Vector4i(args[i * 4 + 0], args[i * 4 + 1], args[i * 4 + 2], args[i * 4 + 3]);
}
}
value = arr;
} else if (id == "PoolColorArray" || id == "ColorArray") {
Vector<float> args;
Error err = _parse_construct<float>(p_stream, args, line, r_err_str);
@ -1666,14 +1560,6 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
str = "\"" + str.c_escape_multiline() + "\"";
p_store_string_func(p_store_string_ud, str);
} break;
case Variant::VECTOR2: {
Vector2 v = p_variant;
p_store_string_func(p_store_string_ud, "Vector2( " + rtos_fix(v.x) + ", " + rtos_fix(v.y) + " )");
} break;
case Variant::VECTOR2I: {
Vector2i v = p_variant;
p_store_string_func(p_store_string_ud, "Vector2i( " + rtos_fix(v.x) + ", " + rtos_fix(v.y) + " )");
} break;
case Variant::RECT2: {
Rect2 aabb = p_variant;
p_store_string_func(p_store_string_ud, "Rect2( " + rtos_fix(aabb.position.x) + ", " + rtos_fix(aabb.position.y) + ", " + rtos_fix(aabb.size.x) + ", " + rtos_fix(aabb.size.y) + " )");
@ -1684,6 +1570,14 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
p_store_string_func(p_store_string_ud, "Rect2i( " + rtos_fix(aabb.position.x) + ", " + rtos_fix(aabb.position.y) + ", " + rtos_fix(aabb.size.x) + ", " + rtos_fix(aabb.size.y) + " )");
} break;
case Variant::VECTOR2: {
Vector2 v = p_variant;
p_store_string_func(p_store_string_ud, "Vector2( " + rtos_fix(v.x) + ", " + rtos_fix(v.y) + " )");
} break;
case Variant::VECTOR2I: {
Vector2i v = p_variant;
p_store_string_func(p_store_string_ud, "Vector2i( " + rtos_fix(v.x) + ", " + rtos_fix(v.y) + " )");
} break;
case Variant::VECTOR3: {
Vector3 v = p_variant;
p_store_string_func(p_store_string_ud, "Vector3( " + rtos_fix(v.x) + ", " + rtos_fix(v.y) + ", " + rtos_fix(v.z) + " )");
@ -1692,34 +1586,27 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
Vector3i v = p_variant;
p_store_string_func(p_store_string_ud, "Vector3i( " + rtos_fix(v.x) + ", " + rtos_fix(v.y) + ", " + rtos_fix(v.z) + " )");
} break;
case Variant::VECTOR4: {
Vector4 v = p_variant;
p_store_string_func(p_store_string_ud, "Vector4( " + rtos_fix(v.x) + ", " + rtos_fix(v.y) + ", " + rtos_fix(v.z) + ", " + rtos_fix(v.w) + " )");
} break;
case Variant::VECTOR4I: {
Vector4i v = p_variant;
p_store_string_func(p_store_string_ud, "Vector4i( " + rtos_fix(v.x) + ", " + rtos_fix(v.y) + ", " + rtos_fix(v.z) + ", " + rtos_fix(v.w) + " )");
} break;
case Variant::PLANE: {
Plane p = p_variant;
p_store_string_func(p_store_string_ud, "Plane( " + rtos_fix(p.normal.x) + ", " + rtos_fix(p.normal.y) + ", " + rtos_fix(p.normal.z) + ", " + rtos_fix(p.d) + " )");
} break;
case Variant::AABB: {
AABB aabb = p_variant;
p_store_string_func(p_store_string_ud, "AABB( " + rtos_fix(aabb.position.x) + ", " + rtos_fix(aabb.position.y) + ", " + rtos_fix(aabb.position.z) + ", " + rtos_fix(aabb.size.x) + ", " + rtos_fix(aabb.size.y) + ", " + rtos_fix(aabb.size.z) + " )");
} break;
case Variant::QUATERNION: {
Quaternion quat = p_variant;
p_store_string_func(p_store_string_ud, "Quaternion( " + rtos_fix(quat.x) + ", " + rtos_fix(quat.y) + ", " + rtos_fix(quat.z) + ", " + rtos_fix(quat.w) + " )");
} break;
case Variant::TRANSFORM2D: {
String s = "Transform2D( ";
Transform2D m3 = p_variant;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
if (i != 0 || j != 0) {
s += ", ";
}
s += rtos_fix(m3.columns[i][j]);
}
}
p_store_string_func(p_store_string_ud, s + " )");
case Variant::AABB: {
AABB aabb = p_variant;
p_store_string_func(p_store_string_ud, "AABB( " + rtos_fix(aabb.position.x) + ", " + rtos_fix(aabb.position.y) + ", " + rtos_fix(aabb.position.z) + ", " + rtos_fix(aabb.size.x) + ", " + rtos_fix(aabb.size.y) + ", " + rtos_fix(aabb.size.z) + " )");
} break;
case Variant::BASIS: {
@ -1754,6 +1641,35 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
p_store_string_func(p_store_string_ud, s + " )");
} break;
case Variant::TRANSFORM2D: {
String s = "Transform2D( ";
Transform2D m3 = p_variant;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
if (i != 0 || j != 0) {
s += ", ";
}
s += rtos_fix(m3.columns[i][j]);
}
}
p_store_string_func(p_store_string_ud, s + " )");
} break;
case Variant::PROJECTION: {
String s = "Projection(";
Projection t = p_variant;
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
if (i != 0 || j != 0) {
s += ", ";
}
s += rtos_fix(t.matrix[i][j]);
}
}
p_store_string_func(p_store_string_ud, s + ")");
} break;
// misc types
case Variant::COLOR: {
@ -1768,7 +1684,7 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
p_store_string_func(p_store_string_ud, str);
} break;
//RID
case Variant::OBJECT: {
Object *obj = p_variant;
@ -1826,7 +1742,6 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
p_store_string_func(p_store_string_ud, ")\n");
} break;
case Variant::STRING_NAME: {
String str = p_variant;
@ -1834,7 +1749,6 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
p_store_string_func(p_store_string_ud, str);
} break;
case Variant::DICTIONARY: {
Dictionary dict = p_variant;
@ -2015,6 +1929,41 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
p_store_string_func(p_store_string_ud, " )");
} break;
case Variant::POOL_VECTOR4_ARRAY: {
p_store_string_func(p_store_string_ud, "PoolVector4Array( ");
PoolVector<Vector4> data = p_variant;
int len = data.size();
PoolVector<Vector4>::Read r = data.read();
const Vector4 *ptr = r.ptr();
for (int i = 0; i < len; i++) {
if (i > 0) {
p_store_string_func(p_store_string_ud, ", ");
}
p_store_string_func(p_store_string_ud, rtos_fix(ptr[i].x) + ", " + rtos_fix(ptr[i].y) + ", " + rtos_fix(ptr[i].z) + ", " + rtos_fix(ptr[i].w));
}
p_store_string_func(p_store_string_ud, " )");
} break;
case Variant::POOL_VECTOR4I_ARRAY: {
p_store_string_func(p_store_string_ud, "PoolVector4iArray( ");
PoolVector<Vector4i> data = p_variant;
int len = data.size();
PoolVector<Vector4i>::Read r = data.read();
const Vector4i *ptr = r.ptr();
for (int i = 0; i < len; i++) {
if (i > 0) {
p_store_string_func(p_store_string_ud, ", ");
}
p_store_string_func(p_store_string_ud, rtos_fix(ptr[i].x) + ", " + rtos_fix(ptr[i].y) + ", " + rtos_fix(ptr[i].z) + ", " + rtos_fix(ptr[i].w));
}
p_store_string_func(p_store_string_ud, " )");
} break;
case Variant::POOL_COLOR_ARRAY: {
p_store_string_func(p_store_string_ud, "PoolColorArray( ");

View File

@ -39,6 +39,7 @@
#include "core/math/math_defs.h"
#include "core/math/math_funcs.h"
#include "core/math/plane.h"
#include "core/math/projection.h"
#include "core/math/quaternion.h"
#include "core/math/rect2.h"
#include "core/math/transform.h"
@ -2035,6 +2036,183 @@ EditorPropertyVector3i::EditorPropertyVector3i() {
setting = false;
}
///////////////////// VECTOR4 /////////////////////////
void EditorPropertyVector4::_value_changed(double val, const String &p_name) {
if (setting) {
return;
}
Vector4 v4;
v4.x = spin[0]->get_value();
v4.y = spin[1]->get_value();
v4.z = spin[2]->get_value();
v4.w = spin[3]->get_value();
emit_changed(get_edited_property(), v4, p_name);
}
void EditorPropertyVector4::update_property() {
update_using_vector(get_edited_object()->get(get_edited_property()));
}
void EditorPropertyVector4::update_using_vector(Vector4 p_vector) {
setting = true;
spin[0]->set_value(p_vector.x);
spin[1]->set_value(p_vector.y);
spin[2]->set_value(p_vector.z);
spin[3]->set_value(p_vector.w);
setting = false;
}
Vector4 EditorPropertyVector4::get_vector() {
Vector4 v4;
v4.x = spin[0]->get_value();
v4.y = spin[1]->get_value();
v4.z = spin[2]->get_value();
v4.w = spin[3]->get_value();
return v4;
}
void EditorPropertyVector4::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
Color base = get_color("accent_color", "Editor");
for (int i = 0; i < 4; i++) {
Color c = base;
c.set_hsv(float(i) / 3.0 + 0.05, c.get_s() * 0.75, c.get_v());
spin[i]->set_custom_label_color(true, c);
}
}
}
void EditorPropertyVector4::_bind_methods() {
ClassDB::bind_method(D_METHOD("_value_changed"), &EditorPropertyVector4::_value_changed);
}
void EditorPropertyVector4::setup(double p_min, double p_max, double p_step, bool p_no_slider) {
for (int i = 0; i < 4; i++) {
spin[i]->set_min(p_min);
spin[i]->set_max(p_max);
spin[i]->set_step(p_step);
spin[i]->set_hide_slider(p_no_slider);
spin[i]->set_allow_greater(true);
spin[i]->set_allow_lesser(true);
}
}
EditorPropertyVector4::EditorPropertyVector4() {
bool horizontal = EDITOR_GET("interface/inspector/horizontal_vector_types_editing");
BoxContainer *bc;
if (horizontal) {
bc = memnew(HBoxContainer);
add_child(bc);
set_bottom_editor(bc);
} else {
bc = memnew(VBoxContainer);
add_child(bc);
}
static const char *desc[4] = { "x", "y", "z", "w" };
for (int i = 0; i < 4; i++) {
spin[i] = memnew(EditorSpinSlider);
spin[i]->set_flat(true);
spin[i]->set_label(desc[i]);
bc->add_child(spin[i]);
add_focusable(spin[i]);
spin[i]->connect("value_changed", this, "_value_changed", varray(desc[i]));
if (horizontal) {
spin[i]->set_h_size_flags(SIZE_EXPAND_FILL);
}
}
if (!horizontal) {
set_label_reference(spin[0]); //show text and buttons around this
}
setting = false;
}
///////////////////// VECTOR3I /////////////////////////
void EditorPropertyVector4i::_value_changed(double val, const String &p_name) {
if (setting) {
return;
}
Vector4i v4;
v4.x = spin[0]->get_value();
v4.y = spin[1]->get_value();
v4.z = spin[2]->get_value();
v4.w = spin[3]->get_value();
emit_changed(get_edited_property(), v4, p_name);
}
void EditorPropertyVector4i::update_property() {
Vector4i val = get_edited_object()->get(get_edited_property());
setting = true;
spin[0]->set_value(val.x);
spin[1]->set_value(val.y);
spin[2]->set_value(val.z);
spin[3]->set_value(val.w);
setting = false;
}
void EditorPropertyVector4i::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
Color base = get_color("accent_color", "Editor");
for (int i = 0; i < 4; i++) {
Color c = base;
c.set_hsv(float(i) / 3.0 + 0.05, c.get_s() * 0.75, c.get_v());
spin[i]->set_custom_label_color(true, c);
}
}
}
void EditorPropertyVector4i::_bind_methods() {
ClassDB::bind_method(D_METHOD("_value_changed"), &EditorPropertyVector4i::_value_changed);
}
void EditorPropertyVector4i::setup(int p_min, int p_max, bool p_no_slider) {
for (int i = 0; i < 4; i++) {
spin[i]->set_min(p_min);
spin[i]->set_max(p_max);
spin[i]->set_step(1);
spin[i]->set_hide_slider(p_no_slider);
spin[i]->set_allow_greater(true);
spin[i]->set_allow_lesser(true);
}
}
EditorPropertyVector4i::EditorPropertyVector4i() {
bool horizontal = EDITOR_GET("interface/inspector/horizontal_vector_types_editing");
BoxContainer *bc;
if (horizontal) {
bc = memnew(HBoxContainer);
add_child(bc);
set_bottom_editor(bc);
} else {
bc = memnew(VBoxContainer);
add_child(bc);
}
static const char *desc[4] = { "x", "y", "z", "w" };
for (int i = 0; i < 4; i++) {
spin[i] = memnew(EditorSpinSlider);
spin[i]->set_flat(true);
spin[i]->set_label(desc[i]);
bc->add_child(spin[i]);
add_focusable(spin[i]);
spin[i]->connect("value_changed", this, "_value_changed", varray(desc[i]));
if (horizontal) {
spin[i]->set_h_size_flags(SIZE_EXPAND_FILL);
}
}
if (!horizontal) {
set_label_reference(spin[0]); //show text and buttons around this
}
setting = false;
}
///////////////////// PLANE /////////////////////////
void EditorPropertyPlane::_value_changed(double val, const String &p_name) {
@ -2518,6 +2696,105 @@ EditorPropertyTransform::EditorPropertyTransform() {
setting = false;
}
///////////////////// PROJECTION /////////////////////////
void EditorPropertyProjection::_value_changed(double val, const String &p_name) {
if (setting) {
return;
}
Projection p;
p.matrix[0][0] = spin[0]->get_value();
p.matrix[0][1] = spin[1]->get_value();
p.matrix[0][2] = spin[2]->get_value();
p.matrix[0][3] = spin[3]->get_value();
p.matrix[1][0] = spin[4]->get_value();
p.matrix[1][1] = spin[5]->get_value();
p.matrix[1][2] = spin[6]->get_value();
p.matrix[1][3] = spin[7]->get_value();
p.matrix[2][0] = spin[8]->get_value();
p.matrix[2][1] = spin[9]->get_value();
p.matrix[2][2] = spin[10]->get_value();
p.matrix[2][3] = spin[11]->get_value();
p.matrix[3][0] = spin[12]->get_value();
p.matrix[3][1] = spin[13]->get_value();
p.matrix[3][2] = spin[14]->get_value();
p.matrix[3][3] = spin[15]->get_value();
emit_changed(get_edited_property(), p, p_name);
}
void EditorPropertyProjection::update_property() {
update_using_projection(get_edited_object()->get(get_edited_property()));
}
void EditorPropertyProjection::update_using_projection(Projection p_projection) {
setting = true;
spin[0]->set_value(p_projection.matrix[0][0]);
spin[1]->set_value(p_projection.matrix[0][1]);
spin[2]->set_value(p_projection.matrix[0][2]);
spin[3]->set_value(p_projection.matrix[0][3]);
spin[4]->set_value(p_projection.matrix[1][0]);
spin[5]->set_value(p_projection.matrix[1][1]);
spin[6]->set_value(p_projection.matrix[1][2]);
spin[7]->set_value(p_projection.matrix[1][3]);
spin[8]->set_value(p_projection.matrix[2][0]);
spin[9]->set_value(p_projection.matrix[2][1]);
spin[10]->set_value(p_projection.matrix[2][2]);
spin[11]->set_value(p_projection.matrix[2][3]);
spin[12]->set_value(p_projection.matrix[3][0]);
spin[13]->set_value(p_projection.matrix[3][1]);
spin[14]->set_value(p_projection.matrix[3][2]);
spin[15]->set_value(p_projection.matrix[3][3]);
setting = false;
}
void EditorPropertyProjection::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
Color base = get_color("accent_color", "Editor");
for (int i = 0; i < 16; i++) {
Color c = base;
c.set_hsv(float(i % 3) / 3.0 + 0.05, c.get_s() * 0.75, c.get_v());
spin[i]->set_custom_label_color(true, c);
}
}
}
void EditorPropertyProjection::_bind_methods() {
ClassDB::bind_method(D_METHOD("_value_changed"), &EditorPropertyProjection::_value_changed);
}
void EditorPropertyProjection::setup(double p_min, double p_max, double p_step, bool p_no_slider) {
for (int i = 0; i < 16; i++) {
spin[i]->set_min(p_min);
spin[i]->set_max(p_max);
spin[i]->set_step(p_step);
spin[i]->set_hide_slider(p_no_slider);
spin[i]->set_allow_greater(true);
spin[i]->set_allow_lesser(true);
}
}
EditorPropertyProjection::EditorPropertyProjection() {
GridContainer *g = memnew(GridContainer);
g->set_columns(4);
add_child(g);
static const char *desc[16] = { "x", "y", "z", "w", "x", "y", "z", "w", "x", "y", "z", "w", "x", "y", "z", "w" };
for (int i = 0; i < 16; i++) {
spin[i] = memnew(EditorSpinSlider);
spin[i]->set_label(desc[i]);
spin[i]->set_flat(true);
g->add_child(spin[i]);
spin[i]->set_h_size_flags(SIZE_EXPAND_FILL);
add_focusable(spin[i]);
spin[i]->connect("value_changed", this, "_value_changed", varray(desc[i]));
}
set_bottom_editor(g);
setting = false;
}
////////////// COLOR PICKER //////////////////////
void EditorPropertyColor::_color_changed(const Color &p_color) {
@ -3331,6 +3608,37 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
// math types
case Variant::RECT2: {
EditorPropertyRect2 *editor = memnew(EditorPropertyRect2);
double min = -65535, max = 65535, step = default_float_step;
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
min = p_hint_text.get_slice(",", 0).to_double();
max = p_hint_text.get_slice(",", 1).to_double();
if (p_hint_text.get_slice_count(",") >= 3) {
step = p_hint_text.get_slice(",", 2).to_double();
}
hide_slider = false;
}
editor->setup(min, max, step, hide_slider);
add_property_editor(p_path, editor);
} break;
case Variant::RECT2I: {
EditorPropertyRect2i *editor = memnew(EditorPropertyRect2i);
double min = -65535, max = 65535;
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
min = p_hint_text.get_slice(",", 0).to_double();
max = p_hint_text.get_slice(",", 1).to_double();
hide_slider = false;
}
editor->setup(min, max, hide_slider);
add_property_editor(p_path, editor);
} break;
case Variant::VECTOR2: {
EditorPropertyVector2 *editor = memnew(EditorPropertyVector2);
double min = -65535, max = 65535, step = default_float_step;
@ -3364,37 +3672,6 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
add_property_editor(p_path, editor);
} break;
case Variant::RECT2: {
EditorPropertyRect2 *editor = memnew(EditorPropertyRect2);
double min = -65535, max = 65535, step = default_float_step;
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
min = p_hint_text.get_slice(",", 0).to_double();
max = p_hint_text.get_slice(",", 1).to_double();
if (p_hint_text.get_slice_count(",") >= 3) {
step = p_hint_text.get_slice(",", 2).to_double();
}
hide_slider = false;
}
editor->setup(min, max, step, hide_slider);
add_property_editor(p_path, editor);
} break;
case Variant::RECT2I: {
EditorPropertyRect2i *editor = memnew(EditorPropertyRect2i);
double min = -65535, max = 65535;
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
min = p_hint_text.get_slice(",", 0).to_double();
max = p_hint_text.get_slice(",", 1).to_double();
hide_slider = false;
}
editor->setup(min, max, hide_slider);
add_property_editor(p_path, editor);
} break;
case Variant::VECTOR3: {
EditorPropertyVector3 *editor = memnew(EditorPropertyVector3);
double min = -65535, max = 65535, step = default_float_step;
@ -3428,8 +3705,8 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
add_property_editor(p_path, editor);
} break;
case Variant::TRANSFORM2D: {
EditorPropertyTransform2D *editor = memnew(EditorPropertyTransform2D);
case Variant::VECTOR4: {
EditorPropertyVector4 *editor = memnew(EditorPropertyVector4);
double min = -65535, max = 65535, step = default_float_step;
bool hide_slider = true;
@ -3445,6 +3722,21 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
editor->setup(min, max, step, hide_slider);
add_property_editor(p_path, editor);
} break;
case Variant::VECTOR4I: {
EditorPropertyVector4i *editor = memnew(EditorPropertyVector4i);
double min = -65535, max = 65535;
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
min = p_hint_text.get_slice(",", 0).to_double();
max = p_hint_text.get_slice(",", 1).to_double();
hide_slider = false;
}
editor->setup(min, max, hide_slider);
add_property_editor(p_path, editor);
} break;
case Variant::PLANE: {
EditorPropertyPlane *editor = memnew(EditorPropertyPlane);
@ -3531,6 +3823,42 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
editor->setup(min, max, step, hide_slider);
add_property_editor(p_path, editor);
} break;
case Variant::TRANSFORM2D: {
EditorPropertyTransform2D *editor = memnew(EditorPropertyTransform2D);
double min = -65535, max = 65535, step = default_float_step;
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
min = p_hint_text.get_slice(",", 0).to_double();
max = p_hint_text.get_slice(",", 1).to_double();
if (p_hint_text.get_slice_count(",") >= 3) {
step = p_hint_text.get_slice(",", 2).to_double();
}
hide_slider = false;
}
editor->setup(min, max, step, hide_slider);
add_property_editor(p_path, editor);
} break;
case Variant::PROJECTION: {
EditorPropertyProjection *editor = memnew(EditorPropertyProjection);
double min = -65535, max = 65535, step = default_float_step;
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
min = p_hint_text.get_slice(",", 0).to_double();
max = p_hint_text.get_slice(",", 1).to_double();
if (p_hint_text.get_slice_count(",") >= 3) {
step = p_hint_text.get_slice(",", 2).to_double();
}
hide_slider = false;
}
editor->setup(min, max, step, hide_slider);
add_property_editor(p_path, editor);
} break;
// misc types
@ -3552,7 +3880,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
add_property_editor(p_path, editor);
} break; // 15
case Variant::_RID: {
case Variant::RID: {
EditorPropertyRID *editor = memnew(EditorPropertyRID);
add_property_editor(p_path, editor);
} break;
@ -3640,6 +3968,16 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
editor->setup(Variant::POOL_VECTOR3I_ARRAY);
add_property_editor(p_path, editor);
} break; // 25
case Variant::POOL_VECTOR4_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_VECTOR4_ARRAY);
add_property_editor(p_path, editor);
} break; // 25
case Variant::POOL_VECTOR4I_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_VECTOR4I_ARRAY);
add_property_editor(p_path, editor);
} break; // 25
case Variant::POOL_COLOR_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_COLOR_ARRAY);

View File

@ -34,6 +34,8 @@
#include "core/color.h"
#include "core/math/vector2.h"
#include "core/math/vector3.h"
#include "core/math/vector4.h"
#include "core/node_path.h"
#include "core/object.h"
#include "core/reference.h"
@ -516,6 +518,40 @@ public:
EditorPropertyVector3i();
};
class EditorPropertyVector4 : public EditorProperty {
GDCLASS(EditorPropertyVector4, EditorProperty);
EditorSpinSlider *spin[4];
bool setting;
void _value_changed(double p_val, const String &p_name);
protected:
void _notification(int p_what);
static void _bind_methods();
public:
virtual void update_property();
virtual void update_using_vector(Vector4 p_vector);
virtual Vector4 get_vector();
void setup(double p_min, double p_max, double p_step, bool p_no_slider);
EditorPropertyVector4();
};
class EditorPropertyVector4i : public EditorProperty {
GDCLASS(EditorPropertyVector4i, EditorProperty);
EditorSpinSlider *spin[4];
bool setting;
void _value_changed(double p_val, const String &p_name);
protected:
void _notification(int p_what);
static void _bind_methods();
public:
virtual void update_property();
void setup(int p_min, int p_max, bool p_no_slider);
EditorPropertyVector4i();
};
class EditorPropertyPlane : public EditorProperty {
GDCLASS(EditorPropertyPlane, EditorProperty);
EditorSpinSlider *spin[4];
@ -613,6 +649,23 @@ public:
EditorPropertyTransform();
};
class EditorPropertyProjection : public EditorProperty {
GDCLASS(EditorPropertyProjection, EditorProperty);
EditorSpinSlider *spin[16];
bool setting;
void _value_changed(double p_val, const String &p_name);
protected:
void _notification(int p_what);
static void _bind_methods();
public:
virtual void update_property();
virtual void update_using_projection(Projection p_projection);
void setup(double p_min, double p_max, double p_step, bool p_no_slider);
EditorPropertyProjection();
};
class EditorPropertyColor : public EditorProperty {
GDCLASS(EditorPropertyColor, EditorProperty);
ColorPickerButton *picker;

View File

@ -30,26 +30,25 @@
#include "editor_properties_array_dict.h"
#include "core/io/marshalls.h"
#include "core/os/input.h"
#include "editor/editor_node.h"
#include "editor/editor_scale.h"
#include "editor_properties.h"
#include "scene/main/viewport.h"
#include "core/class_db.h"
#include "core/color.h"
#include "core/error_macros.h"
#include "core/io/marshalls.h"
#include "core/io/resource_loader.h"
#include "core/math/math_defs.h"
#include "core/math/rect2.h"
#include "core/os/input.h"
#include "core/os/input_event.h"
#include "core/os/memory.h"
#include "core/resource.h"
#include "core/typedefs.h"
#include "core/vector.h"
#include "editor/editor_file_system.h"
#include "editor/editor_node.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
#include "editor/editor_spin_slider.h"
#include "editor_properties.h"
#include "scene/gui/box_container.h"
#include "scene/gui/button.h"
#include "scene/gui/control.h"
@ -57,6 +56,7 @@
#include "scene/gui/panel_container.h"
#include "scene/gui/popup_menu.h"
#include "scene/main/node.h"
#include "scene/main/viewport.h"
#include "scene/resources/style_box.h"
bool EditorPropertyArrayObject::_set(const StringName &p_name, const Variant &p_value) {
@ -267,6 +267,14 @@ void EditorPropertyArray::update_property() {
case Variant::POOL_VECTOR3I_ARRAY: {
arrtype = "PoolVector3iArray";
} break;
case Variant::POOL_VECTOR4_ARRAY: {
arrtype = "PoolVector4Array";
} break;
case Variant::POOL_VECTOR4I_ARRAY: {
arrtype = "PoolVector4iArray";
} break;
case Variant::POOL_COLOR_ARRAY: {
arrtype = "PoolColorArray";
@ -959,19 +967,7 @@ void EditorPropertyDictionary::update_property() {
} break;
// Math types.
case Variant::VECTOR2: {
EditorPropertyVector2 *editor = memnew(EditorPropertyVector2);
editor->setup(-100000, 100000, 0.001, true);
prop = editor;
} break;
case Variant::VECTOR2I: {
EditorPropertyVector2i *editor = memnew(EditorPropertyVector2i);
editor->setup(-100000, 100000, true);
prop = editor;
} break;
// Math types.
case Variant::RECT2: {
EditorPropertyRect2 *editor = memnew(EditorPropertyRect2);
editor->setup(-100000, 100000, 0.001, true);
@ -984,6 +980,19 @@ void EditorPropertyDictionary::update_property() {
prop = editor;
} break;
case Variant::VECTOR2: {
EditorPropertyVector2 *editor = memnew(EditorPropertyVector2);
editor->setup(-100000, 100000, 0.001, true);
prop = editor;
} break;
case Variant::VECTOR2I: {
EditorPropertyVector2i *editor = memnew(EditorPropertyVector2i);
editor->setup(-100000, 100000, true);
prop = editor;
} break;
case Variant::VECTOR3: {
EditorPropertyVector3 *editor = memnew(EditorPropertyVector3);
editor->setup(-100000, 100000, 0.001, true);
@ -996,11 +1005,17 @@ void EditorPropertyDictionary::update_property() {
prop = editor;
} break;
case Variant::TRANSFORM2D: {
EditorPropertyTransform2D *editor = memnew(EditorPropertyTransform2D);
case Variant::VECTOR4: {
EditorPropertyVector4 *editor = memnew(EditorPropertyVector4);
editor->setup(-100000, 100000, 0.001, true);
prop = editor;
} break;
case Variant::VECTOR4I: {
EditorPropertyVector4i *editor = memnew(EditorPropertyVector4i);
editor->setup(-100000, 100000, true);
prop = editor;
} break;
case Variant::PLANE: {
EditorPropertyPlane *editor = memnew(EditorPropertyPlane);
@ -1031,6 +1046,18 @@ void EditorPropertyDictionary::update_property() {
editor->setup(-100000, 100000, 0.001, true);
prop = editor;
} break;
case Variant::TRANSFORM2D: {
EditorPropertyTransform2D *editor = memnew(EditorPropertyTransform2D);
editor->setup(-100000, 100000, 0.001, true);
prop = editor;
} break;
case Variant::PROJECTION: {
EditorPropertyProjection *editor = memnew(EditorPropertyProjection);
editor->setup(-100000, 100000, 0.001, true);
prop = editor;
} break;
// Miscellaneous types.
@ -1042,7 +1069,7 @@ void EditorPropertyDictionary::update_property() {
prop = memnew(EditorPropertyNodePath);
} break;
case Variant::_RID: {
case Variant::RID: {
prop = memnew(EditorPropertyRID);
} break;
@ -1117,6 +1144,16 @@ void EditorPropertyDictionary::update_property() {
editor->setup(Variant::POOL_VECTOR3I_ARRAY);
prop = editor;
} break;
case Variant::POOL_VECTOR4_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_VECTOR4_ARRAY);
prop = editor;
} break;
case Variant::POOL_VECTOR4I_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_VECTOR4I_ARRAY);
prop = editor;
} break;
case Variant::POOL_COLOR_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_COLOR_ARRAY);

View File

@ -55,6 +55,7 @@ def make_editor_icons_action(target, source, env):
#hack
icon_name = icon_name.replace("Vector2I", "Vector2i")
icon_name = icon_name.replace("Vector3I", "Vector3i")
icon_name = icon_name.replace("Vector4I", "Vector4i")
icon_name = icon_name.replace("Rect2I", "Rect2i")
icon_name = icon_name.replace("_", "")

View File

@ -0,0 +1 @@
<svg height="12" viewBox="0 0 16 12" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m0 0v12h4v-2h-2v-8h2v-2zm12 0v2h2v8h-2v2h4v-12z" fill="#e0e0e0"/><path d="m6 2a3 3 0 0 0 -3 3v5h2v-2h1v-2h-1v-1a1 1 0 0 1 1-1zm1 0v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1-1v-5zm3 0v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1-1v-1h1v-2h-1v-2z" fill="#61daf4"/><path d="m7 2v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1-1v-5z" fill="#fff" fill-opacity=".39216"/></svg>

After

Width:  |  Height:  |  Size: 426 B

View File

@ -0,0 +1 @@
<svg height="12" viewBox="0 0 16 12" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m0 0v12h4v-2h-2v-8h2v-2zm12 0v2h2v8h-2v2h4v-12z" fill="#e0e0e0"/><path d="m6 2a3 3 0 0 0 -3 3v5h2v-2h1v-2h-1v-1a1 1 0 0 1 1-1zm1 0v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1-1v-5zm3 0v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1-1v-1h1v-2h-1v-2z" fill="#61daf4"/><path d="m7 2v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1-1v-5z" fill="#fff" fill-opacity=".39216"/></svg>

After

Width:  |  Height:  |  Size: 426 B

View File

@ -0,0 +1 @@
<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m9 1038.4a3 3 0 0 0 -2.9883 2.7774 3 3 0 0 0 -2.0117-.7774 3 3 0 0 0 -3 3 3 3 0 0 0 2 2.8243v2.1757c0 .554.44599 1 1 1h6c.55401 0 1-.446 1-1v-1l3 2v-6l-3 2v-1.7695a3 3 0 0 0 1-2.2305 3 3 0 0 0 -3-3z" fill="#fc9c9c" transform="translate(0 -1036.4)"/></svg>

After

Width:  |  Height:  |  Size: 348 B

View File

Before

Width:  |  Height:  |  Size: 499 B

After

Width:  |  Height:  |  Size: 499 B

View File

@ -0,0 +1 @@
<svg viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg"><path d="M1 4v6h2a3 3 0 0 0 3-3V4H4v3a1 1 0 0 1-1 1V4zm5 3a3 3 0 0 0 3 3h1V8H9a1 1 0 0 1 0-2h1V4H9a3 3 0 0 0-3 3z" fill="#de66f0"/><path d="m12.467 1.523-1.526 5.694 3.02-.015.044 3.795h1.98V5.116h-2.373l.943-3.595z" fill="#eba2f6"/></svg>

After

Width:  |  Height:  |  Size: 300 B

View File

@ -0,0 +1 @@
<svg viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg"><path d="M1 4v6h2a3 3 0 0 0 3-3V4H4v3a1 1 0 0 1-1 1V4zm5 3a3 3 0 0 0 3 3h1V8H9a1 1 0 0 1 0-2h1V4H9a3 3 0 0 0-3 3z" fill="#de66f0"/><path d="m12.467 1.523-1.526 5.694 3.02-.015.044 3.795h1.98V5.116h-2.373l.943-3.595z" fill="#eba2f6"/></svg>

After

Width:  |  Height:  |  Size: 300 B

View File

@ -388,7 +388,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
checks20[i]->hide();
}
type = (p_variant.get_type() != Variant::NIL && p_variant.get_type() != Variant::_RID && p_type != Variant::OBJECT) ? p_variant.get_type() : p_type;
type = (p_variant.get_type() != Variant::NIL && p_variant.get_type() != Variant::RID && p_type != Variant::OBJECT) ? p_variant.get_type() : p_type;
switch (type) {
case Variant::BOOL: {

View File

@ -30,8 +30,6 @@
#include "property_selector.h"
#include "core/os/keyboard.h"
#include "editor/editor_node.h"
#include "core/class_db.h"
#include "core/color.h"
#include "core/error_macros.h"
@ -39,12 +37,14 @@
#include "core/map.h"
#include "core/method_bind.h"
#include "core/os/input_event.h"
#include "core/os/keyboard.h"
#include "core/os/memory.h"
#include "core/script_language.h"
#include "core/string_name.h"
#include "core/typedefs.h"
#include "editor/doc/doc_data.h"
#include "editor/editor_help.h"
#include "editor/editor_node.h"
#include "scene/gui/box_container.h"
#include "scene/gui/button.h"
#include "scene/gui/control.h"
@ -143,19 +143,26 @@ void PropertySelector::_update_search() {
Control::get_icon("int", "EditorIcons"),
Control::get_icon("float", "EditorIcons"),
Control::get_icon("String", "EditorIcons"),
Control::get_icon("Vector2", "EditorIcons"),
Control::get_icon("Rect2", "EditorIcons"),
Control::get_icon("Rect2i", "EditorIcons"),
Control::get_icon("Vector2", "EditorIcons"),
Control::get_icon("Vector2i", "EditorIcons"),
Control::get_icon("Vector3", "EditorIcons"),
Control::get_icon("Transform2D", "EditorIcons"),
Control::get_icon("Vector3i", "EditorIcons"),
Control::get_icon("Vector4", "EditorIcons"),
Control::get_icon("Vector4i", "EditorIcons"),
Control::get_icon("Plane", "EditorIcons"),
Control::get_icon("Quaternion", "EditorIcons"),
Control::get_icon("AABB", "EditorIcons"),
Control::get_icon("Basis", "EditorIcons"),
Control::get_icon("Transform", "EditorIcons"),
Control::get_icon("Transform2D", "EditorIcons"),
Control::get_icon("Projection", "EditorIcons"),
Control::get_icon("Color", "EditorIcons"),
Control::get_icon("Path", "EditorIcons"),
Control::get_icon("RID", "EditorIcons"),
Control::get_icon("Object", "EditorIcons"),
Control::get_icon("StringName", "EditorIcons"),
Control::get_icon("Dictionary", "EditorIcons"),
Control::get_icon("Array", "EditorIcons"),
Control::get_icon("PoolByteArray", "EditorIcons"),
@ -163,7 +170,11 @@ void PropertySelector::_update_search() {
Control::get_icon("PoolRealArray", "EditorIcons"),
Control::get_icon("PoolStringArray", "EditorIcons"),
Control::get_icon("PoolVector2Array", "EditorIcons"),
Control::get_icon("PoolVector2iArray", "EditorIcons"),
Control::get_icon("PoolVector3Array", "EditorIcons"),
Control::get_icon("PoolVector3iArray", "EditorIcons"),
Control::get_icon("PoolVector4Array", "EditorIcons"),
Control::get_icon("PoolVector4iArray", "EditorIcons"),
Control::get_icon("PoolColorArray", "EditorIcons")
};

View File

@ -1836,7 +1836,7 @@ void ScriptEditorDebugger::_method_changed(Object *p_base, const StringName &p_n
for (int i = 0; i < VARIANT_ARG_MAX; i++) {
//no pointers, sorry
if (argptr[i] && (argptr[i]->get_type() == Variant::OBJECT || argptr[i]->get_type() == Variant::_RID)) {
if (argptr[i] && (argptr[i]->get_type() == Variant::OBJECT || argptr[i]->get_type() == Variant::RID)) {
return;
}
}

View File

@ -358,7 +358,7 @@ public:
void test_vec(Plane p_vec) {
Projection cm;
cm.set_perspective(45, 1, 0, 100);
Plane v0 = cm.xform4(p_vec);
Plane v0 = cm.xform(p_vec);
print_line("out: " + v0);
v0.normal.z = (v0.d / 100.0 * 2.0 - 1.0) * v0.d;

View File

@ -2173,10 +2173,11 @@ static void _find_identifiers(const CScriptCompletionContext &p_context, bool p_
}
static const char *_type_names[Variant::VARIANT_MAX] = {
"null", "bool", "int", "float", "String", "Vector2", "Vector2i", "Rect2", "Rect2i", "Vector3", "Vector3i", "Transform2D", "Plane",
"Quaternion", "AABB", "Basis", "Transform", "Color", "NodePath", "RID", "Object", "Dictionary", "Array",
"PoolByteArray", "PoolIntArray", "PoolRealArray", "PoolStringArray",
"PoolVector2Array", "PoolVector2iArray", "PoolVector3Array", "PoolVector3iArray", "PoolColorArray"
"null", "bool", "int", "float", "String", "Rect2", "Rect2i", "Vector2", "Vector2i", "Vector3", "Vector3i", "Vector4", "Vector4i",
"Plane", "Quaternion", "AABB", "Basis", "Transform", "Transform2D", "Projection", "Color", "NodePath",
"RID", "Object", "StringName", "Dictionary", "Array", "PoolByteArray", "PoolIntArray", "PoolRealArray", "PoolStringArray",
"PoolVector2Array", "PoolVector2iArray", "PoolVector3Array", "PoolVector3iArray",
"PoolVector4Array", "PoolVector4iArray", "PoolColorArray"
};
for (int i = 0; i < Variant::VARIANT_MAX; i++) {

View File

@ -1371,6 +1371,14 @@ void CScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_c
PoolVector<Vector3i> d = *p_args[0];
r_ret = d.size();
} break;
case Variant::POOL_VECTOR4_ARRAY: {
PoolVector<Vector4> d = *p_args[0];
r_ret = d.size();
} break;
case Variant::POOL_VECTOR4I_ARRAY: {
PoolVector<Vector4i> d = *p_args[0];
r_ret = d.size();
} break;
case Variant::POOL_COLOR_ARRAY: {
PoolVector<Color> d = *p_args[0];
r_ret = d.size();

View File

@ -6543,6 +6543,8 @@ CScriptParser::DataType CScriptParser::_reduce_node_type(Node *p_node) {
case Variant::POOL_VECTOR2I_ARRAY:
case Variant::POOL_VECTOR3_ARRAY:
case Variant::POOL_VECTOR3I_ARRAY:
case Variant::POOL_VECTOR4_ARRAY:
case Variant::POOL_VECTOR4I_ARRAY:
case Variant::ARRAY:
case Variant::STRING: {
error = index_type.builtin_type != Variant::INT && index_type.builtin_type != Variant::REAL;
@ -6561,9 +6563,12 @@ CScriptParser::DataType CScriptParser::_reduce_node_type(Node *p_node) {
case Variant::VECTOR2I:
case Variant::VECTOR3:
case Variant::VECTOR3I:
case Variant::VECTOR4:
case Variant::VECTOR4I:
case Variant::TRANSFORM2D:
case Variant::BASIS:
case Variant::TRANSFORM: {
case Variant::TRANSFORM:
case Variant::PROJECTION: {
error = index_type.builtin_type != Variant::INT && index_type.builtin_type != Variant::REAL &&
index_type.builtin_type != Variant::STRING;
} break;
@ -6595,7 +6600,11 @@ CScriptParser::DataType CScriptParser::_reduce_node_type(Node *p_node) {
case Variant::POOL_REAL_ARRAY:
case Variant::POOL_STRING_ARRAY:
case Variant::POOL_VECTOR2_ARRAY:
case Variant::POOL_VECTOR3_ARRAY: {
case Variant::POOL_VECTOR2I_ARRAY:
case Variant::POOL_VECTOR3_ARRAY:
case Variant::POOL_VECTOR3I_ARRAY:
case Variant::POOL_VECTOR4_ARRAY:
case Variant::POOL_VECTOR4I_ARRAY: {
break;
}
default: {
@ -6636,12 +6645,15 @@ CScriptParser::DataType CScriptParser::_reduce_node_type(Node *p_node) {
case Variant::INT:
case Variant::REAL:
case Variant::NODE_PATH:
case Variant::_RID: {
case Variant::RID: {
_set_error("Can't index on a value of type \"" + base_type.to_string() + "\".", op->line);
return DataType();
} break;
// Return int
case Variant::POOL_BYTE_ARRAY:
case Variant::VECTOR2I:
case Variant::VECTOR3I:
case Variant::VECTOR4I:
case Variant::POOL_INT_ARRAY: {
result.builtin_type = Variant::INT;
} break;
@ -6649,6 +6661,7 @@ CScriptParser::DataType CScriptParser::_reduce_node_type(Node *p_node) {
case Variant::POOL_REAL_ARRAY:
case Variant::VECTOR2:
case Variant::VECTOR3:
case Variant::VECTOR4:
case Variant::QUATERNION: {
result.builtin_type = Variant::REAL;
} break;
@ -6666,12 +6679,22 @@ CScriptParser::DataType CScriptParser::_reduce_node_type(Node *p_node) {
case Variant::TRANSFORM2D:
case Variant::RECT2: {
result.builtin_type = Variant::VECTOR2;
} break;
case Variant::POOL_VECTOR2I_ARRAY:
case Variant::RECT2I: {
result.builtin_type = Variant::VECTOR2I;
} break;
// Return Vector3
case Variant::POOL_VECTOR3_ARRAY:
case Variant::AABB:
case Variant::BASIS: {
result.builtin_type = Variant::VECTOR3;
} break;
case Variant::POOL_VECTOR3I_ARRAY: {
result.builtin_type = Variant::VECTOR3I;
} break;
case Variant::PROJECTION: {
result.builtin_type = Variant::VECTOR4;
} break;
// Depends on the index
case Variant::TRANSFORM:

View File

@ -141,23 +141,26 @@ static const _bit _type_list[] = {
{ Variant::INT, "int" },
{ Variant::REAL, "float" },
{ Variant::STRING, "String" },
{ Variant::VECTOR2, "Vector2" },
{ Variant::VECTOR2I, "Vector2i" },
{ Variant::RECT2, "Rect2" },
{ Variant::RECT2I, "Rect2i" },
{ Variant::TRANSFORM2D, "Transform2D" },
{ Variant::VECTOR2, "Vector2" },
{ Variant::VECTOR2I, "Vector2i" },
{ Variant::VECTOR3, "Vector3" },
{ Variant::VECTOR3I, "Vector3i" },
{ Variant::AABB, "AABB" },
{ Variant::VECTOR4, "Vector4" },
{ Variant::VECTOR4I, "Vector4i" },
{ Variant::PLANE, "Plane" },
{ Variant::QUATERNION, "Quaternion" },
{ Variant::AABB, "AABB" },
{ Variant::BASIS, "Basis" },
{ Variant::TRANSFORM, "Transform" },
{ Variant::TRANSFORM2D, "Transform2D" },
{ Variant::PROJECTION, "Projection" },
{ Variant::COLOR, "Color" },
{ Variant::_RID, "RID" },
{ Variant::NODE_PATH, "NodePath" },
{ Variant::RID, "RID" },
{ Variant::OBJECT, "Object" },
{ Variant::STRING_NAME, "StringName" },
{ Variant::NODE_PATH, "NodePath" },
{ Variant::DICTIONARY, "Dictionary" },
{ Variant::ARRAY, "Array" },
{ Variant::POOL_BYTE_ARRAY, "PoolByteArray" },
@ -168,6 +171,8 @@ static const _bit _type_list[] = {
{ Variant::POOL_VECTOR2I_ARRAY, "PoolVector2iArray" },
{ Variant::POOL_VECTOR3_ARRAY, "PoolVector3Array" },
{ Variant::POOL_VECTOR3I_ARRAY, "PoolVector3iArray" },
{ Variant::POOL_VECTOR4_ARRAY, "PoolVector4Array" },
{ Variant::POOL_VECTOR4I_ARRAY, "PoolVector4iArray" },
{ Variant::POOL_COLOR_ARRAY, "PoolColorArray" },
{ Variant::VARIANT_MAX, nullptr },
};

View File

@ -550,7 +550,7 @@ void ItemTemplate::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_teaches_spells"), &ItemTemplate::get_teaches_spells);
ClassDB::bind_method(D_METHOD("set_teaches_spells", "spells"), &ItemTemplate::set_teaches_spells);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "teaches_spells", PROPERTY_HINT_NONE, "20/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_teaches_spells", "get_teaches_spells");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "teaches_spells", PROPERTY_HINT_NONE, "23/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_teaches_spells", "get_teaches_spells");
//// Grants Spells ////
ClassDB::bind_method(D_METHOD("get_num_grants_spells"), &ItemTemplate::get_num_grants_spells);
@ -561,7 +561,7 @@ void ItemTemplate::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_grants_spells"), &ItemTemplate::get_grants_spells);
ClassDB::bind_method(D_METHOD("set_grants_spells", "spells"), &ItemTemplate::set_grants_spells);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "grants_spells", PROPERTY_HINT_NONE, "20/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_grants_spells", "get_grants_spells");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "grants_spells", PROPERTY_HINT_NONE, "23/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_grants_spells", "get_grants_spells");
//// Auras ////
ClassDB::bind_method(D_METHOD("get_num_auras"), &ItemTemplate::get_num_auras);
@ -572,7 +572,7 @@ void ItemTemplate::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_auras"), &ItemTemplate::get_auras);
ClassDB::bind_method(D_METHOD("set_auras", "auras"), &ItemTemplate::set_auras);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "auras", PROPERTY_HINT_NONE, "20/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_auras", "get_auras");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "auras", PROPERTY_HINT_NONE, "23/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_auras", "get_auras");
//// Required Skills ////
ClassDB::bind_method(D_METHOD("get_num_required_skills"), &ItemTemplate::get_num_required_skills);
@ -582,7 +582,7 @@ void ItemTemplate::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_required_skills"), &ItemTemplate::get_required_skills);
ClassDB::bind_method(D_METHOD("set_required_skills", "auras"), &ItemTemplate::set_required_skills);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "required_skills", PROPERTY_HINT_NONE, "20/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_required_skills", "get_required_skills");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "required_skills", PROPERTY_HINT_NONE, "23/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_required_skills", "get_required_skills");
//Use spell
ClassDB::bind_method(D_METHOD("get_use_spell"), &ItemTemplate::get_use_spell);

View File

@ -96,5 +96,5 @@ void ModelVisual::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_visual_entries"), &ModelVisual::get_visual_entries);
ClassDB::bind_method(D_METHOD("set_visual_entries", "visual_entrys"), &ModelVisual::set_visual_entries);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "get_visual_entries", PROPERTY_HINT_NONE, "20/19:ModelVisualEntry", PROPERTY_USAGE_DEFAULT, "ModelVisualEntry"), "set_visual_entries", "get_visual_entries");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "get_visual_entries", PROPERTY_HINT_NONE, "23/19:ModelVisualEntry", PROPERTY_USAGE_DEFAULT, "ModelVisualEntry"), "set_visual_entries", "get_visual_entries");
}

View File

@ -202,7 +202,7 @@ void EntitySpeciesData::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_model_datas"), &EntitySpeciesData::get_model_datas);
ClassDB::bind_method(D_METHOD("set_model_datas", "model_datas"), &EntitySpeciesData::set_model_datas);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "model_datas", PROPERTY_HINT_NONE, "20/19:SpeciesModelData", PROPERTY_USAGE_DEFAULT, "SpeciesModelData"), "set_model_datas", "get_model_datas");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "model_datas", PROPERTY_HINT_NONE, "23/19:SpeciesModelData", PROPERTY_USAGE_DEFAULT, "SpeciesModelData"), "set_model_datas", "get_model_datas");
//Spells
ClassDB::bind_method(D_METHOD("get_spell", "index"), &EntitySpeciesData::get_spell);
@ -214,7 +214,7 @@ void EntitySpeciesData::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_spells"), &EntitySpeciesData::get_spells);
ClassDB::bind_method(D_METHOD("set_spells", "spells"), &EntitySpeciesData::set_spells);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells", PROPERTY_HINT_NONE, "20/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_spells", "get_spells");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells", PROPERTY_HINT_NONE, "23/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_spells", "get_spells");
//Auras
ClassDB::bind_method(D_METHOD("get_aura", "index"), &EntitySpeciesData::get_aura);
@ -226,5 +226,5 @@ void EntitySpeciesData::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_auras"), &EntitySpeciesData::get_auras);
ClassDB::bind_method(D_METHOD("set_auras", "auras"), &EntitySpeciesData::set_auras);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "auras", PROPERTY_HINT_NONE, "20/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_auras", "get_auras");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "auras", PROPERTY_HINT_NONE, "23/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_auras", "get_auras");
}

View File

@ -331,7 +331,7 @@ void SpeciesModelData::_get_property_list(List<PropertyInfo> *p_list) const {
int count = _customizable_slots_string.get_slice_count(",");
for (int i = 0; i < count; ++i) {
p_list->push_back(PropertyInfo(Variant::ARRAY, "customizable_slots/" + itos(i) + "_" + _customizable_slots_string.get_slicec(',', i), PROPERTY_HINT_NONE, "20/19:ModelVisualEntry", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL, "ModelVisualEntry"));
p_list->push_back(PropertyInfo(Variant::ARRAY, "customizable_slots/" + itos(i) + "_" + _customizable_slots_string.get_slicec(',', i), PROPERTY_HINT_NONE, "23/19:ModelVisualEntry", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL, "ModelVisualEntry"));
}
count = _customizable_color_slots_string.get_slice_count(",");
@ -339,7 +339,7 @@ void SpeciesModelData::_get_property_list(List<PropertyInfo> *p_list) const {
for (int i = 0; i < count; ++i) {
p_list->push_back(PropertyInfo(Variant::INT, "customizable_color_slots/" + itos(i) + "_" + _customizable_color_slots_string.get_slicec(',', i) + "/texture_layer", PROPERTY_HINT_ENUM, ESS::get_singleton()->texture_layers_get(), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED));
p_list->push_back(PropertyInfo(Variant::INT, "customizable_color_slots/" + itos(i) + "_" + _customizable_color_slots_string.get_slicec(',', i) + "/bone_slot_mask", PROPERTY_HINT_FLAGS, ESS::get_singleton()->skeletons_bones_index_get(_bone_structure), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL));
p_list->push_back(PropertyInfo(Variant::ARRAY, "customizable_color_slots/" + itos(i) + "_" + _customizable_color_slots_string.get_slicec(',', i) + "/colors", PROPERTY_HINT_NONE, "20/19:Color", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL, "Color"));
p_list->push_back(PropertyInfo(Variant::ARRAY, "customizable_color_slots/" + itos(i) + "_" + _customizable_color_slots_string.get_slicec(',', i) + "/colors", PROPERTY_HINT_NONE, "23/19:Color", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL, "Color"));
}
}
void SpeciesModelData::_validate_property(PropertyInfo &property) const {

View File

@ -2728,7 +2728,7 @@ void Spell::_bind_methods() {
ClassDB::bind_method(D_METHOD("spells_cast_on_caster_get"), &Spell::spells_cast_on_caster_get);
ClassDB::bind_method(D_METHOD("spells_cast_on_caster_set", "caster_aura_applys"), &Spell::spells_cast_on_caster_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells_cast_on_caster", PROPERTY_HINT_NONE, "20/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "spells_cast_on_caster_set", "spells_cast_on_caster_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells_cast_on_caster", PROPERTY_HINT_NONE, "23/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "spells_cast_on_caster_set", "spells_cast_on_caster_get");
//ADD_GROUP("Target Aura Apply", "target_aura_applys");
ClassDB::bind_method(D_METHOD("spells_cast_on_target_num_get"), &Spell::spells_cast_on_target_num_get);
@ -2739,7 +2739,7 @@ void Spell::_bind_methods() {
ClassDB::bind_method(D_METHOD("spells_cast_on_target_get"), &Spell::spells_cast_on_target_get);
ClassDB::bind_method(D_METHOD("spells_cast_on_target_set", "target_aura_applys"), &Spell::spells_cast_on_target_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells_cast_on_target", PROPERTY_HINT_NONE, "20/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "spells_cast_on_target_set", "spells_cast_on_target_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells_cast_on_target", PROPERTY_HINT_NONE, "23/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "spells_cast_on_target_set", "spells_cast_on_target_get");
//ADD_GROUP("Apply Auras On Learn", "on_learn_auras");
ClassDB::bind_method(D_METHOD("on_learn_cast_spells_num_get"), &Spell::on_learn_cast_spells_num_get);
@ -2750,7 +2750,7 @@ void Spell::_bind_methods() {
ClassDB::bind_method(D_METHOD("spells_cast_on_learn_get"), &Spell::spells_cast_on_learn_get);
ClassDB::bind_method(D_METHOD("spells_cast_on_learn_set", "spells"), &Spell::spells_cast_on_learn_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells_cast_on_learn", PROPERTY_HINT_NONE, "20/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "spells_cast_on_learn_set", "spells_cast_on_learn_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells_cast_on_learn", PROPERTY_HINT_NONE, "23/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "spells_cast_on_learn_set", "spells_cast_on_learn_get");
ADD_GROUP("Texts", "text");
BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::STRING, "desc"), "_get_description", PropertyInfo(Variant::INT, "class_level"), PropertyInfo(Variant::INT, "character_level")));

View File

@ -312,11 +312,11 @@ void ESSResourceDBStatic::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_remap_ids", "value"), &ESSResourceDBStatic::set_remap_ids);
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "remap_ids"), "set_remap_ids", "get_remap_ids");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "entity_resources", PROPERTY_HINT_NONE, "20/19:EntityResource", PROPERTY_USAGE_DEFAULT, "EntityResource"), "set_entity_resources", "get_entity_resources");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "entity_skills", PROPERTY_HINT_NONE, "20/19:EntitySkillData", PROPERTY_USAGE_DEFAULT, "EntitySkillData"), "set_entity_skills", "get_entity_skills");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "entity_datas", PROPERTY_HINT_NONE, "20/19:EntityData", PROPERTY_USAGE_DEFAULT, "EntityData"), "set_entity_datas", "get_entity_datas");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells", PROPERTY_HINT_NONE, "20/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_spells", "get_spells");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "craft_recipes", PROPERTY_HINT_NONE, "20/19:CraftRecipe", PROPERTY_USAGE_DEFAULT, "CraftRecipe"), "set_craft_recipes", "get_craft_recipes");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "item_templates", PROPERTY_HINT_NONE, "20/19:ItemTemplate", PROPERTY_USAGE_DEFAULT, "ItemTemplate"), "set_item_templates", "get_item_templates");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "entity_species_datas", PROPERTY_HINT_NONE, "20/19:EntitySpeciesData", PROPERTY_USAGE_DEFAULT, "EntitySpeciesData"), "set_entity_species_datas", "get_entity_species_datas");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "entity_resources", PROPERTY_HINT_NONE, "23/19:EntityResource", PROPERTY_USAGE_DEFAULT, "EntityResource"), "set_entity_resources", "get_entity_resources");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "entity_skills", PROPERTY_HINT_NONE, "23/19:EntitySkillData", PROPERTY_USAGE_DEFAULT, "EntitySkillData"), "set_entity_skills", "get_entity_skills");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "entity_datas", PROPERTY_HINT_NONE, "23/19:EntityData", PROPERTY_USAGE_DEFAULT, "EntityData"), "set_entity_datas", "get_entity_datas");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells", PROPERTY_HINT_NONE, "23/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_spells", "get_spells");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "craft_recipes", PROPERTY_HINT_NONE, "23/19:CraftRecipe", PROPERTY_USAGE_DEFAULT, "CraftRecipe"), "set_craft_recipes", "get_craft_recipes");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "item_templates", PROPERTY_HINT_NONE, "23/19:ItemTemplate", PROPERTY_USAGE_DEFAULT, "ItemTemplate"), "set_item_templates", "get_item_templates");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "entity_species_datas", PROPERTY_HINT_NONE, "23/19:EntitySpeciesData", PROPERTY_USAGE_DEFAULT, "EntitySpeciesData"), "set_entity_species_datas", "get_entity_species_datas");
}

View File

@ -415,7 +415,7 @@ void EntityClassData::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_entity_resources"), &EntityClassData::get_entity_resources);
ClassDB::bind_method(D_METHOD("set_entity_resources", "entity_resources"), &EntityClassData::set_entity_resources);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "entity_resources", PROPERTY_HINT_NONE, "20/19:EntityResource", PROPERTY_USAGE_DEFAULT, "EntityResource"), "set_entity_resources", "get_entity_resources");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "entity_resources", PROPERTY_HINT_NONE, "23/19:EntityResource", PROPERTY_USAGE_DEFAULT, "EntityResource"), "set_entity_resources", "get_entity_resources");
ClassDB::bind_method(D_METHOD("_setup_resources", "entity"), &EntityClassData::_setup_resources);
@ -428,7 +428,7 @@ void EntityClassData::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_specs"), &EntityClassData::get_specs);
ClassDB::bind_method(D_METHOD("set_specs", "specs"), &EntityClassData::set_specs);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "specs", PROPERTY_HINT_NONE, "20/19:CharacterSpec", PROPERTY_USAGE_DEFAULT, "CharacterSpec"), "set_specs", "get_specs");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "specs", PROPERTY_HINT_NONE, "23/19:CharacterSpec", PROPERTY_USAGE_DEFAULT, "CharacterSpec"), "set_specs", "get_specs");
//// Spell ////
ClassDB::bind_method(D_METHOD("get_num_spells"), &EntityClassData::get_num_spells);
@ -439,7 +439,7 @@ void EntityClassData::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_spells"), &EntityClassData::get_spells);
ClassDB::bind_method(D_METHOD("set_spells", "spells"), &EntityClassData::set_spells);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells", PROPERTY_HINT_NONE, "20/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_spells", "get_spells");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells", PROPERTY_HINT_NONE, "23/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_spells", "get_spells");
//// Start Spells ////
ClassDB::bind_method(D_METHOD("get_num_start_spells"), &EntityClassData::get_num_start_spells);
@ -450,7 +450,7 @@ void EntityClassData::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_start_spells"), &EntityClassData::get_start_spells);
ClassDB::bind_method(D_METHOD("set_start_spells", "spells"), &EntityClassData::set_start_spells);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "start_spells", PROPERTY_HINT_NONE, "20/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_start_spells", "get_start_spells");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "start_spells", PROPERTY_HINT_NONE, "23/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_start_spells", "get_start_spells");
//// AURAS ////
ClassDB::bind_method(D_METHOD("get_num_auras"), &EntityClassData::get_num_auras);
@ -461,7 +461,7 @@ void EntityClassData::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_auras"), &EntityClassData::get_auras);
ClassDB::bind_method(D_METHOD("set_auras", "auras"), &EntityClassData::set_auras);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "auras", PROPERTY_HINT_NONE, "20/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_auras", "get_auras");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "auras", PROPERTY_HINT_NONE, "23/19:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_auras", "get_auras");
//Vendor
ClassDB::bind_method(D_METHOD("get_vendor_item_data"), &EntityClassData::get_vendor_item_data);
@ -485,7 +485,7 @@ void EntityClassData::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_craft_recipes"), &EntityClassData::get_craft_recipes);
ClassDB::bind_method(D_METHOD("set_craft_recipes", "recipe"), &EntityClassData::set_craft_recipes);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "craft_recipes", PROPERTY_HINT_NONE, "20/19:CraftRecipe", PROPERTY_USAGE_DEFAULT, "CraftRecipe"), "set_craft_recipes", "get_craft_recipes");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "craft_recipes", PROPERTY_HINT_NONE, "23/19:CraftRecipe", PROPERTY_USAGE_DEFAULT, "CraftRecipe"), "set_craft_recipes", "get_craft_recipes");
//// AI ACTIONS ////
ClassDB::bind_method(D_METHOD("get_num_ais"), &EntityClassData::get_num_ais);
@ -496,7 +496,7 @@ void EntityClassData::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_ais"), &EntityClassData::get_ais);
ClassDB::bind_method(D_METHOD("set_ais", "auras"), &EntityClassData::set_ais);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "ais", PROPERTY_HINT_NONE, "20/19:EntityAI", PROPERTY_USAGE_DEFAULT, "EntityAI"), "set_ais", "get_ais");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "ais", PROPERTY_HINT_NONE, "23/19:EntityAI", PROPERTY_USAGE_DEFAULT, "EntityAI"), "set_ais", "get_ais");
BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::OBJECT, "ret", PROPERTY_HINT_RESOURCE_TYPE, "EntityAI"), "_get_ai_instance"));

View File

@ -70,5 +70,5 @@ void ItemContainerData::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_container_datas"), &ItemContainerData::get_container_datas);
ClassDB::bind_method(D_METHOD("set_container_datas", "container_datas"), &ItemContainerData::set_container_datas);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "container_datas", PROPERTY_HINT_NONE, "20/19:ItemContainerDataEntry", PROPERTY_USAGE_DEFAULT, "ItemContainerDataEntry"), "set_container_datas", "get_container_datas");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "container_datas", PROPERTY_HINT_NONE, "23/19:ItemContainerDataEntry", PROPERTY_USAGE_DEFAULT, "ItemContainerDataEntry"), "set_container_datas", "get_container_datas");
}

View File

@ -64,5 +64,5 @@ void VendorItemData::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_vendor_datas"), &VendorItemData::get_vendor_datas);
ClassDB::bind_method(D_METHOD("set_vendor_datas", "vendor_datas"), &VendorItemData::set_vendor_datas);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "vendor_datas", PROPERTY_HINT_NONE, "20/19:VendorItemDataEntry", PROPERTY_USAGE_DEFAULT, "VendorItemDataEntry"), "set_vendor_datas", "get_vendor_datas");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "vendor_datas", PROPERTY_HINT_NONE, "23/19:VendorItemDataEntry", PROPERTY_USAGE_DEFAULT, "VendorItemDataEntry"), "set_vendor_datas", "get_vendor_datas");
}

View File

@ -7156,7 +7156,7 @@ void Entity::_bind_methods() {
ClassDB::bind_method(D_METHOD("sauras_get"), &Entity::sauras_get);
ClassDB::bind_method(D_METHOD("sauras_set", "data"), &Entity::sauras_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "sauras", PROPERTY_HINT_NONE, "20/19:AuraData", PROPERTY_USAGE_ENTITY_HIDDEN, "AuraData"), "sauras_set", "sauras_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "sauras", PROPERTY_HINT_NONE, "23/19:AuraData", PROPERTY_USAGE_ENTITY_HIDDEN, "AuraData"), "sauras_set", "sauras_get");
//Hooks
BIND_VMETHOD(MethodInfo("_moved"));
@ -7406,7 +7406,7 @@ void Entity::_bind_methods() {
ClassDB::bind_method(D_METHOD("sresources_get"), &Entity::sresources_get);
ClassDB::bind_method(D_METHOD("sresources_set", "caster_aura_applys"), &Entity::sresources_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "sresources", PROPERTY_HINT_NONE, "20/19:EntityResource", PROPERTY_USAGE_ENTITY_HIDDEN, "EntityResource"), "sresources_set", "sresources_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "sresources", PROPERTY_HINT_NONE, "23/19:EntityResource", PROPERTY_USAGE_ENTITY_HIDDEN, "EntityResource"), "sresources_set", "sresources_get");
//GCD
ADD_SIGNAL(MethodInfo("sgcd_started", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::REAL, "value")));
@ -7441,7 +7441,7 @@ void Entity::_bind_methods() {
ClassDB::bind_method(D_METHOD("sdatas_get"), &Entity::sdatas_get);
ClassDB::bind_method(D_METHOD("sdatas_set", "data"), &Entity::sdatas_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "sdatas", PROPERTY_HINT_NONE, "20/19:EntityDataContainer", PROPERTY_USAGE_ENTITY_HIDDEN, "EntityDataContainer"), "sdatas_set", "sdatas_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "sdatas", PROPERTY_HINT_NONE, "23/19:EntityDataContainer", PROPERTY_USAGE_ENTITY_HIDDEN, "EntityDataContainer"), "sdatas_set", "sdatas_get");
//States
ADD_SIGNAL(MethodInfo("sstate_changed", PropertyInfo(Variant::INT, "value")));
@ -7577,7 +7577,7 @@ void Entity::_bind_methods() {
ClassDB::bind_method(D_METHOD("sspells_get"), &Entity::sspells_get);
ClassDB::bind_method(D_METHOD("sspells_set", "data"), &Entity::sspells_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "sspells", PROPERTY_HINT_NONE, "20/19:Spell", PROPERTY_USAGE_ENTITY_HIDDEN, "Spell"), "sspells_set", "sspells_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "sspells", PROPERTY_HINT_NONE, "23/19:Spell", PROPERTY_USAGE_ENTITY_HIDDEN, "Spell"), "sspells_set", "sspells_get");
//Crafting
BIND_VMETHOD(MethodInfo("_crafts", PropertyInfo(Variant::INT, "id")));
@ -7612,7 +7612,7 @@ void Entity::_bind_methods() {
ClassDB::bind_method(D_METHOD("scraft_recipes_get"), &Entity::scraft_recipes_get);
ClassDB::bind_method(D_METHOD("scraft_recipes_set", "caster_aura_applys"), &Entity::scraft_recipes_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "scraft_recipes", PROPERTY_HINT_NONE, "20/19:CraftRecipe", PROPERTY_USAGE_ENTITY_HIDDEN, "CraftRecipe"), "scraft_recipes_set", "scraft_recipes_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "scraft_recipes", PROPERTY_HINT_NONE, "23/19:CraftRecipe", PROPERTY_USAGE_ENTITY_HIDDEN, "CraftRecipe"), "scraft_recipes_set", "scraft_recipes_get");
//Skills
ClassDB::bind_method(D_METHOD("skill_hass_id", "id"), &Entity::skill_hass_id);
@ -7636,7 +7636,7 @@ void Entity::_bind_methods() {
ClassDB::bind_method(D_METHOD("sskills_get"), &Entity::sskills_get);
ClassDB::bind_method(D_METHOD("sskills_set", "data"), &Entity::sskills_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "sskills", PROPERTY_HINT_NONE, "20/19:EntitySkill", PROPERTY_USAGE_ENTITY_HIDDEN, "EntitySkill"), "sskills_set", "sskills_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "sskills", PROPERTY_HINT_NONE, "23/19:EntitySkill", PROPERTY_USAGE_ENTITY_HIDDEN, "EntitySkill"), "sskills_set", "sskills_get");
//skeleton
ClassDB::bind_method(D_METHOD("get_body"), &Entity::get_body);

View File

@ -337,7 +337,7 @@ void ESSMaterialCache::_bind_methods() {
ClassDB::bind_method(D_METHOD("materials_get"), &ESSMaterialCache::materials_get);
ClassDB::bind_method(D_METHOD("materials_set"), &ESSMaterialCache::materials_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "20/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "23/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
ClassDB::bind_method(D_METHOD("texture_add", "texture"), &ESSMaterialCache::texture_add);
ClassDB::bind_method(D_METHOD("texture_remove", "texture"), &ESSMaterialCache::texture_remove);

View File

@ -855,7 +855,7 @@ void ESS::_bind_methods() {
ClassDB::bind_method(D_METHOD("materials_get"), &ESS::materials_get);
ClassDB::bind_method(D_METHOD("materials_set"), &ESS::materials_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "20/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "23/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
ClassDB::bind_method(D_METHOD("material_cache_get", "key"), &ESS::material_cache_get);
ClassDB::bind_method(D_METHOD("material_cache_unref", "key"), &ESS::material_cache_unref);

View File

@ -2183,10 +2183,11 @@ static void _find_identifiers(const GDScriptCompletionContext &p_context, bool p
}
static const char *_type_names[Variant::VARIANT_MAX] = {
"null", "bool", "int", "float", "String", "Vector2", "Vector2i", "Rect2", "Rect2i", "Vector3", "Vector3i", "Transform2D", "Plane",
"Quaternion", "AABB", "Basis", "Transform", "Color", "NodePath", "RID", "Object", "Dictionary", "Array",
"PoolByteArray", "PoolIntArray", "PoolRealArray", "PoolStringArray",
"PoolVector2Array", "PoolVector2iArray", "PoolVector3Array", "PoolVector3iArray", "PoolColorArray"
"null", "bool", "int", "float", "String", "Rect2", "Rect2i", "Vector2", "Vector2i", "Vector3", "Vector3i", "Vector4", "Vector4i",
"Plane", "Quaternion", "AABB", "Basis", "Transform", "Transform2D", "Projection", "Color", "NodePath",
"RID", "Object", "StringName", "Dictionary", "Array", "PoolByteArray", "PoolIntArray", "PoolRealArray", "PoolStringArray",
"PoolVector2Array", "PoolVector2iArray", "PoolVector3Array", "PoolVector3iArray",
"PoolVector4Array", "PoolVector4iArray", "PoolColorArray"
};
for (int i = 0; i < Variant::VARIANT_MAX; i++) {

View File

@ -1371,6 +1371,14 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
PoolVector<Vector3i> d = *p_args[0];
r_ret = d.size();
} break;
case Variant::POOL_VECTOR4_ARRAY: {
PoolVector<Vector4> d = *p_args[0];
r_ret = d.size();
} break;
case Variant::POOL_VECTOR4I_ARRAY: {
PoolVector<Vector4i> d = *p_args[0];
r_ret = d.size();
} break;
case Variant::POOL_COLOR_ARRAY: {
PoolVector<Color> d = *p_args[0];
r_ret = d.size();

View File

@ -6749,6 +6749,8 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
case Variant::POOL_VECTOR2I_ARRAY:
case Variant::POOL_VECTOR3_ARRAY:
case Variant::POOL_VECTOR3I_ARRAY:
case Variant::POOL_VECTOR4_ARRAY:
case Variant::POOL_VECTOR4I_ARRAY:
case Variant::ARRAY:
case Variant::STRING: {
error = index_type.builtin_type != Variant::INT && index_type.builtin_type != Variant::REAL;
@ -6767,9 +6769,12 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
case Variant::VECTOR2I:
case Variant::VECTOR3:
case Variant::VECTOR3I:
case Variant::VECTOR4:
case Variant::VECTOR4I:
case Variant::TRANSFORM2D:
case Variant::BASIS:
case Variant::TRANSFORM: {
case Variant::TRANSFORM:
case Variant::PROJECTION: {
error = index_type.builtin_type != Variant::INT && index_type.builtin_type != Variant::REAL &&
index_type.builtin_type != Variant::STRING;
} break;
@ -6801,7 +6806,11 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
case Variant::POOL_REAL_ARRAY:
case Variant::POOL_STRING_ARRAY:
case Variant::POOL_VECTOR2_ARRAY:
case Variant::POOL_VECTOR3_ARRAY: {
case Variant::POOL_VECTOR2I_ARRAY:
case Variant::POOL_VECTOR3_ARRAY:
case Variant::POOL_VECTOR3I_ARRAY:
case Variant::POOL_VECTOR4_ARRAY:
case Variant::POOL_VECTOR4I_ARRAY: {
break;
}
default: {
@ -6842,12 +6851,15 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
case Variant::INT:
case Variant::REAL:
case Variant::NODE_PATH:
case Variant::_RID: {
case Variant::RID: {
_set_error("Can't index on a value of type \"" + base_type.to_string() + "\".", op->line);
return DataType();
} break;
// Return int
case Variant::POOL_BYTE_ARRAY:
case Variant::VECTOR2I:
case Variant::VECTOR3I:
case Variant::VECTOR4I:
case Variant::POOL_INT_ARRAY: {
result.builtin_type = Variant::INT;
} break;
@ -6855,6 +6867,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
case Variant::POOL_REAL_ARRAY:
case Variant::VECTOR2:
case Variant::VECTOR3:
case Variant::VECTOR4:
case Variant::QUATERNION: {
result.builtin_type = Variant::REAL;
} break;
@ -6872,12 +6885,22 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
case Variant::TRANSFORM2D:
case Variant::RECT2: {
result.builtin_type = Variant::VECTOR2;
} break;
case Variant::POOL_VECTOR2I_ARRAY:
case Variant::RECT2I: {
result.builtin_type = Variant::VECTOR2I;
} break;
// Return Vector3
case Variant::POOL_VECTOR3_ARRAY:
case Variant::AABB:
case Variant::BASIS: {
result.builtin_type = Variant::VECTOR3;
} break;
case Variant::POOL_VECTOR3I_ARRAY: {
result.builtin_type = Variant::VECTOR3I;
} break;
case Variant::PROJECTION: {
result.builtin_type = Variant::VECTOR4;
} break;
// Depends on the index
case Variant::TRANSFORM:

View File

@ -150,23 +150,26 @@ static const _bit _type_list[] = {
{ Variant::INT, "int" },
{ Variant::REAL, "float" },
{ Variant::STRING, "String" },
{ Variant::VECTOR2, "Vector2" },
{ Variant::VECTOR2I, "Vector2i" },
{ Variant::RECT2, "Rect2" },
{ Variant::RECT2I, "Rect2i" },
{ Variant::TRANSFORM2D, "Transform2D" },
{ Variant::VECTOR2, "Vector2" },
{ Variant::VECTOR2I, "Vector2i" },
{ Variant::VECTOR3, "Vector3" },
{ Variant::VECTOR3I, "Vector3i" },
{ Variant::AABB, "AABB" },
{ Variant::VECTOR4, "Vector4" },
{ Variant::VECTOR4I, "Vector4i" },
{ Variant::PLANE, "Plane" },
{ Variant::QUATERNION, "Quaternion" },
{ Variant::AABB, "AABB" },
{ Variant::BASIS, "Basis" },
{ Variant::TRANSFORM, "Transform" },
{ Variant::TRANSFORM2D, "Transform2D" },
{ Variant::PROJECTION, "Projection" },
{ Variant::COLOR, "Color" },
{ Variant::_RID, "RID" },
{ Variant::NODE_PATH, "NodePath" },
{ Variant::RID, "RID" },
{ Variant::OBJECT, "Object" },
{ Variant::STRING_NAME, "StringName" },
{ Variant::NODE_PATH, "NodePath" },
{ Variant::DICTIONARY, "Dictionary" },
{ Variant::ARRAY, "Array" },
{ Variant::POOL_BYTE_ARRAY, "PoolByteArray" },
@ -177,6 +180,8 @@ static const _bit _type_list[] = {
{ Variant::POOL_VECTOR2I_ARRAY, "PoolVector2iArray" },
{ Variant::POOL_VECTOR3_ARRAY, "PoolVector3Array" },
{ Variant::POOL_VECTOR3I_ARRAY, "PoolVector3iArray" },
{ Variant::POOL_VECTOR4_ARRAY, "PoolVector4Array" },
{ Variant::POOL_VECTOR4I_ARRAY, "PoolVector4iArray" },
{ Variant::POOL_COLOR_ARRAY, "PoolColorArray" },
{ Variant::VARIANT_MAX, nullptr },
};

View File

@ -221,7 +221,7 @@ void MMMaterial::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_nodes"), &MMMaterial::get_nodes);
ClassDB::bind_method(D_METHOD("set_nodes", "value"), &MMMaterial::set_nodes);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "nodes", PROPERTY_HINT_NONE, "20/19:MMNode", PROPERTY_USAGE_DEFAULT, "MMNode"), "set_nodes", "get_nodes");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "nodes", PROPERTY_HINT_NONE, "23/19:MMNode", PROPERTY_USAGE_DEFAULT, "MMNode"), "set_nodes", "get_nodes");
ClassDB::bind_method(D_METHOD("get_initialized"), &MMMaterial::get_initialized);
ClassDB::bind_method(D_METHOD("set_initialized", "value"), &MMMaterial::set_initialized);

View File

@ -236,11 +236,11 @@ void MMNode::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_input_properties"), &MMNode::get_input_properties);
ClassDB::bind_method(D_METHOD("set_input_properties", "value"), &MMNode::set_input_properties);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "input_properties", PROPERTY_HINT_NONE, "20/19:MMNodeUniversalProperty", PROPERTY_USAGE_DEFAULT, "MMNodeUniversalProperty"), "set_input_properties", "get_input_properties");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "input_properties", PROPERTY_HINT_NONE, "23/19:MMNodeUniversalProperty", PROPERTY_USAGE_DEFAULT, "MMNodeUniversalProperty"), "set_input_properties", "get_input_properties");
ClassDB::bind_method(D_METHOD("get_output_properties"), &MMNode::get_output_properties);
ClassDB::bind_method(D_METHOD("set_output_properties", "value"), &MMNode::set_output_properties);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "output_properties", PROPERTY_HINT_NONE, "20/19:MMNodeUniversalProperty", PROPERTY_USAGE_DEFAULT, "MMNodeUniversalProperty"), "set_output_properties", "get_output_properties");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "output_properties", PROPERTY_HINT_NONE, "23/19:MMNodeUniversalProperty", PROPERTY_USAGE_DEFAULT, "MMNodeUniversalProperty"), "set_output_properties", "get_output_properties");
ClassDB::bind_method(D_METHOD("get_properties_initialized"), &MMNode::get_properties_initialized);
ClassDB::bind_method(D_METHOD("set_properties_initialized", "value"), &MMNode::set_properties_initialized);

View File

@ -329,7 +329,7 @@ void PropMaterialCache::_bind_methods() {
ClassDB::bind_method(D_METHOD("materials_get"), &PropMaterialCache::materials_get);
ClassDB::bind_method(D_METHOD("materials_set"), &PropMaterialCache::materials_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "20/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "23/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
ClassDB::bind_method(D_METHOD("texture_add", "texture"), &PropMaterialCache::texture_add);
ClassDB::bind_method(D_METHOD("texture_remove", "texture"), &PropMaterialCache::texture_remove);

View File

@ -957,7 +957,7 @@ void PropInstanceMerger::_bind_methods() {
ClassDB::bind_method(D_METHOD("materials_get"), &PropInstanceMerger::materials_get);
ClassDB::bind_method(D_METHOD("materials_set"), &PropInstanceMerger::materials_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "20/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "23/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
//Meshes
ClassDB::bind_method(D_METHOD("mesh_get", "index"), &PropInstanceMerger::mesh_get);

View File

@ -161,7 +161,7 @@ void PropData::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_props"), &PropData::get_props);
ClassDB::bind_method(D_METHOD("set_props", "props"), &PropData::set_props);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "20/19:PropDataEntry", PROPERTY_USAGE_DEFAULT, "PropDataEntry"), "set_props", "get_props");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "23/19:PropDataEntry", PROPERTY_USAGE_DEFAULT, "PropDataEntry"), "set_props", "get_props");
#if TEXTURE_PACKER_PRESENT
ClassDB::bind_method(D_METHOD("add_textures_into", "texture_packer"), &PropData::add_textures_into);

View File

@ -408,7 +408,7 @@ void PropCache::_bind_methods() {
ClassDB::bind_method(D_METHOD("materials_get"), &PropCache::materials_get);
ClassDB::bind_method(D_METHOD("materials_set"), &PropCache::materials_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "20/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "23/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
ClassDB::bind_method(D_METHOD("material_cache_get", "prop"), &PropCache::material_cache_get);
ClassDB::bind_method(D_METHOD("material_cache_unref", "prop"), &PropCache::material_cache_unref);

View File

@ -565,7 +565,7 @@ void TiledWallData::_bind_methods() {
ClassDB::bind_method(D_METHOD("materials_get"), &TiledWallData::materials_get);
ClassDB::bind_method(D_METHOD("materials_set"), &TiledWallData::materials_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "20/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "23/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
#if TEXTURE_PACKER_PRESENT
ClassDB::bind_method(D_METHOD("add_textures_into", "texture_packer"), &TiledWallData::add_textures_into);

View File

@ -139,7 +139,7 @@ void Prop2DData::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_props"), &Prop2DData::get_props);
ClassDB::bind_method(D_METHOD("set_props", "props"), &Prop2DData::set_props);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "20/19:Prop2DDataEntry", PROPERTY_USAGE_DEFAULT, "Prop2DDataEntry"), "set_props", "get_props");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "23/19:Prop2DDataEntry", PROPERTY_USAGE_DEFAULT, "Prop2DDataEntry"), "set_props", "get_props");
#if TEXTURE_PACKER_PRESENT
ClassDB::bind_method(D_METHOD("add_textures_into", "texture_packer"), &Prop2DData::add_textures_into);

View File

@ -255,7 +255,7 @@ void TiledWall2DData::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_textures"), &TiledWall2DData::get_textures);
ClassDB::bind_method(D_METHOD("set_textures", "textures"), &TiledWall2DData::set_textures);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "textures", PROPERTY_HINT_NONE, "20/19:Texture", PROPERTY_USAGE_DEFAULT, "Texture"), "set_textures", "get_textures");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "textures", PROPERTY_HINT_NONE, "23/19:Texture", PROPERTY_USAGE_DEFAULT, "Texture"), "set_textures", "get_textures");
//flavour_textures
ClassDB::bind_method(D_METHOD("get_flavour_texture", "index"), &TiledWall2DData::get_flavour_texture);
@ -267,7 +267,7 @@ void TiledWall2DData::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_flavour_textures"), &TiledWall2DData::get_flavour_textures);
ClassDB::bind_method(D_METHOD("set_flavour_textures", "textures"), &TiledWall2DData::set_flavour_textures);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "flavour_textures", PROPERTY_HINT_NONE, "20/19:Texture", PROPERTY_USAGE_DEFAULT, "Texture"), "set_flavour_textures", "get_flavour_textures");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "flavour_textures", PROPERTY_HINT_NONE, "23/19:Texture", PROPERTY_USAGE_DEFAULT, "Texture"), "set_flavour_textures", "get_flavour_textures");
ClassDB::bind_method(D_METHOD("get_flavour_chance"), &TiledWall2DData::get_flavour_chance);
ClassDB::bind_method(D_METHOD("set_flavour_chance", "texture"), &TiledWall2DData::set_flavour_chance);

View File

@ -390,7 +390,7 @@ void TerrainLibrary::_bind_methods() {
ClassDB::bind_method(D_METHOD("materials_get"), &TerrainLibrary::materials_get);
ClassDB::bind_method(D_METHOD("materials_set"), &TerrainLibrary::materials_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "20/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "23/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
BIND_VMETHOD(MethodInfo("_liquid_material_cache_get_key", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "TerrainChunk")));
BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::OBJECT, "ret", PROPERTY_HINT_RESOURCE_TYPE, "TerrainMaterialCache"), "_liquid_material_cache_get", PropertyInfo(Variant::INT, "key")));
@ -414,7 +414,7 @@ void TerrainLibrary::_bind_methods() {
ClassDB::bind_method(D_METHOD("liquid_materials_get"), &TerrainLibrary::liquid_materials_get);
ClassDB::bind_method(D_METHOD("liquid_materials_set"), &TerrainLibrary::liquid_materials_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "liquid_materials", PROPERTY_HINT_NONE, "20/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "liquid_materials_set", "liquid_materials_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "liquid_materials", PROPERTY_HINT_NONE, "23/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "liquid_materials_set", "liquid_materials_get");
BIND_VMETHOD(MethodInfo("_prop_material_cache_get_key", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "TerrainChunk")));
BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::OBJECT, "ret", PROPERTY_HINT_RESOURCE_TYPE, "TerrainMaterialCache"), "_prop_material_cache_get", PropertyInfo(Variant::INT, "key")));
@ -438,7 +438,7 @@ void TerrainLibrary::_bind_methods() {
ClassDB::bind_method(D_METHOD("prop_materials_get"), &TerrainLibrary::prop_materials_get);
ClassDB::bind_method(D_METHOD("prop_materials_set"), &TerrainLibrary::prop_materials_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "prop_materials", PROPERTY_HINT_NONE, "20/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "prop_materials_set", "prop_materials_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "prop_materials", PROPERTY_HINT_NONE, "23/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "prop_materials_set", "prop_materials_get");
ClassDB::bind_method(D_METHOD("terra_surface_get", "index"), &TerrainLibrary::terra_surface_get);
ClassDB::bind_method(D_METHOD("terra_surface_add", "value"), &TerrainLibrary::terra_surface_add);

View File

@ -460,12 +460,12 @@ void TerrainLibraryMerger::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_terra_surfaces"), &TerrainLibraryMerger::get_terra_surfaces);
ClassDB::bind_method(D_METHOD("set_terra_surfaces"), &TerrainLibraryMerger::set_terra_surfaces);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "terra_surfaces", PROPERTY_HINT_NONE, "20/19:TerrainSurfaceMerger", PROPERTY_USAGE_DEFAULT, "TerrainSurfaceMerger"), "set_terra_surfaces", "get_terra_surfaces");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "terra_surfaces", PROPERTY_HINT_NONE, "23/19:TerrainSurfaceMerger", PROPERTY_USAGE_DEFAULT, "TerrainSurfaceMerger"), "set_terra_surfaces", "get_terra_surfaces");
#ifdef PROPS_PRESENT
ClassDB::bind_method(D_METHOD("get_props"), &TerrainLibraryMerger::get_props);
ClassDB::bind_method(D_METHOD("set_props"), &TerrainLibraryMerger::set_props);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "20/19:PropData", PROPERTY_USAGE_DEFAULT, "PropData"), "set_props", "get_props");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "23/19:PropData", PROPERTY_USAGE_DEFAULT, "PropData"), "set_props", "get_props");
ClassDB::bind_method(D_METHOD("get_prop_uv_rect", "texture"), &TerrainLibraryMerger::get_prop_uv_rect);

View File

@ -1000,12 +1000,12 @@ void TerrainLibraryMergerPCM::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_terra_surfaces"), &TerrainLibraryMergerPCM::get_terra_surfaces);
ClassDB::bind_method(D_METHOD("set_terra_surfaces"), &TerrainLibraryMergerPCM::set_terra_surfaces);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "terra_surfaces", PROPERTY_HINT_NONE, "20/19:TerrainSurfaceMerger", PROPERTY_USAGE_DEFAULT, "TerrainSurfaceMerger"), "set_terra_surfaces", "get_terra_surfaces");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "terra_surfaces", PROPERTY_HINT_NONE, "23/19:TerrainSurfaceMerger", PROPERTY_USAGE_DEFAULT, "TerrainSurfaceMerger"), "set_terra_surfaces", "get_terra_surfaces");
#ifdef PROPS_PRESENT
ClassDB::bind_method(D_METHOD("get_props"), &TerrainLibraryMergerPCM::get_props);
ClassDB::bind_method(D_METHOD("set_props"), &TerrainLibraryMergerPCM::set_props);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "20/19:PropData", PROPERTY_USAGE_DEFAULT, "PropData"), "set_props", "get_props");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "23/19:PropData", PROPERTY_USAGE_DEFAULT, "PropData"), "set_props", "get_props");
ClassDB::bind_method(D_METHOD("get_prop_uv_rect", "texture"), &TerrainLibraryMergerPCM::get_prop_uv_rect);

View File

@ -147,5 +147,5 @@ void TerrainLibrarySimple::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_terra_surfaces"), &TerrainLibrarySimple::get_terra_surfaces);
ClassDB::bind_method(D_METHOD("set_terra_surfaces"), &TerrainLibrarySimple::set_terra_surfaces);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "terra_surfaces", PROPERTY_HINT_NONE, "20/19:TerrainSurfaceSimple", PROPERTY_USAGE_DEFAULT, "TerrainSurfaceSimple"), "set_terra_surfaces", "get_terra_surfaces");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "terra_surfaces", PROPERTY_HINT_NONE, "23/19:TerrainSurfaceSimple", PROPERTY_USAGE_DEFAULT, "TerrainSurfaceSimple"), "set_terra_surfaces", "get_terra_surfaces");
}

View File

@ -294,7 +294,7 @@ void TerrainMaterialCache::_bind_methods() {
ClassDB::bind_method(D_METHOD("materials_get"), &TerrainMaterialCache::materials_get);
ClassDB::bind_method(D_METHOD("materials_set"), &TerrainMaterialCache::materials_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "20/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "23/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
ClassDB::bind_method(D_METHOD("surface_get", "index"), &TerrainMaterialCache::surface_get);
ClassDB::bind_method(D_METHOD("surface_id_get", "index"), &TerrainMaterialCache::surface_id_get);

View File

@ -125,7 +125,7 @@ RID TerrainChunkDefault::mesh_rid_get(const int mesh_index, const int mesh_type_
Variant v = m[mesh_type_index];
if (v.get_type() != Variant::_RID)
if (v.get_type() != Variant::RID)
return RID();
return v;
@ -144,7 +144,7 @@ void TerrainChunkDefault::mesh_rid_set(const int mesh_index, const int mesh_type
Variant v = m[mesh_type_index];
ERR_FAIL_COND(v.get_type() != Variant::_RID);
ERR_FAIL_COND(v.get_type() != Variant::RID);
m[mesh_type_index] = value;
_rids[mesh_index] = m;

View File

@ -1476,7 +1476,7 @@ void TerrainChunk::_bind_methods() {
ClassDB::bind_method(D_METHOD("voxel_structures_get"), &TerrainChunk::voxel_structures_get);
ClassDB::bind_method(D_METHOD("voxel_structures_set"), &TerrainChunk::voxel_structures_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_structures", PROPERTY_HINT_NONE, "20/19:TerrainStructure", PROPERTY_USAGE_DEFAULT, "TerrainStructure"), "voxel_structures_set", "voxel_structures_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_structures", PROPERTY_HINT_NONE, "23/19:TerrainStructure", PROPERTY_USAGE_DEFAULT, "TerrainStructure"), "voxel_structures_set", "voxel_structures_get");
//Meshes

View File

@ -1149,7 +1149,7 @@ void TerrainWorld::_bind_methods() {
ClassDB::bind_method(D_METHOD("voxel_structures_get"), &TerrainWorld::voxel_structures_get);
ClassDB::bind_method(D_METHOD("voxel_structures_set"), &TerrainWorld::voxel_structures_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_structures", PROPERTY_HINT_NONE, "20/19:TerrainStructure", PROPERTY_USAGE_DEFAULT, "TerrainStructure"), "voxel_structures_set", "voxel_structures_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_structures", PROPERTY_HINT_NONE, "23/19:TerrainStructure", PROPERTY_USAGE_DEFAULT, "TerrainStructure"), "voxel_structures_set", "voxel_structures_get");
BIND_VMETHOD(MethodInfo("_chunk_added", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "TerrainChunk")));
@ -1166,7 +1166,7 @@ void TerrainWorld::_bind_methods() {
ClassDB::bind_method(D_METHOD("chunks_get"), &TerrainWorld::chunks_get);
ClassDB::bind_method(D_METHOD("chunks_set"), &TerrainWorld::chunks_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "chunks", PROPERTY_HINT_NONE, "20/19:TerrainChunk", PROPERTY_USAGE_DEFAULT, "TerrainChunk"), "chunks_set", "chunks_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "chunks", PROPERTY_HINT_NONE, "23/19:TerrainChunk", PROPERTY_USAGE_DEFAULT, "TerrainChunk"), "chunks_set", "chunks_get");
ClassDB::bind_method(D_METHOD("generation_queue_add_to", "chunk"), &TerrainWorld::generation_queue_add_to);
ClassDB::bind_method(D_METHOD("generation_queue_get_index", "index"), &TerrainWorld::generation_queue_get_index);

View File

@ -414,12 +414,12 @@ void Terrain2DLibraryMerger::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_terra_surfaces"), &Terrain2DLibraryMerger::get_terra_surfaces);
ClassDB::bind_method(D_METHOD("set_terra_surfaces"), &Terrain2DLibraryMerger::set_terra_surfaces);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "terra_surfaces", PROPERTY_HINT_NONE, "20/19:Terrain2DSurfaceMerger", PROPERTY_USAGE_DEFAULT, "Terrain2DSurfaceMerger"), "set_terra_surfaces", "get_terra_surfaces");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "terra_surfaces", PROPERTY_HINT_NONE, "23/19:Terrain2DSurfaceMerger", PROPERTY_USAGE_DEFAULT, "Terrain2DSurfaceMerger"), "set_terra_surfaces", "get_terra_surfaces");
#ifdef PROPS_2D_PRESENT
ClassDB::bind_method(D_METHOD("get_props"), &Terrain2DLibraryMerger::get_props);
ClassDB::bind_method(D_METHOD("set_props"), &Terrain2DLibraryMerger::set_props);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "20/19:Prop2DData", PROPERTY_USAGE_DEFAULT, "Prop2DData"), "set_props", "get_props");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "23/19:Prop2DData", PROPERTY_USAGE_DEFAULT, "Prop2DData"), "set_props", "get_props");
ClassDB::bind_method(D_METHOD("get_prop_uv_rect", "texture"), &Terrain2DLibraryMerger::get_prop_uv_rect);

View File

@ -790,12 +790,12 @@ void Terrain2DLibraryMergerPCM::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_terra_surfaces"), &Terrain2DLibraryMergerPCM::get_terra_surfaces);
ClassDB::bind_method(D_METHOD("set_terra_surfaces"), &Terrain2DLibraryMergerPCM::set_terra_surfaces);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "terra_surfaces", PROPERTY_HINT_NONE, "20/19:Terrain2DSurfaceMerger", PROPERTY_USAGE_DEFAULT, "Terrain2DSurfaceMerger"), "set_terra_surfaces", "get_terra_surfaces");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "terra_surfaces", PROPERTY_HINT_NONE, "23/19:Terrain2DSurfaceMerger", PROPERTY_USAGE_DEFAULT, "Terrain2DSurfaceMerger"), "set_terra_surfaces", "get_terra_surfaces");
#ifdef PROPS_2D_PRESENT
ClassDB::bind_method(D_METHOD("get_props"), &Terrain2DLibraryMergerPCM::get_props);
ClassDB::bind_method(D_METHOD("set_props"), &Terrain2DLibraryMergerPCM::set_props);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "20/19:Prop2DData", PROPERTY_USAGE_DEFAULT, "Prop2DData"), "set_props", "get_props");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "23/19:Prop2DData", PROPERTY_USAGE_DEFAULT, "Prop2DData"), "set_props", "get_props");
ClassDB::bind_method(D_METHOD("get_prop_uv_rect", "texture"), &Terrain2DLibraryMergerPCM::get_prop_uv_rect);

View File

@ -147,5 +147,5 @@ void Terrain2DLibrarySimple::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_terra_surfaces"), &Terrain2DLibrarySimple::get_terra_surfaces);
ClassDB::bind_method(D_METHOD("set_terra_surfaces"), &Terrain2DLibrarySimple::set_terra_surfaces);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "terra_surfaces", PROPERTY_HINT_NONE, "20/19:Terrain2DSurfaceSimple", PROPERTY_USAGE_DEFAULT, "Terrain2DSurfaceSimple"), "set_terra_surfaces", "get_terra_surfaces");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "terra_surfaces", PROPERTY_HINT_NONE, "23/19:Terrain2DSurfaceSimple", PROPERTY_USAGE_DEFAULT, "Terrain2DSurfaceSimple"), "set_terra_surfaces", "get_terra_surfaces");
}

View File

@ -85,7 +85,7 @@ RID Terrain2DChunkDefault::mesh_rid_get(const int mesh_index, const int mesh_typ
Variant v = m[mesh_type_index];
if (v.get_type() != Variant::_RID)
if (v.get_type() != Variant::RID)
return RID();
return v;
@ -104,7 +104,7 @@ void Terrain2DChunkDefault::mesh_rid_set(const int mesh_index, const int mesh_ty
Variant v = m[mesh_type_index];
ERR_FAIL_COND(v.get_type() != Variant::_RID);
ERR_FAIL_COND(v.get_type() != Variant::RID);
m[mesh_type_index] = value;
_rids[mesh_index] = m;

View File

@ -1598,7 +1598,7 @@ void Terrain2DChunk::_bind_methods() {
ClassDB::bind_method(D_METHOD("voxel_structures_get"), &Terrain2DChunk::voxel_structures_get);
ClassDB::bind_method(D_METHOD("voxel_structures_set"), &Terrain2DChunk::voxel_structures_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_structures", PROPERTY_HINT_NONE, "20/19:Terrain2DStructure", PROPERTY_USAGE_DEFAULT, "Terrain2DStructure"), "voxel_structures_set", "voxel_structures_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_structures", PROPERTY_HINT_NONE, "23/19:Terrain2DStructure", PROPERTY_USAGE_DEFAULT, "Terrain2DStructure"), "voxel_structures_set", "voxel_structures_get");
//Meshes

View File

@ -1236,7 +1236,7 @@ void Terrain2DWorld::_bind_methods() {
ClassDB::bind_method(D_METHOD("voxel_structures_get"), &Terrain2DWorld::voxel_structures_get);
ClassDB::bind_method(D_METHOD("voxel_structures_set"), &Terrain2DWorld::voxel_structures_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_structures", PROPERTY_HINT_NONE, "20/19:Terrain2DStructure", PROPERTY_USAGE_DEFAULT, "Terrain2DStructure"), "voxel_structures_set", "voxel_structures_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_structures", PROPERTY_HINT_NONE, "23/19:Terrain2DStructure", PROPERTY_USAGE_DEFAULT, "Terrain2DStructure"), "voxel_structures_set", "voxel_structures_get");
BIND_VMETHOD(MethodInfo("_chunk_added", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "Terrain2DChunk")));
@ -1253,7 +1253,7 @@ void Terrain2DWorld::_bind_methods() {
ClassDB::bind_method(D_METHOD("chunks_get"), &Terrain2DWorld::chunks_get);
ClassDB::bind_method(D_METHOD("chunks_set"), &Terrain2DWorld::chunks_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "chunks", PROPERTY_HINT_NONE, "20/19:Terrain2DChunk", PROPERTY_USAGE_DEFAULT, "Terrain2DChunk"), "chunks_set", "chunks_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "chunks", PROPERTY_HINT_NONE, "23/19:Terrain2DChunk", PROPERTY_USAGE_DEFAULT, "Terrain2DChunk"), "chunks_set", "chunks_get");
ClassDB::bind_method(D_METHOD("generation_queue_add_to", "chunk"), &Terrain2DWorld::generation_queue_add_to);
ClassDB::bind_method(D_METHOD("generation_queue_get_index", "index"), &Terrain2DWorld::generation_queue_get_index);

View File

@ -314,7 +314,7 @@ void TextureMerger::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_textures"), &TextureMerger::get_textures);
ClassDB::bind_method(D_METHOD("set_textures", "textures"), &TextureMerger::set_textures);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "textures", PROPERTY_HINT_NONE, "20/19:Texture", PROPERTY_USAGE_DEFAULT, "Texture"), "set_textures", "get_textures");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "textures", PROPERTY_HINT_NONE, "23/19:Texture", PROPERTY_USAGE_DEFAULT, "Texture"), "set_textures", "get_textures");
ClassDB::bind_method(D_METHOD("get_packer"), &TextureMerger::get_packer);
ClassDB::bind_method(D_METHOD("set_packer", "packer"), &TextureMerger::set_packer);

View File

@ -128,7 +128,7 @@ UserManagerStatic::~UserManagerStatic() {
void UserManagerStatic::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_users"), &UserManagerStatic::get_users);
ClassDB::bind_method(D_METHOD("set_users", "users"), &UserManagerStatic::set_users);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "users", PROPERTY_HINT_NONE, "20/19:User", PROPERTY_USAGE_DEFAULT, "User"), "set_users", "get_users");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "users", PROPERTY_HINT_NONE, "23/19:User", PROPERTY_USAGE_DEFAULT, "User"), "set_users", "get_users");
ClassDB::bind_method(D_METHOD("get_create_user_name"), &UserManagerStatic::get_create_user_name_bind);
ClassDB::bind_method(D_METHOD("set_create_user_name", "val"), &UserManagerStatic::set_create_user_name_bind);

View File

@ -327,7 +327,7 @@ void User::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_modules"), &User::get_modules);
ClassDB::bind_method(D_METHOD("set_modules", "modules"), &User::set_modules);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "modules", PROPERTY_HINT_NONE, "20/19:UserModule", PROPERTY_USAGE_DEFAULT, "UserModule"), "set_modules", "get_modules");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "modules", PROPERTY_HINT_NONE, "23/19:UserModule", PROPERTY_USAGE_DEFAULT, "UserModule"), "set_modules", "get_modules");
BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "ret"), "_check_password", PropertyInfo(Variant::STRING, "password")));
BIND_VMETHOD(MethodInfo("_create_password", PropertyInfo(Variant::STRING, "password")));

View File

@ -391,7 +391,7 @@ void VoxelLibrary::_bind_methods() {
ClassDB::bind_method(D_METHOD("materials_get"), &VoxelLibrary::materials_get);
ClassDB::bind_method(D_METHOD("materials_set"), &VoxelLibrary::materials_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "20/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "23/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
BIND_VMETHOD(MethodInfo("_liquid_material_cache_get_key", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk")));
BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::OBJECT, "ret", PROPERTY_HINT_RESOURCE_TYPE, "TerrainMaterialCache"), "_liquid_material_cache_get", PropertyInfo(Variant::INT, "key")));
@ -415,7 +415,7 @@ void VoxelLibrary::_bind_methods() {
ClassDB::bind_method(D_METHOD("liquid_materials_get"), &VoxelLibrary::liquid_materials_get);
ClassDB::bind_method(D_METHOD("liquid_materials_set"), &VoxelLibrary::liquid_materials_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "liquid_materials", PROPERTY_HINT_NONE, "20/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "liquid_materials_set", "liquid_materials_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "liquid_materials", PROPERTY_HINT_NONE, "23/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "liquid_materials_set", "liquid_materials_get");
BIND_VMETHOD(MethodInfo("_prop_material_cache_get_key", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk")));
BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::OBJECT, "ret", PROPERTY_HINT_RESOURCE_TYPE, "TerrainMaterialCache"), "_prop_material_cache_get", PropertyInfo(Variant::INT, "key")));
@ -439,7 +439,7 @@ void VoxelLibrary::_bind_methods() {
ClassDB::bind_method(D_METHOD("prop_materials_get"), &VoxelLibrary::prop_materials_get);
ClassDB::bind_method(D_METHOD("prop_materials_set"), &VoxelLibrary::prop_materials_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "prop_materials", PROPERTY_HINT_NONE, "20/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "prop_materials_set", "prop_materials_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "prop_materials", PROPERTY_HINT_NONE, "23/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "prop_materials_set", "prop_materials_get");
ClassDB::bind_method(D_METHOD("voxel_surface_get", "index"), &VoxelLibrary::voxel_surface_get);
ClassDB::bind_method(D_METHOD("voxel_surface_add", "value"), &VoxelLibrary::voxel_surface_add);

View File

@ -458,12 +458,12 @@ void VoxelLibraryMerger::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_voxel_surfaces"), &VoxelLibraryMerger::get_voxel_surfaces);
ClassDB::bind_method(D_METHOD("set_voxel_surfaces"), &VoxelLibraryMerger::set_voxel_surfaces);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_surfaces", PROPERTY_HINT_NONE, "20/19:VoxelSurfaceMerger", PROPERTY_USAGE_DEFAULT, "VoxelSurfaceMerger"), "set_voxel_surfaces", "get_voxel_surfaces");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_surfaces", PROPERTY_HINT_NONE, "23/19:VoxelSurfaceMerger", PROPERTY_USAGE_DEFAULT, "VoxelSurfaceMerger"), "set_voxel_surfaces", "get_voxel_surfaces");
#ifdef PROPS_PRESENT
ClassDB::bind_method(D_METHOD("get_props"), &VoxelLibraryMerger::get_props);
ClassDB::bind_method(D_METHOD("set_props"), &VoxelLibraryMerger::set_props);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "20/19:PropData", PROPERTY_USAGE_DEFAULT, "PropData"), "set_props", "get_props");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "23/19:PropData", PROPERTY_USAGE_DEFAULT, "PropData"), "set_props", "get_props");
ClassDB::bind_method(D_METHOD("get_prop_uv_rect", "texture"), &VoxelLibraryMerger::get_prop_uv_rect);

View File

@ -801,12 +801,12 @@ void VoxelLibraryMergerPCM::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_voxel_surfaces"), &VoxelLibraryMergerPCM::get_voxel_surfaces);
ClassDB::bind_method(D_METHOD("set_voxel_surfaces"), &VoxelLibraryMergerPCM::set_voxel_surfaces);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_surfaces", PROPERTY_HINT_NONE, "20/19:VoxelSurfaceMerger", PROPERTY_USAGE_DEFAULT, "VoxelSurfaceMerger"), "set_voxel_surfaces", "get_voxel_surfaces");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_surfaces", PROPERTY_HINT_NONE, "23/19:VoxelSurfaceMerger", PROPERTY_USAGE_DEFAULT, "VoxelSurfaceMerger"), "set_voxel_surfaces", "get_voxel_surfaces");
#ifdef PROPS_PRESENT
ClassDB::bind_method(D_METHOD("get_props"), &VoxelLibraryMergerPCM::get_props);
ClassDB::bind_method(D_METHOD("set_props"), &VoxelLibraryMergerPCM::set_props);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "20/19:PropData", PROPERTY_USAGE_DEFAULT, "PropData"), "set_props", "get_props");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "23/19:PropData", PROPERTY_USAGE_DEFAULT, "PropData"), "set_props", "get_props");
ClassDB::bind_method(D_METHOD("get_prop_uv_rect", "texture"), &VoxelLibraryMergerPCM::get_prop_uv_rect);

View File

@ -147,5 +147,5 @@ void VoxelLibrarySimple::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_voxel_surfaces"), &VoxelLibrarySimple::get_voxel_surfaces);
ClassDB::bind_method(D_METHOD("set_voxel_surfaces"), &VoxelLibrarySimple::set_voxel_surfaces);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_surfaces", PROPERTY_HINT_NONE, "20/19:VoxelSurfaceSimple", PROPERTY_USAGE_DEFAULT, "VoxelSurfaceSimple"), "set_voxel_surfaces", "get_voxel_surfaces");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_surfaces", PROPERTY_HINT_NONE, "23/19:VoxelSurfaceSimple", PROPERTY_USAGE_DEFAULT, "VoxelSurfaceSimple"), "set_voxel_surfaces", "get_voxel_surfaces");
}

View File

@ -294,7 +294,7 @@ void VoxelMaterialCache::_bind_methods() {
ClassDB::bind_method(D_METHOD("materials_get"), &VoxelMaterialCache::materials_get);
ClassDB::bind_method(D_METHOD("materials_set"), &VoxelMaterialCache::materials_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "20/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "23/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
ClassDB::bind_method(D_METHOD("surface_get", "index"), &VoxelMaterialCache::surface_get);
ClassDB::bind_method(D_METHOD("surface_id_get", "index"), &VoxelMaterialCache::surface_id_get);

View File

@ -123,7 +123,7 @@ RID VoxelChunkDefault::mesh_rid_get(const int mesh_index, const int mesh_type_in
Variant v = m[mesh_type_index];
if (v.get_type() != Variant::_RID)
if (v.get_type() != Variant::RID)
return RID();
return v;
@ -142,7 +142,7 @@ void VoxelChunkDefault::mesh_rid_set(const int mesh_index, const int mesh_type_i
Variant v = m[mesh_type_index];
ERR_FAIL_COND(v.get_type() != Variant::_RID);
ERR_FAIL_COND(v.get_type() != Variant::RID);
m[mesh_type_index] = value;
_rids[mesh_index] = m;

View File

@ -1458,7 +1458,7 @@ void VoxelChunk::_bind_methods() {
ClassDB::bind_method(D_METHOD("voxel_structures_get"), &VoxelChunk::voxel_structures_get);
ClassDB::bind_method(D_METHOD("voxel_structures_set"), &VoxelChunk::voxel_structures_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_structures", PROPERTY_HINT_NONE, "20/19:VoxelStructure", PROPERTY_USAGE_DEFAULT, "VoxelStructure"), "voxel_structures_set", "voxel_structures_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_structures", PROPERTY_HINT_NONE, "23/19:VoxelStructure", PROPERTY_USAGE_DEFAULT, "VoxelStructure"), "voxel_structures_set", "voxel_structures_get");
//Meshes

View File

@ -1109,7 +1109,7 @@ void VoxelWorld::_bind_methods() {
ClassDB::bind_method(D_METHOD("voxel_structures_get"), &VoxelWorld::voxel_structures_get);
ClassDB::bind_method(D_METHOD("voxel_structures_set"), &VoxelWorld::voxel_structures_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_structures", PROPERTY_HINT_NONE, "20/19:VoxelStructure", PROPERTY_USAGE_DEFAULT, "VoxelStructure"), "voxel_structures_set", "voxel_structures_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_structures", PROPERTY_HINT_NONE, "23/19:VoxelStructure", PROPERTY_USAGE_DEFAULT, "VoxelStructure"), "voxel_structures_set", "voxel_structures_get");
BIND_VMETHOD(MethodInfo("_chunk_added", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk")));
@ -1126,7 +1126,7 @@ void VoxelWorld::_bind_methods() {
ClassDB::bind_method(D_METHOD("chunks_get"), &VoxelWorld::chunks_get);
ClassDB::bind_method(D_METHOD("chunks_set"), &VoxelWorld::chunks_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "chunks", PROPERTY_HINT_NONE, "20/19:VoxelChunk", PROPERTY_USAGE_DEFAULT, "VoxelChunk"), "chunks_set", "chunks_get");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "chunks", PROPERTY_HINT_NONE, "23/19:VoxelChunk", PROPERTY_USAGE_DEFAULT, "VoxelChunk"), "chunks_set", "chunks_get");
ClassDB::bind_method(D_METHOD("generation_queue_add_to", "chunk"), &VoxelWorld::generation_queue_add_to);
ClassDB::bind_method(D_METHOD("generation_queue_get_index", "index"), &VoxelWorld::generation_queue_get_index);

View File

@ -527,7 +527,7 @@ void BBCodeParserTag::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_child_tags"), &BBCodeParserTag::get_child_tags);
ClassDB::bind_method(D_METHOD("set_child_tags", "val"), &BBCodeParserTag::set_child_tags);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "child_tags", PROPERTY_HINT_NONE, "20/19:BBCodeParserTag", PROPERTY_USAGE_DEFAULT, "BBCodeParserTag"), "set_child_tags", "get_child_tags");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "child_tags", PROPERTY_HINT_NONE, "23/19:BBCodeParserTag", PROPERTY_USAGE_DEFAULT, "BBCodeParserTag"), "set_child_tags", "get_child_tags");
ClassDB::bind_method(D_METHOD("add_child_attribute", "tag"), &BBCodeParserTag::add_child_attribute);
ClassDB::bind_method(D_METHOD("remote_child_attribute", "index"), &BBCodeParserTag::remote_child_attribute);
@ -537,7 +537,7 @@ void BBCodeParserTag::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_attributes"), &BBCodeParserTag::get_attributes);
ClassDB::bind_method(D_METHOD("set_attributes", "val"), &BBCodeParserTag::set_attributes);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "attributes", PROPERTY_HINT_NONE, "20/19:BBCodeParserAttribute", PROPERTY_USAGE_DEFAULT, "BBCodeParserAttribute"), "set_attributes", "get_attributes");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "attributes", PROPERTY_HINT_NONE, "23/19:BBCodeParserAttribute", PROPERTY_USAGE_DEFAULT, "BBCodeParserAttribute"), "set_attributes", "get_attributes");
ClassDB::bind_method(D_METHOD("get_first", "t"), &BBCodeParserTag::get_first);
ClassDB::bind_method(D_METHOD("get_firstc", "t", "attrib", "val"), &BBCodeParserTag::get_firstc);

View File

@ -796,7 +796,7 @@ void FormField::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_entries"), &FormField::get_entries);
ClassDB::bind_method(D_METHOD("set_entries", "array"), &FormField::set_entries);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "entries", PROPERTY_HINT_NONE, "20/19:FormFieldEntry", PROPERTY_USAGE_DEFAULT, "FormFieldEntry"), "set_entries", "get_entries");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "entries", PROPERTY_HINT_NONE, "23/19:FormFieldEntry", PROPERTY_USAGE_DEFAULT, "FormFieldEntry"), "set_entries", "get_entries");
ClassDB::bind_method(D_METHOD("need_to_exist"), &FormField::need_to_exist);
ClassDB::bind_method(D_METHOD("need_to_be_int"), &FormField::need_to_be_int);
@ -905,7 +905,7 @@ void FormValidator::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_fields"), &FormValidator::get_fields);
ClassDB::bind_method(D_METHOD("set_fields", "array"), &FormValidator::set_fields);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "fields", PROPERTY_HINT_NONE, "20/19:FormField", PROPERTY_USAGE_DEFAULT, "FormField"), "set_fields", "get_fields");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "fields", PROPERTY_HINT_NONE, "23/19:FormField", PROPERTY_USAGE_DEFAULT, "FormField"), "set_fields", "get_fields");
BIND_VMETHOD(MethodInfo("_validate", PropertyInfo(Variant::OBJECT, "request", PROPERTY_HINT_RESOURCE_TYPE, "WebServerRequest")));
ClassDB::bind_method(D_METHOD("validate", "request"), &FormValidator::validate);

View File

@ -571,7 +571,7 @@ void HTMLParserTag::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_child_tags"), &HTMLParserTag::get_child_tags);
ClassDB::bind_method(D_METHOD("set_child_tags", "val"), &HTMLParserTag::set_child_tags);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "child_tags", PROPERTY_HINT_NONE, "20/19:HTMLParserTag", PROPERTY_USAGE_DEFAULT, "HTMLParserTag"), "set_child_tags", "get_child_tags");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "child_tags", PROPERTY_HINT_NONE, "23/19:HTMLParserTag", PROPERTY_USAGE_DEFAULT, "HTMLParserTag"), "set_child_tags", "get_child_tags");
ClassDB::bind_method(D_METHOD("add_child_attribute", "tag"), &HTMLParserTag::add_child_attribute);
ClassDB::bind_method(D_METHOD("remote_child_attribute", "index"), &HTMLParserTag::remote_child_attribute);
@ -581,7 +581,7 @@ void HTMLParserTag::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_attributes"), &HTMLParserTag::get_attributes);
ClassDB::bind_method(D_METHOD("set_attributes", "val"), &HTMLParserTag::set_attributes);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "attributes", PROPERTY_HINT_NONE, "20/19:HTMLParserAttribute", PROPERTY_USAGE_DEFAULT, "HTMLParserAttribute"), "set_attributes", "get_attributes");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "attributes", PROPERTY_HINT_NONE, "23/19:HTMLParserAttribute", PROPERTY_USAGE_DEFAULT, "HTMLParserAttribute"), "set_attributes", "get_attributes");
ClassDB::bind_method(D_METHOD("get_first", "t"), &HTMLParserTag::get_first);
ClassDB::bind_method(D_METHOD("get_firstc", "t", "attrib", "val"), &HTMLParserTag::get_firstc);

View File

@ -205,7 +205,7 @@ void WebRoot::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_middlewares"), &WebRoot::get_middlewares);
ClassDB::bind_method(D_METHOD("set_middlewares", "data"), &WebRoot::set_middlewares);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "middlewares", PROPERTY_HINT_NONE, "20/19:WebServerMiddleware", PROPERTY_USAGE_DEFAULT, "WebServerMiddleware"), "set_middlewares", "get_middlewares");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "middlewares", PROPERTY_HINT_NONE, "23/19:WebServerMiddleware", PROPERTY_USAGE_DEFAULT, "WebServerMiddleware"), "set_middlewares", "get_middlewares");
ClassDB::bind_method(D_METHOD("process_middlewares", "request"), &WebRoot::process_middlewares);
ClassDB::bind_method(D_METHOD("try_send_wwwroot_file", "request"), &WebRoot::try_send_wwwroot_file);

View File

@ -59,7 +59,7 @@
<DisplayString Condition="type == Variant::QUATERNION">{*(Quaternion *)_data._mem}</DisplayString>
<DisplayString Condition="type == Variant::COLOR">{*(Color *)_data._mem}</DisplayString>
<DisplayString Condition="type == Variant::NODE_PATH">{*(NodePath *)_data._mem}</DisplayString>
<DisplayString Condition="type == Variant::_RID">{*(RID *)_data._mem}</DisplayString>
<DisplayString Condition="type == Variant::RID">{*(RID *)_data._mem}</DisplayString>
<DisplayString Condition="type == Variant::OBJECT">{*(Object *)_data._mem}</DisplayString>
<DisplayString Condition="type == Variant::DICTIONARY">{*(Dictionary *)_data._mem}</DisplayString>
<DisplayString Condition="type == Variant::ARRAY">{*(Array *)_data._mem}</DisplayString>
@ -89,7 +89,7 @@
<Item Name="[value]" Condition="type == Variant::QUATERNION">*(Quaternion *)_data._mem</Item>
<Item Name="[value]" Condition="type == Variant::COLOR">*(Color *)_data._mem</Item>
<Item Name="[value]" Condition="type == Variant::NODE_PATH">*(NodePath *)_data._mem</Item>
<Item Name="[value]" Condition="type == Variant::_RID">*(RID *)_data._mem</Item>
<Item Name="[value]" Condition="type == Variant::RID">*(RID *)_data._mem</Item>
<Item Name="[value]" Condition="type == Variant::OBJECT">*(Object *)_data._mem</Item>
<Item Name="[value]" Condition="type == Variant::DICTIONARY">*(Dictionary *)_data._mem</Item>
<Item Name="[value]" Condition="type == Variant::ARRAY">*(Array *)_data._mem</Item>

View File

@ -536,13 +536,13 @@ void Area2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("_body_inout"), &Area2D::_body_inout);
ClassDB::bind_method(D_METHOD("_area_inout"), &Area2D::_area_inout);
ADD_SIGNAL(MethodInfo("body_shape_entered", PropertyInfo(Variant::_RID, "body_rid"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("body_shape_exited", PropertyInfo(Variant::_RID, "body_rid"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("body_shape_entered", PropertyInfo(Variant::RID, "body_rid"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("body_shape_exited", PropertyInfo(Variant::RID, "body_rid"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("body_entered", PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node")));
ADD_SIGNAL(MethodInfo("body_exited", PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node")));
ADD_SIGNAL(MethodInfo("area_shape_entered", PropertyInfo(Variant::_RID, "area_rid"), PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area2D"), PropertyInfo(Variant::INT, "area_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("area_shape_exited", PropertyInfo(Variant::_RID, "area_rid"), PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area2D"), PropertyInfo(Variant::INT, "area_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("area_shape_entered", PropertyInfo(Variant::RID, "area_rid"), PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area2D"), PropertyInfo(Variant::INT, "area_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("area_shape_exited", PropertyInfo(Variant::RID, "area_rid"), PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area2D"), PropertyInfo(Variant::INT, "area_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("area_entered", PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area2D")));
ADD_SIGNAL(MethodInfo("area_exited", PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area2D")));

View File

@ -933,8 +933,8 @@ void RigidBody2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "applied_force"), "set_applied_force", "get_applied_force");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "applied_torque"), "set_applied_torque", "get_applied_torque");
ADD_SIGNAL(MethodInfo("body_shape_entered", PropertyInfo(Variant::_RID, "body_rid"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("body_shape_exited", PropertyInfo(Variant::_RID, "body_rid"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("body_shape_entered", PropertyInfo(Variant::RID, "body_rid"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("body_shape_exited", PropertyInfo(Variant::RID, "body_rid"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("body_entered", PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node")));
ADD_SIGNAL(MethodInfo("body_exited", PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node")));
ADD_SIGNAL(MethodInfo("sleeping_state_changed"));
@ -1588,7 +1588,7 @@ void KinematicCollision2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "local_shape"), "", "get_local_shape");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "collider"), "", "get_collider");
ADD_PROPERTY(PropertyInfo(Variant::INT, "collider_id"), "", "get_collider_id");
ADD_PROPERTY(PropertyInfo(Variant::_RID, "collider_rid"), "", "get_collider_rid");
ADD_PROPERTY(PropertyInfo(Variant::RID, "collider_rid"), "", "get_collider_rid");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "collider_shape"), "", "get_collider_shape");
ADD_PROPERTY(PropertyInfo(Variant::INT, "collider_shape_index"), "", "get_collider_shape_index");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "collider_velocity"), "", "get_collider_velocity");

View File

@ -575,13 +575,13 @@ void Area::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_reverb_uniformity", "amount"), &Area::set_reverb_uniformity);
ClassDB::bind_method(D_METHOD("get_reverb_uniformity"), &Area::get_reverb_uniformity);
ADD_SIGNAL(MethodInfo("body_shape_entered", PropertyInfo(Variant::_RID, "body_rid"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("body_shape_exited", PropertyInfo(Variant::_RID, "body_rid"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("body_shape_entered", PropertyInfo(Variant::RID, "body_rid"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("body_shape_exited", PropertyInfo(Variant::RID, "body_rid"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("body_entered", PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node")));
ADD_SIGNAL(MethodInfo("body_exited", PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node")));
ADD_SIGNAL(MethodInfo("area_shape_entered", PropertyInfo(Variant::_RID, "area_rid"), PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area"), PropertyInfo(Variant::INT, "area_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("area_shape_exited", PropertyInfo(Variant::_RID, "area_rid"), PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area"), PropertyInfo(Variant::INT, "area_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("area_shape_entered", PropertyInfo(Variant::RID, "area_rid"), PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area"), PropertyInfo(Variant::INT, "area_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("area_shape_exited", PropertyInfo(Variant::RID, "area_rid"), PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area"), PropertyInfo(Variant::INT, "area_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("area_entered", PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area")));
ADD_SIGNAL(MethodInfo("area_exited", PropertyInfo(Variant::OBJECT, "area", PROPERTY_HINT_RESOURCE_TYPE, "Area")));

View File

@ -375,7 +375,7 @@ Point2 Camera::unproject_position(const Vector3 &p_pos) const {
Plane p(get_camera_transform().xform_inv(p_pos), 1.0);
p = cm.xform4(p);
p = cm.xform(p);
p.normal /= p.d;
Point2 res;

View File

@ -115,7 +115,7 @@ void Navigation::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::REAL, "edge_connection_margin"), "set_edge_connection_margin", "get_edge_connection_margin");
ADD_PROPERTY(PropertyInfo(Variant::INT, "navigation_layers", PROPERTY_HINT_LAYERS_3D_NAVIGATION), "set_navigation_layers", "get_navigation_layers");
ADD_SIGNAL(MethodInfo("map_changed", PropertyInfo(Variant::_RID, "map")));
ADD_SIGNAL(MethodInfo("map_changed", PropertyInfo(Variant::RID, "map")));
}
void Navigation::_notification(int p_what) {

View File

@ -909,8 +909,8 @@ void RigidBody::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "angular_velocity"), "set_angular_velocity", "get_angular_velocity");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"), "set_angular_damp", "get_angular_damp");
ADD_SIGNAL(MethodInfo("body_shape_entered", PropertyInfo(Variant::_RID, "body_rid"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("body_shape_exited", PropertyInfo(Variant::_RID, "body_rid"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("body_shape_entered", PropertyInfo(Variant::RID, "body_rid"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("body_shape_exited", PropertyInfo(Variant::RID, "body_rid"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape_index"), PropertyInfo(Variant::INT, "local_shape_index")));
ADD_SIGNAL(MethodInfo("body_entered", PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node")));
ADD_SIGNAL(MethodInfo("body_exited", PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node")));
ADD_SIGNAL(MethodInfo("sleeping_state_changed"));
@ -1606,7 +1606,7 @@ void KinematicCollision::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "local_shape"), "", "get_local_shape");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "collider"), "", "get_collider");
ADD_PROPERTY(PropertyInfo(Variant::INT, "collider_id"), "", "get_collider_id");
ADD_PROPERTY(PropertyInfo(Variant::_RID, "collider_rid"), "", "get_collider_rid");
ADD_PROPERTY(PropertyInfo(Variant::RID, "collider_rid"), "", "get_collider_rid");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "collider_shape"), "", "get_collider_shape");
ADD_PROPERTY(PropertyInfo(Variant::INT, "collider_shape_index"), "", "get_collider_shape_index");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "collider_velocity"), "", "get_collider_velocity");

View File

@ -2920,7 +2920,7 @@ void RichTextLabel::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "deselect_on_focus_loss_enabled"), "set_deselect_on_focus_loss_enabled", "is_deselect_on_focus_loss_enabled");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "custom_effects", PROPERTY_HINT_RESOURCE_TYPE, "20/19:RichTextEffect", (PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE), "RichTextEffect"), "set_effects", "get_effects");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "custom_effects", PROPERTY_HINT_RESOURCE_TYPE, "23/19:RichTextEffect", (PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE), "RichTextEffect"), "set_effects", "get_effects");
ADD_SIGNAL(MethodInfo("meta_clicked", PropertyInfo(Variant::NIL, "meta", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT)));
ADD_SIGNAL(MethodInfo("meta_hover_started", PropertyInfo(Variant::NIL, "meta", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT)));

View File

@ -78,7 +78,7 @@ void Shader::get_param_list(List<PropertyInfo> *p_params) const {
params_cache[pi.name] = E->get().name;
if (p_params) {
//small little hack
if (pi.type == Variant::_RID) {
if (pi.type == Variant::RID) {
pi.type = Variant::OBJECT;
}
p_params->push_back(pi);

Some files were not shown because too many files have changed in this diff Show More