Merge pull request #36515 from reduz/packed-array-64-bits
Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.
This commit is contained in:
commit
2f237d181b
|
@ -3101,8 +3101,8 @@ void _Engine::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editor_hint"), "set_editor_hint", "is_editor_hint");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "iterations_per_second"), "set_iterations_per_second", "get_iterations_per_second");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "target_fps"), "set_target_fps", "get_target_fps");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "time_scale"), "set_time_scale", "get_time_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "physics_jitter_fix"), "set_physics_jitter_fix", "get_physics_jitter_fix");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "time_scale"), "set_time_scale", "get_time_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "physics_jitter_fix"), "set_physics_jitter_fix", "get_physics_jitter_fix");
|
||||
}
|
||||
|
||||
_Engine *_Engine::singleton = NULL;
|
||||
|
|
|
@ -279,8 +279,8 @@ StringName PHashTranslation::get_message(const StringName &p_src_text) const {
|
|||
|
||||
void PHashTranslation::_get_property_list(List<PropertyInfo> *p_list) const {
|
||||
|
||||
p_list->push_back(PropertyInfo(Variant::PACKED_INT_ARRAY, "hash_table"));
|
||||
p_list->push_back(PropertyInfo(Variant::PACKED_INT_ARRAY, "bucket_table"));
|
||||
p_list->push_back(PropertyInfo(Variant::PACKED_INT32_ARRAY, "hash_table"));
|
||||
p_list->push_back(PropertyInfo(Variant::PACKED_INT32_ARRAY, "bucket_table"));
|
||||
p_list->push_back(PropertyInfo(Variant::PACKED_BYTE_ARRAY, "strings"));
|
||||
p_list->push_back(PropertyInfo(Variant::OBJECT, "load_from", PROPERTY_HINT_RESOURCE_TYPE, "Translation", PROPERTY_USAGE_EDITOR));
|
||||
}
|
||||
|
|
|
@ -594,7 +594,7 @@ void register_global_constants() {
|
|||
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_NIL", Variant::NIL);
|
||||
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_BOOL", Variant::BOOL);
|
||||
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_INT", Variant::INT);
|
||||
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_REAL", Variant::REAL);
|
||||
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_REAL", Variant::FLOAT);
|
||||
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_RECT2", Variant::RECT2);
|
||||
|
@ -615,8 +615,10 @@ void register_global_constants() {
|
|||
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_DICTIONARY", Variant::DICTIONARY); // 20
|
||||
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_ARRAY", Variant::ARRAY);
|
||||
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RAW_ARRAY", Variant::PACKED_BYTE_ARRAY);
|
||||
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_INT_ARRAY", Variant::PACKED_INT_ARRAY);
|
||||
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_REAL_ARRAY", Variant::PACKED_REAL_ARRAY);
|
||||
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_INT32_ARRAY", Variant::PACKED_INT32_ARRAY);
|
||||
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_INT64_ARRAY", Variant::PACKED_INT64_ARRAY);
|
||||
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_FLOAT32_ARRAY", Variant::PACKED_FLOAT32_ARRAY);
|
||||
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_FLOAT64_ARRAY", Variant::PACKED_FLOAT64_ARRAY);
|
||||
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_STRING_ARRAY", Variant::PACKED_STRING_ARRAY);
|
||||
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2_ARRAY", Variant::PACKED_VECTOR2_ARRAY); // 25
|
||||
BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR3_ARRAY", Variant::PACKED_VECTOR3_ARRAY);
|
||||
|
|
|
@ -70,9 +70,11 @@ String JSON::_print_var(const Variant &p_var, const String &p_indent, int p_cur_
|
|||
case Variant::NIL: return "null";
|
||||
case Variant::BOOL: return p_var.operator bool() ? "true" : "false";
|
||||
case Variant::INT: return itos(p_var);
|
||||
case Variant::REAL: return rtos(p_var);
|
||||
case Variant::PACKED_INT_ARRAY:
|
||||
case Variant::PACKED_REAL_ARRAY:
|
||||
case Variant::FLOAT: return rtos(p_var);
|
||||
case Variant::PACKED_INT32_ARRAY:
|
||||
case Variant::PACKED_INT64_ARRAY:
|
||||
case Variant::PACKED_FLOAT32_ARRAY:
|
||||
case Variant::PACKED_FLOAT64_ARRAY:
|
||||
case Variant::PACKED_STRING_ARRAY:
|
||||
case Variant::ARRAY: {
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
|
|||
}
|
||||
|
||||
} break;
|
||||
case Variant::REAL: {
|
||||
case Variant::FLOAT: {
|
||||
|
||||
if (type & ENCODE_FLAG_64) {
|
||||
ERR_FAIL_COND_V(len < 8, ERR_INVALID_DATA);
|
||||
|
@ -621,7 +621,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
|
|||
}
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_INT_ARRAY: {
|
||||
case Variant::PACKED_INT32_ARRAY: {
|
||||
|
||||
ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA);
|
||||
int32_t count = decode_uint32(buf);
|
||||
|
@ -630,12 +630,12 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
|
|||
ERR_FAIL_MUL_OF(count, 4, ERR_INVALID_DATA);
|
||||
ERR_FAIL_COND_V(count < 0 || count * 4 > len, ERR_INVALID_DATA);
|
||||
|
||||
Vector<int> data;
|
||||
Vector<int32_t> data;
|
||||
|
||||
if (count) {
|
||||
//const int*rbuf=(const int*)buf;
|
||||
data.resize(count);
|
||||
int *w = data.ptrw();
|
||||
int32_t *w = data.ptrw();
|
||||
for (int32_t i = 0; i < count; i++) {
|
||||
|
||||
w[i] = decode_uint32(&buf[i * 4]);
|
||||
|
@ -643,11 +643,37 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
|
|||
}
|
||||
r_variant = Variant(data);
|
||||
if (r_len) {
|
||||
(*r_len) += 4 + count * sizeof(int);
|
||||
(*r_len) += 4 + count * sizeof(int32_t);
|
||||
}
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_REAL_ARRAY: {
|
||||
case Variant::PACKED_INT64_ARRAY: {
|
||||
|
||||
ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA);
|
||||
int64_t count = decode_uint64(buf);
|
||||
buf += 4;
|
||||
len -= 4;
|
||||
ERR_FAIL_MUL_OF(count, 8, ERR_INVALID_DATA);
|
||||
ERR_FAIL_COND_V(count < 0 || count * 8 > len, ERR_INVALID_DATA);
|
||||
|
||||
Vector<int64_t> data;
|
||||
|
||||
if (count) {
|
||||
//const int*rbuf=(const int*)buf;
|
||||
data.resize(count);
|
||||
int64_t *w = data.ptrw();
|
||||
for (int64_t i = 0; i < count; i++) {
|
||||
|
||||
w[i] = decode_uint64(&buf[i * 8]);
|
||||
}
|
||||
}
|
||||
r_variant = Variant(data);
|
||||
if (r_len) {
|
||||
(*r_len) += 4 + count * sizeof(int64_t);
|
||||
}
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_FLOAT32_ARRAY: {
|
||||
|
||||
ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA);
|
||||
int32_t count = decode_uint32(buf);
|
||||
|
@ -673,6 +699,33 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
|
|||
(*r_len) += 4 + count * sizeof(float);
|
||||
}
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_FLOAT64_ARRAY: {
|
||||
|
||||
ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA);
|
||||
int64_t count = decode_uint64(buf);
|
||||
buf += 4;
|
||||
len -= 4;
|
||||
ERR_FAIL_MUL_OF(count, 8, ERR_INVALID_DATA);
|
||||
ERR_FAIL_COND_V(count < 0 || count * 8 > len, ERR_INVALID_DATA);
|
||||
|
||||
Vector<double> data;
|
||||
|
||||
if (count) {
|
||||
//const double*rbuf=(const double*)buf;
|
||||
data.resize(count);
|
||||
double *w = data.ptrw();
|
||||
for (int64_t i = 0; i < count; i++) {
|
||||
|
||||
w[i] = decode_double(&buf[i * 8]);
|
||||
}
|
||||
}
|
||||
r_variant = data;
|
||||
|
||||
if (r_len) {
|
||||
(*r_len) += 4 + count * sizeof(double);
|
||||
}
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_STRING_ARRAY: {
|
||||
|
||||
|
@ -851,7 +904,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
|
|||
flags |= ENCODE_FLAG_64;
|
||||
}
|
||||
} break;
|
||||
case Variant::REAL: {
|
||||
case Variant::FLOAT: {
|
||||
|
||||
double d = p_variant;
|
||||
float f = d;
|
||||
|
@ -918,7 +971,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
|
|||
r_len += 4;
|
||||
}
|
||||
} break;
|
||||
case Variant::REAL: {
|
||||
case Variant::FLOAT: {
|
||||
|
||||
if (flags & ENCODE_FLAG_64) {
|
||||
if (buf) {
|
||||
|
@ -1333,39 +1386,73 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
|
|||
}
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_INT_ARRAY: {
|
||||
case Variant::PACKED_INT32_ARRAY: {
|
||||
|
||||
Vector<int> data = p_variant;
|
||||
Vector<int32_t> data = p_variant;
|
||||
int datalen = data.size();
|
||||
int datasize = sizeof(int32_t);
|
||||
|
||||
if (buf) {
|
||||
encode_uint32(datalen, buf);
|
||||
buf += 4;
|
||||
const int *r = data.ptr();
|
||||
for (int i = 0; i < datalen; i++)
|
||||
const int32_t *r = data.ptr();
|
||||
for (int32_t i = 0; i < datalen; i++)
|
||||
encode_uint32(r[i], &buf[i * datasize]);
|
||||
}
|
||||
|
||||
r_len += 4 + datalen * datasize;
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_REAL_ARRAY: {
|
||||
case Variant::PACKED_INT64_ARRAY: {
|
||||
|
||||
Vector<real_t> data = p_variant;
|
||||
Vector<int64_t> data = p_variant;
|
||||
int datalen = data.size();
|
||||
int datasize = sizeof(real_t);
|
||||
int datasize = sizeof(int64_t);
|
||||
|
||||
if (buf) {
|
||||
encode_uint64(datalen, buf);
|
||||
buf += 4;
|
||||
const int64_t *r = data.ptr();
|
||||
for (int64_t i = 0; i < datalen; i++)
|
||||
encode_uint64(r[i], &buf[i * datasize]);
|
||||
}
|
||||
|
||||
r_len += 4 + datalen * datasize;
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_FLOAT32_ARRAY: {
|
||||
|
||||
Vector<float> data = p_variant;
|
||||
int datalen = data.size();
|
||||
int datasize = sizeof(float);
|
||||
|
||||
if (buf) {
|
||||
encode_uint32(datalen, buf);
|
||||
buf += 4;
|
||||
const real_t *r = data.ptr();
|
||||
const float *r = data.ptr();
|
||||
for (int i = 0; i < datalen; i++)
|
||||
encode_float(r[i], &buf[i * datasize]);
|
||||
}
|
||||
|
||||
r_len += 4 + datalen * datasize;
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_FLOAT64_ARRAY: {
|
||||
|
||||
Vector<double> data = p_variant;
|
||||
int datalen = data.size();
|
||||
int datasize = sizeof(double);
|
||||
|
||||
if (buf) {
|
||||
encode_uint32(datalen, buf);
|
||||
buf += 4;
|
||||
const double *r = data.ptr();
|
||||
for (int i = 0; i < datalen; i++)
|
||||
encode_double(r[i], &buf[i * datasize]);
|
||||
}
|
||||
|
||||
r_len += 4 + datalen * datasize;
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_STRING_ARRAY: {
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ enum {
|
|||
VARIANT_NIL = 1,
|
||||
VARIANT_BOOL = 2,
|
||||
VARIANT_INT = 3,
|
||||
VARIANT_REAL = 4,
|
||||
VARIANT_FLOAT = 4,
|
||||
VARIANT_STRING = 5,
|
||||
VARIANT_VECTOR2 = 10,
|
||||
VARIANT_RECT2 = 11,
|
||||
|
@ -65,8 +65,8 @@ enum {
|
|||
VARIANT_DICTIONARY = 26,
|
||||
VARIANT_ARRAY = 30,
|
||||
VARIANT_RAW_ARRAY = 31,
|
||||
VARIANT_INT_ARRAY = 32,
|
||||
VARIANT_REAL_ARRAY = 33,
|
||||
VARIANT_INT32_ARRAY = 32,
|
||||
VARIANT_FLOAT32_ARRAY = 33,
|
||||
VARIANT_STRING_ARRAY = 34,
|
||||
VARIANT_VECTOR3_ARRAY = 35,
|
||||
VARIANT_COLOR_ARRAY = 36,
|
||||
|
@ -79,6 +79,8 @@ enum {
|
|||
VARIANT_VECTOR2I = 45,
|
||||
VARIANT_RECT2I = 46,
|
||||
VARIANT_VECTOR3I = 47,
|
||||
VARIANT_INT64_ARRAY = 48,
|
||||
VARIANT_FLOAT64_ARRAY = 49,
|
||||
OBJECT_EMPTY = 0,
|
||||
OBJECT_EXTERNAL_RESOURCE = 1,
|
||||
OBJECT_INTERNAL_RESOURCE = 2,
|
||||
|
@ -142,7 +144,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
|
|||
|
||||
r_v = int64_t(f->get_64());
|
||||
} break;
|
||||
case VARIANT_REAL: {
|
||||
case VARIANT_FLOAT: {
|
||||
|
||||
r_v = f->get_real();
|
||||
} break;
|
||||
|
@ -452,14 +454,14 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
|
|||
r_v = array;
|
||||
|
||||
} break;
|
||||
case VARIANT_INT_ARRAY: {
|
||||
case VARIANT_INT32_ARRAY: {
|
||||
|
||||
uint32_t len = f->get_32();
|
||||
|
||||
Vector<int> array;
|
||||
Vector<int32_t> array;
|
||||
array.resize(len);
|
||||
int *w = array.ptrw();
|
||||
f->get_buffer((uint8_t *)w, len * 4);
|
||||
int32_t *w = array.ptrw();
|
||||
f->get_buffer((uint8_t *)w, len * sizeof(int32_t));
|
||||
#ifdef BIG_ENDIAN_ENABLED
|
||||
{
|
||||
uint32_t *ptr = (uint32_t *)w.ptr();
|
||||
|
@ -473,14 +475,35 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
|
|||
|
||||
r_v = array;
|
||||
} break;
|
||||
case VARIANT_REAL_ARRAY: {
|
||||
case VARIANT_INT64_ARRAY: {
|
||||
|
||||
uint32_t len = f->get_32();
|
||||
|
||||
Vector<real_t> array;
|
||||
Vector<int64_t> array;
|
||||
array.resize(len);
|
||||
real_t *w = array.ptrw();
|
||||
f->get_buffer((uint8_t *)w, len * sizeof(real_t));
|
||||
int64_t *w = array.ptrw();
|
||||
f->get_buffer((uint8_t *)w, len * sizeof(int64_t));
|
||||
#ifdef BIG_ENDIAN_ENABLED
|
||||
{
|
||||
uint64_t *ptr = (uint64_t *)w.ptr();
|
||||
for (int i = 0; i < len; i++) {
|
||||
|
||||
ptr[i] = BSWAP64(ptr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
r_v = array;
|
||||
} break;
|
||||
case VARIANT_FLOAT32_ARRAY: {
|
||||
|
||||
uint32_t len = f->get_32();
|
||||
|
||||
Vector<float> array;
|
||||
array.resize(len);
|
||||
float *w = array.ptrw();
|
||||
f->get_buffer((uint8_t *)w, len * sizeof(float));
|
||||
#ifdef BIG_ENDIAN_ENABLED
|
||||
{
|
||||
uint32_t *ptr = (uint32_t *)w.ptr();
|
||||
|
@ -490,6 +513,27 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
|
|||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
r_v = array;
|
||||
} break;
|
||||
case VARIANT_FLOAT64_ARRAY: {
|
||||
|
||||
uint32_t len = f->get_32();
|
||||
|
||||
Vector<double> array;
|
||||
array.resize(len);
|
||||
double *w = array.ptrw();
|
||||
f->get_buffer((uint8_t *)w, len * sizeof(double));
|
||||
#ifdef BIG_ENDIAN_ENABLED
|
||||
{
|
||||
uint64_t *ptr = (uint64_t *)w.ptr();
|
||||
for (int i = 0; i < len; i++) {
|
||||
|
||||
ptr[i] = BSWAP64(ptr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
r_v = array;
|
||||
|
@ -1293,7 +1337,7 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia
|
|||
}
|
||||
|
||||
} break;
|
||||
case Variant::REAL: {
|
||||
case Variant::FLOAT: {
|
||||
|
||||
double d = p_property;
|
||||
float fl = d;
|
||||
|
@ -1302,7 +1346,7 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia
|
|||
f->store_double(d);
|
||||
} else {
|
||||
|
||||
f->store_32(VARIANT_REAL);
|
||||
f->store_32(VARIANT_FLOAT);
|
||||
f->store_real(fl);
|
||||
}
|
||||
|
||||
|
@ -1573,28 +1617,51 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia
|
|||
_pad_buffer(f, len);
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_INT_ARRAY: {
|
||||
case Variant::PACKED_INT32_ARRAY: {
|
||||
|
||||
f->store_32(VARIANT_INT_ARRAY);
|
||||
Vector<int> arr = p_property;
|
||||
f->store_32(VARIANT_INT32_ARRAY);
|
||||
Vector<int32_t> arr = p_property;
|
||||
int len = arr.size();
|
||||
f->store_32(len);
|
||||
const int *r = arr.ptr();
|
||||
const int32_t *r = arr.ptr();
|
||||
for (int i = 0; i < len; i++)
|
||||
f->store_32(r[i]);
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_REAL_ARRAY: {
|
||||
case Variant::PACKED_INT64_ARRAY: {
|
||||
|
||||
f->store_32(VARIANT_REAL_ARRAY);
|
||||
Vector<real_t> arr = p_property;
|
||||
f->store_32(VARIANT_INT64_ARRAY);
|
||||
Vector<int64_t> arr = p_property;
|
||||
int len = arr.size();
|
||||
f->store_32(len);
|
||||
const real_t *r = arr.ptr();
|
||||
const int64_t *r = arr.ptr();
|
||||
for (int i = 0; i < len; i++)
|
||||
f->store_64(r[i]);
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_FLOAT32_ARRAY: {
|
||||
|
||||
f->store_32(VARIANT_FLOAT32_ARRAY);
|
||||
Vector<float> arr = p_property;
|
||||
int len = arr.size();
|
||||
f->store_32(len);
|
||||
const float *r = arr.ptr();
|
||||
for (int i = 0; i < len; i++) {
|
||||
f->store_real(r[i]);
|
||||
}
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_FLOAT64_ARRAY: {
|
||||
|
||||
f->store_32(VARIANT_FLOAT64_ARRAY);
|
||||
Vector<double> arr = p_property;
|
||||
int len = arr.size();
|
||||
f->store_32(len);
|
||||
const double *r = arr.ptr();
|
||||
for (int i = 0; i < len; i++) {
|
||||
f->store_double(r[i]);
|
||||
}
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_STRING_ARRAY: {
|
||||
|
||||
|
|
|
@ -576,8 +576,8 @@ void AStar::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("get_point_path", "from_id", "to_id"), &AStar::get_point_path);
|
||||
ClassDB::bind_method(D_METHOD("get_id_path", "from_id", "to_id"), &AStar::get_id_path);
|
||||
|
||||
BIND_VMETHOD(MethodInfo(Variant::REAL, "_estimate_cost", PropertyInfo(Variant::INT, "from_id"), PropertyInfo(Variant::INT, "to_id")));
|
||||
BIND_VMETHOD(MethodInfo(Variant::REAL, "_compute_cost", PropertyInfo(Variant::INT, "from_id"), PropertyInfo(Variant::INT, "to_id")));
|
||||
BIND_VMETHOD(MethodInfo(Variant::FLOAT, "_estimate_cost", PropertyInfo(Variant::INT, "from_id"), PropertyInfo(Variant::INT, "to_id")));
|
||||
BIND_VMETHOD(MethodInfo(Variant::FLOAT, "_compute_cost", PropertyInfo(Variant::INT, "from_id"), PropertyInfo(Variant::INT, "to_id")));
|
||||
}
|
||||
|
||||
AStar::AStar() {
|
||||
|
|
|
@ -212,7 +212,7 @@ int Expression::get_func_argument_count(BuiltinFunc p_func) {
|
|||
if (!p_inputs[m_arg]->is_num()) { \
|
||||
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; \
|
||||
r_error.argument = m_arg; \
|
||||
r_error.expected = Variant::REAL; \
|
||||
r_error.expected = Variant::FLOAT; \
|
||||
return; \
|
||||
}
|
||||
|
||||
|
@ -314,7 +314,7 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant
|
|||
|
||||
int64_t i = *p_inputs[0];
|
||||
*r_return = ABS(i);
|
||||
} else if (p_inputs[0]->get_type() == Variant::REAL) {
|
||||
} else if (p_inputs[0]->get_type() == Variant::FLOAT) {
|
||||
|
||||
real_t r = *p_inputs[0];
|
||||
*r_return = Math::abs(r);
|
||||
|
@ -322,7 +322,7 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant
|
|||
|
||||
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
|
||||
r_error.argument = 0;
|
||||
r_error.expected = Variant::REAL;
|
||||
r_error.expected = Variant::FLOAT;
|
||||
}
|
||||
} break;
|
||||
case MATH_SIGN: {
|
||||
|
@ -331,7 +331,7 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant
|
|||
|
||||
int64_t i = *p_inputs[0];
|
||||
*r_return = i < 0 ? -1 : (i > 0 ? +1 : 0);
|
||||
} else if (p_inputs[0]->get_type() == Variant::REAL) {
|
||||
} else if (p_inputs[0]->get_type() == Variant::FLOAT) {
|
||||
|
||||
real_t r = *p_inputs[0];
|
||||
*r_return = r < 0.0 ? -1.0 : (r > 0.0 ? +1.0 : 0.0);
|
||||
|
@ -339,7 +339,7 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant
|
|||
|
||||
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
|
||||
r_error.argument = 0;
|
||||
r_error.expected = Variant::REAL;
|
||||
r_error.expected = Variant::FLOAT;
|
||||
}
|
||||
} break;
|
||||
case MATH_POW: {
|
||||
|
|
|
@ -133,8 +133,10 @@ MAKE_PTRARG(Callable);
|
|||
MAKE_PTRARG(Signal);
|
||||
MAKE_PTRARG(Array);
|
||||
MAKE_PTRARG(PackedByteArray);
|
||||
MAKE_PTRARG(PackedIntArray);
|
||||
MAKE_PTRARG(PackedRealArray);
|
||||
MAKE_PTRARG(PackedInt32Array);
|
||||
MAKE_PTRARG(PackedInt64Array);
|
||||
MAKE_PTRARG(PackedFloat32Array);
|
||||
MAKE_PTRARG(PackedFloat64Array);
|
||||
MAKE_PTRARG(PackedStringArray);
|
||||
MAKE_PTRARG(PackedVector2Array);
|
||||
MAKE_PTRARG(PackedVector3Array);
|
||||
|
|
|
@ -541,7 +541,7 @@ void InputEventMouseButton::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("set_doubleclick", "doubleclick"), &InputEventMouseButton::set_doubleclick);
|
||||
ClassDB::bind_method(D_METHOD("is_doubleclick"), &InputEventMouseButton::is_doubleclick);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "factor"), "set_factor", "get_factor");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "factor"), "set_factor", "get_factor");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "button_index"), "set_button_index", "get_button_index");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "pressed"), "set_pressed", "is_pressed");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "doubleclick"), "set_doubleclick", "is_doubleclick");
|
||||
|
@ -702,7 +702,7 @@ void InputEventMouseMotion::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("get_speed"), &InputEventMouseMotion::get_speed);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "tilt"), "set_tilt", "get_tilt");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "pressure"), "set_pressure", "get_pressure");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "pressure"), "set_pressure", "get_pressure");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "relative"), "set_relative", "get_relative");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "speed"), "set_speed", "get_speed");
|
||||
}
|
||||
|
@ -780,7 +780,7 @@ void InputEventJoypadMotion::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("get_axis_value"), &InputEventJoypadMotion::get_axis_value);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "axis"), "set_axis", "get_axis");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "axis_value"), "set_axis_value", "get_axis_value");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "axis_value"), "set_axis_value", "get_axis_value");
|
||||
}
|
||||
|
||||
InputEventJoypadMotion::InputEventJoypadMotion() {
|
||||
|
@ -861,7 +861,7 @@ void InputEventJoypadButton::_bind_methods() {
|
|||
// ClassDB::bind_method(D_METHOD("is_pressed"), &InputEventJoypadButton::is_pressed);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "button_index"), "set_button_index", "get_button_index");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "pressure"), "set_pressure", "get_pressure");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "pressure"), "set_pressure", "get_pressure");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "pressed"), "set_pressed", "is_pressed");
|
||||
}
|
||||
|
||||
|
@ -1100,7 +1100,7 @@ void InputEventAction::_bind_methods() {
|
|||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "action"), "set_action", "get_action");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "pressed"), "set_pressed", "is_pressed");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "strength", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_strength", "get_strength");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "strength", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_strength", "get_strength");
|
||||
}
|
||||
|
||||
InputEventAction::InputEventAction() {
|
||||
|
@ -1162,7 +1162,7 @@ void InputEventMagnifyGesture::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("set_factor", "factor"), &InputEventMagnifyGesture::set_factor);
|
||||
ClassDB::bind_method(D_METHOD("get_factor"), &InputEventMagnifyGesture::get_factor);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "factor"), "set_factor", "get_factor");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "factor"), "set_factor", "get_factor");
|
||||
}
|
||||
|
||||
InputEventMagnifyGesture::InputEventMagnifyGesture() {
|
||||
|
|
|
@ -44,8 +44,8 @@ void MainLoop::_bind_methods() {
|
|||
BIND_VMETHOD(MethodInfo("_input_event", PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent")));
|
||||
BIND_VMETHOD(MethodInfo("_input_text", PropertyInfo(Variant::STRING, "text")));
|
||||
BIND_VMETHOD(MethodInfo("_initialize"));
|
||||
BIND_VMETHOD(MethodInfo(Variant::BOOL, "_iteration", PropertyInfo(Variant::REAL, "delta")));
|
||||
BIND_VMETHOD(MethodInfo(Variant::BOOL, "_idle", PropertyInfo(Variant::REAL, "delta")));
|
||||
BIND_VMETHOD(MethodInfo(Variant::BOOL, "_iteration", PropertyInfo(Variant::FLOAT, "delta")));
|
||||
BIND_VMETHOD(MethodInfo(Variant::BOOL, "_idle", PropertyInfo(Variant::FLOAT, "delta")));
|
||||
BIND_VMETHOD(MethodInfo("_drop_files", PropertyInfo(Variant::PACKED_STRING_ARRAY, "files"), PropertyInfo(Variant::INT, "from_screen")));
|
||||
BIND_VMETHOD(MethodInfo("_finalize"));
|
||||
|
||||
|
|
|
@ -230,7 +230,7 @@ uint32_t PackedDataContainer::_pack(const Variant &p_data, Vector<uint8_t> &tmpd
|
|||
case Variant::NIL:
|
||||
case Variant::BOOL:
|
||||
case Variant::INT:
|
||||
case Variant::REAL:
|
||||
case Variant::FLOAT:
|
||||
case Variant::VECTOR2:
|
||||
case Variant::RECT2:
|
||||
case Variant::VECTOR3:
|
||||
|
@ -241,8 +241,10 @@ uint32_t PackedDataContainer::_pack(const Variant &p_data, Vector<uint8_t> &tmpd
|
|||
case Variant::BASIS:
|
||||
case Variant::TRANSFORM:
|
||||
case Variant::PACKED_BYTE_ARRAY:
|
||||
case Variant::PACKED_INT_ARRAY:
|
||||
case Variant::PACKED_REAL_ARRAY:
|
||||
case Variant::PACKED_INT32_ARRAY:
|
||||
case Variant::PACKED_INT64_ARRAY:
|
||||
case Variant::PACKED_FLOAT32_ARRAY:
|
||||
case Variant::PACKED_FLOAT64_ARRAY:
|
||||
case Variant::PACKED_STRING_ARRAY:
|
||||
case Variant::PACKED_VECTOR2_ARRAY:
|
||||
case Variant::PACKED_VECTOR3_ARRAY:
|
||||
|
|
|
@ -137,8 +137,8 @@ MAKE_TYPE_INFO_WITH_META(int32_t, Variant::INT, GodotTypeInfo::METADATA_INT_IS_I
|
|||
MAKE_TYPE_INFO_WITH_META(uint64_t, Variant::INT, GodotTypeInfo::METADATA_INT_IS_UINT64)
|
||||
MAKE_TYPE_INFO_WITH_META(int64_t, Variant::INT, GodotTypeInfo::METADATA_INT_IS_INT64)
|
||||
MAKE_TYPE_INFO(wchar_t, Variant::INT)
|
||||
MAKE_TYPE_INFO_WITH_META(float, Variant::REAL, GodotTypeInfo::METADATA_REAL_IS_FLOAT)
|
||||
MAKE_TYPE_INFO_WITH_META(double, Variant::REAL, GodotTypeInfo::METADATA_REAL_IS_DOUBLE)
|
||||
MAKE_TYPE_INFO_WITH_META(float, Variant::FLOAT, GodotTypeInfo::METADATA_REAL_IS_FLOAT)
|
||||
MAKE_TYPE_INFO_WITH_META(double, Variant::FLOAT, GodotTypeInfo::METADATA_REAL_IS_DOUBLE)
|
||||
|
||||
MAKE_TYPE_INFO(String, Variant::STRING)
|
||||
MAKE_TYPE_INFO(Vector2, Variant::VECTOR2)
|
||||
|
@ -159,8 +159,10 @@ MAKE_TYPE_INFO(Signal, Variant::SIGNAL)
|
|||
MAKE_TYPE_INFO(Dictionary, Variant::DICTIONARY)
|
||||
MAKE_TYPE_INFO(Array, Variant::ARRAY)
|
||||
MAKE_TYPE_INFO(PackedByteArray, Variant::PACKED_BYTE_ARRAY)
|
||||
MAKE_TYPE_INFO(PackedIntArray, Variant::PACKED_INT_ARRAY)
|
||||
MAKE_TYPE_INFO(PackedRealArray, Variant::PACKED_REAL_ARRAY)
|
||||
MAKE_TYPE_INFO(PackedInt32Array, Variant::PACKED_INT32_ARRAY)
|
||||
MAKE_TYPE_INFO(PackedInt64Array, Variant::PACKED_INT64_ARRAY)
|
||||
MAKE_TYPE_INFO(PackedFloat32Array, Variant::PACKED_FLOAT32_ARRAY)
|
||||
MAKE_TYPE_INFO(PackedFloat64Array, Variant::PACKED_FLOAT64_ARRAY)
|
||||
MAKE_TYPE_INFO(PackedStringArray, Variant::PACKED_STRING_ARRAY)
|
||||
MAKE_TYPE_INFO(PackedVector2Array, Variant::PACKED_VECTOR2_ARRAY)
|
||||
MAKE_TYPE_INFO(PackedVector3Array, Variant::PACKED_VECTOR3_ARRAY)
|
||||
|
@ -221,20 +223,6 @@ MAKE_TEMPLATE_TYPE_INFO(Vector, Plane, Variant::ARRAY)
|
|||
MAKE_TEMPLATE_TYPE_INFO(Vector, Face3, Variant::PACKED_VECTOR3_ARRAY)
|
||||
MAKE_TEMPLATE_TYPE_INFO(Vector, StringName, Variant::PACKED_STRING_ARRAY)
|
||||
|
||||
/*
|
||||
MAKE_TEMPLATE_TYPE_INFO(Vector, uint8_t, Variant::PACKED_BYTE_ARRAY)
|
||||
MAKE_TEMPLATE_TYPE_INFO(Vector, int, Variant::PACKED_INT_ARRAY)
|
||||
MAKE_TEMPLATE_TYPE_INFO(Vector, float, Variant::PACKED_REAL_ARRAY)
|
||||
MAKE_TEMPLATE_TYPE_INFO(Vector, String, Variant::PACKED_STRING_ARRAY)
|
||||
MAKE_TEMPLATE_TYPE_INFO(Vector, Vector2, Variant::PACKED_VECTOR2_ARRAY)
|
||||
MAKE_TEMPLATE_TYPE_INFO(Vector, Vector3, Variant::PACKED_VECTOR3_ARRAY)
|
||||
MAKE_TEMPLATE_TYPE_INFO(Vector, Color, Variant::PACKED_COLOR_ARRAY)
|
||||
|
||||
|
||||
MAKE_TEMPLATE_TYPE_INFO(Vector, Plane, Variant::ARRAY)
|
||||
MAKE_TEMPLATE_TYPE_INFO(Vector, Face3, Variant::PACKED_VECTOR3_ARRAY)
|
||||
*/
|
||||
|
||||
template <typename T>
|
||||
struct GetTypeInfo<T *, typename EnableIf<TypeInherits<Object, T>::value>::type> {
|
||||
static const Variant::Type VARIANT_TYPE = Variant::OBJECT;
|
||||
|
|
408
core/variant.cpp
408
core/variant.cpp
|
@ -57,7 +57,7 @@ String Variant::get_type_name(Variant::Type p_type) {
|
|||
return "int";
|
||||
|
||||
} break;
|
||||
case REAL: {
|
||||
case FLOAT: {
|
||||
|
||||
return "float";
|
||||
|
||||
|
@ -175,14 +175,24 @@ String Variant::get_type_name(Variant::Type p_type) {
|
|||
return "PackedByteArray";
|
||||
|
||||
} break;
|
||||
case PACKED_INT_ARRAY: {
|
||||
case PACKED_INT32_ARRAY: {
|
||||
|
||||
return "PackedIntArray";
|
||||
return "PackedInt32Array";
|
||||
|
||||
} break;
|
||||
case PACKED_REAL_ARRAY: {
|
||||
case PACKED_INT64_ARRAY: {
|
||||
|
||||
return "PackedRealArray";
|
||||
return "PackedInt64Array";
|
||||
|
||||
} break;
|
||||
case PACKED_FLOAT32_ARRAY: {
|
||||
|
||||
return "PackedFloat32Array";
|
||||
|
||||
} break;
|
||||
case PACKED_FLOAT64_ARRAY: {
|
||||
|
||||
return "PackedFloat64Array";
|
||||
|
||||
} break;
|
||||
case PACKED_STRING_ARRAY: {
|
||||
|
@ -230,7 +240,7 @@ bool Variant::can_convert(Variant::Type p_type_from, Variant::Type p_type_to) {
|
|||
|
||||
static const Type valid[] = {
|
||||
INT,
|
||||
REAL,
|
||||
FLOAT,
|
||||
STRING,
|
||||
NIL,
|
||||
};
|
||||
|
@ -241,7 +251,7 @@ bool Variant::can_convert(Variant::Type p_type_from, Variant::Type p_type_to) {
|
|||
|
||||
static const Type valid[] = {
|
||||
BOOL,
|
||||
REAL,
|
||||
FLOAT,
|
||||
STRING,
|
||||
NIL,
|
||||
};
|
||||
|
@ -249,7 +259,7 @@ bool Variant::can_convert(Variant::Type p_type_from, Variant::Type p_type_to) {
|
|||
valid_types = valid;
|
||||
|
||||
} break;
|
||||
case REAL: {
|
||||
case FLOAT: {
|
||||
|
||||
static const Type valid[] = {
|
||||
BOOL,
|
||||
|
@ -425,9 +435,11 @@ bool Variant::can_convert(Variant::Type p_type_from, Variant::Type p_type_to) {
|
|||
|
||||
static const Type valid[] = {
|
||||
PACKED_BYTE_ARRAY,
|
||||
PACKED_INT_ARRAY,
|
||||
PACKED_INT32_ARRAY,
|
||||
PACKED_INT64_ARRAY,
|
||||
PACKED_FLOAT32_ARRAY,
|
||||
PACKED_FLOAT64_ARRAY,
|
||||
PACKED_STRING_ARRAY,
|
||||
PACKED_REAL_ARRAY,
|
||||
PACKED_COLOR_ARRAY,
|
||||
PACKED_VECTOR2_ARRAY,
|
||||
PACKED_VECTOR3_ARRAY,
|
||||
|
@ -446,7 +458,7 @@ bool Variant::can_convert(Variant::Type p_type_from, Variant::Type p_type_to) {
|
|||
|
||||
valid_types = valid;
|
||||
} break;
|
||||
case PACKED_INT_ARRAY: {
|
||||
case PACKED_INT32_ARRAY: {
|
||||
|
||||
static const Type valid[] = {
|
||||
ARRAY,
|
||||
|
@ -454,7 +466,24 @@ bool Variant::can_convert(Variant::Type p_type_from, Variant::Type p_type_to) {
|
|||
};
|
||||
valid_types = valid;
|
||||
} break;
|
||||
case PACKED_REAL_ARRAY: {
|
||||
case PACKED_INT64_ARRAY: {
|
||||
|
||||
static const Type valid[] = {
|
||||
ARRAY,
|
||||
NIL
|
||||
};
|
||||
valid_types = valid;
|
||||
} break;
|
||||
case PACKED_FLOAT32_ARRAY: {
|
||||
|
||||
static const Type valid[] = {
|
||||
ARRAY,
|
||||
NIL
|
||||
};
|
||||
|
||||
valid_types = valid;
|
||||
} break;
|
||||
case PACKED_FLOAT64_ARRAY: {
|
||||
|
||||
static const Type valid[] = {
|
||||
ARRAY,
|
||||
|
@ -547,7 +576,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from, Variant::Type p_type
|
|||
|
||||
static const Type valid[] = {
|
||||
INT,
|
||||
REAL,
|
||||
FLOAT,
|
||||
//STRING,
|
||||
NIL,
|
||||
};
|
||||
|
@ -558,7 +587,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from, Variant::Type p_type
|
|||
|
||||
static const Type valid[] = {
|
||||
BOOL,
|
||||
REAL,
|
||||
FLOAT,
|
||||
//STRING,
|
||||
NIL,
|
||||
};
|
||||
|
@ -566,7 +595,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from, Variant::Type p_type
|
|||
valid_types = valid;
|
||||
|
||||
} break;
|
||||
case REAL: {
|
||||
case FLOAT: {
|
||||
|
||||
static const Type valid[] = {
|
||||
BOOL,
|
||||
|
@ -743,9 +772,11 @@ bool Variant::can_convert_strict(Variant::Type p_type_from, Variant::Type p_type
|
|||
|
||||
static const Type valid[] = {
|
||||
PACKED_BYTE_ARRAY,
|
||||
PACKED_INT_ARRAY,
|
||||
PACKED_INT32_ARRAY,
|
||||
PACKED_INT64_ARRAY,
|
||||
PACKED_FLOAT32_ARRAY,
|
||||
PACKED_FLOAT64_ARRAY,
|
||||
PACKED_STRING_ARRAY,
|
||||
PACKED_REAL_ARRAY,
|
||||
PACKED_COLOR_ARRAY,
|
||||
PACKED_VECTOR2_ARRAY,
|
||||
PACKED_VECTOR3_ARRAY,
|
||||
|
@ -764,7 +795,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from, Variant::Type p_type
|
|||
|
||||
valid_types = valid;
|
||||
} break;
|
||||
case PACKED_INT_ARRAY: {
|
||||
case PACKED_INT32_ARRAY: {
|
||||
|
||||
static const Type valid[] = {
|
||||
ARRAY,
|
||||
|
@ -772,7 +803,24 @@ bool Variant::can_convert_strict(Variant::Type p_type_from, Variant::Type p_type
|
|||
};
|
||||
valid_types = valid;
|
||||
} break;
|
||||
case PACKED_REAL_ARRAY: {
|
||||
case PACKED_INT64_ARRAY: {
|
||||
|
||||
static const Type valid[] = {
|
||||
ARRAY,
|
||||
NIL
|
||||
};
|
||||
valid_types = valid;
|
||||
} break;
|
||||
case PACKED_FLOAT32_ARRAY: {
|
||||
|
||||
static const Type valid[] = {
|
||||
ARRAY,
|
||||
NIL
|
||||
};
|
||||
|
||||
valid_types = valid;
|
||||
} break;
|
||||
case PACKED_FLOAT64_ARRAY: {
|
||||
|
||||
static const Type valid[] = {
|
||||
ARRAY,
|
||||
|
@ -882,9 +930,9 @@ bool Variant::is_zero() const {
|
|||
return _data._int == 0;
|
||||
|
||||
} break;
|
||||
case REAL: {
|
||||
case FLOAT: {
|
||||
|
||||
return _data._real == 0;
|
||||
return _data._float == 0;
|
||||
|
||||
} break;
|
||||
case STRING: {
|
||||
|
@ -1008,14 +1056,24 @@ bool Variant::is_zero() const {
|
|||
return PackedArrayRef<uint8_t>::get_array(_data.packed_array).size() == 0;
|
||||
|
||||
} break;
|
||||
case PACKED_INT_ARRAY: {
|
||||
case PACKED_INT32_ARRAY: {
|
||||
|
||||
return PackedArrayRef<int32_t>::get_array(_data.packed_array).size() == 0;
|
||||
|
||||
} break;
|
||||
case PACKED_REAL_ARRAY: {
|
||||
case PACKED_INT64_ARRAY: {
|
||||
|
||||
return PackedArrayRef<real_t>::get_array(_data.packed_array).size() == 0;
|
||||
return PackedArrayRef<int64_t>::get_array(_data.packed_array).size() == 0;
|
||||
|
||||
} break;
|
||||
case PACKED_FLOAT32_ARRAY: {
|
||||
|
||||
return PackedArrayRef<float>::get_array(_data.packed_array).size() == 0;
|
||||
|
||||
} break;
|
||||
case PACKED_FLOAT64_ARRAY: {
|
||||
|
||||
return PackedArrayRef<double>::get_array(_data.packed_array).size() == 0;
|
||||
|
||||
} break;
|
||||
case PACKED_STRING_ARRAY: {
|
||||
|
@ -1063,9 +1121,9 @@ bool Variant::is_one() const {
|
|||
return _data._int == 1;
|
||||
|
||||
} break;
|
||||
case REAL: {
|
||||
case FLOAT: {
|
||||
|
||||
return _data._real == 1;
|
||||
return _data._float == 1;
|
||||
|
||||
} break;
|
||||
case VECTOR2: {
|
||||
|
@ -1131,7 +1189,7 @@ void Variant::reference(const Variant &p_variant) {
|
|||
case NIL:
|
||||
case BOOL:
|
||||
case INT:
|
||||
case REAL:
|
||||
case FLOAT:
|
||||
break;
|
||||
default:
|
||||
clear();
|
||||
|
@ -1154,9 +1212,9 @@ void Variant::reference(const Variant &p_variant) {
|
|||
|
||||
_data._int = p_variant._data._int;
|
||||
} break;
|
||||
case REAL: {
|
||||
case FLOAT: {
|
||||
|
||||
_data._real = p_variant._data._real;
|
||||
_data._float = p_variant._data._float;
|
||||
} break;
|
||||
case STRING: {
|
||||
|
||||
|
@ -1281,7 +1339,7 @@ void Variant::reference(const Variant &p_variant) {
|
|||
}
|
||||
|
||||
} break;
|
||||
case PACKED_INT_ARRAY: {
|
||||
case PACKED_INT32_ARRAY: {
|
||||
|
||||
_data.packed_array = static_cast<PackedArrayRef<int32_t> *>(p_variant._data.packed_array)->reference();
|
||||
if (!_data.packed_array) {
|
||||
|
@ -1289,11 +1347,27 @@ void Variant::reference(const Variant &p_variant) {
|
|||
}
|
||||
|
||||
} break;
|
||||
case PACKED_REAL_ARRAY: {
|
||||
case PACKED_INT64_ARRAY: {
|
||||
|
||||
_data.packed_array = static_cast<PackedArrayRef<real_t> *>(p_variant._data.packed_array)->reference();
|
||||
_data.packed_array = static_cast<PackedArrayRef<int64_t> *>(p_variant._data.packed_array)->reference();
|
||||
if (!_data.packed_array) {
|
||||
_data.packed_array = PackedArrayRef<real_t>::create();
|
||||
_data.packed_array = PackedArrayRef<int64_t>::create();
|
||||
}
|
||||
|
||||
} break;
|
||||
case PACKED_FLOAT32_ARRAY: {
|
||||
|
||||
_data.packed_array = static_cast<PackedArrayRef<float> *>(p_variant._data.packed_array)->reference();
|
||||
if (!_data.packed_array) {
|
||||
_data.packed_array = PackedArrayRef<float>::create();
|
||||
}
|
||||
|
||||
} break;
|
||||
case PACKED_FLOAT64_ARRAY: {
|
||||
|
||||
_data.packed_array = static_cast<PackedArrayRef<double> *>(p_variant._data.packed_array)->reference();
|
||||
if (!_data.packed_array) {
|
||||
_data.packed_array = PackedArrayRef<double>::create();
|
||||
}
|
||||
|
||||
} break;
|
||||
|
@ -1339,7 +1413,7 @@ void Variant::zero() {
|
|||
case NIL: break;
|
||||
case BOOL: this->_data._bool = false; break;
|
||||
case INT: this->_data._int = 0; break;
|
||||
case REAL: this->_data._real = 0; break;
|
||||
case FLOAT: this->_data._float = 0; break;
|
||||
case VECTOR2: *reinterpret_cast<Vector2 *>(this->_data._mem) = Vector2(); break;
|
||||
case VECTOR2I: *reinterpret_cast<Vector2i *>(this->_data._mem) = Vector2i(); break;
|
||||
case RECT2: *reinterpret_cast<Rect2 *>(this->_data._mem) = Rect2(); break;
|
||||
|
@ -1432,11 +1506,19 @@ void Variant::clear() {
|
|||
|
||||
PackedArrayRefBase::destroy(_data.packed_array);
|
||||
} break;
|
||||
case PACKED_INT_ARRAY: {
|
||||
case PACKED_INT32_ARRAY: {
|
||||
|
||||
PackedArrayRefBase::destroy(_data.packed_array);
|
||||
} break;
|
||||
case PACKED_REAL_ARRAY: {
|
||||
case PACKED_INT64_ARRAY: {
|
||||
|
||||
PackedArrayRefBase::destroy(_data.packed_array);
|
||||
} break;
|
||||
case PACKED_FLOAT32_ARRAY: {
|
||||
|
||||
PackedArrayRefBase::destroy(_data.packed_array);
|
||||
} break;
|
||||
case PACKED_FLOAT64_ARRAY: {
|
||||
|
||||
PackedArrayRefBase::destroy(_data.packed_array);
|
||||
} break;
|
||||
|
@ -1470,7 +1552,7 @@ Variant::operator signed int() const {
|
|||
case NIL: return 0;
|
||||
case BOOL: return _data._bool ? 1 : 0;
|
||||
case INT: return _data._int;
|
||||
case REAL: return _data._real;
|
||||
case FLOAT: return _data._float;
|
||||
case STRING: return operator String().to_int();
|
||||
default: {
|
||||
|
||||
|
@ -1485,7 +1567,7 @@ Variant::operator unsigned int() const {
|
|||
case NIL: return 0;
|
||||
case BOOL: return _data._bool ? 1 : 0;
|
||||
case INT: return _data._int;
|
||||
case REAL: return _data._real;
|
||||
case FLOAT: return _data._float;
|
||||
case STRING: return operator String().to_int();
|
||||
default: {
|
||||
|
||||
|
@ -1501,7 +1583,7 @@ Variant::operator int64_t() const {
|
|||
case NIL: return 0;
|
||||
case BOOL: return _data._bool ? 1 : 0;
|
||||
case INT: return _data._int;
|
||||
case REAL: return _data._real;
|
||||
case FLOAT: return _data._float;
|
||||
case STRING: return operator String().to_int64();
|
||||
default: {
|
||||
|
||||
|
@ -1518,7 +1600,7 @@ Variant::operator long unsigned int() const {
|
|||
case NIL: return 0;
|
||||
case BOOL: return _data._bool ? 1 : 0;
|
||||
case INT: return _data._int;
|
||||
case REAL: return _data._real;
|
||||
case FLOAT: return _data._real;
|
||||
case STRING: return operator String().to_int();
|
||||
default: {
|
||||
|
||||
|
@ -1537,7 +1619,7 @@ Variant::operator uint64_t() const {
|
|||
case NIL: return 0;
|
||||
case BOOL: return _data._bool ? 1 : 0;
|
||||
case INT: return _data._int;
|
||||
case REAL: return _data._real;
|
||||
case FLOAT: return _data._float;
|
||||
case STRING: return operator String().to_int();
|
||||
default: {
|
||||
|
||||
|
@ -1564,7 +1646,7 @@ Variant::operator signed long() const {
|
|||
case NIL: return 0;
|
||||
case BOOL: return _data._bool ? 1 : 0;
|
||||
case INT: return _data._int;
|
||||
case REAL: return _data._real;
|
||||
case FLOAT: return _data._real;
|
||||
case STRING: return operator String().to_int();
|
||||
default: {
|
||||
|
||||
|
@ -1582,7 +1664,7 @@ Variant::operator unsigned long() const {
|
|||
case NIL: return 0;
|
||||
case BOOL: return _data._bool ? 1 : 0;
|
||||
case INT: return _data._int;
|
||||
case REAL: return _data._real;
|
||||
case FLOAT: return _data._real;
|
||||
case STRING: return operator String().to_int();
|
||||
default: {
|
||||
|
||||
|
@ -1601,7 +1683,7 @@ Variant::operator signed short() const {
|
|||
case NIL: return 0;
|
||||
case BOOL: return _data._bool ? 1 : 0;
|
||||
case INT: return _data._int;
|
||||
case REAL: return _data._real;
|
||||
case FLOAT: return _data._float;
|
||||
case STRING: return operator String().to_int();
|
||||
default: {
|
||||
|
||||
|
@ -1616,7 +1698,7 @@ Variant::operator unsigned short() const {
|
|||
case NIL: return 0;
|
||||
case BOOL: return _data._bool ? 1 : 0;
|
||||
case INT: return _data._int;
|
||||
case REAL: return _data._real;
|
||||
case FLOAT: return _data._float;
|
||||
case STRING: return operator String().to_int();
|
||||
default: {
|
||||
|
||||
|
@ -1631,7 +1713,7 @@ Variant::operator signed char() const {
|
|||
case NIL: return 0;
|
||||
case BOOL: return _data._bool ? 1 : 0;
|
||||
case INT: return _data._int;
|
||||
case REAL: return _data._real;
|
||||
case FLOAT: return _data._float;
|
||||
case STRING: return operator String().to_int();
|
||||
default: {
|
||||
|
||||
|
@ -1646,7 +1728,7 @@ Variant::operator unsigned char() const {
|
|||
case NIL: return 0;
|
||||
case BOOL: return _data._bool ? 1 : 0;
|
||||
case INT: return _data._int;
|
||||
case REAL: return _data._real;
|
||||
case FLOAT: return _data._float;
|
||||
case STRING: return operator String().to_int();
|
||||
default: {
|
||||
|
||||
|
@ -1667,7 +1749,7 @@ Variant::operator float() const {
|
|||
case NIL: return 0;
|
||||
case BOOL: return _data._bool ? 1.0 : 0.0;
|
||||
case INT: return (float)_data._int;
|
||||
case REAL: return _data._real;
|
||||
case FLOAT: return _data._float;
|
||||
case STRING: return operator String().to_double();
|
||||
default: {
|
||||
|
||||
|
@ -1682,7 +1764,7 @@ Variant::operator double() const {
|
|||
case NIL: return 0;
|
||||
case BOOL: return _data._bool ? 1.0 : 0.0;
|
||||
case INT: return (double)_data._int;
|
||||
case REAL: return _data._real;
|
||||
case FLOAT: return _data._float;
|
||||
case STRING: return operator String().to_double();
|
||||
default: {
|
||||
|
||||
|
@ -1725,7 +1807,7 @@ String Variant::stringify(List<const void *> &stack) const {
|
|||
case NIL: return "Null";
|
||||
case BOOL: return _data._bool ? "True" : "False";
|
||||
case INT: return itos(_data._int);
|
||||
case REAL: return rtos(_data._real);
|
||||
case FLOAT: return rtos(_data._float);
|
||||
case STRING: return *reinterpret_cast<const String *>(_data._mem);
|
||||
case VECTOR2: return "(" + operator Vector2() + ")";
|
||||
case VECTOR2I: return "(" + operator Vector2i() + ")";
|
||||
|
@ -1847,9 +1929,9 @@ String Variant::stringify(List<const void *> &stack) const {
|
|||
str += "]";
|
||||
return str;
|
||||
} break;
|
||||
case PACKED_INT_ARRAY: {
|
||||
case PACKED_INT32_ARRAY: {
|
||||
|
||||
Vector<int> vec = operator Vector<int>();
|
||||
Vector<int32_t> vec = operator Vector<int32_t>();
|
||||
String str("[");
|
||||
for (int i = 0; i < vec.size(); i++) {
|
||||
|
||||
|
@ -1860,9 +1942,35 @@ String Variant::stringify(List<const void *> &stack) const {
|
|||
str += "]";
|
||||
return str;
|
||||
} break;
|
||||
case PACKED_REAL_ARRAY: {
|
||||
case PACKED_INT64_ARRAY: {
|
||||
|
||||
Vector<real_t> vec = operator Vector<real_t>();
|
||||
Vector<int64_t> vec = operator Vector<int64_t>();
|
||||
String str("[");
|
||||
for (int i = 0; i < vec.size(); i++) {
|
||||
|
||||
if (i > 0)
|
||||
str += ", ";
|
||||
str = str + itos(vec[i]);
|
||||
}
|
||||
str += "]";
|
||||
return str;
|
||||
} break;
|
||||
case PACKED_FLOAT32_ARRAY: {
|
||||
|
||||
Vector<float> vec = operator Vector<float>();
|
||||
String str("[");
|
||||
for (int i = 0; i < vec.size(); i++) {
|
||||
|
||||
if (i > 0)
|
||||
str += ", ";
|
||||
str = str + rtos(vec[i]);
|
||||
}
|
||||
str += "]";
|
||||
return str;
|
||||
} break;
|
||||
case PACKED_FLOAT64_ARRAY: {
|
||||
|
||||
Vector<double> vec = operator Vector<double>();
|
||||
String str("[");
|
||||
for (int i = 0; i < vec.size(); i++) {
|
||||
|
||||
|
@ -2218,11 +2326,17 @@ inline DA _convert_array_from_variant(const Variant &p_variant) {
|
|||
case Variant::PACKED_BYTE_ARRAY: {
|
||||
return _convert_array<DA, Vector<uint8_t> >(p_variant.operator Vector<uint8_t>());
|
||||
}
|
||||
case Variant::PACKED_INT_ARRAY: {
|
||||
return _convert_array<DA, Vector<int> >(p_variant.operator Vector<int>());
|
||||
case Variant::PACKED_INT32_ARRAY: {
|
||||
return _convert_array<DA, Vector<int32_t> >(p_variant.operator Vector<int32_t>());
|
||||
}
|
||||
case Variant::PACKED_REAL_ARRAY: {
|
||||
return _convert_array<DA, Vector<real_t> >(p_variant.operator Vector<real_t>());
|
||||
case Variant::PACKED_INT64_ARRAY: {
|
||||
return _convert_array<DA, Vector<int64_t> >(p_variant.operator Vector<int64_t>());
|
||||
}
|
||||
case Variant::PACKED_FLOAT32_ARRAY: {
|
||||
return _convert_array<DA, Vector<float> >(p_variant.operator Vector<float>());
|
||||
}
|
||||
case Variant::PACKED_FLOAT64_ARRAY: {
|
||||
return _convert_array<DA, Vector<double> >(p_variant.operator Vector<double>());
|
||||
}
|
||||
case Variant::PACKED_STRING_ARRAY: {
|
||||
return _convert_array<DA, Vector<String> >(p_variant.operator Vector<String>());
|
||||
|
@ -2257,19 +2371,35 @@ Variant::operator Vector<uint8_t>() const {
|
|||
else
|
||||
return _convert_array_from_variant<Vector<uint8_t> >(*this);
|
||||
}
|
||||
Variant::operator Vector<int>() const {
|
||||
Variant::operator Vector<int32_t>() const {
|
||||
|
||||
if (type == PACKED_INT_ARRAY)
|
||||
if (type == PACKED_INT32_ARRAY)
|
||||
return static_cast<PackedArrayRef<int32_t> *>(_data.packed_array)->array;
|
||||
else
|
||||
return _convert_array_from_variant<Vector<int> >(*this);
|
||||
}
|
||||
Variant::operator Vector<real_t>() const {
|
||||
Variant::operator Vector<int64_t>() const {
|
||||
|
||||
if (type == PACKED_REAL_ARRAY)
|
||||
return static_cast<PackedArrayRef<real_t> *>(_data.packed_array)->array;
|
||||
if (type == PACKED_INT64_ARRAY)
|
||||
return static_cast<PackedArrayRef<int64_t> *>(_data.packed_array)->array;
|
||||
else
|
||||
return _convert_array_from_variant<Vector<real_t> >(*this);
|
||||
return _convert_array_from_variant<Vector<int64_t> >(*this);
|
||||
}
|
||||
|
||||
Variant::operator Vector<float>() const {
|
||||
|
||||
if (type == PACKED_FLOAT32_ARRAY)
|
||||
return static_cast<PackedArrayRef<float> *>(_data.packed_array)->array;
|
||||
else
|
||||
return _convert_array_from_variant<Vector<float> >(*this);
|
||||
}
|
||||
|
||||
Variant::operator Vector<double>() const {
|
||||
|
||||
if (type == PACKED_FLOAT64_ARRAY)
|
||||
return static_cast<PackedArrayRef<double> *>(_data.packed_array)->array;
|
||||
else
|
||||
return _convert_array_from_variant<Vector<double> >(*this);
|
||||
}
|
||||
|
||||
Variant::operator Vector<String>() const {
|
||||
|
@ -2388,7 +2518,7 @@ Variant::operator Orientation() const {
|
|||
|
||||
Variant::operator IP_Address() const {
|
||||
|
||||
if (type == PACKED_REAL_ARRAY || type == PACKED_INT_ARRAY || type == PACKED_BYTE_ARRAY) {
|
||||
if (type == PACKED_FLOAT32_ARRAY || type == PACKED_INT32_ARRAY || type == PACKED_FLOAT64_ARRAY || type == PACKED_INT64_ARRAY || type == PACKED_BYTE_ARRAY) {
|
||||
|
||||
Vector<int> addr = operator Vector<int>();
|
||||
if (addr.size() == 4) {
|
||||
|
@ -2472,13 +2602,13 @@ Variant::Variant(unsigned char p_char) {
|
|||
}
|
||||
Variant::Variant(float p_float) {
|
||||
|
||||
type = REAL;
|
||||
_data._real = p_float;
|
||||
type = FLOAT;
|
||||
_data._float = p_float;
|
||||
}
|
||||
Variant::Variant(double p_double) {
|
||||
|
||||
type = REAL;
|
||||
_data._real = p_double;
|
||||
type = FLOAT;
|
||||
_data._float = p_double;
|
||||
}
|
||||
|
||||
Variant::Variant(const ObjectID &p_id) {
|
||||
|
@ -2670,22 +2800,36 @@ Variant::Variant(const Vector<RID> &p_array) {
|
|||
}
|
||||
}
|
||||
|
||||
Variant::Variant(const Vector<uint8_t> &p_raw_array) {
|
||||
Variant::Variant(const Vector<uint8_t> &p_byte_array) {
|
||||
|
||||
type = PACKED_BYTE_ARRAY;
|
||||
|
||||
_data.packed_array = PackedArrayRef<uint8_t>::create(p_raw_array);
|
||||
_data.packed_array = PackedArrayRef<uint8_t>::create(p_byte_array);
|
||||
}
|
||||
Variant::Variant(const Vector<int> &p_int_array) {
|
||||
Variant::Variant(const Vector<int32_t> &p_int32_array) {
|
||||
|
||||
type = PACKED_INT_ARRAY;
|
||||
_data.packed_array = PackedArrayRef<int32_t>::create(p_int_array);
|
||||
type = PACKED_INT32_ARRAY;
|
||||
_data.packed_array = PackedArrayRef<int32_t>::create(p_int32_array);
|
||||
}
|
||||
Variant::Variant(const Vector<real_t> &p_real_array) {
|
||||
|
||||
type = PACKED_REAL_ARRAY;
|
||||
_data.packed_array = PackedArrayRef<real_t>::create(p_real_array);
|
||||
Variant::Variant(const Vector<int64_t> &p_int64_array) {
|
||||
|
||||
type = PACKED_INT64_ARRAY;
|
||||
_data.packed_array = PackedArrayRef<int64_t>::create(p_int64_array);
|
||||
}
|
||||
|
||||
Variant::Variant(const Vector<float> &p_float32_array) {
|
||||
|
||||
type = PACKED_FLOAT32_ARRAY;
|
||||
_data.packed_array = PackedArrayRef<float>::create(p_float32_array);
|
||||
}
|
||||
|
||||
Variant::Variant(const Vector<double> &p_float64_array) {
|
||||
|
||||
type = PACKED_FLOAT64_ARRAY;
|
||||
_data.packed_array = PackedArrayRef<double>::create(p_float64_array);
|
||||
}
|
||||
|
||||
Variant::Variant(const Vector<String> &p_string_array) {
|
||||
|
||||
type = PACKED_STRING_ARRAY;
|
||||
|
@ -2777,9 +2921,9 @@ void Variant::operator=(const Variant &p_variant) {
|
|||
|
||||
_data._int = p_variant._data._int;
|
||||
} break;
|
||||
case REAL: {
|
||||
case FLOAT: {
|
||||
|
||||
_data._real = p_variant._data._real;
|
||||
_data._float = p_variant._data._float;
|
||||
} break;
|
||||
case STRING: {
|
||||
|
||||
|
@ -2900,13 +3044,21 @@ void Variant::operator=(const Variant &p_variant) {
|
|||
|
||||
_data.packed_array = PackedArrayRef<uint8_t>::reference_from(_data.packed_array, p_variant._data.packed_array);
|
||||
} break;
|
||||
case PACKED_INT_ARRAY: {
|
||||
case PACKED_INT32_ARRAY: {
|
||||
|
||||
_data.packed_array = PackedArrayRef<int32_t>::reference_from(_data.packed_array, p_variant._data.packed_array);
|
||||
} break;
|
||||
case PACKED_REAL_ARRAY: {
|
||||
case PACKED_INT64_ARRAY: {
|
||||
|
||||
_data.packed_array = PackedArrayRef<real_t>::reference_from(_data.packed_array, p_variant._data.packed_array);
|
||||
_data.packed_array = PackedArrayRef<int64_t>::reference_from(_data.packed_array, p_variant._data.packed_array);
|
||||
} break;
|
||||
case PACKED_FLOAT32_ARRAY: {
|
||||
|
||||
_data.packed_array = PackedArrayRef<float>::reference_from(_data.packed_array, p_variant._data.packed_array);
|
||||
} break;
|
||||
case PACKED_FLOAT64_ARRAY: {
|
||||
|
||||
_data.packed_array = PackedArrayRef<double>::reference_from(_data.packed_array, p_variant._data.packed_array);
|
||||
} break;
|
||||
case PACKED_STRING_ARRAY: {
|
||||
|
||||
|
@ -2962,9 +3114,9 @@ uint32_t Variant::hash() const {
|
|||
|
||||
return _data._int;
|
||||
} break;
|
||||
case REAL: {
|
||||
case FLOAT: {
|
||||
|
||||
return hash_djb2_one_float(_data._real);
|
||||
return hash_djb2_one_float(_data._float);
|
||||
} break;
|
||||
case STRING: {
|
||||
|
||||
|
@ -3140,26 +3292,51 @@ uint32_t Variant::hash() const {
|
|||
}
|
||||
|
||||
} break;
|
||||
case PACKED_INT_ARRAY: {
|
||||
case PACKED_INT32_ARRAY: {
|
||||
|
||||
const Vector<int32_t> &arr = PackedArrayRef<int32_t>::get_array(_data.packed_array);
|
||||
int len = arr.size();
|
||||
if (likely(len)) {
|
||||
const int *r = arr.ptr();
|
||||
return hash_djb2_buffer((uint8_t *)&r[0], len * sizeof(int));
|
||||
const int32_t *r = arr.ptr();
|
||||
return hash_djb2_buffer((uint8_t *)&r[0], len * sizeof(int32_t));
|
||||
} else {
|
||||
return hash_djb2_one_64(0);
|
||||
}
|
||||
|
||||
} break;
|
||||
case PACKED_REAL_ARRAY: {
|
||||
case PACKED_INT64_ARRAY: {
|
||||
|
||||
const Vector<real_t> &arr = PackedArrayRef<real_t>::get_array(_data.packed_array);
|
||||
const Vector<int64_t> &arr = PackedArrayRef<int64_t>::get_array(_data.packed_array);
|
||||
int len = arr.size();
|
||||
if (likely(len)) {
|
||||
const int64_t *r = arr.ptr();
|
||||
return hash_djb2_buffer((uint8_t *)&r[0], len * sizeof(int64_t));
|
||||
} else {
|
||||
return hash_djb2_one_64(0);
|
||||
}
|
||||
|
||||
} break;
|
||||
case PACKED_FLOAT32_ARRAY: {
|
||||
|
||||
const Vector<float> &arr = PackedArrayRef<float>::get_array(_data.packed_array);
|
||||
int len = arr.size();
|
||||
|
||||
if (likely(len)) {
|
||||
const real_t *r = arr.ptr();
|
||||
return hash_djb2_buffer((uint8_t *)&r[0], len * sizeof(real_t));
|
||||
const float *r = arr.ptr();
|
||||
return hash_djb2_buffer((uint8_t *)&r[0], len * sizeof(float));
|
||||
} else {
|
||||
return hash_djb2_one_float(0.0);
|
||||
}
|
||||
|
||||
} break;
|
||||
case PACKED_FLOAT64_ARRAY: {
|
||||
|
||||
const Vector<double> &arr = PackedArrayRef<double>::get_array(_data.packed_array);
|
||||
int len = arr.size();
|
||||
|
||||
if (likely(len)) {
|
||||
const double *r = arr.ptr();
|
||||
return hash_djb2_buffer((uint8_t *)&r[0], len * sizeof(double));
|
||||
} else {
|
||||
return hash_djb2_one_float(0.0);
|
||||
}
|
||||
|
@ -3266,21 +3443,21 @@ uint32_t Variant::hash() const {
|
|||
(hash_compare_scalar((p_lhs).b, (p_rhs).b)) && \
|
||||
(hash_compare_scalar((p_lhs).a, (p_rhs).a))
|
||||
|
||||
#define hash_compare_pool_array(p_lhs, p_rhs, p_type, p_compare_func) \
|
||||
const Vector<p_type> &l = *reinterpret_cast<const Vector<p_type> *>(p_lhs); \
|
||||
const Vector<p_type> &r = *reinterpret_cast<const Vector<p_type> *>(p_rhs); \
|
||||
\
|
||||
if (l.size() != r.size()) \
|
||||
return false; \
|
||||
\
|
||||
const p_type *lr = l.ptr(); \
|
||||
const p_type *rr = r.ptr(); \
|
||||
\
|
||||
for (int i = 0; i < l.size(); ++i) { \
|
||||
if (!p_compare_func((lr[i]), (rr[i]))) \
|
||||
return false; \
|
||||
} \
|
||||
\
|
||||
#define hash_compare_packed_array(p_lhs, p_rhs, p_type, p_compare_func) \
|
||||
const Vector<p_type> &l = PackedArrayRef<p_type>::get_array(p_lhs); \
|
||||
const Vector<p_type> &r = PackedArrayRef<p_type>::get_array(p_rhs); \
|
||||
\
|
||||
if (l.size() != r.size()) \
|
||||
return false; \
|
||||
\
|
||||
const p_type *lr = l.ptr(); \
|
||||
const p_type *rr = r.ptr(); \
|
||||
\
|
||||
for (int i = 0; i < l.size(); ++i) { \
|
||||
if (!p_compare_func((lr[i]), (rr[i]))) \
|
||||
return false; \
|
||||
} \
|
||||
\
|
||||
return true
|
||||
|
||||
bool Variant::hash_compare(const Variant &p_variant) const {
|
||||
|
@ -3288,8 +3465,8 @@ bool Variant::hash_compare(const Variant &p_variant) const {
|
|||
return false;
|
||||
|
||||
switch (type) {
|
||||
case REAL: {
|
||||
return hash_compare_scalar(_data._real, p_variant._data._real);
|
||||
case FLOAT: {
|
||||
return hash_compare_scalar(_data._float, p_variant._data._float);
|
||||
} break;
|
||||
|
||||
case VECTOR2: {
|
||||
|
@ -3413,20 +3590,25 @@ bool Variant::hash_compare(const Variant &p_variant) const {
|
|||
return true;
|
||||
} break;
|
||||
|
||||
case PACKED_REAL_ARRAY: {
|
||||
hash_compare_pool_array(_data._mem, p_variant._data._mem, real_t, hash_compare_scalar);
|
||||
// This is for floating point comparisons only.
|
||||
case PACKED_FLOAT32_ARRAY: {
|
||||
hash_compare_packed_array(_data.packed_array, p_variant._data.packed_array, float, hash_compare_scalar);
|
||||
} break;
|
||||
|
||||
case PACKED_FLOAT64_ARRAY: {
|
||||
hash_compare_packed_array(_data.packed_array, p_variant._data.packed_array, double, hash_compare_scalar);
|
||||
} break;
|
||||
|
||||
case PACKED_VECTOR2_ARRAY: {
|
||||
hash_compare_pool_array(_data._mem, p_variant._data._mem, Vector2, hash_compare_vector2);
|
||||
hash_compare_packed_array(_data.packed_array, p_variant._data.packed_array, Vector2, hash_compare_vector2);
|
||||
} break;
|
||||
|
||||
case PACKED_VECTOR3_ARRAY: {
|
||||
hash_compare_pool_array(_data._mem, p_variant._data._mem, Vector3, hash_compare_vector3);
|
||||
hash_compare_packed_array(_data.packed_array, p_variant._data.packed_array, Vector3, hash_compare_vector3);
|
||||
} break;
|
||||
|
||||
case PACKED_COLOR_ARRAY: {
|
||||
hash_compare_pool_array(_data._mem, p_variant._data._mem, Color, hash_compare_color);
|
||||
hash_compare_packed_array(_data.packed_array, p_variant._data.packed_array, Color, hash_compare_color);
|
||||
} break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -58,8 +58,10 @@ struct PropertyInfo;
|
|||
struct MethodInfo;
|
||||
|
||||
typedef Vector<uint8_t> PackedByteArray;
|
||||
typedef Vector<int> PackedIntArray;
|
||||
typedef Vector<real_t> PackedRealArray;
|
||||
typedef Vector<int32_t> PackedInt32Array;
|
||||
typedef Vector<int64_t> PackedInt64Array;
|
||||
typedef Vector<float> PackedFloat32Array;
|
||||
typedef Vector<double> PackedFloat64Array;
|
||||
typedef Vector<String> PackedStringArray;
|
||||
typedef Vector<Vector2> PackedVector2Array;
|
||||
typedef Vector<Vector3> PackedVector3Array;
|
||||
|
@ -82,7 +84,7 @@ public:
|
|||
// atomic types
|
||||
BOOL,
|
||||
INT,
|
||||
REAL,
|
||||
FLOAT,
|
||||
STRING,
|
||||
|
||||
// math types
|
||||
|
@ -112,8 +114,10 @@ public:
|
|||
ARRAY,
|
||||
// arrays
|
||||
PACKED_BYTE_ARRAY, // 20
|
||||
PACKED_INT_ARRAY,
|
||||
PACKED_REAL_ARRAY,
|
||||
PACKED_INT32_ARRAY,
|
||||
PACKED_INT64_ARRAY,
|
||||
PACKED_FLOAT32_ARRAY,
|
||||
PACKED_FLOAT64_ARRAY,
|
||||
PACKED_STRING_ARRAY,
|
||||
PACKED_VECTOR2_ARRAY,
|
||||
PACKED_VECTOR3_ARRAY, // 25
|
||||
|
@ -201,7 +205,7 @@ private:
|
|||
union {
|
||||
bool _bool;
|
||||
int64_t _int;
|
||||
double _real;
|
||||
double _float;
|
||||
Transform2D *_transform2d;
|
||||
::AABB *_aabb;
|
||||
Basis *_basis;
|
||||
|
@ -224,7 +228,7 @@ public:
|
|||
|
||||
bool is_ref() const;
|
||||
_FORCE_INLINE_ bool is_num() const {
|
||||
return type == INT || type == REAL;
|
||||
return type == INT || type == FLOAT;
|
||||
};
|
||||
_FORCE_INLINE_ bool is_array() const {
|
||||
return type >= ARRAY;
|
||||
|
@ -284,8 +288,10 @@ public:
|
|||
operator Array() const;
|
||||
|
||||
operator Vector<uint8_t>() const;
|
||||
operator Vector<int>() const;
|
||||
operator Vector<real_t>() const;
|
||||
operator Vector<int32_t>() const;
|
||||
operator Vector<int64_t>() const;
|
||||
operator Vector<float>() const;
|
||||
operator Vector<double>() const;
|
||||
operator Vector<String>() const;
|
||||
operator Vector<Vector3>() const;
|
||||
operator Vector<Color>() const;
|
||||
|
@ -349,9 +355,11 @@ public:
|
|||
|
||||
Variant(const Array &p_array);
|
||||
Variant(const Vector<Plane> &p_array); // helper
|
||||
Variant(const Vector<uint8_t> &p_raw_array);
|
||||
Variant(const Vector<int> &p_int_array);
|
||||
Variant(const Vector<real_t> &p_real_array);
|
||||
Variant(const Vector<uint8_t> &p_byte_array);
|
||||
Variant(const Vector<int32_t> &p_int32_array);
|
||||
Variant(const Vector<int64_t> &p_int64_array);
|
||||
Variant(const Vector<float> &p_float32_array);
|
||||
Variant(const Vector<double> &p_float64_array);
|
||||
Variant(const Vector<String> &p_string_array);
|
||||
Variant(const Vector<Vector3> &p_vector3_array);
|
||||
Variant(const Vector<Color> &p_color_array);
|
||||
|
|
|
@ -704,29 +704,53 @@ struct _VariantCall {
|
|||
VCALL_PARRMEM0(PackedByteArray, uint8_t, invert);
|
||||
VCALL_PARRMEM2R(PackedByteArray, uint8_t, subarray);
|
||||
|
||||
VCALL_PARRMEM0R(PackedIntArray, int32_t, size);
|
||||
VCALL_PARRMEM0R(PackedIntArray, int32_t, empty);
|
||||
VCALL_PARRMEM2(PackedIntArray, int32_t, set);
|
||||
VCALL_PARRMEM1R(PackedIntArray, int32_t, get);
|
||||
VCALL_PARRMEM1(PackedIntArray, int32_t, push_back);
|
||||
VCALL_PARRMEM1(PackedIntArray, int32_t, resize);
|
||||
VCALL_PARRMEM2R(PackedIntArray, int32_t, insert);
|
||||
VCALL_PARRMEM1(PackedIntArray, int32_t, remove);
|
||||
VCALL_PARRMEM1(PackedIntArray, int32_t, append);
|
||||
VCALL_PARRMEM1(PackedIntArray, int32_t, append_array);
|
||||
VCALL_PARRMEM0(PackedIntArray, int32_t, invert);
|
||||
VCALL_PARRMEM0R(PackedInt32Array, int32_t, size);
|
||||
VCALL_PARRMEM0R(PackedInt32Array, int32_t, empty);
|
||||
VCALL_PARRMEM2(PackedInt32Array, int32_t, set);
|
||||
VCALL_PARRMEM1R(PackedInt32Array, int32_t, get);
|
||||
VCALL_PARRMEM1(PackedInt32Array, int32_t, push_back);
|
||||
VCALL_PARRMEM1(PackedInt32Array, int32_t, resize);
|
||||
VCALL_PARRMEM2R(PackedInt32Array, int32_t, insert);
|
||||
VCALL_PARRMEM1(PackedInt32Array, int32_t, remove);
|
||||
VCALL_PARRMEM1(PackedInt32Array, int32_t, append);
|
||||
VCALL_PARRMEM1(PackedInt32Array, int32_t, append_array);
|
||||
VCALL_PARRMEM0(PackedInt32Array, int32_t, invert);
|
||||
|
||||
VCALL_PARRMEM0R(PackedRealArray, real_t, size);
|
||||
VCALL_PARRMEM0R(PackedRealArray, real_t, empty);
|
||||
VCALL_PARRMEM2(PackedRealArray, real_t, set);
|
||||
VCALL_PARRMEM1R(PackedRealArray, real_t, get);
|
||||
VCALL_PARRMEM1(PackedRealArray, real_t, push_back);
|
||||
VCALL_PARRMEM1(PackedRealArray, real_t, resize);
|
||||
VCALL_PARRMEM2R(PackedRealArray, real_t, insert);
|
||||
VCALL_PARRMEM1(PackedRealArray, real_t, remove);
|
||||
VCALL_PARRMEM1(PackedRealArray, real_t, append);
|
||||
VCALL_PARRMEM1(PackedRealArray, real_t, append_array);
|
||||
VCALL_PARRMEM0(PackedRealArray, real_t, invert);
|
||||
VCALL_PARRMEM0R(PackedInt64Array, int64_t, size);
|
||||
VCALL_PARRMEM0R(PackedInt64Array, int64_t, empty);
|
||||
VCALL_PARRMEM2(PackedInt64Array, int64_t, set);
|
||||
VCALL_PARRMEM1R(PackedInt64Array, int64_t, get);
|
||||
VCALL_PARRMEM1(PackedInt64Array, int64_t, push_back);
|
||||
VCALL_PARRMEM1(PackedInt64Array, int64_t, resize);
|
||||
VCALL_PARRMEM2R(PackedInt64Array, int64_t, insert);
|
||||
VCALL_PARRMEM1(PackedInt64Array, int64_t, remove);
|
||||
VCALL_PARRMEM1(PackedInt64Array, int64_t, append);
|
||||
VCALL_PARRMEM1(PackedInt64Array, int64_t, append_array);
|
||||
VCALL_PARRMEM0(PackedInt64Array, int64_t, invert);
|
||||
|
||||
VCALL_PARRMEM0R(PackedFloat32Array, float, size);
|
||||
VCALL_PARRMEM0R(PackedFloat32Array, float, empty);
|
||||
VCALL_PARRMEM2(PackedFloat32Array, float, set);
|
||||
VCALL_PARRMEM1R(PackedFloat32Array, float, get);
|
||||
VCALL_PARRMEM1(PackedFloat32Array, float, push_back);
|
||||
VCALL_PARRMEM1(PackedFloat32Array, float, resize);
|
||||
VCALL_PARRMEM2R(PackedFloat32Array, float, insert);
|
||||
VCALL_PARRMEM1(PackedFloat32Array, float, remove);
|
||||
VCALL_PARRMEM1(PackedFloat32Array, float, append);
|
||||
VCALL_PARRMEM1(PackedFloat32Array, float, append_array);
|
||||
VCALL_PARRMEM0(PackedFloat32Array, float, invert);
|
||||
|
||||
VCALL_PARRMEM0R(PackedFloat64Array, double, size);
|
||||
VCALL_PARRMEM0R(PackedFloat64Array, double, empty);
|
||||
VCALL_PARRMEM2(PackedFloat64Array, double, set);
|
||||
VCALL_PARRMEM1R(PackedFloat64Array, double, get);
|
||||
VCALL_PARRMEM1(PackedFloat64Array, double, push_back);
|
||||
VCALL_PARRMEM1(PackedFloat64Array, double, resize);
|
||||
VCALL_PARRMEM2R(PackedFloat64Array, double, insert);
|
||||
VCALL_PARRMEM1(PackedFloat64Array, double, remove);
|
||||
VCALL_PARRMEM1(PackedFloat64Array, double, append);
|
||||
VCALL_PARRMEM1(PackedFloat64Array, double, append_array);
|
||||
VCALL_PARRMEM0(PackedFloat64Array, double, invert);
|
||||
|
||||
VCALL_PARRMEM0R(PackedStringArray, String, size);
|
||||
VCALL_PARRMEM0R(PackedStringArray, String, empty);
|
||||
|
@ -1261,7 +1285,7 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i
|
|||
// atomic types
|
||||
case BOOL: return Variant(false);
|
||||
case INT: return 0;
|
||||
case REAL: return 0.0f;
|
||||
case FLOAT: return 0.0f;
|
||||
case STRING:
|
||||
return String();
|
||||
|
||||
|
@ -1293,8 +1317,10 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i
|
|||
case ARRAY:
|
||||
return Array(); // 20
|
||||
case PACKED_BYTE_ARRAY: return PackedByteArray();
|
||||
case PACKED_INT_ARRAY: return PackedIntArray();
|
||||
case PACKED_REAL_ARRAY: return PackedRealArray();
|
||||
case PACKED_INT32_ARRAY: return PackedInt32Array();
|
||||
case PACKED_INT64_ARRAY: return PackedInt64Array();
|
||||
case PACKED_FLOAT32_ARRAY: return PackedFloat32Array();
|
||||
case PACKED_FLOAT64_ARRAY: return PackedFloat64Array();
|
||||
case PACKED_STRING_ARRAY: return PackedStringArray();
|
||||
case PACKED_VECTOR2_ARRAY:
|
||||
return PackedVector2Array(); // 25
|
||||
|
@ -1319,7 +1345,7 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i
|
|||
case INT: {
|
||||
return (int64_t(*p_args[0]));
|
||||
}
|
||||
case REAL: {
|
||||
case FLOAT: {
|
||||
return real_t(*p_args[0]);
|
||||
}
|
||||
case STRING: {
|
||||
|
@ -1359,8 +1385,10 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i
|
|||
|
||||
// arrays
|
||||
case PACKED_BYTE_ARRAY: return (PackedByteArray(*p_args[0]));
|
||||
case PACKED_INT_ARRAY: return (PackedIntArray(*p_args[0]));
|
||||
case PACKED_REAL_ARRAY: return (PackedRealArray(*p_args[0]));
|
||||
case PACKED_INT32_ARRAY: return (PackedInt32Array(*p_args[0]));
|
||||
case PACKED_INT64_ARRAY: return (PackedInt64Array(*p_args[0]));
|
||||
case PACKED_FLOAT32_ARRAY: return (PackedFloat32Array(*p_args[0]));
|
||||
case PACKED_FLOAT64_ARRAY: return (PackedFloat64Array(*p_args[0]));
|
||||
case PACKED_STRING_ARRAY: return (PackedStringArray(*p_args[0]));
|
||||
case PACKED_VECTOR2_ARRAY:
|
||||
return (PackedVector2Array(*p_args[0])); // 25
|
||||
|
@ -1697,7 +1725,7 @@ void register_variant_methods() {
|
|||
ADDFUNC1R(STRING, BOOL, String, is_subsequence_of, STRING, "text", varray());
|
||||
ADDFUNC1R(STRING, BOOL, String, is_subsequence_ofi, STRING, "text", varray());
|
||||
ADDFUNC0R(STRING, PACKED_STRING_ARRAY, String, bigrams, varray());
|
||||
ADDFUNC1R(STRING, REAL, String, similarity, STRING, "text", varray());
|
||||
ADDFUNC1R(STRING, FLOAT, String, similarity, STRING, "text", varray());
|
||||
|
||||
ADDFUNC2R(STRING, STRING, String, format, NIL, "values", STRING, "placeholder", varray("{_}"));
|
||||
ADDFUNC2R(STRING, STRING, String, replace, STRING, "what", STRING, "forwhat", varray());
|
||||
|
@ -1707,7 +1735,7 @@ void register_variant_methods() {
|
|||
ADDFUNC0R(STRING, STRING, String, capitalize, varray());
|
||||
ADDFUNC3R(STRING, PACKED_STRING_ARRAY, String, split, STRING, "delimiter", BOOL, "allow_empty", INT, "maxsplit", varray(true, 0));
|
||||
ADDFUNC3R(STRING, PACKED_STRING_ARRAY, String, rsplit, STRING, "delimiter", BOOL, "allow_empty", INT, "maxsplit", varray(true, 0));
|
||||
ADDFUNC2R(STRING, PACKED_REAL_ARRAY, String, split_floats, STRING, "delimiter", BOOL, "allow_empty", varray(true));
|
||||
ADDFUNC2R(STRING, PACKED_FLOAT32_ARRAY, String, split_floats, STRING, "delimiter", BOOL, "allow_empty", varray(true));
|
||||
|
||||
ADDFUNC0R(STRING, STRING, String, to_upper, varray());
|
||||
ADDFUNC0R(STRING, STRING, String, to_lower, varray());
|
||||
|
@ -1754,7 +1782,7 @@ void register_variant_methods() {
|
|||
ADDFUNC0R(STRING, BOOL, String, is_valid_ip_address, varray());
|
||||
ADDFUNC0R(STRING, BOOL, String, is_valid_filename, varray());
|
||||
ADDFUNC0R(STRING, INT, String, to_int, varray());
|
||||
ADDFUNC0R(STRING, REAL, String, to_float, varray());
|
||||
ADDFUNC0R(STRING, FLOAT, String, to_float, varray());
|
||||
ADDFUNC0R(STRING, INT, String, hex_to_int, varray());
|
||||
ADDFUNC1R(STRING, STRING, String, pad_decimals, INT, "digits", varray());
|
||||
ADDFUNC1R(STRING, STRING, String, pad_zeros, INT, "digits", varray());
|
||||
|
@ -1764,45 +1792,45 @@ void register_variant_methods() {
|
|||
ADDFUNC0R(STRING, PACKED_BYTE_ARRAY, String, to_ascii, varray());
|
||||
ADDFUNC0R(STRING, PACKED_BYTE_ARRAY, String, to_utf8, varray());
|
||||
|
||||
ADDFUNC0R(VECTOR2, REAL, Vector2, angle, varray());
|
||||
ADDFUNC1R(VECTOR2, REAL, Vector2, angle_to, VECTOR2, "to", varray());
|
||||
ADDFUNC1R(VECTOR2, REAL, Vector2, angle_to_point, VECTOR2, "to", varray());
|
||||
ADDFUNC0R(VECTOR2, FLOAT, Vector2, angle, varray());
|
||||
ADDFUNC1R(VECTOR2, FLOAT, Vector2, angle_to, VECTOR2, "to", varray());
|
||||
ADDFUNC1R(VECTOR2, FLOAT, Vector2, angle_to_point, VECTOR2, "to", varray());
|
||||
ADDFUNC1R(VECTOR2, VECTOR2, Vector2, direction_to, VECTOR2, "b", varray());
|
||||
ADDFUNC1R(VECTOR2, REAL, Vector2, distance_to, VECTOR2, "to", varray());
|
||||
ADDFUNC1R(VECTOR2, REAL, Vector2, distance_squared_to, VECTOR2, "to", varray());
|
||||
ADDFUNC0R(VECTOR2, REAL, Vector2, length, varray());
|
||||
ADDFUNC0R(VECTOR2, REAL, Vector2, length_squared, varray());
|
||||
ADDFUNC1R(VECTOR2, FLOAT, Vector2, distance_to, VECTOR2, "to", varray());
|
||||
ADDFUNC1R(VECTOR2, FLOAT, Vector2, distance_squared_to, VECTOR2, "to", varray());
|
||||
ADDFUNC0R(VECTOR2, FLOAT, Vector2, length, varray());
|
||||
ADDFUNC0R(VECTOR2, FLOAT, Vector2, length_squared, varray());
|
||||
ADDFUNC0R(VECTOR2, VECTOR2, Vector2, normalized, varray());
|
||||
ADDFUNC0R(VECTOR2, BOOL, Vector2, is_normalized, varray());
|
||||
ADDFUNC1R(VECTOR2, BOOL, Vector2, is_equal_approx, VECTOR2, "v", varray());
|
||||
ADDFUNC1R(VECTOR2, VECTOR2, Vector2, posmod, REAL, "mod", varray());
|
||||
ADDFUNC1R(VECTOR2, VECTOR2, Vector2, posmod, FLOAT, "mod", varray());
|
||||
ADDFUNC1R(VECTOR2, VECTOR2, Vector2, posmodv, VECTOR2, "modv", varray());
|
||||
ADDFUNC1R(VECTOR2, VECTOR2, Vector2, project, VECTOR2, "b", varray());
|
||||
ADDFUNC2R(VECTOR2, VECTOR2, Vector2, linear_interpolate, VECTOR2, "b", REAL, "t", varray());
|
||||
ADDFUNC2R(VECTOR2, VECTOR2, Vector2, slerp, VECTOR2, "b", REAL, "t", varray());
|
||||
ADDFUNC4R(VECTOR2, VECTOR2, Vector2, cubic_interpolate, VECTOR2, "b", VECTOR2, "pre_a", VECTOR2, "post_b", REAL, "t", varray());
|
||||
ADDFUNC2R(VECTOR2, VECTOR2, Vector2, move_toward, VECTOR2, "to", REAL, "delta", varray());
|
||||
ADDFUNC1R(VECTOR2, VECTOR2, Vector2, rotated, REAL, "phi", varray());
|
||||
ADDFUNC2R(VECTOR2, VECTOR2, Vector2, linear_interpolate, VECTOR2, "b", FLOAT, "t", varray());
|
||||
ADDFUNC2R(VECTOR2, VECTOR2, Vector2, slerp, VECTOR2, "b", FLOAT, "t", varray());
|
||||
ADDFUNC4R(VECTOR2, VECTOR2, Vector2, cubic_interpolate, VECTOR2, "b", VECTOR2, "pre_a", VECTOR2, "post_b", FLOAT, "t", varray());
|
||||
ADDFUNC2R(VECTOR2, VECTOR2, Vector2, move_toward, VECTOR2, "to", FLOAT, "delta", varray());
|
||||
ADDFUNC1R(VECTOR2, VECTOR2, Vector2, rotated, FLOAT, "phi", varray());
|
||||
ADDFUNC0R(VECTOR2, VECTOR2, Vector2, tangent, varray());
|
||||
ADDFUNC0R(VECTOR2, VECTOR2, Vector2, floor, varray());
|
||||
ADDFUNC0R(VECTOR2, VECTOR2, Vector2, ceil, varray());
|
||||
ADDFUNC0R(VECTOR2, VECTOR2, Vector2, round, varray());
|
||||
ADDFUNC1R(VECTOR2, VECTOR2, Vector2, snapped, VECTOR2, "by", varray());
|
||||
ADDFUNC0R(VECTOR2, REAL, Vector2, aspect, varray());
|
||||
ADDFUNC1R(VECTOR2, REAL, Vector2, dot, VECTOR2, "with", varray());
|
||||
ADDFUNC0R(VECTOR2, FLOAT, Vector2, aspect, varray());
|
||||
ADDFUNC1R(VECTOR2, FLOAT, Vector2, dot, VECTOR2, "with", varray());
|
||||
ADDFUNC1R(VECTOR2, VECTOR2, Vector2, slide, VECTOR2, "n", varray());
|
||||
ADDFUNC1R(VECTOR2, VECTOR2, Vector2, bounce, VECTOR2, "n", varray());
|
||||
ADDFUNC1R(VECTOR2, VECTOR2, Vector2, reflect, VECTOR2, "n", varray());
|
||||
ADDFUNC1R(VECTOR2, REAL, Vector2, cross, VECTOR2, "with", varray());
|
||||
ADDFUNC1R(VECTOR2, FLOAT, Vector2, cross, VECTOR2, "with", varray());
|
||||
ADDFUNC0R(VECTOR2, VECTOR2, Vector2, abs, varray());
|
||||
ADDFUNC1R(VECTOR2, VECTOR2, Vector2, clamped, REAL, "length", varray());
|
||||
ADDFUNC1R(VECTOR2, VECTOR2, Vector2, clamped, FLOAT, "length", varray());
|
||||
ADDFUNC0R(VECTOR2, VECTOR2, Vector2, sign, varray());
|
||||
|
||||
ADDFUNC0R(VECTOR2I, REAL, Vector2i, aspect, varray());
|
||||
ADDFUNC0R(VECTOR2I, FLOAT, Vector2i, aspect, varray());
|
||||
ADDFUNC0R(VECTOR2I, VECTOR2I, Vector2i, sign, varray());
|
||||
ADDFUNC0R(VECTOR2I, VECTOR2I, Vector2i, abs, varray());
|
||||
|
||||
ADDFUNC0R(RECT2, REAL, Rect2, get_area, varray());
|
||||
ADDFUNC0R(RECT2, FLOAT, Rect2, get_area, varray());
|
||||
ADDFUNC0R(RECT2, BOOL, Rect2, has_no_area, varray());
|
||||
ADDFUNC1R(RECT2, BOOL, Rect2, has_point, VECTOR2, "point", varray());
|
||||
ADDFUNC1R(RECT2, BOOL, Rect2, is_equal_approx, RECT2, "rect", varray());
|
||||
|
@ -1811,9 +1839,9 @@ void register_variant_methods() {
|
|||
ADDFUNC1R(RECT2, RECT2, Rect2, clip, RECT2, "b", varray());
|
||||
ADDFUNC1R(RECT2, RECT2, Rect2, merge, RECT2, "b", varray());
|
||||
ADDFUNC1R(RECT2, RECT2, Rect2, expand, VECTOR2, "to", varray());
|
||||
ADDFUNC1R(RECT2, RECT2, Rect2, grow, REAL, "by", varray());
|
||||
ADDFUNC2R(RECT2, RECT2, Rect2, grow_margin, INT, "margin", REAL, "by", varray());
|
||||
ADDFUNC4R(RECT2, RECT2, Rect2, grow_individual, REAL, "left", REAL, "top", REAL, "right", REAL, " bottom", varray());
|
||||
ADDFUNC1R(RECT2, RECT2, Rect2, grow, FLOAT, "by", varray());
|
||||
ADDFUNC2R(RECT2, RECT2, Rect2, grow_margin, INT, "margin", FLOAT, "by", varray());
|
||||
ADDFUNC4R(RECT2, RECT2, Rect2, grow_individual, FLOAT, "left", FLOAT, "top", FLOAT, "right", FLOAT, " bottom", varray());
|
||||
ADDFUNC0R(RECT2, RECT2, Rect2, abs, varray());
|
||||
|
||||
ADDFUNC0R(RECT2I, INT, Rect2i, get_area, varray());
|
||||
|
@ -1831,23 +1859,23 @@ void register_variant_methods() {
|
|||
|
||||
ADDFUNC0R(VECTOR3, INT, Vector3, min_axis, varray());
|
||||
ADDFUNC0R(VECTOR3, INT, Vector3, max_axis, varray());
|
||||
ADDFUNC1R(VECTOR3, REAL, Vector3, angle_to, VECTOR3, "to", varray());
|
||||
ADDFUNC1R(VECTOR3, FLOAT, Vector3, angle_to, VECTOR3, "to", varray());
|
||||
ADDFUNC1R(VECTOR3, VECTOR3, Vector3, direction_to, VECTOR3, "b", varray());
|
||||
ADDFUNC1R(VECTOR3, REAL, Vector3, distance_to, VECTOR3, "b", varray());
|
||||
ADDFUNC1R(VECTOR3, REAL, Vector3, distance_squared_to, VECTOR3, "b", varray());
|
||||
ADDFUNC0R(VECTOR3, REAL, Vector3, length, varray());
|
||||
ADDFUNC0R(VECTOR3, REAL, Vector3, length_squared, varray());
|
||||
ADDFUNC1R(VECTOR3, FLOAT, Vector3, distance_to, VECTOR3, "b", varray());
|
||||
ADDFUNC1R(VECTOR3, FLOAT, Vector3, distance_squared_to, VECTOR3, "b", varray());
|
||||
ADDFUNC0R(VECTOR3, FLOAT, Vector3, length, varray());
|
||||
ADDFUNC0R(VECTOR3, FLOAT, Vector3, length_squared, varray());
|
||||
ADDFUNC0R(VECTOR3, VECTOR3, Vector3, normalized, varray());
|
||||
ADDFUNC0R(VECTOR3, BOOL, Vector3, is_normalized, varray());
|
||||
ADDFUNC1R(VECTOR3, BOOL, Vector3, is_equal_approx, VECTOR3, "v", varray());
|
||||
ADDFUNC0R(VECTOR3, VECTOR3, Vector3, inverse, varray());
|
||||
ADDFUNC1R(VECTOR3, VECTOR3, Vector3, snapped, VECTOR3, "by", varray());
|
||||
ADDFUNC2R(VECTOR3, VECTOR3, Vector3, rotated, VECTOR3, "axis", REAL, "phi", varray());
|
||||
ADDFUNC2R(VECTOR3, VECTOR3, Vector3, linear_interpolate, VECTOR3, "b", REAL, "t", varray());
|
||||
ADDFUNC2R(VECTOR3, VECTOR3, Vector3, slerp, VECTOR3, "b", REAL, "t", varray());
|
||||
ADDFUNC4R(VECTOR3, VECTOR3, Vector3, cubic_interpolate, VECTOR3, "b", VECTOR3, "pre_a", VECTOR3, "post_b", REAL, "t", varray());
|
||||
ADDFUNC2R(VECTOR3, VECTOR3, Vector3, move_toward, VECTOR3, "to", REAL, "delta", varray());
|
||||
ADDFUNC1R(VECTOR3, REAL, Vector3, dot, VECTOR3, "b", varray());
|
||||
ADDFUNC2R(VECTOR3, VECTOR3, Vector3, rotated, VECTOR3, "axis", FLOAT, "phi", varray());
|
||||
ADDFUNC2R(VECTOR3, VECTOR3, Vector3, linear_interpolate, VECTOR3, "b", FLOAT, "t", varray());
|
||||
ADDFUNC2R(VECTOR3, VECTOR3, Vector3, slerp, VECTOR3, "b", FLOAT, "t", varray());
|
||||
ADDFUNC4R(VECTOR3, VECTOR3, Vector3, cubic_interpolate, VECTOR3, "b", VECTOR3, "pre_a", VECTOR3, "post_b", FLOAT, "t", varray());
|
||||
ADDFUNC2R(VECTOR3, VECTOR3, Vector3, move_toward, VECTOR3, "to", FLOAT, "delta", varray());
|
||||
ADDFUNC1R(VECTOR3, FLOAT, Vector3, dot, VECTOR3, "b", varray());
|
||||
ADDFUNC1R(VECTOR3, VECTOR3, Vector3, cross, VECTOR3, "b", varray());
|
||||
ADDFUNC1R(VECTOR3, BASIS, Vector3, outer, VECTOR3, "b", varray());
|
||||
ADDFUNC0R(VECTOR3, BASIS, Vector3, to_diagonal_matrix, varray());
|
||||
|
@ -1855,7 +1883,7 @@ void register_variant_methods() {
|
|||
ADDFUNC0R(VECTOR3, VECTOR3, Vector3, floor, varray());
|
||||
ADDFUNC0R(VECTOR3, VECTOR3, Vector3, ceil, varray());
|
||||
ADDFUNC0R(VECTOR3, VECTOR3, Vector3, round, varray());
|
||||
ADDFUNC1R(VECTOR3, VECTOR3, Vector3, posmod, REAL, "mod", varray());
|
||||
ADDFUNC1R(VECTOR3, VECTOR3, Vector3, posmod, FLOAT, "mod", varray());
|
||||
ADDFUNC1R(VECTOR3, VECTOR3, Vector3, posmodv, VECTOR3, "modv", varray());
|
||||
ADDFUNC1R(VECTOR3, VECTOR3, Vector3, project, VECTOR3, "b", varray());
|
||||
ADDFUNC1R(VECTOR3, VECTOR3, Vector3, slide, VECTOR3, "n", varray());
|
||||
|
@ -1872,27 +1900,27 @@ void register_variant_methods() {
|
|||
ADDFUNC0R(PLANE, VECTOR3, Plane, get_any_point, varray());
|
||||
ADDFUNC1R(PLANE, BOOL, Plane, is_equal_approx, PLANE, "plane", varray());
|
||||
ADDFUNC1R(PLANE, BOOL, Plane, is_point_over, VECTOR3, "point", varray());
|
||||
ADDFUNC1R(PLANE, REAL, Plane, distance_to, VECTOR3, "point", varray());
|
||||
ADDFUNC2R(PLANE, BOOL, Plane, has_point, VECTOR3, "point", REAL, "epsilon", varray(CMP_EPSILON));
|
||||
ADDFUNC1R(PLANE, FLOAT, Plane, distance_to, VECTOR3, "point", varray());
|
||||
ADDFUNC2R(PLANE, BOOL, Plane, has_point, VECTOR3, "point", FLOAT, "epsilon", varray(CMP_EPSILON));
|
||||
ADDFUNC1R(PLANE, VECTOR3, Plane, project, VECTOR3, "point", varray());
|
||||
ADDFUNC2R(PLANE, VECTOR3, Plane, intersect_3, PLANE, "b", PLANE, "c", varray());
|
||||
ADDFUNC2R(PLANE, VECTOR3, Plane, intersects_ray, VECTOR3, "from", VECTOR3, "dir", varray());
|
||||
ADDFUNC2R(PLANE, VECTOR3, Plane, intersects_segment, VECTOR3, "begin", VECTOR3, "end", varray());
|
||||
|
||||
ADDFUNC0R(QUAT, REAL, Quat, length, varray());
|
||||
ADDFUNC0R(QUAT, REAL, Quat, length_squared, varray());
|
||||
ADDFUNC0R(QUAT, FLOAT, Quat, length, varray());
|
||||
ADDFUNC0R(QUAT, FLOAT, Quat, length_squared, varray());
|
||||
ADDFUNC0R(QUAT, QUAT, Quat, normalized, varray());
|
||||
ADDFUNC0R(QUAT, BOOL, Quat, is_normalized, varray());
|
||||
ADDFUNC1R(QUAT, BOOL, Quat, is_equal_approx, QUAT, "quat", varray());
|
||||
ADDFUNC0R(QUAT, QUAT, Quat, inverse, varray());
|
||||
ADDFUNC1R(QUAT, REAL, Quat, dot, QUAT, "b", varray());
|
||||
ADDFUNC1R(QUAT, FLOAT, Quat, dot, QUAT, "b", varray());
|
||||
ADDFUNC1R(QUAT, VECTOR3, Quat, xform, VECTOR3, "v", varray());
|
||||
ADDFUNC2R(QUAT, QUAT, Quat, slerp, QUAT, "b", REAL, "t", varray());
|
||||
ADDFUNC2R(QUAT, QUAT, Quat, slerpni, QUAT, "b", REAL, "t", varray());
|
||||
ADDFUNC4R(QUAT, QUAT, Quat, cubic_slerp, QUAT, "b", QUAT, "pre_a", QUAT, "post_b", REAL, "t", varray());
|
||||
ADDFUNC2R(QUAT, QUAT, Quat, slerp, QUAT, "b", FLOAT, "t", varray());
|
||||
ADDFUNC2R(QUAT, QUAT, Quat, slerpni, QUAT, "b", FLOAT, "t", varray());
|
||||
ADDFUNC4R(QUAT, QUAT, Quat, cubic_slerp, QUAT, "b", QUAT, "pre_a", QUAT, "post_b", FLOAT, "t", varray());
|
||||
ADDFUNC0R(QUAT, VECTOR3, Quat, get_euler, varray());
|
||||
ADDFUNC1(QUAT, NIL, Quat, set_euler, VECTOR3, "euler", varray());
|
||||
ADDFUNC2(QUAT, NIL, Quat, set_axis_angle, VECTOR3, "axis", REAL, "angle", varray());
|
||||
ADDFUNC2(QUAT, NIL, Quat, set_axis_angle, VECTOR3, "axis", FLOAT, "angle", varray());
|
||||
|
||||
ADDFUNC0R(COLOR, INT, Color, to_argb32, varray());
|
||||
ADDFUNC0R(COLOR, INT, Color, to_abgr32, varray());
|
||||
|
@ -1902,12 +1930,12 @@ void register_variant_methods() {
|
|||
ADDFUNC0R(COLOR, INT, Color, to_rgba64, varray());
|
||||
ADDFUNC0R(COLOR, COLOR, Color, inverted, varray());
|
||||
ADDFUNC0R(COLOR, COLOR, Color, contrasted, varray());
|
||||
ADDFUNC2R(COLOR, COLOR, Color, linear_interpolate, COLOR, "b", REAL, "t", varray());
|
||||
ADDFUNC2R(COLOR, COLOR, Color, linear_interpolate, COLOR, "b", FLOAT, "t", varray());
|
||||
ADDFUNC1R(COLOR, COLOR, Color, blend, COLOR, "over", varray());
|
||||
ADDFUNC1R(COLOR, COLOR, Color, lightened, REAL, "amount", varray());
|
||||
ADDFUNC1R(COLOR, COLOR, Color, darkened, REAL, "amount", varray());
|
||||
ADDFUNC1R(COLOR, COLOR, Color, lightened, FLOAT, "amount", varray());
|
||||
ADDFUNC1R(COLOR, COLOR, Color, darkened, FLOAT, "amount", varray());
|
||||
ADDFUNC1R(COLOR, STRING, Color, to_html, BOOL, "with_alpha", varray(true));
|
||||
ADDFUNC4R(COLOR, COLOR, Color, from_hsv, REAL, "h", REAL, "s", REAL, "v", REAL, "a", varray(1.0));
|
||||
ADDFUNC4R(COLOR, COLOR, Color, from_hsv, FLOAT, "h", FLOAT, "s", FLOAT, "v", FLOAT, "a", varray(1.0));
|
||||
ADDFUNC1R(COLOR, BOOL, Color, is_equal_approx, COLOR, "color", varray());
|
||||
|
||||
ADDFUNC0R(_RID, INT, RID, get_id, varray());
|
||||
|
@ -2001,27 +2029,49 @@ void register_variant_methods() {
|
|||
ADDFUNC1R(PACKED_BYTE_ARRAY, PACKED_BYTE_ARRAY, PackedByteArray, compress, INT, "compression_mode", varray(0));
|
||||
ADDFUNC2R(PACKED_BYTE_ARRAY, PACKED_BYTE_ARRAY, PackedByteArray, decompress, INT, "buffer_size", INT, "compression_mode", varray(0));
|
||||
|
||||
ADDFUNC0R(PACKED_INT_ARRAY, INT, PackedIntArray, size, varray());
|
||||
ADDFUNC0R(PACKED_INT_ARRAY, BOOL, PackedIntArray, empty, varray());
|
||||
ADDFUNC2(PACKED_INT_ARRAY, NIL, PackedIntArray, set, INT, "idx", INT, "integer", varray());
|
||||
ADDFUNC1(PACKED_INT_ARRAY, NIL, PackedIntArray, push_back, INT, "integer", varray());
|
||||
ADDFUNC1(PACKED_INT_ARRAY, NIL, PackedIntArray, append, INT, "integer", varray());
|
||||
ADDFUNC1(PACKED_INT_ARRAY, NIL, PackedIntArray, append_array, PACKED_INT_ARRAY, "array", varray());
|
||||
ADDFUNC1(PACKED_INT_ARRAY, NIL, PackedIntArray, remove, INT, "idx", varray());
|
||||
ADDFUNC2R(PACKED_INT_ARRAY, INT, PackedIntArray, insert, INT, "idx", INT, "integer", varray());
|
||||
ADDFUNC1(PACKED_INT_ARRAY, NIL, PackedIntArray, resize, INT, "idx", varray());
|
||||
ADDFUNC0(PACKED_INT_ARRAY, NIL, PackedIntArray, invert, varray());
|
||||
ADDFUNC0R(PACKED_INT32_ARRAY, INT, PackedInt32Array, size, varray());
|
||||
ADDFUNC0R(PACKED_INT32_ARRAY, BOOL, PackedInt32Array, empty, varray());
|
||||
ADDFUNC2(PACKED_INT32_ARRAY, NIL, PackedInt32Array, set, INT, "idx", INT, "integer", varray());
|
||||
ADDFUNC1(PACKED_INT32_ARRAY, NIL, PackedInt32Array, push_back, INT, "integer", varray());
|
||||
ADDFUNC1(PACKED_INT32_ARRAY, NIL, PackedInt32Array, append, INT, "integer", varray());
|
||||
ADDFUNC1(PACKED_INT32_ARRAY, NIL, PackedInt32Array, append_array, PACKED_INT32_ARRAY, "array", varray());
|
||||
ADDFUNC1(PACKED_INT32_ARRAY, NIL, PackedInt32Array, remove, INT, "idx", varray());
|
||||
ADDFUNC2R(PACKED_INT32_ARRAY, INT, PackedInt32Array, insert, INT, "idx", INT, "integer", varray());
|
||||
ADDFUNC1(PACKED_INT32_ARRAY, NIL, PackedInt32Array, resize, INT, "idx", varray());
|
||||
ADDFUNC0(PACKED_INT32_ARRAY, NIL, PackedInt32Array, invert, varray());
|
||||
|
||||
ADDFUNC0R(PACKED_REAL_ARRAY, INT, PackedRealArray, size, varray());
|
||||
ADDFUNC0R(PACKED_REAL_ARRAY, BOOL, PackedRealArray, empty, varray());
|
||||
ADDFUNC2(PACKED_REAL_ARRAY, NIL, PackedRealArray, set, INT, "idx", REAL, "value", varray());
|
||||
ADDFUNC1(PACKED_REAL_ARRAY, NIL, PackedRealArray, push_back, REAL, "value", varray());
|
||||
ADDFUNC1(PACKED_REAL_ARRAY, NIL, PackedRealArray, append, REAL, "value", varray());
|
||||
ADDFUNC1(PACKED_REAL_ARRAY, NIL, PackedRealArray, append_array, PACKED_REAL_ARRAY, "array", varray());
|
||||
ADDFUNC1(PACKED_REAL_ARRAY, NIL, PackedRealArray, remove, INT, "idx", varray());
|
||||
ADDFUNC2R(PACKED_REAL_ARRAY, INT, PackedRealArray, insert, INT, "idx", REAL, "value", varray());
|
||||
ADDFUNC1(PACKED_REAL_ARRAY, NIL, PackedRealArray, resize, INT, "idx", varray());
|
||||
ADDFUNC0(PACKED_REAL_ARRAY, NIL, PackedRealArray, invert, varray());
|
||||
ADDFUNC0R(PACKED_INT64_ARRAY, INT, PackedInt64Array, size, varray());
|
||||
ADDFUNC0R(PACKED_INT64_ARRAY, BOOL, PackedInt64Array, empty, varray());
|
||||
ADDFUNC2(PACKED_INT64_ARRAY, NIL, PackedInt64Array, set, INT, "idx", INT, "integer", varray());
|
||||
ADDFUNC1(PACKED_INT64_ARRAY, NIL, PackedInt64Array, push_back, INT, "integer", varray());
|
||||
ADDFUNC1(PACKED_INT64_ARRAY, NIL, PackedInt64Array, append, INT, "integer", varray());
|
||||
ADDFUNC1(PACKED_INT64_ARRAY, NIL, PackedInt64Array, append_array, PACKED_INT64_ARRAY, "array", varray());
|
||||
ADDFUNC1(PACKED_INT64_ARRAY, NIL, PackedInt64Array, remove, INT, "idx", varray());
|
||||
ADDFUNC2R(PACKED_INT64_ARRAY, INT, PackedInt64Array, insert, INT, "idx", INT, "integer", varray());
|
||||
ADDFUNC1(PACKED_INT64_ARRAY, NIL, PackedInt64Array, resize, INT, "idx", varray());
|
||||
ADDFUNC0(PACKED_INT64_ARRAY, NIL, PackedInt64Array, invert, varray());
|
||||
|
||||
ADDFUNC0R(PACKED_FLOAT32_ARRAY, INT, PackedFloat32Array, size, varray());
|
||||
ADDFUNC0R(PACKED_FLOAT32_ARRAY, BOOL, PackedFloat32Array, empty, varray());
|
||||
ADDFUNC2(PACKED_FLOAT32_ARRAY, NIL, PackedFloat32Array, set, INT, "idx", FLOAT, "value", varray());
|
||||
ADDFUNC1(PACKED_FLOAT32_ARRAY, NIL, PackedFloat32Array, push_back, FLOAT, "value", varray());
|
||||
ADDFUNC1(PACKED_FLOAT32_ARRAY, NIL, PackedFloat32Array, append, FLOAT, "value", varray());
|
||||
ADDFUNC1(PACKED_FLOAT32_ARRAY, NIL, PackedFloat32Array, append_array, PACKED_FLOAT32_ARRAY, "array", varray());
|
||||
ADDFUNC1(PACKED_FLOAT32_ARRAY, NIL, PackedFloat32Array, remove, INT, "idx", varray());
|
||||
ADDFUNC2R(PACKED_FLOAT32_ARRAY, INT, PackedFloat32Array, insert, INT, "idx", FLOAT, "value", varray());
|
||||
ADDFUNC1(PACKED_FLOAT32_ARRAY, NIL, PackedFloat32Array, resize, INT, "idx", varray());
|
||||
ADDFUNC0(PACKED_FLOAT32_ARRAY, NIL, PackedFloat32Array, invert, varray());
|
||||
|
||||
ADDFUNC0R(PACKED_FLOAT64_ARRAY, INT, PackedFloat64Array, size, varray());
|
||||
ADDFUNC0R(PACKED_FLOAT64_ARRAY, BOOL, PackedFloat64Array, empty, varray());
|
||||
ADDFUNC2(PACKED_FLOAT64_ARRAY, NIL, PackedFloat64Array, set, INT, "idx", FLOAT, "value", varray());
|
||||
ADDFUNC1(PACKED_FLOAT64_ARRAY, NIL, PackedFloat64Array, push_back, FLOAT, "value", varray());
|
||||
ADDFUNC1(PACKED_FLOAT64_ARRAY, NIL, PackedFloat64Array, append, FLOAT, "value", varray());
|
||||
ADDFUNC1(PACKED_FLOAT64_ARRAY, NIL, PackedFloat64Array, append_array, PACKED_FLOAT64_ARRAY, "array", varray());
|
||||
ADDFUNC1(PACKED_FLOAT64_ARRAY, NIL, PackedFloat64Array, remove, INT, "idx", varray());
|
||||
ADDFUNC2R(PACKED_FLOAT64_ARRAY, INT, PackedFloat64Array, insert, INT, "idx", FLOAT, "value", varray());
|
||||
ADDFUNC1(PACKED_FLOAT64_ARRAY, NIL, PackedFloat64Array, resize, INT, "idx", varray());
|
||||
ADDFUNC0(PACKED_FLOAT64_ARRAY, NIL, PackedFloat64Array, invert, varray());
|
||||
|
||||
ADDFUNC0R(PACKED_STRING_ARRAY, INT, PackedStringArray, size, varray());
|
||||
ADDFUNC0R(PACKED_STRING_ARRAY, BOOL, PackedStringArray, empty, varray());
|
||||
|
@ -2069,7 +2119,7 @@ void register_variant_methods() {
|
|||
|
||||
//pointerbased
|
||||
|
||||
ADDFUNC0R(AABB, REAL, AABB, get_area, varray());
|
||||
ADDFUNC0R(AABB, FLOAT, AABB, get_area, varray());
|
||||
ADDFUNC0R(AABB, BOOL, AABB, has_no_area, varray());
|
||||
ADDFUNC0R(AABB, BOOL, AABB, has_no_surface, varray());
|
||||
ADDFUNC1R(AABB, BOOL, AABB, has_point, VECTOR3, "point", varray());
|
||||
|
@ -2081,94 +2131,94 @@ void register_variant_methods() {
|
|||
ADDFUNC1R(AABB, AABB, AABB, intersection, AABB, "with", varray());
|
||||
ADDFUNC1R(AABB, AABB, AABB, merge, AABB, "with", varray());
|
||||
ADDFUNC1R(AABB, AABB, AABB, expand, VECTOR3, "to_point", varray());
|
||||
ADDFUNC1R(AABB, AABB, AABB, grow, REAL, "by", varray());
|
||||
ADDFUNC1R(AABB, AABB, AABB, grow, FLOAT, "by", varray());
|
||||
ADDFUNC1R(AABB, VECTOR3, AABB, get_support, VECTOR3, "dir", varray());
|
||||
ADDFUNC0R(AABB, VECTOR3, AABB, get_longest_axis, varray());
|
||||
ADDFUNC0R(AABB, INT, AABB, get_longest_axis_index, varray());
|
||||
ADDFUNC0R(AABB, REAL, AABB, get_longest_axis_size, varray());
|
||||
ADDFUNC0R(AABB, FLOAT, AABB, get_longest_axis_size, varray());
|
||||
ADDFUNC0R(AABB, VECTOR3, AABB, get_shortest_axis, varray());
|
||||
ADDFUNC0R(AABB, INT, AABB, get_shortest_axis_index, varray());
|
||||
ADDFUNC0R(AABB, REAL, AABB, get_shortest_axis_size, varray());
|
||||
ADDFUNC0R(AABB, FLOAT, AABB, get_shortest_axis_size, varray());
|
||||
ADDFUNC1R(AABB, VECTOR3, AABB, get_endpoint, INT, "idx", varray());
|
||||
|
||||
ADDFUNC0R(TRANSFORM2D, TRANSFORM2D, Transform2D, inverse, varray());
|
||||
ADDFUNC0R(TRANSFORM2D, TRANSFORM2D, Transform2D, affine_inverse, varray());
|
||||
ADDFUNC0R(TRANSFORM2D, REAL, Transform2D, get_rotation, varray());
|
||||
ADDFUNC0R(TRANSFORM2D, FLOAT, Transform2D, get_rotation, varray());
|
||||
ADDFUNC0R(TRANSFORM2D, VECTOR2, Transform2D, get_origin, varray());
|
||||
ADDFUNC0R(TRANSFORM2D, VECTOR2, Transform2D, get_scale, varray());
|
||||
ADDFUNC0R(TRANSFORM2D, TRANSFORM2D, Transform2D, orthonormalized, varray());
|
||||
ADDFUNC1R(TRANSFORM2D, TRANSFORM2D, Transform2D, rotated, REAL, "phi", varray());
|
||||
ADDFUNC1R(TRANSFORM2D, TRANSFORM2D, Transform2D, rotated, FLOAT, "phi", varray());
|
||||
ADDFUNC1R(TRANSFORM2D, TRANSFORM2D, Transform2D, scaled, VECTOR2, "scale", varray());
|
||||
ADDFUNC1R(TRANSFORM2D, TRANSFORM2D, Transform2D, translated, VECTOR2, "offset", varray());
|
||||
ADDFUNC1R(TRANSFORM2D, NIL, Transform2D, xform, NIL, "v", varray());
|
||||
ADDFUNC1R(TRANSFORM2D, NIL, Transform2D, xform_inv, NIL, "v", varray());
|
||||
ADDFUNC1R(TRANSFORM2D, VECTOR2, Transform2D, basis_xform, VECTOR2, "v", varray());
|
||||
ADDFUNC1R(TRANSFORM2D, VECTOR2, Transform2D, basis_xform_inv, VECTOR2, "v", varray());
|
||||
ADDFUNC2R(TRANSFORM2D, TRANSFORM2D, Transform2D, interpolate_with, TRANSFORM2D, "transform", REAL, "weight", varray());
|
||||
ADDFUNC2R(TRANSFORM2D, TRANSFORM2D, Transform2D, interpolate_with, TRANSFORM2D, "transform", FLOAT, "weight", varray());
|
||||
ADDFUNC1R(TRANSFORM2D, BOOL, Transform2D, is_equal_approx, TRANSFORM2D, "transform", varray());
|
||||
|
||||
ADDFUNC0R(BASIS, BASIS, Basis, inverse, varray());
|
||||
ADDFUNC0R(BASIS, BASIS, Basis, transposed, varray());
|
||||
ADDFUNC0R(BASIS, BASIS, Basis, orthonormalized, varray());
|
||||
ADDFUNC0R(BASIS, REAL, Basis, determinant, varray());
|
||||
ADDFUNC2R(BASIS, BASIS, Basis, rotated, VECTOR3, "axis", REAL, "phi", varray());
|
||||
ADDFUNC0R(BASIS, FLOAT, Basis, determinant, varray());
|
||||
ADDFUNC2R(BASIS, BASIS, Basis, rotated, VECTOR3, "axis", FLOAT, "phi", varray());
|
||||
ADDFUNC1R(BASIS, BASIS, Basis, scaled, VECTOR3, "scale", varray());
|
||||
ADDFUNC0R(BASIS, VECTOR3, Basis, get_scale, varray());
|
||||
ADDFUNC0R(BASIS, VECTOR3, Basis, get_euler, varray());
|
||||
ADDFUNC1R(BASIS, REAL, Basis, tdotx, VECTOR3, "with", varray());
|
||||
ADDFUNC1R(BASIS, REAL, Basis, tdoty, VECTOR3, "with", varray());
|
||||
ADDFUNC1R(BASIS, REAL, Basis, tdotz, VECTOR3, "with", varray());
|
||||
ADDFUNC1R(BASIS, FLOAT, Basis, tdotx, VECTOR3, "with", varray());
|
||||
ADDFUNC1R(BASIS, FLOAT, Basis, tdoty, VECTOR3, "with", varray());
|
||||
ADDFUNC1R(BASIS, FLOAT, Basis, tdotz, VECTOR3, "with", varray());
|
||||
ADDFUNC1R(BASIS, VECTOR3, Basis, xform, VECTOR3, "v", varray());
|
||||
ADDFUNC1R(BASIS, VECTOR3, Basis, xform_inv, VECTOR3, "v", varray());
|
||||
ADDFUNC0R(BASIS, INT, Basis, get_orthogonal_index, varray());
|
||||
ADDFUNC2R(BASIS, BASIS, Basis, slerp, BASIS, "b", REAL, "t", varray());
|
||||
ADDFUNC2R(BASIS, BOOL, Basis, is_equal_approx, BASIS, "b", REAL, "epsilon", varray(CMP_EPSILON)); // TODO: Replace in 4.0, see other TODO.
|
||||
ADDFUNC2R(BASIS, BASIS, Basis, slerp, BASIS, "b", FLOAT, "t", varray());
|
||||
ADDFUNC2R(BASIS, BOOL, Basis, is_equal_approx, BASIS, "b", FLOAT, "epsilon", varray(CMP_EPSILON)); // TODO: Replace in 4.0, see other TODO.
|
||||
ADDFUNC0R(BASIS, QUAT, Basis, get_rotation_quat, varray());
|
||||
|
||||
ADDFUNC0R(TRANSFORM, TRANSFORM, Transform, inverse, varray());
|
||||
ADDFUNC0R(TRANSFORM, TRANSFORM, Transform, affine_inverse, varray());
|
||||
ADDFUNC0R(TRANSFORM, TRANSFORM, Transform, orthonormalized, varray());
|
||||
ADDFUNC2R(TRANSFORM, TRANSFORM, Transform, rotated, VECTOR3, "axis", REAL, "phi", varray());
|
||||
ADDFUNC2R(TRANSFORM, TRANSFORM, Transform, rotated, VECTOR3, "axis", FLOAT, "phi", varray());
|
||||
ADDFUNC1R(TRANSFORM, TRANSFORM, Transform, scaled, VECTOR3, "scale", varray());
|
||||
ADDFUNC1R(TRANSFORM, TRANSFORM, Transform, translated, VECTOR3, "offset", varray());
|
||||
ADDFUNC2R(TRANSFORM, TRANSFORM, Transform, looking_at, VECTOR3, "target", VECTOR3, "up", varray());
|
||||
ADDFUNC2R(TRANSFORM, TRANSFORM, Transform, interpolate_with, TRANSFORM, "transform", REAL, "weight", varray());
|
||||
ADDFUNC2R(TRANSFORM, TRANSFORM, Transform, interpolate_with, TRANSFORM, "transform", FLOAT, "weight", varray());
|
||||
ADDFUNC1R(TRANSFORM, BOOL, Transform, is_equal_approx, TRANSFORM, "transform", varray());
|
||||
ADDFUNC1R(TRANSFORM, NIL, Transform, xform, NIL, "v", varray());
|
||||
ADDFUNC1R(TRANSFORM, NIL, Transform, xform_inv, NIL, "v", varray());
|
||||
|
||||
/* REGISTER CONSTRUCTORS */
|
||||
|
||||
_VariantCall::add_constructor(_VariantCall::Vector2_init1, Variant::VECTOR2, "x", Variant::REAL, "y", Variant::REAL);
|
||||
_VariantCall::add_constructor(_VariantCall::Vector2_init1, Variant::VECTOR2, "x", Variant::FLOAT, "y", Variant::FLOAT);
|
||||
_VariantCall::add_constructor(_VariantCall::Vector2i_init1, Variant::VECTOR2I, "x", Variant::INT, "y", Variant::INT);
|
||||
|
||||
_VariantCall::add_constructor(_VariantCall::Rect2_init1, Variant::RECT2, "position", Variant::VECTOR2, "size", Variant::VECTOR2);
|
||||
_VariantCall::add_constructor(_VariantCall::Rect2_init2, Variant::RECT2, "x", Variant::REAL, "y", Variant::REAL, "width", Variant::REAL, "height", Variant::REAL);
|
||||
_VariantCall::add_constructor(_VariantCall::Rect2_init2, Variant::RECT2, "x", Variant::FLOAT, "y", Variant::FLOAT, "width", Variant::FLOAT, "height", Variant::FLOAT);
|
||||
|
||||
_VariantCall::add_constructor(_VariantCall::Rect2i_init1, Variant::RECT2I, "position", Variant::VECTOR2, "size", Variant::VECTOR2);
|
||||
_VariantCall::add_constructor(_VariantCall::Rect2i_init2, Variant::RECT2I, "x", Variant::INT, "y", Variant::INT, "width", Variant::INT, "height", Variant::INT);
|
||||
|
||||
_VariantCall::add_constructor(_VariantCall::Transform2D_init2, Variant::TRANSFORM2D, "rotation", Variant::REAL, "position", Variant::VECTOR2);
|
||||
_VariantCall::add_constructor(_VariantCall::Transform2D_init2, Variant::TRANSFORM2D, "rotation", Variant::FLOAT, "position", Variant::VECTOR2);
|
||||
_VariantCall::add_constructor(_VariantCall::Transform2D_init3, Variant::TRANSFORM2D, "x_axis", Variant::VECTOR2, "y_axis", Variant::VECTOR2, "origin", Variant::VECTOR2);
|
||||
|
||||
_VariantCall::add_constructor(_VariantCall::Vector3_init1, Variant::VECTOR3, "x", Variant::REAL, "y", Variant::REAL, "z", Variant::REAL);
|
||||
_VariantCall::add_constructor(_VariantCall::Vector3_init1, Variant::VECTOR3, "x", Variant::FLOAT, "y", Variant::FLOAT, "z", Variant::FLOAT);
|
||||
_VariantCall::add_constructor(_VariantCall::Vector3i_init1, Variant::VECTOR3I, "x", Variant::INT, "y", Variant::INT, "z", 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_init1, Variant::PLANE, "a", Variant::FLOAT, "b", Variant::FLOAT, "c", Variant::FLOAT, "d", Variant::FLOAT);
|
||||
_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);
|
||||
_VariantCall::add_constructor(_VariantCall::Plane_init3, Variant::PLANE, "normal", Variant::VECTOR3, "d", Variant::FLOAT);
|
||||
|
||||
_VariantCall::add_constructor(_VariantCall::Quat_init1, Variant::QUAT, "x", Variant::REAL, "y", Variant::REAL, "z", Variant::REAL, "w", Variant::REAL);
|
||||
_VariantCall::add_constructor(_VariantCall::Quat_init2, Variant::QUAT, "axis", Variant::VECTOR3, "angle", Variant::REAL);
|
||||
_VariantCall::add_constructor(_VariantCall::Quat_init1, Variant::QUAT, "x", Variant::FLOAT, "y", Variant::FLOAT, "z", Variant::FLOAT, "w", Variant::FLOAT);
|
||||
_VariantCall::add_constructor(_VariantCall::Quat_init2, Variant::QUAT, "axis", Variant::VECTOR3, "angle", Variant::FLOAT);
|
||||
_VariantCall::add_constructor(_VariantCall::Quat_init3, Variant::QUAT, "euler", Variant::VECTOR3);
|
||||
|
||||
_VariantCall::add_constructor(_VariantCall::Color_init1, Variant::COLOR, "r", Variant::REAL, "g", Variant::REAL, "b", Variant::REAL, "a", Variant::REAL);
|
||||
_VariantCall::add_constructor(_VariantCall::Color_init2, Variant::COLOR, "r", Variant::REAL, "g", Variant::REAL, "b", Variant::REAL);
|
||||
_VariantCall::add_constructor(_VariantCall::Color_init1, Variant::COLOR, "r", Variant::FLOAT, "g", Variant::FLOAT, "b", Variant::FLOAT, "a", Variant::FLOAT);
|
||||
_VariantCall::add_constructor(_VariantCall::Color_init2, Variant::COLOR, "r", Variant::FLOAT, "g", Variant::FLOAT, "b", Variant::FLOAT);
|
||||
|
||||
_VariantCall::add_constructor(_VariantCall::AABB_init1, Variant::AABB, "position", Variant::VECTOR3, "size", Variant::VECTOR3);
|
||||
|
||||
_VariantCall::add_constructor(_VariantCall::Basis_init1, Variant::BASIS, "x_axis", Variant::VECTOR3, "y_axis", Variant::VECTOR3, "z_axis", Variant::VECTOR3);
|
||||
_VariantCall::add_constructor(_VariantCall::Basis_init2, Variant::BASIS, "axis", Variant::VECTOR3, "phi", Variant::REAL);
|
||||
_VariantCall::add_constructor(_VariantCall::Basis_init2, Variant::BASIS, "axis", Variant::VECTOR3, "phi", Variant::FLOAT);
|
||||
|
||||
_VariantCall::add_constructor(_VariantCall::Transform_init1, Variant::TRANSFORM, "x_axis", Variant::VECTOR3, "y_axis", Variant::VECTOR3, "z_axis", Variant::VECTOR3, "origin", Variant::VECTOR3);
|
||||
_VariantCall::add_constructor(_VariantCall::Transform_init2, Variant::TRANSFORM, "basis", Variant::BASIS, "origin", Variant::VECTOR3);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -941,20 +941,20 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
|
|||
|
||||
return OK;
|
||||
|
||||
} else if (id == "PackedIntArray" || id == "PoolIntArray" || id == "IntArray") {
|
||||
} else if (id == "PackedInt32Array" || id == "PackedIntArray" || id == "PoolIntArray" || id == "IntArray") {
|
||||
|
||||
Vector<int> args;
|
||||
Error err = _parse_construct<int>(p_stream, args, line, r_err_str);
|
||||
Vector<int32_t> args;
|
||||
Error err = _parse_construct<int32_t>(p_stream, args, line, r_err_str);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
Vector<int> arr;
|
||||
Vector<int32_t> arr;
|
||||
{
|
||||
int len = args.size();
|
||||
int32_t len = args.size();
|
||||
arr.resize(len);
|
||||
int *w = arr.ptrw();
|
||||
for (int i = 0; i < len; i++) {
|
||||
w[i] = int(args[i]);
|
||||
int32_t *w = arr.ptrw();
|
||||
for (int32_t i = 0; i < len; i++) {
|
||||
w[i] = int32_t(args[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -962,7 +962,28 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
|
|||
|
||||
return OK;
|
||||
|
||||
} else if (id == "PackedRealArray" || id == "PoolRealArray" || id == "FloatArray") {
|
||||
} else if (id == "PackedInt64Array") {
|
||||
|
||||
Vector<int64_t> args;
|
||||
Error err = _parse_construct<int64_t>(p_stream, args, line, r_err_str);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
Vector<int64_t> arr;
|
||||
{
|
||||
int64_t len = args.size();
|
||||
arr.resize(len);
|
||||
int64_t *w = arr.ptrw();
|
||||
for (int64_t i = 0; i < len; i++) {
|
||||
w[i] = int64_t(args[i]);
|
||||
}
|
||||
}
|
||||
|
||||
value = arr;
|
||||
|
||||
return OK;
|
||||
|
||||
} else if (id == "PackedFloat32Array" || id == "PackedRealArray" || id == "PoolRealArray" || id == "FloatArray") {
|
||||
|
||||
Vector<float> args;
|
||||
Error err = _parse_construct<float>(p_stream, args, line, r_err_str);
|
||||
|
@ -981,6 +1002,26 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
|
|||
|
||||
value = arr;
|
||||
|
||||
return OK;
|
||||
} else if (id == "PackedFloat64Array") {
|
||||
|
||||
Vector<double> args;
|
||||
Error err = _parse_construct<double>(p_stream, args, line, r_err_str);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
Vector<double> arr;
|
||||
{
|
||||
int len = args.size();
|
||||
arr.resize(len);
|
||||
double *w = arr.ptrw();
|
||||
for (int i = 0; i < len; i++) {
|
||||
w[i] = args[i];
|
||||
}
|
||||
}
|
||||
|
||||
value = arr;
|
||||
|
||||
return OK;
|
||||
} else if (id == "PackedStringArray" || id == "PoolStringArray" || id == "StringArray") {
|
||||
|
||||
|
@ -1455,7 +1496,7 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
|
|||
|
||||
p_store_string_func(p_store_string_ud, itos(p_variant.operator int64_t()));
|
||||
} break;
|
||||
case Variant::REAL: {
|
||||
case Variant::FLOAT: {
|
||||
|
||||
String s = rtosfix(p_variant.operator real_t());
|
||||
if (s.find(".") == -1 && s.find("e") == -1)
|
||||
|
@ -1715,14 +1756,14 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
|
|||
p_store_string_func(p_store_string_ud, " )");
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_INT_ARRAY: {
|
||||
case Variant::PACKED_INT32_ARRAY: {
|
||||
|
||||
p_store_string_func(p_store_string_ud, "PackedIntArray( ");
|
||||
Vector<int> data = p_variant;
|
||||
int len = data.size();
|
||||
const int *ptr = data.ptr();
|
||||
p_store_string_func(p_store_string_ud, "PackedInt32Array( ");
|
||||
Vector<int32_t> data = p_variant;
|
||||
int32_t len = data.size();
|
||||
const int32_t *ptr = data.ptr();
|
||||
|
||||
for (int i = 0; i < len; i++) {
|
||||
for (int32_t i = 0; i < len; i++) {
|
||||
|
||||
if (i > 0)
|
||||
p_store_string_func(p_store_string_ud, ", ");
|
||||
|
@ -1733,12 +1774,47 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
|
|||
p_store_string_func(p_store_string_ud, " )");
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_REAL_ARRAY: {
|
||||
case Variant::PACKED_INT64_ARRAY: {
|
||||
|
||||
p_store_string_func(p_store_string_ud, "PackedRealArray( ");
|
||||
Vector<real_t> data = p_variant;
|
||||
p_store_string_func(p_store_string_ud, "PackedInt64Array( ");
|
||||
Vector<int64_t> data = p_variant;
|
||||
int64_t len = data.size();
|
||||
const int64_t *ptr = data.ptr();
|
||||
|
||||
for (int64_t i = 0; i < len; i++) {
|
||||
|
||||
if (i > 0)
|
||||
p_store_string_func(p_store_string_ud, ", ");
|
||||
|
||||
p_store_string_func(p_store_string_ud, itos(ptr[i]));
|
||||
}
|
||||
|
||||
p_store_string_func(p_store_string_ud, " )");
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_FLOAT32_ARRAY: {
|
||||
|
||||
p_store_string_func(p_store_string_ud, "PackedFloat32Array( ");
|
||||
Vector<float> data = p_variant;
|
||||
int len = data.size();
|
||||
const real_t *ptr = data.ptr();
|
||||
const float *ptr = data.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, rtosfix(ptr[i]));
|
||||
}
|
||||
|
||||
p_store_string_func(p_store_string_ud, " )");
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_FLOAT64_ARRAY: {
|
||||
|
||||
p_store_string_func(p_store_string_ud, "PackedFloat64Array( ");
|
||||
Vector<double> data = p_variant;
|
||||
int len = data.size();
|
||||
const double *ptr = data.ptr();
|
||||
|
||||
for (int i = 0; i < len; i++) {
|
||||
|
||||
|
|
|
@ -1681,11 +1681,11 @@ void RasterizerStorageGLES2::shader_get_param_list(RID p_shader, List<PropertyIn
|
|||
case ShaderLanguage::TYPE_UVEC3:
|
||||
case ShaderLanguage::TYPE_IVEC4:
|
||||
case ShaderLanguage::TYPE_UVEC4: {
|
||||
pi.type = Variant::PACKED_INT_ARRAY;
|
||||
pi.type = Variant::PACKED_INT32_ARRAY;
|
||||
} break;
|
||||
|
||||
case ShaderLanguage::TYPE_FLOAT: {
|
||||
pi.type = Variant::REAL;
|
||||
pi.type = Variant::FLOAT;
|
||||
if (u.hint == ShaderLanguage::ShaderNode::Uniform::HINT_RANGE) {
|
||||
pi.hint = PROPERTY_HINT_RANGE;
|
||||
pi.hint_string = rtos(u.hint_range[0]) + "," + rtos(u.hint_range[1]) + "," + rtos(u.hint_range[2]);
|
||||
|
|
|
@ -1150,16 +1150,16 @@ void AnimationBezierTrackEdit::_bind_methods() {
|
|||
ClassDB::bind_method("_clear_selection_for_anim", &AnimationBezierTrackEdit::_clear_selection_for_anim);
|
||||
ClassDB::bind_method("_select_at_anim", &AnimationBezierTrackEdit::_select_at_anim);
|
||||
|
||||
ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::REAL, "position"), PropertyInfo(Variant::BOOL, "drag")));
|
||||
ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag")));
|
||||
ADD_SIGNAL(MethodInfo("remove_request", PropertyInfo(Variant::INT, "track")));
|
||||
ADD_SIGNAL(MethodInfo("insert_key", PropertyInfo(Variant::REAL, "ofs")));
|
||||
ADD_SIGNAL(MethodInfo("insert_key", PropertyInfo(Variant::FLOAT, "ofs")));
|
||||
ADD_SIGNAL(MethodInfo("select_key", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::BOOL, "single")));
|
||||
ADD_SIGNAL(MethodInfo("deselect_key", PropertyInfo(Variant::INT, "index")));
|
||||
ADD_SIGNAL(MethodInfo("clear_selection"));
|
||||
ADD_SIGNAL(MethodInfo("close_request"));
|
||||
|
||||
ADD_SIGNAL(MethodInfo("move_selection_begin"));
|
||||
ADD_SIGNAL(MethodInfo("move_selection", PropertyInfo(Variant::REAL, "ofs")));
|
||||
ADD_SIGNAL(MethodInfo("move_selection", PropertyInfo(Variant::FLOAT, "ofs")));
|
||||
ADD_SIGNAL(MethodInfo("move_selection_commit"));
|
||||
ADD_SIGNAL(MethodInfo("move_selection_cancel"));
|
||||
}
|
||||
|
|
|
@ -548,9 +548,9 @@ public:
|
|||
|
||||
if (use_fps && animation->get_step() > 0) {
|
||||
float max_frame = animation->get_length() / animation->get_step();
|
||||
p_list->push_back(PropertyInfo(Variant::REAL, "frame", PROPERTY_HINT_RANGE, "0," + rtos(max_frame) + ",1"));
|
||||
p_list->push_back(PropertyInfo(Variant::FLOAT, "frame", PROPERTY_HINT_RANGE, "0," + rtos(max_frame) + ",1"));
|
||||
} else {
|
||||
p_list->push_back(PropertyInfo(Variant::REAL, "time", PROPERTY_HINT_RANGE, "0," + rtos(animation->get_length()) + ",0.01"));
|
||||
p_list->push_back(PropertyInfo(Variant::FLOAT, "time", PROPERTY_HINT_RANGE, "0," + rtos(animation->get_length()) + ",0.01"));
|
||||
}
|
||||
|
||||
switch (animation->track_get_type(track)) {
|
||||
|
@ -617,7 +617,7 @@ public:
|
|||
} break;
|
||||
case Animation::TYPE_BEZIER: {
|
||||
|
||||
p_list->push_back(PropertyInfo(Variant::REAL, "value"));
|
||||
p_list->push_back(PropertyInfo(Variant::FLOAT, "value"));
|
||||
p_list->push_back(PropertyInfo(Variant::VECTOR2, "in_handle"));
|
||||
p_list->push_back(PropertyInfo(Variant::VECTOR2, "out_handle"));
|
||||
|
||||
|
@ -625,8 +625,8 @@ public:
|
|||
case Animation::TYPE_AUDIO: {
|
||||
|
||||
p_list->push_back(PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream"));
|
||||
p_list->push_back(PropertyInfo(Variant::REAL, "start_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater"));
|
||||
p_list->push_back(PropertyInfo(Variant::REAL, "end_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater"));
|
||||
p_list->push_back(PropertyInfo(Variant::FLOAT, "start_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater"));
|
||||
p_list->push_back(PropertyInfo(Variant::FLOAT, "end_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater"));
|
||||
|
||||
} break;
|
||||
case Animation::TYPE_ANIMATION: {
|
||||
|
@ -660,7 +660,7 @@ public:
|
|||
}
|
||||
|
||||
if (animation->track_get_type(track) == Animation::TYPE_VALUE) {
|
||||
p_list->push_back(PropertyInfo(Variant::REAL, "easing", PROPERTY_HINT_EXP_EASING));
|
||||
p_list->push_back(PropertyInfo(Variant::FLOAT, "easing", PROPERTY_HINT_EXP_EASING));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1243,9 +1243,9 @@ public:
|
|||
|
||||
if (use_fps && animation->get_step() > 0) {
|
||||
float max_frame = animation->get_length() / animation->get_step();
|
||||
p_list->push_back(PropertyInfo(Variant::REAL, "frame", PROPERTY_HINT_RANGE, "0," + rtos(max_frame) + ",1"));
|
||||
p_list->push_back(PropertyInfo(Variant::FLOAT, "frame", PROPERTY_HINT_RANGE, "0," + rtos(max_frame) + ",1"));
|
||||
} else {
|
||||
p_list->push_back(PropertyInfo(Variant::REAL, "time", PROPERTY_HINT_RANGE, "0," + rtos(animation->get_length()) + ",0.01"));
|
||||
p_list->push_back(PropertyInfo(Variant::FLOAT, "time", PROPERTY_HINT_RANGE, "0," + rtos(animation->get_length()) + ",0.01"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1289,7 +1289,7 @@ public:
|
|||
p_list->push_back(PropertyInfo(v.get_type(), "value", hint, hint_string));
|
||||
}
|
||||
|
||||
p_list->push_back(PropertyInfo(Variant::REAL, "easing", PROPERTY_HINT_EXP_EASING));
|
||||
p_list->push_back(PropertyInfo(Variant::FLOAT, "easing", PROPERTY_HINT_EXP_EASING));
|
||||
} break;
|
||||
case Animation::TYPE_METHOD: {
|
||||
|
||||
|
@ -1316,15 +1316,15 @@ public:
|
|||
} break;
|
||||
case Animation::TYPE_BEZIER: {
|
||||
|
||||
p_list->push_back(PropertyInfo(Variant::REAL, "value"));
|
||||
p_list->push_back(PropertyInfo(Variant::FLOAT, "value"));
|
||||
p_list->push_back(PropertyInfo(Variant::VECTOR2, "in_handle"));
|
||||
p_list->push_back(PropertyInfo(Variant::VECTOR2, "out_handle"));
|
||||
} break;
|
||||
case Animation::TYPE_AUDIO: {
|
||||
|
||||
p_list->push_back(PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream"));
|
||||
p_list->push_back(PropertyInfo(Variant::REAL, "start_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater"));
|
||||
p_list->push_back(PropertyInfo(Variant::REAL, "end_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater"));
|
||||
p_list->push_back(PropertyInfo(Variant::FLOAT, "start_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater"));
|
||||
p_list->push_back(PropertyInfo(Variant::FLOAT, "end_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater"));
|
||||
} break;
|
||||
case Animation::TYPE_ANIMATION: {
|
||||
|
||||
|
@ -1854,9 +1854,9 @@ void AnimationTimelineEdit::_bind_methods() {
|
|||
|
||||
ADD_SIGNAL(MethodInfo("zoom_changed"));
|
||||
ADD_SIGNAL(MethodInfo("name_limit_changed"));
|
||||
ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::REAL, "position"), PropertyInfo(Variant::BOOL, "drag")));
|
||||
ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag")));
|
||||
ADD_SIGNAL(MethodInfo("track_added", PropertyInfo(Variant::INT, "track")));
|
||||
ADD_SIGNAL(MethodInfo("length_changed", PropertyInfo(Variant::REAL, "size")));
|
||||
ADD_SIGNAL(MethodInfo("length_changed", PropertyInfo(Variant::FLOAT, "size")));
|
||||
}
|
||||
|
||||
AnimationTimelineEdit::AnimationTimelineEdit() {
|
||||
|
@ -3073,16 +3073,16 @@ void AnimationTrackEdit::_bind_methods() {
|
|||
ClassDB::bind_method("_path_entered", &AnimationTrackEdit::_path_entered);
|
||||
ClassDB::bind_method("_play_position_draw", &AnimationTrackEdit::_play_position_draw);
|
||||
|
||||
ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::REAL, "position"), PropertyInfo(Variant::BOOL, "drag")));
|
||||
ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag")));
|
||||
ADD_SIGNAL(MethodInfo("remove_request", PropertyInfo(Variant::INT, "track")));
|
||||
ADD_SIGNAL(MethodInfo("dropped", PropertyInfo(Variant::INT, "from_track"), PropertyInfo(Variant::INT, "to_track")));
|
||||
ADD_SIGNAL(MethodInfo("insert_key", PropertyInfo(Variant::REAL, "ofs")));
|
||||
ADD_SIGNAL(MethodInfo("insert_key", PropertyInfo(Variant::FLOAT, "ofs")));
|
||||
ADD_SIGNAL(MethodInfo("select_key", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::BOOL, "single")));
|
||||
ADD_SIGNAL(MethodInfo("deselect_key", PropertyInfo(Variant::INT, "index")));
|
||||
ADD_SIGNAL(MethodInfo("bezier_edit"));
|
||||
|
||||
ADD_SIGNAL(MethodInfo("move_selection_begin"));
|
||||
ADD_SIGNAL(MethodInfo("move_selection", PropertyInfo(Variant::REAL, "ofs")));
|
||||
ADD_SIGNAL(MethodInfo("move_selection", PropertyInfo(Variant::FLOAT, "ofs")));
|
||||
ADD_SIGNAL(MethodInfo("move_selection_commit"));
|
||||
ADD_SIGNAL(MethodInfo("move_selection_cancel"));
|
||||
|
||||
|
@ -3482,7 +3482,7 @@ void AnimationTrackEditor::_query_insert(const InsertData &p_id) {
|
|||
|
||||
switch (insert_data[i].value.get_type()) {
|
||||
case Variant::INT:
|
||||
case Variant::REAL:
|
||||
case Variant::FLOAT:
|
||||
case Variant::VECTOR2:
|
||||
case Variant::VECTOR3:
|
||||
case Variant::QUAT:
|
||||
|
@ -3913,7 +3913,7 @@ static Vector<String> _get_bezier_subindices_for_type(Variant::Type p_type, bool
|
|||
case Variant::INT: {
|
||||
subindices.push_back("");
|
||||
} break;
|
||||
case Variant::REAL: {
|
||||
case Variant::FLOAT: {
|
||||
subindices.push_back("");
|
||||
} break;
|
||||
case Variant::VECTOR2: {
|
||||
|
@ -3991,7 +3991,7 @@ int AnimationTrackEditor::_confirm_insert(InsertData p_id, int p_last_track, boo
|
|||
PropertyInfo h = _find_hint_for_track(animation->get_track_count() - 1, np);
|
||||
animation->remove_track(animation->get_track_count() - 1); //hack
|
||||
|
||||
if (h.type == Variant::REAL ||
|
||||
if (h.type == Variant::FLOAT ||
|
||||
h.type == Variant::VECTOR2 ||
|
||||
h.type == Variant::RECT2 ||
|
||||
h.type == Variant::VECTOR3 ||
|
||||
|
@ -4473,7 +4473,7 @@ void AnimationTrackEditor::_new_track_node_selected(NodePath p_path) {
|
|||
|
||||
Vector<Variant::Type> filter;
|
||||
filter.push_back(Variant::INT);
|
||||
filter.push_back(Variant::REAL);
|
||||
filter.push_back(Variant::FLOAT);
|
||||
filter.push_back(Variant::VECTOR2);
|
||||
filter.push_back(Variant::VECTOR3);
|
||||
filter.push_back(Variant::QUAT);
|
||||
|
@ -4543,7 +4543,7 @@ void AnimationTrackEditor::_new_track_property_selected(String p_name) {
|
|||
animation->track_set_path(animation->get_track_count() - 1, full_path);
|
||||
PropertyInfo h = _find_hint_for_track(animation->get_track_count() - 1, np);
|
||||
animation->remove_track(animation->get_track_count() - 1); //hack
|
||||
if (h.type == Variant::REAL ||
|
||||
if (h.type == Variant::FLOAT ||
|
||||
h.type == Variant::VECTOR2 ||
|
||||
h.type == Variant::RECT2 ||
|
||||
h.type == Variant::VECTOR3 ||
|
||||
|
@ -5777,10 +5777,10 @@ void AnimationTrackEditor::_bind_methods() {
|
|||
ClassDB::bind_method("_show_imported_anim_warning", &AnimationTrackEditor::_show_imported_anim_warning);
|
||||
ClassDB::bind_method("_select_all_tracks_for_copy", &AnimationTrackEditor::_select_all_tracks_for_copy);
|
||||
|
||||
ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::REAL, "position"), PropertyInfo(Variant::BOOL, "drag")));
|
||||
ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag")));
|
||||
ADD_SIGNAL(MethodInfo("keying_changed"));
|
||||
ADD_SIGNAL(MethodInfo("animation_len_changed", PropertyInfo(Variant::REAL, "len")));
|
||||
ADD_SIGNAL(MethodInfo("animation_step_changed", PropertyInfo(Variant::REAL, "step")));
|
||||
ADD_SIGNAL(MethodInfo("animation_len_changed", PropertyInfo(Variant::FLOAT, "len")));
|
||||
ADD_SIGNAL(MethodInfo("animation_step_changed", PropertyInfo(Variant::FLOAT, "step")));
|
||||
}
|
||||
|
||||
AnimationTrackEditor::AnimationTrackEditor() {
|
||||
|
|
|
@ -166,7 +166,7 @@ void ConnectDialog::_add_bind() {
|
|||
switch (vt) {
|
||||
case Variant::BOOL: value = false; break;
|
||||
case Variant::INT: value = 0; break;
|
||||
case Variant::REAL: value = 0.0; break;
|
||||
case Variant::FLOAT: value = 0.0; break;
|
||||
case Variant::STRING: value = ""; break;
|
||||
case Variant::STRING_NAME: value = ""; break;
|
||||
case Variant::VECTOR2: value = Vector2(); break;
|
||||
|
@ -414,7 +414,7 @@ ConnectDialog::ConnectDialog() {
|
|||
add_bind_hb->add_child(type_list);
|
||||
type_list->add_item("bool", Variant::BOOL);
|
||||
type_list->add_item("int", Variant::INT);
|
||||
type_list->add_item("real", Variant::REAL);
|
||||
type_list->add_item("real", Variant::FLOAT);
|
||||
type_list->add_item("String", Variant::STRING);
|
||||
type_list->add_item("StringName", Variant::STRING_NAME);
|
||||
type_list->add_item("Vector2", Variant::VECTOR2);
|
||||
|
|
|
@ -161,7 +161,7 @@ void DocDump::dump(const String &p_file) {
|
|||
default_arg_text = "false";
|
||||
break;
|
||||
case Variant::INT:
|
||||
case Variant::REAL:
|
||||
case Variant::FLOAT:
|
||||
//keep it
|
||||
break;
|
||||
case Variant::STRING:
|
||||
|
@ -188,8 +188,10 @@ void DocDump::dump(const String &p_file) {
|
|||
case Variant::BASIS:
|
||||
case Variant::COLOR:
|
||||
case Variant::PACKED_BYTE_ARRAY:
|
||||
case Variant::PACKED_INT_ARRAY:
|
||||
case Variant::PACKED_REAL_ARRAY:
|
||||
case Variant::PACKED_INT32_ARRAY:
|
||||
case Variant::PACKED_FLOAT32_ARRAY:
|
||||
case Variant::PACKED_INT64_ARRAY:
|
||||
case Variant::PACKED_FLOAT64_ARRAY:
|
||||
case Variant::PACKED_STRING_ARRAY:
|
||||
case Variant::PACKED_VECTOR3_ARRAY:
|
||||
case Variant::PACKED_COLOR_ARRAY:
|
||||
|
|
|
@ -430,7 +430,7 @@ bool EditorPropertyRevert::is_node_property_different(Node *p_node, const Varian
|
|||
return false; //pointless to check if we are not comparing against anything.
|
||||
}
|
||||
|
||||
if (p_current.get_type() == Variant::REAL && p_orig.get_type() == Variant::REAL) {
|
||||
if (p_current.get_type() == Variant::FLOAT && p_orig.get_type() == Variant::FLOAT) {
|
||||
float a = p_current;
|
||||
float b = p_orig;
|
||||
|
||||
|
|
|
@ -5841,7 +5841,7 @@ EditorNode::EditorNode() {
|
|||
EDITOR_DEF_RST("interface/scene_tabs/show_thumbnail_on_hover", true);
|
||||
EDITOR_DEF_RST("interface/inspector/capitalize_properties", true);
|
||||
EDITOR_DEF_RST("interface/inspector/default_float_step", 0.001);
|
||||
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::REAL, "interface/inspector/default_float_step", PROPERTY_HINT_RANGE, "0,1,0"));
|
||||
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::FLOAT, "interface/inspector/default_float_step", PROPERTY_HINT_RANGE, "0,1,0"));
|
||||
EDITOR_DEF_RST("interface/inspector/disable_folding", false);
|
||||
EDITOR_DEF_RST("interface/inspector/auto_unfold_foreign_scenes", true);
|
||||
EDITOR_DEF("interface/inspector/horizontal_vector2_editing", false);
|
||||
|
|
|
@ -3039,7 +3039,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
|
|||
add_property_editor(p_path, editor);
|
||||
}
|
||||
} break;
|
||||
case Variant::REAL: {
|
||||
case Variant::FLOAT: {
|
||||
|
||||
if (p_hint == PROPERTY_HINT_EXP_EASING) {
|
||||
EditorPropertyEasing *editor = memnew(EditorPropertyEasing);
|
||||
|
@ -3389,14 +3389,24 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
|
|||
editor->setup(Variant::PACKED_BYTE_ARRAY);
|
||||
add_property_editor(p_path, editor);
|
||||
} break; // 20
|
||||
case Variant::PACKED_INT_ARRAY: {
|
||||
case Variant::PACKED_INT32_ARRAY: {
|
||||
EditorPropertyArray *editor = memnew(EditorPropertyArray);
|
||||
editor->setup(Variant::PACKED_INT_ARRAY);
|
||||
editor->setup(Variant::PACKED_INT32_ARRAY);
|
||||
add_property_editor(p_path, editor);
|
||||
} break;
|
||||
case Variant::PACKED_REAL_ARRAY: {
|
||||
case Variant::PACKED_INT64_ARRAY: {
|
||||
EditorPropertyArray *editor = memnew(EditorPropertyArray);
|
||||
editor->setup(Variant::PACKED_REAL_ARRAY);
|
||||
editor->setup(Variant::PACKED_INT64_ARRAY);
|
||||
add_property_editor(p_path, editor);
|
||||
} break;
|
||||
case Variant::PACKED_FLOAT32_ARRAY: {
|
||||
EditorPropertyArray *editor = memnew(EditorPropertyArray);
|
||||
editor->setup(Variant::PACKED_FLOAT32_ARRAY);
|
||||
add_property_editor(p_path, editor);
|
||||
} break;
|
||||
case Variant::PACKED_FLOAT64_ARRAY: {
|
||||
EditorPropertyArray *editor = memnew(EditorPropertyArray);
|
||||
editor->setup(Variant::PACKED_FLOAT64_ARRAY);
|
||||
add_property_editor(p_path, editor);
|
||||
} break;
|
||||
case Variant::PACKED_STRING_ARRAY: {
|
||||
|
|
|
@ -231,11 +231,17 @@ void EditorPropertyArray::update_property() {
|
|||
case Variant::PACKED_BYTE_ARRAY: {
|
||||
arrtype = "PackedByteArray";
|
||||
} break;
|
||||
case Variant::PACKED_INT_ARRAY: {
|
||||
arrtype = "PackedIntArray";
|
||||
case Variant::PACKED_INT32_ARRAY: {
|
||||
arrtype = "PackedInt32Array";
|
||||
} break;
|
||||
case Variant::PACKED_REAL_ARRAY: {
|
||||
arrtype = "PackedRealArray";
|
||||
case Variant::PACKED_FLOAT32_ARRAY: {
|
||||
arrtype = "PackedFloat32Array";
|
||||
} break;
|
||||
case Variant::PACKED_INT64_ARRAY: {
|
||||
arrtype = "PackedInt64Array";
|
||||
} break;
|
||||
case Variant::PACKED_FLOAT64_ARRAY: {
|
||||
arrtype = "PackedFloat64Array";
|
||||
} break;
|
||||
case Variant::PACKED_STRING_ARRAY: {
|
||||
arrtype = "PackedStringArray";
|
||||
|
@ -724,7 +730,7 @@ void EditorPropertyDictionary::update_property() {
|
|||
prop = editor;
|
||||
|
||||
} break;
|
||||
case Variant::REAL: {
|
||||
case Variant::FLOAT: {
|
||||
|
||||
EditorPropertyFloat *editor = memnew(EditorPropertyFloat);
|
||||
editor->setup(-100000, 100000, 0.001, true, false, true, true);
|
||||
|
@ -851,16 +857,28 @@ void EditorPropertyDictionary::update_property() {
|
|||
editor->setup(Variant::PACKED_BYTE_ARRAY);
|
||||
prop = editor;
|
||||
} break;
|
||||
case Variant::PACKED_INT_ARRAY: {
|
||||
case Variant::PACKED_INT32_ARRAY: {
|
||||
|
||||
EditorPropertyArray *editor = memnew(EditorPropertyArray);
|
||||
editor->setup(Variant::PACKED_INT_ARRAY);
|
||||
editor->setup(Variant::PACKED_INT32_ARRAY);
|
||||
prop = editor;
|
||||
} break;
|
||||
case Variant::PACKED_REAL_ARRAY: {
|
||||
case Variant::PACKED_FLOAT32_ARRAY: {
|
||||
|
||||
EditorPropertyArray *editor = memnew(EditorPropertyArray);
|
||||
editor->setup(Variant::PACKED_REAL_ARRAY);
|
||||
editor->setup(Variant::PACKED_FLOAT32_ARRAY);
|
||||
prop = editor;
|
||||
} break;
|
||||
case Variant::PACKED_INT64_ARRAY: {
|
||||
|
||||
EditorPropertyArray *editor = memnew(EditorPropertyArray);
|
||||
editor->setup(Variant::PACKED_INT64_ARRAY);
|
||||
prop = editor;
|
||||
} break;
|
||||
case Variant::PACKED_FLOAT64_ARRAY: {
|
||||
|
||||
EditorPropertyArray *editor = memnew(EditorPropertyArray);
|
||||
editor->setup(Variant::PACKED_FLOAT64_ARRAY);
|
||||
prop = editor;
|
||||
} break;
|
||||
case Variant::PACKED_STRING_ARRAY: {
|
||||
|
|
|
@ -319,7 +319,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
|
|||
_initial_set("interface/editor/display_scale", 0);
|
||||
hints["interface/editor/display_scale"] = PropertyInfo(Variant::INT, "interface/editor/display_scale", PROPERTY_HINT_ENUM, "Auto,75%,100%,125%,150%,175%,200%,Custom", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
|
||||
_initial_set("interface/editor/custom_display_scale", 1.0f);
|
||||
hints["interface/editor/custom_display_scale"] = PropertyInfo(Variant::REAL, "interface/editor/custom_display_scale", PROPERTY_HINT_RANGE, "0.5,3,0.01", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
|
||||
hints["interface/editor/custom_display_scale"] = PropertyInfo(Variant::FLOAT, "interface/editor/custom_display_scale", PROPERTY_HINT_RANGE, "0.5,3,0.01", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
|
||||
_initial_set("interface/editor/main_font_size", 14);
|
||||
hints["interface/editor/main_font_size"] = PropertyInfo(Variant::INT, "interface/editor/main_font_size", PROPERTY_HINT_RANGE, "8,48,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
|
||||
_initial_set("interface/editor/code_font_size", 14);
|
||||
|
@ -335,9 +335,9 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
|
|||
hints["interface/editor/code_font"] = PropertyInfo(Variant::STRING, "interface/editor/code_font", PROPERTY_HINT_GLOBAL_FILE, "*.ttf,*.otf", PROPERTY_USAGE_DEFAULT);
|
||||
_initial_set("interface/editor/dim_editor_on_dialog_popup", true);
|
||||
_initial_set("interface/editor/low_processor_mode_sleep_usec", 6900); // ~144 FPS
|
||||
hints["interface/editor/low_processor_mode_sleep_usec"] = PropertyInfo(Variant::REAL, "interface/editor/low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "1,100000,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
|
||||
hints["interface/editor/low_processor_mode_sleep_usec"] = PropertyInfo(Variant::FLOAT, "interface/editor/low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "1,100000,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
|
||||
_initial_set("interface/editor/unfocused_low_processor_mode_sleep_usec", 50000); // 20 FPS
|
||||
hints["interface/editor/unfocused_low_processor_mode_sleep_usec"] = PropertyInfo(Variant::REAL, "interface/editor/unfocused_low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "1,100000,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
|
||||
hints["interface/editor/unfocused_low_processor_mode_sleep_usec"] = PropertyInfo(Variant::FLOAT, "interface/editor/unfocused_low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "1,100000,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
|
||||
_initial_set("interface/editor/separate_distraction_mode", false);
|
||||
_initial_set("interface/editor/automatically_open_screenshots", true);
|
||||
_initial_set("interface/editor/hide_console_window", false);
|
||||
|
@ -354,15 +354,15 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
|
|||
_initial_set("interface/theme/accent_color", Color(0.41, 0.61, 0.91));
|
||||
hints["interface/theme/accent_color"] = PropertyInfo(Variant::COLOR, "interface/theme/accent_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT);
|
||||
_initial_set("interface/theme/contrast", 0.25);
|
||||
hints["interface/theme/contrast"] = PropertyInfo(Variant::REAL, "interface/theme/contrast", PROPERTY_HINT_RANGE, "0.01, 1, 0.01");
|
||||
hints["interface/theme/contrast"] = PropertyInfo(Variant::FLOAT, "interface/theme/contrast", PROPERTY_HINT_RANGE, "0.01, 1, 0.01");
|
||||
_initial_set("interface/theme/relationship_line_opacity", 0.1);
|
||||
hints["interface/theme/relationship_line_opacity"] = PropertyInfo(Variant::REAL, "interface/theme/relationship_line_opacity", PROPERTY_HINT_RANGE, "0.00, 1, 0.01");
|
||||
hints["interface/theme/relationship_line_opacity"] = PropertyInfo(Variant::FLOAT, "interface/theme/relationship_line_opacity", PROPERTY_HINT_RANGE, "0.00, 1, 0.01");
|
||||
_initial_set("interface/theme/highlight_tabs", false);
|
||||
_initial_set("interface/theme/border_size", 1);
|
||||
_initial_set("interface/theme/use_graph_node_headers", false);
|
||||
hints["interface/theme/border_size"] = PropertyInfo(Variant::INT, "interface/theme/border_size", PROPERTY_HINT_RANGE, "0,2,1", PROPERTY_USAGE_DEFAULT);
|
||||
_initial_set("interface/theme/additional_spacing", 0);
|
||||
hints["interface/theme/additional_spacing"] = PropertyInfo(Variant::REAL, "interface/theme/additional_spacing", PROPERTY_HINT_RANGE, "0,5,0.1", PROPERTY_USAGE_DEFAULT);
|
||||
hints["interface/theme/additional_spacing"] = PropertyInfo(Variant::FLOAT, "interface/theme/additional_spacing", PROPERTY_HINT_RANGE, "0,5,0.1", PROPERTY_USAGE_DEFAULT);
|
||||
_initial_set("interface/theme/custom_theme", "");
|
||||
hints["interface/theme/custom_theme"] = PropertyInfo(Variant::STRING, "interface/theme/custom_theme", PROPERTY_HINT_GLOBAL_FILE, "*.res,*.tres,*.theme", PROPERTY_USAGE_DEFAULT);
|
||||
|
||||
|
@ -477,15 +477,15 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
|
|||
_initial_set("text_editor/cursor/block_caret", false);
|
||||
_initial_set("text_editor/cursor/caret_blink", true);
|
||||
_initial_set("text_editor/cursor/caret_blink_speed", 0.5);
|
||||
hints["text_editor/cursor/caret_blink_speed"] = PropertyInfo(Variant::REAL, "text_editor/cursor/caret_blink_speed", PROPERTY_HINT_RANGE, "0.1, 10, 0.01");
|
||||
hints["text_editor/cursor/caret_blink_speed"] = PropertyInfo(Variant::FLOAT, "text_editor/cursor/caret_blink_speed", PROPERTY_HINT_RANGE, "0.1, 10, 0.01");
|
||||
_initial_set("text_editor/cursor/right_click_moves_caret", true);
|
||||
|
||||
// Completion
|
||||
_initial_set("text_editor/completion/idle_parse_delay", 2.0);
|
||||
hints["text_editor/completion/idle_parse_delay"] = PropertyInfo(Variant::REAL, "text_editor/completion/idle_parse_delay", PROPERTY_HINT_RANGE, "0.1, 10, 0.01");
|
||||
hints["text_editor/completion/idle_parse_delay"] = PropertyInfo(Variant::FLOAT, "text_editor/completion/idle_parse_delay", PROPERTY_HINT_RANGE, "0.1, 10, 0.01");
|
||||
_initial_set("text_editor/completion/auto_brace_complete", true);
|
||||
_initial_set("text_editor/completion/code_complete_delay", 0.3);
|
||||
hints["text_editor/completion/code_complete_delay"] = PropertyInfo(Variant::REAL, "text_editor/completion/code_complete_delay", PROPERTY_HINT_RANGE, "0.01, 5, 0.01");
|
||||
hints["text_editor/completion/code_complete_delay"] = PropertyInfo(Variant::FLOAT, "text_editor/completion/code_complete_delay", PROPERTY_HINT_RANGE, "0.01, 5, 0.01");
|
||||
_initial_set("text_editor/completion/put_callhint_tooltip_below_current_line", true);
|
||||
_initial_set("text_editor/completion/callhint_tooltip_offset", Vector2());
|
||||
_initial_set("text_editor/completion/complete_file_paths", true);
|
||||
|
@ -541,23 +541,23 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
|
|||
|
||||
// 3D: Navigation feel
|
||||
_initial_set("editors/3d/navigation_feel/orbit_sensitivity", 0.4);
|
||||
hints["editors/3d/navigation_feel/orbit_sensitivity"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/orbit_sensitivity", PROPERTY_HINT_RANGE, "0.0, 2, 0.01");
|
||||
hints["editors/3d/navigation_feel/orbit_sensitivity"] = PropertyInfo(Variant::FLOAT, "editors/3d/navigation_feel/orbit_sensitivity", PROPERTY_HINT_RANGE, "0.0, 2, 0.01");
|
||||
_initial_set("editors/3d/navigation_feel/orbit_inertia", 0.05);
|
||||
hints["editors/3d/navigation_feel/orbit_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/orbit_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01");
|
||||
hints["editors/3d/navigation_feel/orbit_inertia"] = PropertyInfo(Variant::FLOAT, "editors/3d/navigation_feel/orbit_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01");
|
||||
_initial_set("editors/3d/navigation_feel/translation_inertia", 0.15);
|
||||
hints["editors/3d/navigation_feel/translation_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/translation_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01");
|
||||
hints["editors/3d/navigation_feel/translation_inertia"] = PropertyInfo(Variant::FLOAT, "editors/3d/navigation_feel/translation_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01");
|
||||
_initial_set("editors/3d/navigation_feel/zoom_inertia", 0.075);
|
||||
hints["editors/3d/navigation_feel/zoom_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/zoom_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01");
|
||||
hints["editors/3d/navigation_feel/zoom_inertia"] = PropertyInfo(Variant::FLOAT, "editors/3d/navigation_feel/zoom_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01");
|
||||
_initial_set("editors/3d/navigation_feel/manipulation_orbit_inertia", 0.075);
|
||||
hints["editors/3d/navigation_feel/manipulation_orbit_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/manipulation_orbit_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01");
|
||||
hints["editors/3d/navigation_feel/manipulation_orbit_inertia"] = PropertyInfo(Variant::FLOAT, "editors/3d/navigation_feel/manipulation_orbit_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01");
|
||||
_initial_set("editors/3d/navigation_feel/manipulation_translation_inertia", 0.075);
|
||||
hints["editors/3d/navigation_feel/manipulation_translation_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/manipulation_translation_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01");
|
||||
hints["editors/3d/navigation_feel/manipulation_translation_inertia"] = PropertyInfo(Variant::FLOAT, "editors/3d/navigation_feel/manipulation_translation_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01");
|
||||
|
||||
// 3D: Freelook
|
||||
_initial_set("editors/3d/freelook/freelook_inertia", 0.1);
|
||||
hints["editors/3d/freelook/freelook_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/freelook/freelook_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01");
|
||||
hints["editors/3d/freelook/freelook_inertia"] = PropertyInfo(Variant::FLOAT, "editors/3d/freelook/freelook_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01");
|
||||
_initial_set("editors/3d/freelook/freelook_base_speed", 5.0);
|
||||
hints["editors/3d/freelook/freelook_base_speed"] = PropertyInfo(Variant::REAL, "editors/3d/freelook/freelook_base_speed", PROPERTY_HINT_RANGE, "0.0, 10, 0.01");
|
||||
hints["editors/3d/freelook/freelook_base_speed"] = PropertyInfo(Variant::FLOAT, "editors/3d/freelook/freelook_base_speed", PROPERTY_HINT_RANGE, "0.0, 10, 0.01");
|
||||
_initial_set("editors/3d/freelook/freelook_activation_modifier", 0);
|
||||
hints["editors/3d/freelook/freelook_activation_modifier"] = PropertyInfo(Variant::INT, "editors/3d/freelook/freelook_activation_modifier", PROPERTY_HINT_ENUM, "None,Shift,Alt,Meta,Ctrl");
|
||||
_initial_set("editors/3d/freelook/freelook_speed_zoom_link", false);
|
||||
|
|
|
@ -162,7 +162,7 @@ void EditorImportPlugin::_bind_methods() {
|
|||
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::ARRAY, "get_import_options", PropertyInfo(Variant::INT, "preset")));
|
||||
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_save_extension"));
|
||||
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_resource_type"));
|
||||
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::REAL, "get_priority"));
|
||||
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::FLOAT, "get_priority"));
|
||||
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::INT, "get_import_order"));
|
||||
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "get_option_visibility", PropertyInfo(Variant::STRING, "option"), PropertyInfo(Variant::DICTIONARY, "options")));
|
||||
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::INT, "import", PropertyInfo(Variant::STRING, "source_file"), PropertyInfo(Variant::STRING, "save_path"), PropertyInfo(Variant::DICTIONARY, "options"), PropertyInfo(Variant::ARRAY, "platform_variants"), PropertyInfo(Variant::ARRAY, "gen_files")));
|
||||
|
|
|
@ -75,7 +75,7 @@ String ResourceImporterBitMap::get_preset_name(int p_idx) const {
|
|||
void ResourceImporterBitMap::get_import_options(List<ImportOption> *r_options, int p_preset) const {
|
||||
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "create_from", PROPERTY_HINT_ENUM, "Black & White,Alpha"), 0));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "threshold", PROPERTY_HINT_RANGE, "0,1,0.01"), 0.5));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "threshold", PROPERTY_HINT_RANGE, "0,1,0.01"), 0.5));
|
||||
}
|
||||
|
||||
Error ResourceImporterBitMap::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) {
|
||||
|
|
|
@ -1160,7 +1160,7 @@ void ResourceImporterScene::get_import_options(List<ImportOption> *r_options, in
|
|||
bool scenes_out = p_preset == PRESET_MULTIPLE_SCENES || p_preset == PRESET_MULTIPLE_SCENES_AND_MATERIALS;
|
||||
bool animations_out = p_preset == PRESET_SEPARATE_ANIMATIONS || p_preset == PRESET_SEPARATE_MESHES_AND_ANIMATIONS || p_preset == PRESET_SEPARATE_MATERIALS_AND_ANIMATIONS || p_preset == PRESET_SEPARATE_MESHES_MATERIALS_AND_ANIMATIONS;
|
||||
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "nodes/root_scale", PROPERTY_HINT_RANGE, "0.001,1000,0.001"), 1.0));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "nodes/root_scale", PROPERTY_HINT_RANGE, "0.001,1000,0.001"), 1.0));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::STRING, "nodes/custom_script", PROPERTY_HINT_FILE, script_ext_hint), ""));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "nodes/storage", PROPERTY_HINT_ENUM, "Single Scene,Instanced Sub-Scenes"), scenes_out ? 1 : 0));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "materials/location", PROPERTY_HINT_ENUM, "Node,Mesh"), (meshes_out || materials_out) ? 1 : 0));
|
||||
|
@ -1170,18 +1170,18 @@ void ResourceImporterScene::get_import_options(List<ImportOption> *r_options, in
|
|||
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "meshes/ensure_tangents"), true));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "meshes/storage", PROPERTY_HINT_ENUM, "Built-In,Files (.mesh),Files (.tres)"), meshes_out ? 1 : 0));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "meshes/light_baking", PROPERTY_HINT_ENUM, "Disabled,Enable,Gen Lightmaps", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), 0));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "meshes/lightmap_texel_size", PROPERTY_HINT_RANGE, "0.001,100,0.001"), 0.1));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "meshes/lightmap_texel_size", PROPERTY_HINT_RANGE, "0.001,100,0.001"), 0.1));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "skins/use_named_skins"), true));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "external_files/store_in_subdir"), false));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/import", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), true));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "animation/fps", PROPERTY_HINT_RANGE, "1,120,1"), 15));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "animation/fps", PROPERTY_HINT_RANGE, "1,120,1"), 15));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::STRING, "animation/filter_script", PROPERTY_HINT_MULTILINE_TEXT), ""));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "animation/storage", PROPERTY_HINT_ENUM, "Built-In,Files (.anim),Files (.tres)", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), animations_out));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/keep_custom_tracks"), animations_out));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/optimizer/enabled", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), true));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "animation/optimizer/max_linear_error"), 0.05));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "animation/optimizer/max_angular_error"), 0.01));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "animation/optimizer/max_angle"), 22));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "animation/optimizer/max_linear_error"), 0.05));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "animation/optimizer/max_angular_error"), 0.01));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "animation/optimizer/max_angle"), 22));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/optimizer/remove_unused_tracks"), true));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "animation/clips/amount", PROPERTY_HINT_RANGE, "0,256,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), 0));
|
||||
for (int i = 0; i < 256; i++) {
|
||||
|
|
|
@ -210,7 +210,7 @@ String ResourceImporterTexture::get_preset_name(int p_idx) const {
|
|||
void ResourceImporterTexture::get_import_options(List<ImportOption> *r_options, int p_preset) const {
|
||||
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/mode", PROPERTY_HINT_ENUM, "Lossless,Lossy,VRAM Compressed,VRAM Uncompressed,Basis Universal", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), p_preset == PRESET_3D ? 2 : 0));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "compress/lossy_quality", PROPERTY_HINT_RANGE, "0,1,0.01"), 0.7));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "compress/lossy_quality", PROPERTY_HINT_RANGE, "0,1,0.01"), 0.7));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/hdr_mode", PROPERTY_HINT_ENUM, "Enabled,Force RGBE"), 0));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/bptc_ldr", PROPERTY_HINT_ENUM, "Enabled,RGBA Only"), 0));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/normal_map", PROPERTY_HINT_ENUM, "Detect,Enable,Disabled"), 0));
|
||||
|
@ -226,7 +226,7 @@ void ResourceImporterTexture::get_import_options(List<ImportOption> *r_options,
|
|||
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "process/HDR_as_SRGB"), false));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "process/size_limit", PROPERTY_HINT_RANGE, "0,4096,1"), 0));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "detect_3d/compress_to", PROPERTY_HINT_ENUM, "Disabled,VRAM Compressed,Basis Universal"), (p_preset == PRESET_DETECT) ? 1 : 0));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "svg/scale", PROPERTY_HINT_RANGE, "0.001,100,0.001"), 1.0));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "svg/scale", PROPERTY_HINT_RANGE, "0.001,100,0.001"), 1.0));
|
||||
}
|
||||
|
||||
void ResourceImporterTexture::save_to_stex_format(FileAccess *f, const Ref<Image> &p_image, CompressMode p_compress_mode, Image::UsedChannels p_channels, Image::CompressMode p_compress_format, float p_lossy_quality, bool p_force_rgbe) {
|
||||
|
|
|
@ -82,7 +82,7 @@ void ResourceImporterWAV::get_import_options(List<ImportOption> *r_options, int
|
|||
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "force/8_bit"), false));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "force/mono"), false));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "force/max_rate", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), false));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "force/max_rate_hz", PROPERTY_HINT_EXP_RANGE, "11025,192000,1"), 44100));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "force/max_rate_hz", PROPERTY_HINT_EXP_RANGE, "11025,192000,1"), 44100));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "edit/trim"), false));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "edit/normalize"), false));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "edit/loop"), false));
|
||||
|
|
|
@ -307,8 +307,10 @@ void ScriptTextEditor::_set_theme_for_script() {
|
|||
text_edit->add_keyword_color("Dictionary", basetype_color);
|
||||
text_edit->add_keyword_color("Array", basetype_color);
|
||||
text_edit->add_keyword_color("PackedByteArray", basetype_color);
|
||||
text_edit->add_keyword_color("PackedIntArray", basetype_color);
|
||||
text_edit->add_keyword_color("PackedRealArray", basetype_color);
|
||||
text_edit->add_keyword_color("PackedInt32Array", basetype_color);
|
||||
text_edit->add_keyword_color("PackedFloat32Array", basetype_color);
|
||||
text_edit->add_keyword_color("PackedInt64Array", basetype_color);
|
||||
text_edit->add_keyword_color("PackedFloat64Array", basetype_color);
|
||||
text_edit->add_keyword_color("PackedStringArray", basetype_color);
|
||||
text_edit->add_keyword_color("PackedVector2Array", basetype_color);
|
||||
text_edit->add_keyword_color("PackedVector3Array", basetype_color);
|
||||
|
|
|
@ -6042,7 +6042,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
|
|||
EDITOR_DEF("editors/3d/manipulator_gizmo_size", 80);
|
||||
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "editors/3d/manipulator_gizmo_size", PROPERTY_HINT_RANGE, "16,1024,1"));
|
||||
EDITOR_DEF("editors/3d/manipulator_gizmo_opacity", 0.4);
|
||||
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::REAL, "editors/3d/manipulator_gizmo_opacity", PROPERTY_HINT_RANGE, "0,1,0.01"));
|
||||
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::FLOAT, "editors/3d/manipulator_gizmo_opacity", PROPERTY_HINT_RANGE, "0,1,0.01"));
|
||||
|
||||
over_gizmo_handle = -1;
|
||||
}
|
||||
|
|
|
@ -376,7 +376,7 @@ void SpriteEditor::_convert_to_polygon_2d_node() {
|
|||
Vector<Vector2> outline = computed_outline_lines[i];
|
||||
Vector<Vector2> uv_outline = outline_lines[i];
|
||||
|
||||
PackedIntArray pia;
|
||||
PackedInt32Array pia;
|
||||
pia.resize(outline.size());
|
||||
int *pia_write = pia.ptrw();
|
||||
|
||||
|
|
|
@ -3507,7 +3507,7 @@ void TilesetEditorContext::_get_property_list(List<PropertyInfo> *p_list) const
|
|||
p_list->push_back(PropertyInfo(Variant::OBJECT, "selected_collision", PROPERTY_HINT_RESOURCE_TYPE, tileset_editor->edited_collision_shape->get_class()));
|
||||
if (tileset_editor->edited_collision_shape.is_valid()) {
|
||||
p_list->push_back(PropertyInfo(Variant::BOOL, "selected_collision_one_way", PROPERTY_HINT_NONE));
|
||||
p_list->push_back(PropertyInfo(Variant::REAL, "selected_collision_one_way_margin", PROPERTY_HINT_NONE));
|
||||
p_list->push_back(PropertyInfo(Variant::FLOAT, "selected_collision_one_way_margin", PROPERTY_HINT_NONE));
|
||||
}
|
||||
}
|
||||
if (tileset_editor->edit_mode == TileSetEditor::EDITMODE_NAVIGATION && tileset_editor->edited_navigation_shape.is_valid()) {
|
||||
|
|
|
@ -648,7 +648,7 @@ void VisualShaderEditor::_update_graph() {
|
|||
button->set_text(((bool)default_value) ? "true" : "false");
|
||||
} break;
|
||||
case Variant::INT:
|
||||
case Variant::REAL: {
|
||||
case Variant::FLOAT: {
|
||||
button->set_text(String::num(default_value, 4));
|
||||
} break;
|
||||
case Variant::VECTOR3: {
|
||||
|
|
|
@ -393,12 +393,12 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
|
|||
|
||||
} break;
|
||||
case Variant::INT:
|
||||
case Variant::REAL: {
|
||||
case Variant::FLOAT: {
|
||||
|
||||
if (hint == PROPERTY_HINT_RANGE) {
|
||||
|
||||
int c = hint_text.get_slice_count(",");
|
||||
float min = 0, max = 100, step = type == Variant::REAL ? .01 : 1;
|
||||
float min = 0, max = 100, step = type == Variant::FLOAT ? .01 : 1;
|
||||
if (c >= 1) {
|
||||
|
||||
if (!hint_text.get_slice(",", 0).empty())
|
||||
|
@ -1048,10 +1048,16 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
|
|||
case Variant::PACKED_BYTE_ARRAY: {
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_INT_ARRAY: {
|
||||
case Variant::PACKED_INT32_ARRAY: {
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_REAL_ARRAY: {
|
||||
case Variant::PACKED_FLOAT32_ARRAY: {
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_INT64_ARRAY: {
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_FLOAT64_ARRAY: {
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_STRING_ARRAY: {
|
||||
|
@ -1113,7 +1119,7 @@ void CustomPropertyEditor::_file_selected(String p_file) {
|
|||
|
||||
void CustomPropertyEditor::_type_create_selected(int p_idx) {
|
||||
|
||||
if (type == Variant::INT || type == Variant::REAL) {
|
||||
if (type == Variant::INT || type == Variant::FLOAT) {
|
||||
|
||||
float newval = 0;
|
||||
switch (p_idx) {
|
||||
|
@ -1563,7 +1569,7 @@ void CustomPropertyEditor::_modified(String p_string) {
|
|||
emit_signal("variant_changed");
|
||||
|
||||
} break;
|
||||
case Variant::REAL: {
|
||||
case Variant::FLOAT: {
|
||||
|
||||
if (hint != PROPERTY_HINT_EXP_EASING) {
|
||||
String text = value_editor[0]->get_text();
|
||||
|
@ -1700,10 +1706,10 @@ void CustomPropertyEditor::_modified(String p_string) {
|
|||
case Variant::PACKED_BYTE_ARRAY: {
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_INT_ARRAY: {
|
||||
case Variant::PACKED_INT32_ARRAY: {
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_REAL_ARRAY: {
|
||||
case Variant::PACKED_FLOAT32_ARRAY: {
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_STRING_ARRAY: {
|
||||
|
@ -1751,7 +1757,7 @@ void CustomPropertyEditor::_range_modified(double p_value) {
|
|||
|
||||
void CustomPropertyEditor::_focus_enter() {
|
||||
switch (type) {
|
||||
case Variant::REAL:
|
||||
case Variant::FLOAT:
|
||||
case Variant::STRING:
|
||||
case Variant::VECTOR2:
|
||||
case Variant::RECT2:
|
||||
|
@ -1777,7 +1783,7 @@ void CustomPropertyEditor::_focus_enter() {
|
|||
|
||||
void CustomPropertyEditor::_focus_exit() {
|
||||
switch (type) {
|
||||
case Variant::REAL:
|
||||
case Variant::FLOAT:
|
||||
case Variant::STRING:
|
||||
case Variant::VECTOR2:
|
||||
case Variant::RECT2:
|
||||
|
|
|
@ -142,8 +142,8 @@ void PropertySelector::_update_search() {
|
|||
Control::get_icon("Dictionary", "EditorIcons"),
|
||||
Control::get_icon("Array", "EditorIcons"),
|
||||
Control::get_icon("PackedByteArray", "EditorIcons"),
|
||||
Control::get_icon("PackedIntArray", "EditorIcons"),
|
||||
Control::get_icon("PackedRealArray", "EditorIcons"),
|
||||
Control::get_icon("PackedInt32Array", "EditorIcons"),
|
||||
Control::get_icon("PackedFloat32Array", "EditorIcons"),
|
||||
Control::get_icon("PackedStringArray", "EditorIcons"),
|
||||
Control::get_icon("PackedVector2Array", "EditorIcons"),
|
||||
Control::get_icon("PackedVector3Array", "EditorIcons"),
|
||||
|
|
|
@ -1817,7 +1817,7 @@ bool Main::start() {
|
|||
GLOBAL_DEF("display/window/stretch/aspect", "ignore");
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/aspect", PropertyInfo(Variant::STRING, "display/window/stretch/aspect", PROPERTY_HINT_ENUM, "ignore,keep,keep_width,keep_height,expand"));
|
||||
GLOBAL_DEF("display/window/stretch/shrink", 1.0);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/shrink", PropertyInfo(Variant::REAL, "display/window/stretch/shrink", PROPERTY_HINT_RANGE, "1.0,8.0,0.1"));
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/shrink", PropertyInfo(Variant::FLOAT, "display/window/stretch/shrink", PROPERTY_HINT_RANGE, "1.0,8.0,0.1"));
|
||||
sml->set_auto_accept_quit(GLOBAL_DEF("application/config/auto_accept_quit", true));
|
||||
sml->set_quit_on_go_back(GLOBAL_DEF("application/config/quit_on_go_back", true));
|
||||
GLOBAL_DEF("gui/common/snap_controls_to_pixels", true);
|
||||
|
|
|
@ -1275,7 +1275,7 @@ EditorSceneImporterAssimp::_generate_mesh_from_surface_indices(ImportState &stat
|
|||
for (size_t l = 0; l < num_vertices; l++) {
|
||||
AssimpUtils::calc_tangent_from_mesh(ai_mesh, j, l, l, w);
|
||||
}
|
||||
PackedRealArray new_tangents = array_copy[VisualServer::ARRAY_TANGENT].duplicate(true);
|
||||
PackedFloat32Array new_tangents = array_copy[VisualServer::ARRAY_TANGENT].duplicate(true);
|
||||
ERR_CONTINUE(new_tangents.size() != tangents.size() * 4);
|
||||
for (int32_t l = 0; l < tangents.size(); l++) {
|
||||
new_tangents.ptrw()[l + 0] = tangents[l].r;
|
||||
|
|
|
@ -474,7 +474,7 @@ void HeightMapShapeBullet::set_data(const Variant &p_data) {
|
|||
Vector<real_t> l_heights;
|
||||
Variant l_heights_v = d["heights"];
|
||||
|
||||
if (l_heights_v.get_type() == Variant::PACKED_REAL_ARRAY) {
|
||||
if (l_heights_v.get_type() == Variant::PACKED_FLOAT32_ARRAY) {
|
||||
// Ready-to-use heights can be passed
|
||||
|
||||
l_heights = l_heights_v;
|
||||
|
@ -505,7 +505,7 @@ void HeightMapShapeBullet::set_data(const Variant &p_data) {
|
|||
}
|
||||
|
||||
} else {
|
||||
ERR_FAIL_MSG("Expected PackedRealArray or float Image.");
|
||||
ERR_FAIL_MSG("Expected PackedFloat32Array or float Image.");
|
||||
}
|
||||
|
||||
ERR_FAIL_COND(l_width <= 0);
|
||||
|
|
|
@ -621,7 +621,7 @@ void CSGShape::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("get_meshes"), &CSGShape::get_meshes);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "operation", PROPERTY_HINT_ENUM, "Union,Intersection,Subtraction"), "set_operation", "get_operation");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "snap", PROPERTY_HINT_RANGE, "0.0001,1,0.001"), "set_snap", "get_snap");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "snap", PROPERTY_HINT_RANGE, "0.0001,1,0.001"), "set_snap", "get_snap");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "calculate_tangents"), "set_calculate_tangents", "is_calculating_tangents");
|
||||
|
||||
ADD_GROUP("Collision", "collision_");
|
||||
|
@ -1049,7 +1049,7 @@ void CSGSphere::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("set_material", "material"), &CSGSphere::set_material);
|
||||
ClassDB::bind_method(D_METHOD("get_material"), &CSGSphere::get_material);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_RANGE, "0.001,100.0,0.001"), "set_radius", "get_radius");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_RANGE, "0.001,100.0,0.001"), "set_radius", "get_radius");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "radial_segments", PROPERTY_HINT_RANGE, "1,100,1"), "set_radial_segments", "get_radial_segments");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "rings", PROPERTY_HINT_RANGE, "1,100,1"), "set_rings", "get_rings");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "smooth_faces"), "set_smooth_faces", "get_smooth_faces");
|
||||
|
@ -1236,9 +1236,9 @@ void CSGBox::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("set_material", "material"), &CSGBox::set_material);
|
||||
ClassDB::bind_method(D_METHOD("get_material"), &CSGBox::get_material);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "width", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_width", "get_width");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "height", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_height", "get_height");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "depth", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_depth", "get_depth");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "width", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_width", "get_width");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "height", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_height", "get_height");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "depth", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_depth", "get_depth");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "material", PROPERTY_HINT_RESOURCE_TYPE, "StandardMaterial3D,ShaderMaterial"), "set_material", "get_material");
|
||||
}
|
||||
|
||||
|
@ -1451,8 +1451,8 @@ void CSGCylinder::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("set_smooth_faces", "smooth_faces"), &CSGCylinder::set_smooth_faces);
|
||||
ClassDB::bind_method(D_METHOD("get_smooth_faces"), &CSGCylinder::get_smooth_faces);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_radius", "get_radius");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "height", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_height", "get_height");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_radius", "get_radius");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "height", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_height", "get_height");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "sides", PROPERTY_HINT_RANGE, "3,64,1"), "set_sides", "get_sides");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cone"), "set_cone", "is_cone");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "smooth_faces"), "set_smooth_faces", "get_smooth_faces");
|
||||
|
@ -1678,8 +1678,8 @@ void CSGTorus::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("set_smooth_faces", "smooth_faces"), &CSGTorus::set_smooth_faces);
|
||||
ClassDB::bind_method(D_METHOD("get_smooth_faces"), &CSGTorus::get_smooth_faces);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "inner_radius", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_inner_radius", "get_inner_radius");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "outer_radius", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_outer_radius", "get_outer_radius");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "inner_radius", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_inner_radius", "get_inner_radius");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "outer_radius", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_outer_radius", "get_outer_radius");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "sides", PROPERTY_HINT_RANGE, "3,64,1"), "set_sides", "get_sides");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "ring_sides", PROPERTY_HINT_RANGE, "3,64,1"), "set_ring_sides", "get_ring_sides");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "smooth_faces"), "set_smooth_faces", "get_smooth_faces");
|
||||
|
@ -2314,11 +2314,11 @@ void CSGPolygon::_bind_methods() {
|
|||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "polygon"), "set_polygon", "get_polygon");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Depth,Spin,Path"), "set_mode", "get_mode");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "depth", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_depth", "get_depth");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "spin_degrees", PROPERTY_HINT_RANGE, "1,360,0.1"), "set_spin_degrees", "get_spin_degrees");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "depth", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_depth", "get_depth");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "spin_degrees", PROPERTY_HINT_RANGE, "1,360,0.1"), "set_spin_degrees", "get_spin_degrees");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "spin_sides", PROPERTY_HINT_RANGE, "3,64,1"), "set_spin_sides", "get_spin_sides");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "path_node", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "Path"), "set_path_node", "get_path_node");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "path_interval", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_path_interval", "get_path_interval");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "path_interval", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_path_interval", "get_path_interval");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "path_rotation", PROPERTY_HINT_ENUM, "Polygon,Path,PathFollow"), "set_path_rotation", "get_path_rotation");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "path_local"), "set_path_local", "is_path_local");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "path_continuous_u"), "set_path_continuous_u", "is_path_continuous_u");
|
||||
|
|
|
@ -209,13 +209,13 @@ void GDAPI godot_variant_new_packed_byte_array(godot_variant *r_dest, const godo
|
|||
|
||||
void GDAPI godot_variant_new_packed_int_array(godot_variant *r_dest, const godot_packed_int_array *p_pia) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
PackedIntArray *pia = (PackedIntArray *)p_pia;
|
||||
PackedInt32Array *pia = (PackedInt32Array *)p_pia;
|
||||
memnew_placement_custom(dest, Variant, Variant(*pia));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_packed_real_array(godot_variant *r_dest, const godot_packed_real_array *p_pra) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
PackedRealArray *pra = (PackedRealArray *)p_pra;
|
||||
PackedFloat32Array *pra = (PackedFloat32Array *)p_pra;
|
||||
memnew_placement_custom(dest, Variant, Variant(*pra));
|
||||
}
|
||||
|
||||
|
@ -402,8 +402,8 @@ godot_packed_byte_array GDAPI godot_variant_as_packed_byte_array(const godot_var
|
|||
godot_packed_int_array GDAPI godot_variant_as_packed_int_array(const godot_variant *p_self) {
|
||||
godot_packed_int_array raw_dest;
|
||||
const Variant *self = (const Variant *)p_self;
|
||||
PackedIntArray *dest = (PackedIntArray *)&raw_dest;
|
||||
memnew_placement(dest, PackedIntArray(self->operator PackedIntArray())); // operator = is overloaded by PackedIntArray
|
||||
PackedInt32Array *dest = (PackedInt32Array *)&raw_dest;
|
||||
memnew_placement(dest, PackedInt32Array(self->operator PackedInt32Array())); // operator = is overloaded by PackedInt32Array
|
||||
*dest = *self;
|
||||
return raw_dest;
|
||||
}
|
||||
|
@ -411,8 +411,8 @@ godot_packed_int_array GDAPI godot_variant_as_packed_int_array(const godot_varia
|
|||
godot_packed_real_array GDAPI godot_variant_as_packed_real_array(const godot_variant *p_self) {
|
||||
godot_packed_real_array raw_dest;
|
||||
const Variant *self = (const Variant *)p_self;
|
||||
PackedRealArray *dest = (PackedRealArray *)&raw_dest;
|
||||
memnew_placement(dest, PackedRealArray(self->operator PackedRealArray())); // operator = is overloaded by PackedRealArray
|
||||
PackedFloat32Array *dest = (PackedFloat32Array *)&raw_dest;
|
||||
memnew_placement(dest, PackedFloat32Array(self->operator PackedFloat32Array())); // operator = is overloaded by PackedFloat32Array
|
||||
*dest = *self;
|
||||
return raw_dest;
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ typedef struct {
|
|||
} godot_packed_byte_array;
|
||||
#endif
|
||||
|
||||
/////// PackedIntArray
|
||||
/////// PackedInt32Array
|
||||
|
||||
#define GODOT_PACKED_INT_ARRAY_SIZE sizeof(void *)
|
||||
|
||||
|
@ -59,7 +59,7 @@ typedef struct {
|
|||
} godot_packed_int_array;
|
||||
#endif
|
||||
|
||||
/////// PackedRealArray
|
||||
/////// PackedFloat32Array
|
||||
|
||||
#define GODOT_PACKED_REAL_ARRAY_SIZE sizeof(void *)
|
||||
|
||||
|
|
|
@ -1124,7 +1124,7 @@ static bool _guess_expression_type(GDScriptCompletionContext &p_context, const G
|
|||
v2 = 1;
|
||||
v2_use_value = false;
|
||||
}
|
||||
if (vop == Variant::OP_DIVIDE && v2.get_type() == Variant::REAL) {
|
||||
if (vop == Variant::OP_DIVIDE && v2.get_type() == Variant::FLOAT) {
|
||||
v2 = 1.0;
|
||||
v2_use_value = false;
|
||||
}
|
||||
|
@ -2173,7 +2173,7 @@ static void _find_identifiers(const GDScriptCompletionContext &p_context, bool p
|
|||
|
||||
static const char *_type_names[Variant::VARIANT_MAX] = {
|
||||
"null", "bool", "int", "float", "String", "Vector2", "Rect2", "Vector3", "Transform2D", "Plane", "Quat", "AABB", "Basis", "Transform",
|
||||
"Color", "NodePath", "RID", "Object", "Dictionary", "Array", "PackedByteArray", "PackedIntArray", "PackedRealArray", "PackedStringArray",
|
||||
"Color", "NodePath", "RID", "Object", "Callable", "Signal", "Dictionary", "Array", "PackedByteArray", "PackedInt32Array", "PackedInt64Array", "PackedFloat32Array", "PackedFloat64Array", "PackedStringArray",
|
||||
"PackedVector2Array", "PackedVector3Array", "PackedColorArray"
|
||||
};
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
|
|||
if (!p_args[m_arg]->is_num()) { \
|
||||
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; \
|
||||
r_error.argument = m_arg; \
|
||||
r_error.expected = Variant::REAL; \
|
||||
r_error.expected = Variant::FLOAT; \
|
||||
r_ret = Variant(); \
|
||||
return; \
|
||||
}
|
||||
|
@ -272,7 +272,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
|
|||
|
||||
int64_t i = *p_args[0];
|
||||
r_ret = ABS(i);
|
||||
} else if (p_args[0]->get_type() == Variant::REAL) {
|
||||
} else if (p_args[0]->get_type() == Variant::FLOAT) {
|
||||
|
||||
double r = *p_args[0];
|
||||
r_ret = Math::abs(r);
|
||||
|
@ -280,7 +280,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
|
|||
|
||||
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
|
||||
r_error.argument = 0;
|
||||
r_error.expected = Variant::REAL;
|
||||
r_error.expected = Variant::FLOAT;
|
||||
r_ret = Variant();
|
||||
}
|
||||
} break;
|
||||
|
@ -290,7 +290,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
|
|||
|
||||
int64_t i = *p_args[0];
|
||||
r_ret = i < 0 ? -1 : (i > 0 ? +1 : 0);
|
||||
} else if (p_args[0]->get_type() == Variant::REAL) {
|
||||
} else if (p_args[0]->get_type() == Variant::FLOAT) {
|
||||
|
||||
real_t r = *p_args[0];
|
||||
r_ret = r < 0.0 ? -1.0 : (r > 0.0 ? +1.0 : 0.0);
|
||||
|
@ -298,7 +298,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
|
|||
|
||||
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
|
||||
r_error.argument = 0;
|
||||
r_error.expected = Variant::REAL;
|
||||
r_error.expected = Variant::FLOAT;
|
||||
r_ret = Variant();
|
||||
}
|
||||
} break;
|
||||
|
@ -360,7 +360,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
|
|||
VALIDATE_ARG_COUNT(3);
|
||||
VALIDATE_ARG_NUM(2);
|
||||
const double t = (double)*p_args[2];
|
||||
switch (p_args[0]->get_type() == p_args[1]->get_type() ? p_args[0]->get_type() : Variant::REAL) {
|
||||
switch (p_args[0]->get_type() == p_args[1]->get_type() ? p_args[0]->get_type() : Variant::FLOAT) {
|
||||
case Variant::VECTOR2: {
|
||||
r_ret = ((Vector2)*p_args[0]).linear_interpolate((Vector2)*p_args[1], t);
|
||||
} break;
|
||||
|
@ -1359,7 +1359,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
|
|||
case INSTANCE_FROM_ID: {
|
||||
|
||||
VALIDATE_ARG_COUNT(1);
|
||||
if (p_args[0]->get_type() != Variant::INT && p_args[0]->get_type() != Variant::REAL) {
|
||||
if (p_args[0]->get_type() != Variant::INT && p_args[0]->get_type() != Variant::FLOAT) {
|
||||
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
|
||||
r_error.argument = 0;
|
||||
r_error.expected = Variant::INT;
|
||||
|
@ -1395,14 +1395,24 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
|
|||
Vector<uint8_t> d = *p_args[0];
|
||||
r_ret = d.size();
|
||||
} break;
|
||||
case Variant::PACKED_INT_ARRAY: {
|
||||
case Variant::PACKED_INT32_ARRAY: {
|
||||
|
||||
Vector<int> d = *p_args[0];
|
||||
Vector<int32_t> d = *p_args[0];
|
||||
r_ret = d.size();
|
||||
} break;
|
||||
case Variant::PACKED_REAL_ARRAY: {
|
||||
case Variant::PACKED_INT64_ARRAY: {
|
||||
|
||||
Vector<real_t> d = *p_args[0];
|
||||
Vector<int64_t> d = *p_args[0];
|
||||
r_ret = d.size();
|
||||
} break;
|
||||
case Variant::PACKED_FLOAT32_ARRAY: {
|
||||
|
||||
Vector<float> d = *p_args[0];
|
||||
r_ret = d.size();
|
||||
} break;
|
||||
case Variant::PACKED_FLOAT64_ARRAY: {
|
||||
|
||||
Vector<double> d = *p_args[0];
|
||||
r_ret = d.size();
|
||||
} break;
|
||||
case Variant::PACKED_STRING_ARRAY: {
|
||||
|
@ -1530,69 +1540,69 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) {
|
|||
switch (p_func) {
|
||||
|
||||
case MATH_SIN: {
|
||||
MethodInfo mi("sin", PropertyInfo(Variant::REAL, "s"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("sin", PropertyInfo(Variant::FLOAT, "s"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
|
||||
} break;
|
||||
case MATH_COS: {
|
||||
MethodInfo mi("cos", PropertyInfo(Variant::REAL, "s"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("cos", PropertyInfo(Variant::FLOAT, "s"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_TAN: {
|
||||
MethodInfo mi("tan", PropertyInfo(Variant::REAL, "s"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("tan", PropertyInfo(Variant::FLOAT, "s"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_SINH: {
|
||||
MethodInfo mi("sinh", PropertyInfo(Variant::REAL, "s"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("sinh", PropertyInfo(Variant::FLOAT, "s"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_COSH: {
|
||||
MethodInfo mi("cosh", PropertyInfo(Variant::REAL, "s"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("cosh", PropertyInfo(Variant::FLOAT, "s"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_TANH: {
|
||||
MethodInfo mi("tanh", PropertyInfo(Variant::REAL, "s"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("tanh", PropertyInfo(Variant::FLOAT, "s"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_ASIN: {
|
||||
MethodInfo mi("asin", PropertyInfo(Variant::REAL, "s"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("asin", PropertyInfo(Variant::FLOAT, "s"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_ACOS: {
|
||||
MethodInfo mi("acos", PropertyInfo(Variant::REAL, "s"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("acos", PropertyInfo(Variant::FLOAT, "s"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_ATAN: {
|
||||
MethodInfo mi("atan", PropertyInfo(Variant::REAL, "s"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("atan", PropertyInfo(Variant::FLOAT, "s"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_ATAN2: {
|
||||
MethodInfo mi("atan2", PropertyInfo(Variant::REAL, "y"), PropertyInfo(Variant::REAL, "x"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("atan2", PropertyInfo(Variant::FLOAT, "y"), PropertyInfo(Variant::FLOAT, "x"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_SQRT: {
|
||||
MethodInfo mi("sqrt", PropertyInfo(Variant::REAL, "s"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("sqrt", PropertyInfo(Variant::FLOAT, "s"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_FMOD: {
|
||||
MethodInfo mi("fmod", PropertyInfo(Variant::REAL, "a"), PropertyInfo(Variant::REAL, "b"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("fmod", PropertyInfo(Variant::FLOAT, "a"), PropertyInfo(Variant::FLOAT, "b"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_FPOSMOD: {
|
||||
MethodInfo mi("fposmod", PropertyInfo(Variant::REAL, "a"), PropertyInfo(Variant::REAL, "b"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("fposmod", PropertyInfo(Variant::FLOAT, "a"), PropertyInfo(Variant::FLOAT, "b"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_POSMOD: {
|
||||
|
@ -1601,114 +1611,114 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) {
|
|||
return mi;
|
||||
} break;
|
||||
case MATH_FLOOR: {
|
||||
MethodInfo mi("floor", PropertyInfo(Variant::REAL, "s"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("floor", PropertyInfo(Variant::FLOAT, "s"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_CEIL: {
|
||||
MethodInfo mi("ceil", PropertyInfo(Variant::REAL, "s"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("ceil", PropertyInfo(Variant::FLOAT, "s"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_ROUND: {
|
||||
MethodInfo mi("round", PropertyInfo(Variant::REAL, "s"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("round", PropertyInfo(Variant::FLOAT, "s"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_ABS: {
|
||||
MethodInfo mi("abs", PropertyInfo(Variant::REAL, "s"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("abs", PropertyInfo(Variant::FLOAT, "s"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_SIGN: {
|
||||
MethodInfo mi("sign", PropertyInfo(Variant::REAL, "s"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("sign", PropertyInfo(Variant::FLOAT, "s"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_POW: {
|
||||
MethodInfo mi("pow", PropertyInfo(Variant::REAL, "base"), PropertyInfo(Variant::REAL, "exp"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("pow", PropertyInfo(Variant::FLOAT, "base"), PropertyInfo(Variant::FLOAT, "exp"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_LOG: {
|
||||
MethodInfo mi("log", PropertyInfo(Variant::REAL, "s"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("log", PropertyInfo(Variant::FLOAT, "s"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_EXP: {
|
||||
MethodInfo mi("exp", PropertyInfo(Variant::REAL, "s"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("exp", PropertyInfo(Variant::FLOAT, "s"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_ISNAN: {
|
||||
MethodInfo mi("is_nan", PropertyInfo(Variant::REAL, "s"));
|
||||
MethodInfo mi("is_nan", PropertyInfo(Variant::FLOAT, "s"));
|
||||
mi.return_val.type = Variant::BOOL;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_ISINF: {
|
||||
MethodInfo mi("is_inf", PropertyInfo(Variant::REAL, "s"));
|
||||
MethodInfo mi("is_inf", PropertyInfo(Variant::FLOAT, "s"));
|
||||
mi.return_val.type = Variant::BOOL;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_ISEQUALAPPROX: {
|
||||
MethodInfo mi("is_equal_approx", PropertyInfo(Variant::REAL, "a"), PropertyInfo(Variant::REAL, "b"));
|
||||
MethodInfo mi("is_equal_approx", PropertyInfo(Variant::FLOAT, "a"), PropertyInfo(Variant::FLOAT, "b"));
|
||||
mi.return_val.type = Variant::BOOL;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_ISZEROAPPROX: {
|
||||
MethodInfo mi("is_zero_approx", PropertyInfo(Variant::REAL, "s"));
|
||||
MethodInfo mi("is_zero_approx", PropertyInfo(Variant::FLOAT, "s"));
|
||||
mi.return_val.type = Variant::BOOL;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_EASE: {
|
||||
MethodInfo mi("ease", PropertyInfo(Variant::REAL, "s"), PropertyInfo(Variant::REAL, "curve"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("ease", PropertyInfo(Variant::FLOAT, "s"), PropertyInfo(Variant::FLOAT, "curve"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_STEP_DECIMALS: {
|
||||
MethodInfo mi("step_decimals", PropertyInfo(Variant::REAL, "step"));
|
||||
MethodInfo mi("step_decimals", PropertyInfo(Variant::FLOAT, "step"));
|
||||
mi.return_val.type = Variant::INT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_STEPIFY: {
|
||||
MethodInfo mi("stepify", PropertyInfo(Variant::REAL, "s"), PropertyInfo(Variant::REAL, "step"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("stepify", PropertyInfo(Variant::FLOAT, "s"), PropertyInfo(Variant::FLOAT, "step"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_LERP: {
|
||||
MethodInfo mi("lerp", PropertyInfo(Variant::NIL, "from"), PropertyInfo(Variant::NIL, "to"), PropertyInfo(Variant::REAL, "weight"));
|
||||
MethodInfo mi("lerp", PropertyInfo(Variant::NIL, "from"), PropertyInfo(Variant::NIL, "to"), PropertyInfo(Variant::FLOAT, "weight"));
|
||||
mi.return_val.type = Variant::NIL;
|
||||
mi.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_LERP_ANGLE: {
|
||||
MethodInfo mi("lerp_angle", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"), PropertyInfo(Variant::REAL, "weight"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("lerp_angle", PropertyInfo(Variant::FLOAT, "from"), PropertyInfo(Variant::FLOAT, "to"), PropertyInfo(Variant::FLOAT, "weight"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_INVERSE_LERP: {
|
||||
MethodInfo mi("inverse_lerp", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"), PropertyInfo(Variant::REAL, "weight"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("inverse_lerp", PropertyInfo(Variant::FLOAT, "from"), PropertyInfo(Variant::FLOAT, "to"), PropertyInfo(Variant::FLOAT, "weight"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_RANGE_LERP: {
|
||||
MethodInfo mi("range_lerp", PropertyInfo(Variant::REAL, "value"), PropertyInfo(Variant::REAL, "istart"), PropertyInfo(Variant::REAL, "istop"), PropertyInfo(Variant::REAL, "ostart"), PropertyInfo(Variant::REAL, "ostop"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("range_lerp", PropertyInfo(Variant::FLOAT, "value"), PropertyInfo(Variant::FLOAT, "istart"), PropertyInfo(Variant::FLOAT, "istop"), PropertyInfo(Variant::FLOAT, "ostart"), PropertyInfo(Variant::FLOAT, "ostop"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_SMOOTHSTEP: {
|
||||
MethodInfo mi("smoothstep", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"), PropertyInfo(Variant::REAL, "weight"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("smoothstep", PropertyInfo(Variant::FLOAT, "from"), PropertyInfo(Variant::FLOAT, "to"), PropertyInfo(Variant::FLOAT, "weight"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_MOVE_TOWARD: {
|
||||
MethodInfo mi("move_toward", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"), PropertyInfo(Variant::REAL, "delta"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("move_toward", PropertyInfo(Variant::FLOAT, "from"), PropertyInfo(Variant::FLOAT, "to"), PropertyInfo(Variant::FLOAT, "delta"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_DECTIME: {
|
||||
MethodInfo mi("dectime", PropertyInfo(Variant::REAL, "value"), PropertyInfo(Variant::REAL, "amount"), PropertyInfo(Variant::REAL, "step"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("dectime", PropertyInfo(Variant::FLOAT, "value"), PropertyInfo(Variant::FLOAT, "amount"), PropertyInfo(Variant::FLOAT, "step"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_RANDOMIZE: {
|
||||
|
@ -1723,12 +1733,12 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) {
|
|||
} break;
|
||||
case MATH_RANDF: {
|
||||
MethodInfo mi("randf");
|
||||
mi.return_val.type = Variant::REAL;
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_RANDOM: {
|
||||
MethodInfo mi("rand_range", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("rand_range", PropertyInfo(Variant::FLOAT, "from"), PropertyInfo(Variant::FLOAT, "to"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_SEED: {
|
||||
|
@ -1742,32 +1752,32 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) {
|
|||
return mi;
|
||||
} break;
|
||||
case MATH_DEG2RAD: {
|
||||
MethodInfo mi("deg2rad", PropertyInfo(Variant::REAL, "deg"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("deg2rad", PropertyInfo(Variant::FLOAT, "deg"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_RAD2DEG: {
|
||||
MethodInfo mi("rad2deg", PropertyInfo(Variant::REAL, "rad"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("rad2deg", PropertyInfo(Variant::FLOAT, "rad"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_LINEAR2DB: {
|
||||
MethodInfo mi("linear2db", PropertyInfo(Variant::REAL, "nrg"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("linear2db", PropertyInfo(Variant::FLOAT, "nrg"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_DB2LINEAR: {
|
||||
MethodInfo mi("db2linear", PropertyInfo(Variant::REAL, "db"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("db2linear", PropertyInfo(Variant::FLOAT, "db"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_POLAR2CARTESIAN: {
|
||||
MethodInfo mi("polar2cartesian", PropertyInfo(Variant::REAL, "r"), PropertyInfo(Variant::REAL, "th"));
|
||||
MethodInfo mi("polar2cartesian", PropertyInfo(Variant::FLOAT, "r"), PropertyInfo(Variant::FLOAT, "th"));
|
||||
mi.return_val.type = Variant::VECTOR2;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_CARTESIAN2POLAR: {
|
||||
MethodInfo mi("cartesian2polar", PropertyInfo(Variant::REAL, "x"), PropertyInfo(Variant::REAL, "y"));
|
||||
MethodInfo mi("cartesian2polar", PropertyInfo(Variant::FLOAT, "x"), PropertyInfo(Variant::FLOAT, "y"));
|
||||
mi.return_val.type = Variant::VECTOR2;
|
||||
return mi;
|
||||
} break;
|
||||
|
@ -1777,24 +1787,24 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) {
|
|||
return mi;
|
||||
} break;
|
||||
case MATH_WRAPF: {
|
||||
MethodInfo mi("wrapf", PropertyInfo(Variant::REAL, "value"), PropertyInfo(Variant::REAL, "min"), PropertyInfo(Variant::REAL, "max"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("wrapf", PropertyInfo(Variant::FLOAT, "value"), PropertyInfo(Variant::FLOAT, "min"), PropertyInfo(Variant::FLOAT, "max"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case LOGIC_MAX: {
|
||||
MethodInfo mi("max", PropertyInfo(Variant::REAL, "a"), PropertyInfo(Variant::REAL, "b"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("max", PropertyInfo(Variant::FLOAT, "a"), PropertyInfo(Variant::FLOAT, "b"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
|
||||
} break;
|
||||
case LOGIC_MIN: {
|
||||
MethodInfo mi("min", PropertyInfo(Variant::REAL, "a"), PropertyInfo(Variant::REAL, "b"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("min", PropertyInfo(Variant::FLOAT, "a"), PropertyInfo(Variant::FLOAT, "b"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case LOGIC_CLAMP: {
|
||||
MethodInfo mi("clamp", PropertyInfo(Variant::REAL, "value"), PropertyInfo(Variant::REAL, "min"), PropertyInfo(Variant::REAL, "max"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
MethodInfo mi("clamp", PropertyInfo(Variant::FLOAT, "value"), PropertyInfo(Variant::FLOAT, "min"), PropertyInfo(Variant::FLOAT, "max"));
|
||||
mi.return_val.type = Variant::FLOAT;
|
||||
return mi;
|
||||
} break;
|
||||
case LOGIC_NEAREST_PO2: {
|
||||
|
@ -2012,7 +2022,7 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) {
|
|||
} break;
|
||||
case COLORN: {
|
||||
|
||||
MethodInfo mi("ColorN", PropertyInfo(Variant::STRING, "name"), PropertyInfo(Variant::REAL, "alpha"));
|
||||
MethodInfo mi("ColorN", PropertyInfo(Variant::STRING, "name"), PropertyInfo(Variant::FLOAT, "alpha"));
|
||||
mi.default_arguments.push_back(1.0f);
|
||||
mi.return_val.type = Variant::COLOR;
|
||||
return mi;
|
||||
|
|
|
@ -3108,7 +3108,7 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) {
|
|||
args.push_back(op->arguments[i]);
|
||||
if (constant && op->arguments[i]->type == Node::TYPE_CONSTANT) {
|
||||
ConstantNode *c = static_cast<ConstantNode *>(op->arguments[i]);
|
||||
if (c->value.get_type() == Variant::REAL || c->value.get_type() == Variant::INT) {
|
||||
if (c->value.get_type() == Variant::FLOAT || c->value.get_type() == Variant::INT) {
|
||||
constants.push_back(c->value);
|
||||
constant = true;
|
||||
}
|
||||
|
@ -4222,7 +4222,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||
|
||||
[[fallthrough]];
|
||||
}
|
||||
case Variant::REAL: {
|
||||
case Variant::FLOAT: {
|
||||
|
||||
if (tokenizer->get_token() == GDScriptTokenizer::TK_IDENTIFIER && tokenizer->get_token_identifier() == "EASE") {
|
||||
current_export.hint = PROPERTY_HINT_EXP_EASING;
|
||||
|
@ -5955,10 +5955,10 @@ GDScriptParser::DataType GDScriptParser::_get_operation_type(const Variant::Oper
|
|||
}
|
||||
|
||||
// Avoid division by zero
|
||||
if (a_type == Variant::INT || a_type == Variant::REAL) {
|
||||
if (a_type == Variant::INT || a_type == Variant::FLOAT) {
|
||||
Variant::evaluate(Variant::OP_ADD, a, 1, a, r_valid);
|
||||
}
|
||||
if (b_type == Variant::INT || b_type == Variant::REAL) {
|
||||
if (b_type == Variant::INT || b_type == Variant::FLOAT) {
|
||||
Variant::evaluate(Variant::OP_ADD, b, 1, b, r_valid);
|
||||
}
|
||||
if (a_type == Variant::STRING && b_type != Variant::ARRAY) {
|
||||
|
@ -6598,14 +6598,16 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
|
|||
// Expect int or real as index
|
||||
case Variant::PACKED_BYTE_ARRAY:
|
||||
case Variant::PACKED_COLOR_ARRAY:
|
||||
case Variant::PACKED_INT_ARRAY:
|
||||
case Variant::PACKED_REAL_ARRAY:
|
||||
case Variant::PACKED_INT32_ARRAY:
|
||||
case Variant::PACKED_INT64_ARRAY:
|
||||
case Variant::PACKED_FLOAT32_ARRAY:
|
||||
case Variant::PACKED_FLOAT64_ARRAY:
|
||||
case Variant::PACKED_STRING_ARRAY:
|
||||
case Variant::PACKED_VECTOR2_ARRAY:
|
||||
case Variant::PACKED_VECTOR3_ARRAY:
|
||||
case Variant::ARRAY:
|
||||
case Variant::STRING: {
|
||||
error = index_type.builtin_type != Variant::INT && index_type.builtin_type != Variant::REAL;
|
||||
error = index_type.builtin_type != Variant::INT && index_type.builtin_type != Variant::FLOAT;
|
||||
} break;
|
||||
// Expect String only
|
||||
case Variant::RECT2:
|
||||
|
@ -6621,7 +6623,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
|
|||
case Variant::TRANSFORM2D:
|
||||
case Variant::BASIS:
|
||||
case Variant::TRANSFORM: {
|
||||
error = index_type.builtin_type != Variant::INT && index_type.builtin_type != Variant::REAL &&
|
||||
error = index_type.builtin_type != Variant::INT && index_type.builtin_type != Variant::FLOAT &&
|
||||
index_type.builtin_type != Variant::STRING;
|
||||
} break;
|
||||
// Expect String or int
|
||||
|
@ -6648,8 +6650,10 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
|
|||
case Variant::DICTIONARY:
|
||||
case Variant::PACKED_BYTE_ARRAY:
|
||||
case Variant::PACKED_COLOR_ARRAY:
|
||||
case Variant::PACKED_INT_ARRAY:
|
||||
case Variant::PACKED_REAL_ARRAY:
|
||||
case Variant::PACKED_INT32_ARRAY:
|
||||
case Variant::PACKED_INT64_ARRAY:
|
||||
case Variant::PACKED_FLOAT32_ARRAY:
|
||||
case Variant::PACKED_FLOAT64_ARRAY:
|
||||
case Variant::PACKED_STRING_ARRAY:
|
||||
case Variant::PACKED_VECTOR2_ARRAY:
|
||||
case Variant::PACKED_VECTOR3_ARRAY: {
|
||||
|
@ -6691,7 +6695,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
|
|||
case Variant::NIL:
|
||||
case Variant::BOOL:
|
||||
case Variant::INT:
|
||||
case Variant::REAL:
|
||||
case Variant::FLOAT:
|
||||
case Variant::NODE_PATH:
|
||||
case Variant::_RID: {
|
||||
_set_error("Can't index on a value of type \"" + base_type.to_string() + "\".", op->line);
|
||||
|
@ -6699,15 +6703,17 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
|
|||
} break;
|
||||
// Return int
|
||||
case Variant::PACKED_BYTE_ARRAY:
|
||||
case Variant::PACKED_INT_ARRAY: {
|
||||
case Variant::PACKED_INT32_ARRAY:
|
||||
case Variant::PACKED_INT64_ARRAY: {
|
||||
result.builtin_type = Variant::INT;
|
||||
} break;
|
||||
// Return real
|
||||
case Variant::PACKED_REAL_ARRAY:
|
||||
case Variant::PACKED_FLOAT32_ARRAY:
|
||||
case Variant::PACKED_FLOAT64_ARRAY:
|
||||
case Variant::VECTOR2:
|
||||
case Variant::VECTOR3:
|
||||
case Variant::QUAT: {
|
||||
result.builtin_type = Variant::REAL;
|
||||
result.builtin_type = Variant::FLOAT;
|
||||
} break;
|
||||
// Return color
|
||||
case Variant::PACKED_COLOR_ARRAY: {
|
||||
|
@ -7002,7 +7008,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
|
|||
break;
|
||||
} else {
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (arg_type.kind == DataType::BUILTIN && arg_type.builtin_type == Variant::INT && par_types[i].kind == DataType::BUILTIN && par_types[i].builtin_type == Variant::REAL) {
|
||||
if (arg_type.kind == DataType::BUILTIN && arg_type.builtin_type == Variant::INT && par_types[i].kind == DataType::BUILTIN && par_types[i].builtin_type == Variant::FLOAT) {
|
||||
_add_warning(GDScriptWarning::NARROWING_CONVERSION, p_call->line, Variant::get_type_name(tn->vtype));
|
||||
}
|
||||
if (par_types[i].may_yield && p_call->arguments[i + 1]->type == Node::TYPE_OPERATOR) {
|
||||
|
@ -7245,7 +7251,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
|
|||
_mark_line_as_unsafe(p_call->line);
|
||||
}
|
||||
} else {
|
||||
if (arg_type.kind == DataType::BUILTIN && arg_type.builtin_type == Variant::INT && par_type.kind == DataType::BUILTIN && par_type.builtin_type == Variant::REAL) {
|
||||
if (arg_type.kind == DataType::BUILTIN && arg_type.builtin_type == Variant::INT && par_type.kind == DataType::BUILTIN && par_type.builtin_type == Variant::FLOAT) {
|
||||
_add_warning(GDScriptWarning::NARROWING_CONVERSION, p_call->line, callee_name);
|
||||
}
|
||||
}
|
||||
|
@ -8103,7 +8109,7 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) {
|
|||
lv->assign = convert_call;
|
||||
lv->assign_op->arguments.write[1] = convert_call;
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (lv->datatype.builtin_type == Variant::INT && assign_type.builtin_type == Variant::REAL) {
|
||||
if (lv->datatype.builtin_type == Variant::INT && assign_type.builtin_type == Variant::FLOAT) {
|
||||
_add_warning(GDScriptWarning::NARROWING_CONVERSION, lv->line);
|
||||
}
|
||||
#endif // DEBUG_ENABLED
|
||||
|
@ -8240,7 +8246,7 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) {
|
|||
type_match = true; // Since we are converting, the type is matching
|
||||
}
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (lh_type.builtin_type == Variant::INT && rh_type.builtin_type == Variant::REAL) {
|
||||
if (lh_type.builtin_type == Variant::INT && rh_type.builtin_type == Variant::FLOAT) {
|
||||
_add_warning(GDScriptWarning::NARROWING_CONVERSION, op->line);
|
||||
}
|
||||
#endif // DEBUG_ENABLED
|
||||
|
|
|
@ -146,7 +146,7 @@ static const _bit _type_list[] = {
|
|||
//types
|
||||
{ Variant::BOOL, "bool" },
|
||||
{ Variant::INT, "int" },
|
||||
{ Variant::REAL, "float" },
|
||||
{ Variant::FLOAT, "float" },
|
||||
{ Variant::STRING, "String" },
|
||||
{ Variant::VECTOR2, "Vector2" },
|
||||
{ Variant::VECTOR2I, "Vector2i" },
|
||||
|
@ -170,8 +170,10 @@ static const _bit _type_list[] = {
|
|||
{ Variant::SIGNAL, "Signal" },
|
||||
{ Variant::ARRAY, "Array" },
|
||||
{ Variant::PACKED_BYTE_ARRAY, "PackedByteArray" },
|
||||
{ Variant::PACKED_INT_ARRAY, "PackedIntArray" },
|
||||
{ Variant::PACKED_REAL_ARRAY, "PackedRealArray" },
|
||||
{ Variant::PACKED_INT32_ARRAY, "PackedInt32Array" },
|
||||
{ Variant::PACKED_INT64_ARRAY, "PackedInt64Array" },
|
||||
{ Variant::PACKED_FLOAT32_ARRAY, "PackedFloat32Array" },
|
||||
{ Variant::PACKED_FLOAT64_ARRAY, "PackedFloat64Array" },
|
||||
{ Variant::PACKED_STRING_ARRAY, "PackedStringArray" },
|
||||
{ Variant::PACKED_VECTOR2_ARRAY, "PackedVector2Array" },
|
||||
{ Variant::PACKED_VECTOR3_ARRAY, "PackedVector3Array" },
|
||||
|
|
|
@ -874,7 +874,7 @@ void GridMap::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cell_center_x"), "set_center_x", "get_center_x");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cell_center_y"), "set_center_y", "get_center_y");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cell_center_z"), "set_center_z", "get_center_z");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "cell_scale"), "set_cell_scale", "get_cell_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "cell_scale"), "set_cell_scale", "get_cell_scale");
|
||||
ADD_GROUP("Collision", "collision_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_layer", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_layer", "get_collision_layer");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_mask", "get_collision_mask");
|
||||
|
|
|
@ -221,13 +221,13 @@ void MobileVRInterface::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("set_k2", "k"), &MobileVRInterface::set_k2);
|
||||
ClassDB::bind_method(D_METHOD("get_k2"), &MobileVRInterface::get_k2);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "eye_height", PROPERTY_HINT_RANGE, "0.0,3.0,0.1"), "set_eye_height", "get_eye_height");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "iod", PROPERTY_HINT_RANGE, "4.0,10.0,0.1"), "set_iod", "get_iod");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "display_width", PROPERTY_HINT_RANGE, "5.0,25.0,0.1"), "set_display_width", "get_display_width");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "display_to_lens", PROPERTY_HINT_RANGE, "5.0,25.0,0.1"), "set_display_to_lens", "get_display_to_lens");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "oversample", PROPERTY_HINT_RANGE, "1.0,2.0,0.1"), "set_oversample", "get_oversample");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "k1", PROPERTY_HINT_RANGE, "0.1,10.0,0.0001"), "set_k1", "get_k1");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "k2", PROPERTY_HINT_RANGE, "0.1,10.0,0.0001"), "set_k2", "get_k2");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "eye_height", PROPERTY_HINT_RANGE, "0.0,3.0,0.1"), "set_eye_height", "get_eye_height");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "iod", PROPERTY_HINT_RANGE, "4.0,10.0,0.1"), "set_iod", "get_iod");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "display_width", PROPERTY_HINT_RANGE, "5.0,25.0,0.1"), "set_display_width", "get_display_width");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "display_to_lens", PROPERTY_HINT_RANGE, "5.0,25.0,0.1"), "set_display_to_lens", "get_display_to_lens");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "oversample", PROPERTY_HINT_RANGE, "1.0,2.0,0.1"), "set_oversample", "get_oversample");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "k1", PROPERTY_HINT_RANGE, "0.1,10.0,0.0001"), "set_k1", "get_k1");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "k2", PROPERTY_HINT_RANGE, "0.1,10.0,0.0001"), "set_k2", "get_k2");
|
||||
}
|
||||
|
||||
void MobileVRInterface::set_eye_height(const real_t p_eye_height) {
|
||||
|
|
|
@ -411,7 +411,7 @@ static String variant_type_to_managed_name(const String &p_var_type_name) {
|
|||
if (p_var_type_name == Variant::get_type_name(Variant::OBJECT))
|
||||
return "Godot.Object";
|
||||
|
||||
if (p_var_type_name == Variant::get_type_name(Variant::REAL)) {
|
||||
if (p_var_type_name == Variant::get_type_name(Variant::FLOAT)) {
|
||||
#ifdef REAL_T_IS_DOUBLE
|
||||
return "double";
|
||||
#else
|
||||
|
@ -430,9 +430,9 @@ static String variant_type_to_managed_name(const String &p_var_type_name) {
|
|||
|
||||
if (p_var_type_name == Variant::get_type_name(Variant::PACKED_BYTE_ARRAY))
|
||||
return "byte[]";
|
||||
if (p_var_type_name == Variant::get_type_name(Variant::PACKED_INT_ARRAY))
|
||||
if (p_var_type_name == Variant::get_type_name(Variant::PACKED_INT32_ARRAY))
|
||||
return "int[]";
|
||||
if (p_var_type_name == Variant::get_type_name(Variant::PACKED_REAL_ARRAY)) {
|
||||
if (p_var_type_name == Variant::get_type_name(Variant::PACKED_FLOAT32_ARRAY)) {
|
||||
#ifdef REAL_T_IS_DOUBLE
|
||||
return "double[]";
|
||||
#else
|
||||
|
|
|
@ -505,9 +505,9 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf
|
|||
xml_output.append("</c>");
|
||||
} else if (tag == "PackedByteArray") {
|
||||
xml_output.append("<see cref=\"byte\"/>");
|
||||
} else if (tag == "PackedIntArray") {
|
||||
} else if (tag == "PackedInt32Array") {
|
||||
xml_output.append("<see cref=\"int\"/>");
|
||||
} else if (tag == "PackedRealArray") {
|
||||
} else if (tag == "PackedFloat32Array") {
|
||||
#ifdef REAL_T_IS_DOUBLE
|
||||
xml_output.append("<see cref=\"double\"/>");
|
||||
#else
|
||||
|
@ -2383,7 +2383,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
|
|||
} else {
|
||||
if (return_info.type == Variant::INT) {
|
||||
imethod.return_type.cname = _get_int_type_name_from_meta(m ? m->get_argument_meta(-1) : GodotTypeInfo::METADATA_NONE);
|
||||
} else if (return_info.type == Variant::REAL) {
|
||||
} else if (return_info.type == Variant::FLOAT) {
|
||||
imethod.return_type.cname = _get_float_type_name_from_meta(m ? m->get_argument_meta(-1) : GodotTypeInfo::METADATA_NONE);
|
||||
} else {
|
||||
imethod.return_type.cname = Variant::get_type_name(return_info.type);
|
||||
|
@ -2410,7 +2410,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
|
|||
} else {
|
||||
if (arginfo.type == Variant::INT) {
|
||||
iarg.type.cname = _get_int_type_name_from_meta(m ? m->get_argument_meta(i) : GodotTypeInfo::METADATA_NONE);
|
||||
} else if (arginfo.type == Variant::REAL) {
|
||||
} else if (arginfo.type == Variant::FLOAT) {
|
||||
iarg.type.cname = _get_float_type_name_from_meta(m ? m->get_argument_meta(i) : GodotTypeInfo::METADATA_NONE);
|
||||
} else {
|
||||
iarg.type.cname = Variant::get_type_name(arginfo.type);
|
||||
|
@ -2581,7 +2581,7 @@ bool BindingsGenerator::_arg_default_value_from_variant(const Variant &p_val, Ar
|
|||
r_iarg.default_argument = "(%s)" + r_iarg.default_argument;
|
||||
}
|
||||
break;
|
||||
case Variant::REAL:
|
||||
case Variant::FLOAT:
|
||||
#ifndef REAL_T_IS_DOUBLE
|
||||
r_iarg.default_argument += "f";
|
||||
#endif
|
||||
|
@ -2629,8 +2629,10 @@ bool BindingsGenerator::_arg_default_value_from_variant(const Variant &p_val, Ar
|
|||
break;
|
||||
case Variant::ARRAY:
|
||||
case Variant::PACKED_BYTE_ARRAY:
|
||||
case Variant::PACKED_INT_ARRAY:
|
||||
case Variant::PACKED_REAL_ARRAY:
|
||||
case Variant::PACKED_INT32_ARRAY:
|
||||
case Variant::PACKED_FLOAT32_ARRAY:
|
||||
case Variant::PACKED_INT64_ARRAY:
|
||||
case Variant::PACKED_FLOAT64_ARRAY:
|
||||
case Variant::PACKED_STRING_ARRAY:
|
||||
case Variant::PACKED_VECTOR2_ARRAY:
|
||||
case Variant::PACKED_VECTOR3_ARRAY:
|
||||
|
@ -2914,13 +2916,13 @@ void BindingsGenerator::_populate_builtin_type_interfaces() {
|
|||
|
||||
#define INSERT_ARRAY(m_type, m_proxy_t) INSERT_ARRAY_FULL(m_type, m_type, m_proxy_t)
|
||||
|
||||
INSERT_ARRAY(PackedIntArray, int);
|
||||
INSERT_ARRAY(PackedInt32Array, int);
|
||||
INSERT_ARRAY_FULL(PackedByteArray, PackedByteArray, byte);
|
||||
|
||||
#ifdef REAL_T_IS_DOUBLE
|
||||
INSERT_ARRAY(PackedRealArray, double);
|
||||
INSERT_ARRAY(PackedFloat32Array, double);
|
||||
#else
|
||||
INSERT_ARRAY(PackedRealArray, float);
|
||||
INSERT_ARRAY(PackedFloat32Array, float);
|
||||
#endif
|
||||
|
||||
INSERT_ARRAY(PackedStringArray, string);
|
||||
|
|
|
@ -252,12 +252,12 @@ void GDMonoField::set_value_from_variant(MonoObject *p_object, const Variant &p_
|
|||
}
|
||||
|
||||
if (array_type->eklass == CACHED_CLASS_RAW(int32_t)) {
|
||||
SET_FROM_ARRAY(PackedIntArray);
|
||||
SET_FROM_ARRAY(PackedInt32Array);
|
||||
break;
|
||||
}
|
||||
|
||||
if (array_type->eklass == REAL_T_MONOCLASS) {
|
||||
SET_FROM_ARRAY(PackedRealArray);
|
||||
SET_FROM_ARRAY(PackedFloat32Array);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -370,7 +370,7 @@ void GDMonoField::set_value_from_variant(MonoObject *p_object, const Variant &p_
|
|||
int32_t val = p_value.operator signed int();
|
||||
mono_field_set_value(p_object, mono_field, &val);
|
||||
} break;
|
||||
case Variant::REAL: {
|
||||
case Variant::FLOAT: {
|
||||
#ifdef REAL_T_IS_DOUBLE
|
||||
double val = p_value.operator double();
|
||||
mono_field_set_value(p_object, mono_field, &val);
|
||||
|
@ -437,11 +437,11 @@ void GDMonoField::set_value_from_variant(MonoObject *p_object, const Variant &p_
|
|||
case Variant::PACKED_BYTE_ARRAY: {
|
||||
SET_FROM_ARRAY(PackedByteArray);
|
||||
} break;
|
||||
case Variant::PACKED_INT_ARRAY: {
|
||||
SET_FROM_ARRAY(PackedIntArray);
|
||||
case Variant::PACKED_INT32_ARRAY: {
|
||||
SET_FROM_ARRAY(PackedInt32Array);
|
||||
} break;
|
||||
case Variant::PACKED_REAL_ARRAY: {
|
||||
SET_FROM_ARRAY(PackedRealArray);
|
||||
case Variant::PACKED_FLOAT32_ARRAY: {
|
||||
SET_FROM_ARRAY(PackedFloat32Array);
|
||||
} break;
|
||||
case Variant::PACKED_STRING_ARRAY: {
|
||||
SET_FROM_ARRAY(PackedStringArray);
|
||||
|
|
|
@ -60,9 +60,9 @@ Variant::Type managed_to_variant_type(const ManagedType &p_type) {
|
|||
return Variant::INT;
|
||||
|
||||
case MONO_TYPE_R4:
|
||||
return Variant::REAL;
|
||||
return Variant::FLOAT;
|
||||
case MONO_TYPE_R8:
|
||||
return Variant::REAL;
|
||||
return Variant::FLOAT;
|
||||
|
||||
case MONO_TYPE_STRING: {
|
||||
return Variant::STRING;
|
||||
|
@ -116,10 +116,10 @@ Variant::Type managed_to_variant_type(const ManagedType &p_type) {
|
|||
return Variant::PACKED_BYTE_ARRAY;
|
||||
|
||||
if (array_type->eklass == CACHED_CLASS_RAW(int32_t))
|
||||
return Variant::PACKED_INT_ARRAY;
|
||||
return Variant::PACKED_INT32_ARRAY;
|
||||
|
||||
if (array_type->eklass == REAL_T_MONOCLASS)
|
||||
return Variant::PACKED_REAL_ARRAY;
|
||||
return Variant::PACKED_FLOAT32_ARRAY;
|
||||
|
||||
if (array_type->eklass == CACHED_CLASS_RAW(String))
|
||||
return Variant::PACKED_STRING_ARRAY;
|
||||
|
@ -494,10 +494,10 @@ MonoObject *variant_to_mono_object(const Variant *p_var, const ManagedType &p_ty
|
|||
return (MonoObject *)PackedByteArray_to_mono_array(p_var->operator PackedByteArray());
|
||||
|
||||
if (array_type->eklass == CACHED_CLASS_RAW(int32_t))
|
||||
return (MonoObject *)PackedIntArray_to_mono_array(p_var->operator PackedIntArray());
|
||||
return (MonoObject *)PackedInt32Array_to_mono_array(p_var->operator PackedInt32Array());
|
||||
|
||||
if (array_type->eklass == REAL_T_MONOCLASS)
|
||||
return (MonoObject *)PackedRealArray_to_mono_array(p_var->operator PackedRealArray());
|
||||
return (MonoObject *)PackedFloat32Array_to_mono_array(p_var->operator PackedFloat32Array());
|
||||
|
||||
if (array_type->eklass == CACHED_CLASS_RAW(String))
|
||||
return (MonoObject *)PackedStringArray_to_mono_array(p_var->operator PackedStringArray());
|
||||
|
@ -577,7 +577,7 @@ MonoObject *variant_to_mono_object(const Variant *p_var, const ManagedType &p_ty
|
|||
int32_t val = p_var->operator signed int();
|
||||
return BOX_INT32(val);
|
||||
}
|
||||
case Variant::REAL: {
|
||||
case Variant::FLOAT: {
|
||||
#ifdef REAL_T_IS_DOUBLE
|
||||
double val = p_var->operator double();
|
||||
return BOX_DOUBLE(val);
|
||||
|
@ -640,10 +640,10 @@ MonoObject *variant_to_mono_object(const Variant *p_var, const ManagedType &p_ty
|
|||
return GDMonoUtils::create_managed_from(p_var->operator Array(), CACHED_CLASS(Array));
|
||||
case Variant::PACKED_BYTE_ARRAY:
|
||||
return (MonoObject *)PackedByteArray_to_mono_array(p_var->operator PackedByteArray());
|
||||
case Variant::PACKED_INT_ARRAY:
|
||||
return (MonoObject *)PackedIntArray_to_mono_array(p_var->operator PackedIntArray());
|
||||
case Variant::PACKED_REAL_ARRAY:
|
||||
return (MonoObject *)PackedRealArray_to_mono_array(p_var->operator PackedRealArray());
|
||||
case Variant::PACKED_INT32_ARRAY:
|
||||
return (MonoObject *)PackedInt32Array_to_mono_array(p_var->operator PackedInt32Array());
|
||||
case Variant::PACKED_FLOAT32_ARRAY:
|
||||
return (MonoObject *)PackedFloat32Array_to_mono_array(p_var->operator PackedFloat32Array());
|
||||
case Variant::PACKED_STRING_ARRAY:
|
||||
return (MonoObject *)PackedStringArray_to_mono_array(p_var->operator PackedStringArray());
|
||||
case Variant::PACKED_VECTOR2_ARRAY:
|
||||
|
@ -788,10 +788,10 @@ Variant mono_object_to_variant_impl(MonoObject *p_obj, const ManagedType &p_type
|
|||
return mono_array_to_PackedByteArray((MonoArray *)p_obj);
|
||||
|
||||
if (array_type->eklass == CACHED_CLASS_RAW(int32_t))
|
||||
return mono_array_to_PackedIntArray((MonoArray *)p_obj);
|
||||
return mono_array_to_PackedInt32Array((MonoArray *)p_obj);
|
||||
|
||||
if (array_type->eklass == REAL_T_MONOCLASS)
|
||||
return mono_array_to_PackedRealArray((MonoArray *)p_obj);
|
||||
return mono_array_to_PackedFloat32Array((MonoArray *)p_obj);
|
||||
|
||||
if (array_type->eklass == CACHED_CLASS_RAW(String))
|
||||
return mono_array_to_PackedStringArray((MonoArray *)p_obj);
|
||||
|
@ -987,7 +987,7 @@ Array mono_array_to_Array(MonoArray *p_array) {
|
|||
|
||||
// TODO: Use memcpy where possible
|
||||
|
||||
MonoArray *PackedIntArray_to_mono_array(const PackedIntArray &p_array) {
|
||||
MonoArray *PackedInt32Array_to_mono_array(const PackedInt32Array &p_array) {
|
||||
const int *r = p_array.ptr();
|
||||
|
||||
MonoArray *ret = mono_array_new(mono_domain_get(), CACHED_CLASS_RAW(int32_t), p_array.size());
|
||||
|
@ -999,8 +999,8 @@ MonoArray *PackedIntArray_to_mono_array(const PackedIntArray &p_array) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
PackedIntArray mono_array_to_PackedIntArray(MonoArray *p_array) {
|
||||
PackedIntArray ret;
|
||||
PackedInt32Array mono_array_to_PackedInt32Array(MonoArray *p_array) {
|
||||
PackedInt32Array ret;
|
||||
if (!p_array)
|
||||
return ret;
|
||||
int length = mono_array_length(p_array);
|
||||
|
@ -1041,7 +1041,7 @@ PackedByteArray mono_array_to_PackedByteArray(MonoArray *p_array) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
MonoArray *PackedRealArray_to_mono_array(const PackedRealArray &p_array) {
|
||||
MonoArray *PackedFloat32Array_to_mono_array(const PackedFloat32Array &p_array) {
|
||||
const real_t *r = p_array.ptr();
|
||||
|
||||
MonoArray *ret = mono_array_new(mono_domain_get(), REAL_T_MONOCLASS, p_array.size());
|
||||
|
@ -1053,8 +1053,8 @@ MonoArray *PackedRealArray_to_mono_array(const PackedRealArray &p_array) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
PackedRealArray mono_array_to_PackedRealArray(MonoArray *p_array) {
|
||||
PackedRealArray ret;
|
||||
PackedFloat32Array mono_array_to_PackedFloat32Array(MonoArray *p_array) {
|
||||
PackedFloat32Array ret;
|
||||
if (!p_array)
|
||||
return ret;
|
||||
int length = mono_array_length(p_array);
|
||||
|
|
|
@ -127,20 +127,20 @@ String mono_object_to_variant_string(MonoObject *p_obj, MonoException **r_exc);
|
|||
MonoArray *Array_to_mono_array(const Array &p_array);
|
||||
Array mono_array_to_Array(MonoArray *p_array);
|
||||
|
||||
// PackedIntArray
|
||||
// PackedInt32Array
|
||||
|
||||
MonoArray *PackedIntArray_to_mono_array(const PackedIntArray &p_array);
|
||||
PackedIntArray mono_array_to_PackedIntArray(MonoArray *p_array);
|
||||
MonoArray *PackedInt32Array_to_mono_array(const PackedInt32Array &p_array);
|
||||
PackedInt32Array mono_array_to_PackedInt32Array(MonoArray *p_array);
|
||||
|
||||
// PackedByteArray
|
||||
|
||||
MonoArray *PackedByteArray_to_mono_array(const PackedByteArray &p_array);
|
||||
PackedByteArray mono_array_to_PackedByteArray(MonoArray *p_array);
|
||||
|
||||
// PackedRealArray
|
||||
// PackedFloat32Array
|
||||
|
||||
MonoArray *PackedRealArray_to_mono_array(const PackedRealArray &p_array);
|
||||
PackedRealArray mono_array_to_PackedRealArray(MonoArray *p_array);
|
||||
MonoArray *PackedFloat32Array_to_mono_array(const PackedFloat32Array &p_array);
|
||||
PackedFloat32Array mono_array_to_PackedFloat32Array(MonoArray *p_array);
|
||||
|
||||
// PackedStringArray
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ void NoiseTexture::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::INT, "height", PROPERTY_HINT_RANGE, "1,2048,1,or_greater"), "set_height", "get_height");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "seamless"), "set_seamless", "get_seamless");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "as_normalmap"), "set_as_normalmap", "is_normalmap");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "bump_strength", PROPERTY_HINT_RANGE, "0,32,0.1,or_greater"), "set_bump_strength", "get_bump_strength");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bump_strength", PROPERTY_HINT_RANGE, "0,32,0.1,or_greater"), "set_bump_strength", "get_bump_strength");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "noise", PROPERTY_HINT_RESOURCE_TYPE, "OpenSimplexNoise"), "set_noise", "get_noise");
|
||||
}
|
||||
|
||||
|
|
|
@ -186,9 +186,9 @@ void OpenSimplexNoise::_bind_methods() {
|
|||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "seed"), "set_seed", "get_seed");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "octaves", PROPERTY_HINT_RANGE, vformat("1,%d,1", MAX_OCTAVES)), "set_octaves", "get_octaves");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "period", PROPERTY_HINT_RANGE, "0.1,256.0,0.1"), "set_period", "get_period");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "persistence", PROPERTY_HINT_RANGE, "0.0,1.0,0.001"), "set_persistence", "get_persistence");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "lacunarity", PROPERTY_HINT_RANGE, "0.1,4.0,0.01"), "set_lacunarity", "get_lacunarity");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "period", PROPERTY_HINT_RANGE, "0.1,256.0,0.1"), "set_period", "get_period");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "persistence", PROPERTY_HINT_RANGE, "0.0,1.0,0.001"), "set_persistence", "get_persistence");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lacunarity", PROPERTY_HINT_RANGE, "0.1,4.0,0.01"), "set_lacunarity", "get_lacunarity");
|
||||
}
|
||||
|
||||
float OpenSimplexNoise::get_noise_1d(float x) {
|
||||
|
|
|
@ -267,7 +267,7 @@ void AudioStreamOGGVorbis::_bind_methods() {
|
|||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::PACKED_BYTE_ARRAY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_data", "get_data");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "loop"), "set_loop", "has_loop");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "loop_offset"), "set_loop_offset", "get_loop_offset");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "loop_offset"), "set_loop_offset", "get_loop_offset");
|
||||
}
|
||||
|
||||
AudioStreamOGGVorbis::AudioStreamOGGVorbis() {
|
||||
|
|
|
@ -73,7 +73,7 @@ String ResourceImporterOGGVorbis::get_preset_name(int p_idx) const {
|
|||
void ResourceImporterOGGVorbis::get_import_options(List<ImportOption> *r_options, int p_preset) const {
|
||||
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "loop"), true));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "loop_offset"), 0));
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "loop_offset"), 0));
|
||||
}
|
||||
|
||||
Error ResourceImporterOGGVorbis::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) {
|
||||
|
|
|
@ -277,22 +277,22 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const
|
|||
case MATH_EXP:
|
||||
case MATH_ISNAN:
|
||||
case MATH_ISINF: {
|
||||
return PropertyInfo(Variant::REAL, "s");
|
||||
return PropertyInfo(Variant::FLOAT, "s");
|
||||
} break;
|
||||
case MATH_ATAN2: {
|
||||
if (p_idx == 0)
|
||||
return PropertyInfo(Variant::REAL, "y");
|
||||
return PropertyInfo(Variant::FLOAT, "y");
|
||||
else
|
||||
return PropertyInfo(Variant::REAL, "x");
|
||||
return PropertyInfo(Variant::FLOAT, "x");
|
||||
} break;
|
||||
case MATH_FMOD:
|
||||
case MATH_FPOSMOD:
|
||||
case LOGIC_MAX:
|
||||
case LOGIC_MIN: {
|
||||
if (p_idx == 0)
|
||||
return PropertyInfo(Variant::REAL, "a");
|
||||
return PropertyInfo(Variant::FLOAT, "a");
|
||||
else
|
||||
return PropertyInfo(Variant::REAL, "b");
|
||||
return PropertyInfo(Variant::FLOAT, "b");
|
||||
} break;
|
||||
case MATH_POSMOD: {
|
||||
if (p_idx == 0)
|
||||
|
@ -302,63 +302,63 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const
|
|||
} break;
|
||||
case MATH_POW: {
|
||||
if (p_idx == 0)
|
||||
return PropertyInfo(Variant::REAL, "base");
|
||||
return PropertyInfo(Variant::FLOAT, "base");
|
||||
else
|
||||
return PropertyInfo(Variant::REAL, "exp");
|
||||
return PropertyInfo(Variant::FLOAT, "exp");
|
||||
} break;
|
||||
case MATH_EASE: {
|
||||
if (p_idx == 0)
|
||||
return PropertyInfo(Variant::REAL, "s");
|
||||
return PropertyInfo(Variant::FLOAT, "s");
|
||||
else
|
||||
return PropertyInfo(Variant::REAL, "curve");
|
||||
return PropertyInfo(Variant::FLOAT, "curve");
|
||||
} break;
|
||||
case MATH_STEP_DECIMALS: {
|
||||
return PropertyInfo(Variant::REAL, "step");
|
||||
return PropertyInfo(Variant::FLOAT, "step");
|
||||
} break;
|
||||
case MATH_STEPIFY: {
|
||||
if (p_idx == 0)
|
||||
return PropertyInfo(Variant::REAL, "s");
|
||||
return PropertyInfo(Variant::FLOAT, "s");
|
||||
else
|
||||
return PropertyInfo(Variant::REAL, "steps");
|
||||
return PropertyInfo(Variant::FLOAT, "steps");
|
||||
} break;
|
||||
case MATH_LERP:
|
||||
case MATH_LERP_ANGLE:
|
||||
case MATH_INVERSE_LERP:
|
||||
case MATH_SMOOTHSTEP: {
|
||||
if (p_idx == 0)
|
||||
return PropertyInfo(Variant::REAL, "from");
|
||||
return PropertyInfo(Variant::FLOAT, "from");
|
||||
else if (p_idx == 1)
|
||||
return PropertyInfo(Variant::REAL, "to");
|
||||
return PropertyInfo(Variant::FLOAT, "to");
|
||||
else
|
||||
return PropertyInfo(Variant::REAL, "weight");
|
||||
return PropertyInfo(Variant::FLOAT, "weight");
|
||||
} break;
|
||||
case MATH_RANGE_LERP: {
|
||||
if (p_idx == 0)
|
||||
return PropertyInfo(Variant::REAL, "value");
|
||||
return PropertyInfo(Variant::FLOAT, "value");
|
||||
else if (p_idx == 1)
|
||||
return PropertyInfo(Variant::REAL, "istart");
|
||||
return PropertyInfo(Variant::FLOAT, "istart");
|
||||
else if (p_idx == 2)
|
||||
return PropertyInfo(Variant::REAL, "istop");
|
||||
return PropertyInfo(Variant::FLOAT, "istop");
|
||||
else if (p_idx == 3)
|
||||
return PropertyInfo(Variant::REAL, "ostart");
|
||||
return PropertyInfo(Variant::FLOAT, "ostart");
|
||||
else
|
||||
return PropertyInfo(Variant::REAL, "ostop");
|
||||
return PropertyInfo(Variant::FLOAT, "ostop");
|
||||
} break;
|
||||
case MATH_MOVE_TOWARD: {
|
||||
if (p_idx == 0)
|
||||
return PropertyInfo(Variant::REAL, "from");
|
||||
return PropertyInfo(Variant::FLOAT, "from");
|
||||
else if (p_idx == 1)
|
||||
return PropertyInfo(Variant::REAL, "to");
|
||||
return PropertyInfo(Variant::FLOAT, "to");
|
||||
else
|
||||
return PropertyInfo(Variant::REAL, "delta");
|
||||
return PropertyInfo(Variant::FLOAT, "delta");
|
||||
} break;
|
||||
case MATH_DECTIME: {
|
||||
if (p_idx == 0)
|
||||
return PropertyInfo(Variant::REAL, "value");
|
||||
return PropertyInfo(Variant::FLOAT, "value");
|
||||
else if (p_idx == 1)
|
||||
return PropertyInfo(Variant::REAL, "amount");
|
||||
return PropertyInfo(Variant::FLOAT, "amount");
|
||||
else
|
||||
return PropertyInfo(Variant::REAL, "step");
|
||||
return PropertyInfo(Variant::FLOAT, "step");
|
||||
} break;
|
||||
case MATH_RANDOMIZE:
|
||||
case MATH_RAND:
|
||||
|
@ -367,37 +367,37 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const
|
|||
} break;
|
||||
case MATH_RANDOM: {
|
||||
if (p_idx == 0)
|
||||
return PropertyInfo(Variant::REAL, "from");
|
||||
return PropertyInfo(Variant::FLOAT, "from");
|
||||
else
|
||||
return PropertyInfo(Variant::REAL, "to");
|
||||
return PropertyInfo(Variant::FLOAT, "to");
|
||||
} break;
|
||||
case MATH_SEED:
|
||||
case MATH_RANDSEED: {
|
||||
return PropertyInfo(Variant::INT, "seed");
|
||||
} break;
|
||||
case MATH_DEG2RAD: {
|
||||
return PropertyInfo(Variant::REAL, "deg");
|
||||
return PropertyInfo(Variant::FLOAT, "deg");
|
||||
} break;
|
||||
case MATH_RAD2DEG: {
|
||||
return PropertyInfo(Variant::REAL, "rad");
|
||||
return PropertyInfo(Variant::FLOAT, "rad");
|
||||
} break;
|
||||
case MATH_LINEAR2DB: {
|
||||
return PropertyInfo(Variant::REAL, "nrg");
|
||||
return PropertyInfo(Variant::FLOAT, "nrg");
|
||||
} break;
|
||||
case MATH_DB2LINEAR: {
|
||||
return PropertyInfo(Variant::REAL, "db");
|
||||
return PropertyInfo(Variant::FLOAT, "db");
|
||||
} break;
|
||||
case MATH_POLAR2CARTESIAN: {
|
||||
if (p_idx == 0)
|
||||
return PropertyInfo(Variant::REAL, "r");
|
||||
return PropertyInfo(Variant::FLOAT, "r");
|
||||
else
|
||||
return PropertyInfo(Variant::REAL, "th");
|
||||
return PropertyInfo(Variant::FLOAT, "th");
|
||||
} break;
|
||||
case MATH_CARTESIAN2POLAR: {
|
||||
if (p_idx == 0)
|
||||
return PropertyInfo(Variant::REAL, "x");
|
||||
return PropertyInfo(Variant::FLOAT, "x");
|
||||
else
|
||||
return PropertyInfo(Variant::REAL, "y");
|
||||
return PropertyInfo(Variant::FLOAT, "y");
|
||||
} break;
|
||||
case MATH_WRAP: {
|
||||
if (p_idx == 0)
|
||||
|
@ -410,11 +410,11 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const
|
|||
case MATH_WRAPF:
|
||||
case LOGIC_CLAMP: {
|
||||
if (p_idx == 0)
|
||||
return PropertyInfo(Variant::REAL, "value");
|
||||
return PropertyInfo(Variant::FLOAT, "value");
|
||||
else if (p_idx == 1)
|
||||
return PropertyInfo(Variant::REAL, "min");
|
||||
return PropertyInfo(Variant::FLOAT, "min");
|
||||
else
|
||||
return PropertyInfo(Variant::REAL, "max");
|
||||
return PropertyInfo(Variant::FLOAT, "max");
|
||||
} break;
|
||||
case LOGIC_NEAREST_PO2: {
|
||||
return PropertyInfo(Variant::INT, "value");
|
||||
|
@ -475,7 +475,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const
|
|||
if (p_idx == 0)
|
||||
return PropertyInfo(Variant::STRING, "name");
|
||||
else
|
||||
return PropertyInfo(Variant::REAL, "alpha");
|
||||
return PropertyInfo(Variant::FLOAT, "alpha");
|
||||
} break;
|
||||
case FUNC_MAX: {
|
||||
}
|
||||
|
@ -504,7 +504,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons
|
|||
case MATH_FPOSMOD:
|
||||
case MATH_FLOOR:
|
||||
case MATH_CEIL: {
|
||||
t = Variant::REAL;
|
||||
t = Variant::FLOAT;
|
||||
} break;
|
||||
case MATH_POSMOD:
|
||||
case MATH_ROUND: {
|
||||
|
@ -519,14 +519,14 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons
|
|||
case MATH_POW:
|
||||
case MATH_LOG:
|
||||
case MATH_EXP: {
|
||||
t = Variant::REAL;
|
||||
t = Variant::FLOAT;
|
||||
} break;
|
||||
case MATH_ISNAN:
|
||||
case MATH_ISINF: {
|
||||
t = Variant::BOOL;
|
||||
} break;
|
||||
case MATH_EASE: {
|
||||
t = Variant::REAL;
|
||||
t = Variant::FLOAT;
|
||||
} break;
|
||||
case MATH_STEP_DECIMALS: {
|
||||
t = Variant::INT;
|
||||
|
@ -539,7 +539,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons
|
|||
case MATH_SMOOTHSTEP:
|
||||
case MATH_MOVE_TOWARD:
|
||||
case MATH_DECTIME: {
|
||||
t = Variant::REAL;
|
||||
t = Variant::FLOAT;
|
||||
|
||||
} break;
|
||||
case MATH_RANDOMIZE: {
|
||||
|
@ -551,7 +551,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons
|
|||
} break;
|
||||
case MATH_RANDF:
|
||||
case MATH_RANDOM: {
|
||||
t = Variant::REAL;
|
||||
t = Variant::FLOAT;
|
||||
} break;
|
||||
case MATH_SEED: {
|
||||
|
||||
|
@ -568,7 +568,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons
|
|||
case MATH_LINEAR2DB:
|
||||
case MATH_WRAPF:
|
||||
case MATH_DB2LINEAR: {
|
||||
t = Variant::REAL;
|
||||
t = Variant::FLOAT;
|
||||
} break;
|
||||
case MATH_POLAR2CARTESIAN:
|
||||
case MATH_CARTESIAN2POLAR: {
|
||||
|
@ -679,7 +679,7 @@ VisualScriptBuiltinFunc::BuiltinFunc VisualScriptBuiltinFunc::get_func() {
|
|||
if (!p_inputs[m_arg]->is_num()) { \
|
||||
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; \
|
||||
r_error.argument = m_arg; \
|
||||
r_error.expected = Variant::REAL; \
|
||||
r_error.expected = Variant::FLOAT; \
|
||||
return; \
|
||||
}
|
||||
|
||||
|
@ -781,7 +781,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in
|
|||
|
||||
int64_t i = *p_inputs[0];
|
||||
*r_return = ABS(i);
|
||||
} else if (p_inputs[0]->get_type() == Variant::REAL) {
|
||||
} else if (p_inputs[0]->get_type() == Variant::FLOAT) {
|
||||
|
||||
real_t r = *p_inputs[0];
|
||||
*r_return = Math::abs(r);
|
||||
|
@ -789,7 +789,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in
|
|||
|
||||
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
|
||||
r_error.argument = 0;
|
||||
r_error.expected = Variant::REAL;
|
||||
r_error.expected = Variant::FLOAT;
|
||||
}
|
||||
} break;
|
||||
case VisualScriptBuiltinFunc::MATH_SIGN: {
|
||||
|
@ -798,7 +798,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in
|
|||
|
||||
int64_t i = *p_inputs[0];
|
||||
*r_return = i < 0 ? -1 : (i > 0 ? +1 : 0);
|
||||
} else if (p_inputs[0]->get_type() == Variant::REAL) {
|
||||
} else if (p_inputs[0]->get_type() == Variant::FLOAT) {
|
||||
|
||||
real_t r = *p_inputs[0];
|
||||
*r_return = r < 0.0 ? -1.0 : (r > 0.0 ? +1.0 : 0.0);
|
||||
|
@ -806,7 +806,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in
|
|||
|
||||
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
|
||||
r_error.argument = 0;
|
||||
r_error.expected = Variant::REAL;
|
||||
r_error.expected = Variant::FLOAT;
|
||||
}
|
||||
} break;
|
||||
case VisualScriptBuiltinFunc::MATH_POW: {
|
||||
|
|
|
@ -346,7 +346,7 @@ static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) {
|
|||
|
||||
case Variant::BOOL: color = Color(0.55, 0.65, 0.94); break;
|
||||
case Variant::INT: color = Color(0.49, 0.78, 0.94); break;
|
||||
case Variant::REAL: color = Color(0.38, 0.85, 0.96); break;
|
||||
case Variant::FLOAT: color = Color(0.38, 0.85, 0.96); break;
|
||||
case Variant::STRING: color = Color(0.42, 0.65, 0.93); break;
|
||||
|
||||
case Variant::VECTOR2: color = Color(0.74, 0.57, 0.95); break;
|
||||
|
@ -367,8 +367,10 @@ static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) {
|
|||
|
||||
case Variant::ARRAY: color = Color(0.88, 0.88, 0.88); break;
|
||||
case Variant::PACKED_BYTE_ARRAY: color = Color(0.67, 0.96, 0.78); break;
|
||||
case Variant::PACKED_INT_ARRAY: color = Color(0.69, 0.86, 0.96); break;
|
||||
case Variant::PACKED_REAL_ARRAY: color = Color(0.59, 0.91, 0.97); break;
|
||||
case Variant::PACKED_INT32_ARRAY: color = Color(0.69, 0.86, 0.96); break;
|
||||
case Variant::PACKED_FLOAT32_ARRAY: color = Color(0.59, 0.91, 0.97); break;
|
||||
case Variant::PACKED_INT64_ARRAY: color = Color(0.69, 0.86, 0.96); break;
|
||||
case Variant::PACKED_FLOAT64_ARRAY: color = Color(0.59, 0.91, 0.97); break;
|
||||
case Variant::PACKED_STRING_ARRAY: color = Color(0.62, 0.77, 0.95); break;
|
||||
case Variant::PACKED_VECTOR2_ARRAY: color = Color(0.82, 0.7, 0.96); break;
|
||||
case Variant::PACKED_VECTOR3_ARRAY: color = Color(0.87, 0.61, 0.95); break;
|
||||
|
@ -383,7 +385,7 @@ static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) {
|
|||
|
||||
case Variant::BOOL: color = Color(0.43, 0.56, 0.92); break;
|
||||
case Variant::INT: color = Color(0.31, 0.7, 0.91); break;
|
||||
case Variant::REAL: color = Color(0.15, 0.8, 0.94); break;
|
||||
case Variant::FLOAT: color = Color(0.15, 0.8, 0.94); break;
|
||||
case Variant::STRING: color = Color(0.27, 0.56, 0.91); break;
|
||||
|
||||
case Variant::VECTOR2: color = Color(0.68, 0.46, 0.93); break;
|
||||
|
@ -404,8 +406,10 @@ static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) {
|
|||
|
||||
case Variant::ARRAY: color = Color(0.45, 0.45, 0.45); break;
|
||||
case Variant::PACKED_BYTE_ARRAY: color = Color(0.38, 0.92, 0.6); break;
|
||||
case Variant::PACKED_INT_ARRAY: color = Color(0.38, 0.73, 0.92); break;
|
||||
case Variant::PACKED_REAL_ARRAY: color = Color(0.25, 0.83, 0.95); break;
|
||||
case Variant::PACKED_INT32_ARRAY: color = Color(0.38, 0.73, 0.92); break;
|
||||
case Variant::PACKED_FLOAT32_ARRAY: color = Color(0.25, 0.83, 0.95); break;
|
||||
case Variant::PACKED_INT64_ARRAY: color = Color(0.38, 0.73, 0.92); break;
|
||||
case Variant::PACKED_FLOAT64_ARRAY: color = Color(0.25, 0.83, 0.95); break;
|
||||
case Variant::PACKED_STRING_ARRAY: color = Color(0.38, 0.62, 0.92); break;
|
||||
case Variant::PACKED_VECTOR2_ARRAY: color = Color(0.62, 0.36, 0.92); break;
|
||||
case Variant::PACKED_VECTOR3_ARRAY: color = Color(0.79, 0.35, 0.92); break;
|
||||
|
@ -521,8 +525,8 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
|
|||
Control::get_icon("Dictionary", "EditorIcons"),
|
||||
Control::get_icon("Array", "EditorIcons"),
|
||||
Control::get_icon("PackedByteArray", "EditorIcons"),
|
||||
Control::get_icon("PackedIntArray", "EditorIcons"),
|
||||
Control::get_icon("PackedRealArray", "EditorIcons"),
|
||||
Control::get_icon("PackedInt32Array", "EditorIcons"),
|
||||
Control::get_icon("PackedFloat32Array", "EditorIcons"),
|
||||
Control::get_icon("PackedStringArray", "EditorIcons"),
|
||||
Control::get_icon("PackedVector2Array", "EditorIcons"),
|
||||
Control::get_icon("PackedVector3Array", "EditorIcons"),
|
||||
|
@ -977,8 +981,8 @@ void VisualScriptEditor::_update_members() {
|
|||
Control::get_icon("Dictionary", "EditorIcons"),
|
||||
Control::get_icon("Array", "EditorIcons"),
|
||||
Control::get_icon("PackedByteArray", "EditorIcons"),
|
||||
Control::get_icon("PackedIntArray", "EditorIcons"),
|
||||
Control::get_icon("PackedRealArray", "EditorIcons"),
|
||||
Control::get_icon("PackedInt32Array", "EditorIcons"),
|
||||
Control::get_icon("PackedFloat32Array", "EditorIcons"),
|
||||
Control::get_icon("PackedStringArray", "EditorIcons"),
|
||||
Control::get_icon("PackedVector2Array", "EditorIcons"),
|
||||
Control::get_icon("PackedVector3Array", "EditorIcons"),
|
||||
|
@ -2910,8 +2914,8 @@ void VisualScriptEditor::_graph_connected(const String &p_from, int p_from_slot,
|
|||
if (to_type != Variant::NIL && from_type != Variant::NIL && to_type != from_type) {
|
||||
// add a constructor node between the ports
|
||||
bool exceptions = false; // true if there are any exceptions
|
||||
exceptions = exceptions || (to_type == Variant::INT && from_type == Variant::REAL);
|
||||
exceptions = exceptions || (to_type == Variant::REAL && from_type == Variant::INT);
|
||||
exceptions = exceptions || (to_type == Variant::INT && from_type == Variant::FLOAT);
|
||||
exceptions = exceptions || (to_type == Variant::FLOAT && from_type == Variant::INT);
|
||||
if (Variant::can_convert(from_type, to_type) && !exceptions) {
|
||||
MethodInfo mi;
|
||||
mi.name = Variant::get_type_name(to_type);
|
||||
|
|
|
@ -2259,7 +2259,7 @@ PropertyInfo VisualScriptMathConstant::get_input_value_port_info(int p_idx) cons
|
|||
|
||||
PropertyInfo VisualScriptMathConstant::get_output_value_port_info(int p_idx) const {
|
||||
|
||||
return PropertyInfo(Variant::REAL, const_name[constant]);
|
||||
return PropertyInfo(Variant::FLOAT, const_name[constant]);
|
||||
}
|
||||
|
||||
String VisualScriptMathConstant::get_caption() const {
|
||||
|
|
|
@ -120,8 +120,10 @@ void VisualScriptPropertySelector::_update_search() {
|
|||
Control::get_icon("Dictionary", "EditorIcons"),
|
||||
Control::get_icon("Array", "EditorIcons"),
|
||||
Control::get_icon("PackedByteArray", "EditorIcons"),
|
||||
Control::get_icon("PackedIntArray", "EditorIcons"),
|
||||
Control::get_icon("PackedRealArray", "EditorIcons"),
|
||||
Control::get_icon("PackedInt32Array", "EditorIcons"),
|
||||
Control::get_icon("PackedFloat32Array", "EditorIcons"),
|
||||
Control::get_icon("PackedInt64Array", "EditorIcons"),
|
||||
Control::get_icon("PackedFloat64Array", "EditorIcons"),
|
||||
Control::get_icon("PackedStringArray", "EditorIcons"),
|
||||
Control::get_icon("PackedVector2Array", "EditorIcons"),
|
||||
Control::get_icon("PackedVector3Array", "EditorIcons"),
|
||||
|
@ -279,7 +281,7 @@ void VisualScriptPropertySelector::_update_search() {
|
|||
if (type == Variant::BOOL) {
|
||||
get_visual_node_names("operators/logic/", Set<String>(), found, root, search_box);
|
||||
}
|
||||
if (type == Variant::BOOL || type == Variant::INT || type == Variant::REAL || type == Variant::VECTOR2 || type == Variant::VECTOR3) {
|
||||
if (type == Variant::BOOL || type == Variant::INT || type == Variant::FLOAT || type == Variant::VECTOR2 || type == Variant::VECTOR3) {
|
||||
get_visual_node_names("operators/math/", Set<String>(), found, root, search_box);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -188,7 +188,7 @@ void VisualScriptYield::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("get_wait_time"), &VisualScriptYield::get_wait_time);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Frame,Physics Frame,Time", PROPERTY_USAGE_NOEDITOR), "set_yield_mode", "get_yield_mode");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "wait_time"), "set_wait_time", "get_wait_time");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "wait_time"), "set_wait_time", "get_wait_time");
|
||||
|
||||
BIND_ENUM_CONSTANT(YIELD_FRAME);
|
||||
BIND_ENUM_CONSTANT(YIELD_PHYSICS_FRAME);
|
||||
|
|
|
@ -113,12 +113,12 @@ class JavaClass : public Reference {
|
|||
break;
|
||||
case ARG_TYPE_FLOAT | ARG_NUMBER_CLASS_BIT:
|
||||
case ARG_TYPE_FLOAT:
|
||||
r_type = Variant::REAL;
|
||||
r_type = Variant::FLOAT;
|
||||
likelihood = 1.0;
|
||||
break;
|
||||
case ARG_TYPE_DOUBLE | ARG_NUMBER_CLASS_BIT:
|
||||
case ARG_TYPE_DOUBLE:
|
||||
r_type = Variant::REAL;
|
||||
r_type = Variant::FLOAT;
|
||||
likelihood = 0.5;
|
||||
break;
|
||||
case ARG_TYPE_STRING: r_type = Variant::STRING; break;
|
||||
|
@ -134,23 +134,23 @@ class JavaClass : public Reference {
|
|||
likelihood = 0.5;
|
||||
break;
|
||||
case ARG_ARRAY_BIT | ARG_TYPE_SHORT:
|
||||
r_type = Variant::PACKED_INT_ARRAY;
|
||||
r_type = Variant::PACKED_INT32_ARRAY;
|
||||
likelihood = 0.3;
|
||||
break;
|
||||
case ARG_ARRAY_BIT | ARG_TYPE_INT:
|
||||
r_type = Variant::PACKED_INT_ARRAY;
|
||||
r_type = Variant::PACKED_INT32_ARRAY;
|
||||
likelihood = 1.0;
|
||||
break;
|
||||
case ARG_ARRAY_BIT | ARG_TYPE_LONG:
|
||||
r_type = Variant::PACKED_INT_ARRAY;
|
||||
r_type = Variant::PACKED_INT32_ARRAY;
|
||||
likelihood = 0.5;
|
||||
break;
|
||||
case ARG_ARRAY_BIT | ARG_TYPE_FLOAT:
|
||||
r_type = Variant::PACKED_REAL_ARRAY;
|
||||
r_type = Variant::PACKED_FLOAT32_ARRAY;
|
||||
likelihood = 1.0;
|
||||
break;
|
||||
case ARG_ARRAY_BIT | ARG_TYPE_DOUBLE:
|
||||
r_type = Variant::PACKED_REAL_ARRAY;
|
||||
r_type = Variant::PACKED_FLOAT32_ARRAY;
|
||||
likelihood = 0.5;
|
||||
break;
|
||||
case ARG_ARRAY_BIT | ARG_TYPE_STRING: r_type = Variant::PACKED_STRING_ARRAY; break;
|
||||
|
|
|
@ -97,7 +97,7 @@ bool JavaClass::_call_method(JavaObject *p_instance, const StringName &p_method,
|
|||
case ARG_TYPE_DOUBLE: {
|
||||
|
||||
if (!p_args[i]->is_num())
|
||||
arg_expected = Variant::REAL;
|
||||
arg_expected = Variant::FLOAT;
|
||||
|
||||
} break;
|
||||
case ARG_TYPE_STRING: {
|
||||
|
|
|
@ -99,7 +99,7 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant *p_a
|
|||
v.val.i = *p_arg;
|
||||
};
|
||||
} break;
|
||||
case Variant::REAL: {
|
||||
case Variant::FLOAT: {
|
||||
|
||||
if (force_jobject) {
|
||||
|
||||
|
@ -182,7 +182,7 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant *p_a
|
|||
v.obj = jdict;
|
||||
} break;
|
||||
|
||||
case Variant::PACKED_INT_ARRAY: {
|
||||
case Variant::PACKED_INT32_ARRAY: {
|
||||
|
||||
Vector<int> array = *p_arg;
|
||||
jintArray arr = env->NewIntArray(array.size());
|
||||
|
@ -201,7 +201,7 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant *p_a
|
|||
v.obj = arr;
|
||||
|
||||
} break;
|
||||
case Variant::PACKED_REAL_ARRAY: {
|
||||
case Variant::PACKED_FLOAT32_ARRAY: {
|
||||
|
||||
Vector<float> array = *p_arg;
|
||||
jfloatArray arr = env->NewFloatArray(array.size());
|
||||
|
@ -211,6 +211,10 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant *p_a
|
|||
v.obj = arr;
|
||||
|
||||
} break;
|
||||
#ifndef _MSC_VER
|
||||
#warning This is missing 64 bits arrays, I have no idea how to do it in JNI
|
||||
#endif
|
||||
|
||||
default: {
|
||||
|
||||
v.val.i = 0;
|
||||
|
@ -319,7 +323,7 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) {
|
|||
|
||||
jdoubleArray arr = (jdoubleArray)obj;
|
||||
int fCount = env->GetArrayLength(arr);
|
||||
PackedRealArray sarr;
|
||||
PackedFloat32Array sarr;
|
||||
sarr.resize(fCount);
|
||||
|
||||
real_t *w = sarr.ptrw();
|
||||
|
@ -337,7 +341,7 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) {
|
|||
|
||||
jfloatArray arr = (jfloatArray)obj;
|
||||
int fCount = env->GetArrayLength(arr);
|
||||
PackedRealArray sarr;
|
||||
PackedFloat32Array sarr;
|
||||
sarr.resize(fCount);
|
||||
|
||||
real_t *w = sarr.ptrw();
|
||||
|
@ -487,7 +491,7 @@ public:
|
|||
|
||||
ret = env->CallIntMethodA(instance, E->get().method, v);
|
||||
} break;
|
||||
case Variant::REAL: {
|
||||
case Variant::FLOAT: {
|
||||
|
||||
ret = env->CallFloatMethodA(instance, E->get().method, v);
|
||||
} break;
|
||||
|
@ -505,7 +509,7 @@ public:
|
|||
|
||||
env->DeleteLocalRef(arr);
|
||||
} break;
|
||||
case Variant::PACKED_INT_ARRAY: {
|
||||
case Variant::PACKED_INT32_ARRAY: {
|
||||
|
||||
jintArray arr = (jintArray)env->CallObjectMethodA(instance, E->get().method, v);
|
||||
|
||||
|
@ -519,7 +523,7 @@ public:
|
|||
ret = sarr;
|
||||
env->DeleteLocalRef(arr);
|
||||
} break;
|
||||
case Variant::PACKED_REAL_ARRAY: {
|
||||
case Variant::PACKED_FLOAT32_ARRAY: {
|
||||
|
||||
jfloatArray arr = (jfloatArray)env->CallObjectMethodA(instance, E->get().method, v);
|
||||
|
||||
|
@ -534,6 +538,9 @@ public:
|
|||
env->DeleteLocalRef(arr);
|
||||
} break;
|
||||
|
||||
#ifndef _MSC_VER
|
||||
#warning This is missing 64 bits arrays, I have no idea how to do it in JNI
|
||||
#endif
|
||||
case Variant::DICTIONARY: {
|
||||
|
||||
jobject obj = env->CallObjectMethodA(instance, E->get().method, v);
|
||||
|
@ -1246,12 +1253,12 @@ static Variant::Type get_jni_type(const String &p_type) {
|
|||
{ "void", Variant::NIL },
|
||||
{ "boolean", Variant::BOOL },
|
||||
{ "int", Variant::INT },
|
||||
{ "float", Variant::REAL },
|
||||
{ "double", Variant::REAL },
|
||||
{ "float", Variant::FLOAT },
|
||||
{ "double", Variant::FLOAT },
|
||||
{ "java.lang.String", Variant::STRING },
|
||||
{ "[I", Variant::PACKED_INT_ARRAY },
|
||||
{ "[I", Variant::PACKED_INT32_ARRAY },
|
||||
{ "[B", Variant::PACKED_BYTE_ARRAY },
|
||||
{ "[F", Variant::PACKED_REAL_ARRAY },
|
||||
{ "[F", Variant::PACKED_FLOAT32_ARRAY },
|
||||
{ "[Ljava.lang.String;", Variant::PACKED_STRING_ARRAY },
|
||||
{ "org.godotengine.godot.Dictionary", Variant::DICTIONARY },
|
||||
{ NULL, Variant::NIL }
|
||||
|
|
|
@ -81,7 +81,7 @@ Variant JavaScript::eval(const String &p_code, bool p_use_global_exec_context) {
|
|||
|
||||
case 'number':
|
||||
setValue(PTR, eval_ret, 'double');
|
||||
return 3; // REAL
|
||||
return 3; // FLOAT
|
||||
|
||||
case 'string':
|
||||
var array_len = lengthBytesUTF8(eval_ret)+1;
|
||||
|
@ -128,7 +128,7 @@ Variant JavaScript::eval(const String &p_code, bool p_use_global_exec_context) {
|
|||
switch (return_type) {
|
||||
case Variant::BOOL:
|
||||
return js_data.b;
|
||||
case Variant::REAL:
|
||||
case Variant::FLOAT:
|
||||
return js_data.d;
|
||||
case Variant::STRING: {
|
||||
String str = String::utf8(js_data.s);
|
||||
|
|
|
@ -744,11 +744,11 @@ void AnimatedSprite::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "frames", PROPERTY_HINT_RESOURCE_TYPE, "SpriteFrames"), "set_sprite_frames", "get_sprite_frames");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "animation"), "set_animation", "get_animation");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "frame"), "set_frame", "get_frame");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed_scale"), "set_speed_scale", "get_speed_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "speed_scale"), "set_speed_scale", "get_speed_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playing"), "_set_playing", "_is_playing");
|
||||
ADD_GROUP("Lighting", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "specular_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_specular_color", "get_specular_color");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "shininess", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_shininess", "get_shininess");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "shininess", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_shininess", "get_shininess");
|
||||
ADD_GROUP("Offset", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "centered"), "set_centered", "is_centered");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "offset"), "set_offset", "get_offset");
|
||||
|
|
|
@ -660,11 +660,11 @@ void Area2D::_bind_methods() {
|
|||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "space_override", PROPERTY_HINT_ENUM, "Disabled,Combine,Combine-Replace,Replace,Replace-Combine"), "set_space_override_mode", "get_space_override_mode");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "gravity_point"), "set_gravity_is_point", "is_gravity_a_point");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity_distance_scale", PROPERTY_HINT_EXP_RANGE, "0,1024,0.001,or_greater"), "set_gravity_distance_scale", "get_gravity_distance_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "gravity_distance_scale", PROPERTY_HINT_EXP_RANGE, "0,1024,0.001,or_greater"), "set_gravity_distance_scale", "get_gravity_distance_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "gravity_vec"), "set_gravity_vector", "get_gravity_vector");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity", PROPERTY_HINT_RANGE, "-1024,1024,0.001"), "set_gravity", "get_gravity");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "linear_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_angular_damp", "get_angular_damp");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "gravity", PROPERTY_HINT_RANGE, "-1024,1024,0.001"), "set_gravity", "get_gravity");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "linear_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_angular_damp", "get_angular_damp");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "priority", PROPERTY_HINT_RANGE, "0,128,1"), "set_priority", "get_priority");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitoring"), "set_monitoring", "is_monitoring");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitorable"), "set_monitorable", "is_monitorable");
|
||||
|
|
|
@ -515,13 +515,13 @@ void AudioStreamPlayer2D::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("_bus_layout_changed"), &AudioStreamPlayer2D::_bus_layout_changed);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream"), "set_stream", "get_stream");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "volume_db", PROPERTY_HINT_RANGE, "-80,24"), "set_volume_db", "get_volume_db");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "pitch_scale", PROPERTY_HINT_RANGE, "0.01,4,0.01,or_greater"), "set_pitch_scale", "get_pitch_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "volume_db", PROPERTY_HINT_RANGE, "-80,24"), "set_volume_db", "get_volume_db");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "pitch_scale", PROPERTY_HINT_RANGE, "0.01,4,0.01,or_greater"), "set_pitch_scale", "get_pitch_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playing", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "_set_playing", "is_playing");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autoplay"), "set_autoplay", "is_autoplay_enabled");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "stream_paused", PROPERTY_HINT_NONE, ""), "set_stream_paused", "get_stream_paused");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_distance", PROPERTY_HINT_EXP_RANGE, "1,4096,1,or_greater"), "set_max_distance", "get_max_distance");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "attenuation", PROPERTY_HINT_EXP_EASING, "attenuation"), "set_attenuation", "get_attenuation");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_distance", PROPERTY_HINT_EXP_RANGE, "1,4096,1,or_greater"), "set_max_distance", "get_max_distance");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "attenuation", PROPERTY_HINT_EXP_EASING, "attenuation"), "set_attenuation", "get_attenuation");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "bus", PROPERTY_HINT_ENUM, ""), "set_bus", "get_bus");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "area_mask", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_area_mask", "get_area_mask");
|
||||
|
||||
|
|
|
@ -753,17 +753,17 @@ void Camera2D::_bind_methods() {
|
|||
|
||||
ADD_GROUP("Smoothing", "smoothing_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "smoothing_enabled"), "set_enable_follow_smoothing", "is_follow_smoothing_enabled");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "smoothing_speed"), "set_follow_smoothing", "get_follow_smoothing");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "smoothing_speed"), "set_follow_smoothing", "get_follow_smoothing");
|
||||
|
||||
ADD_GROUP("Offset", "offset_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "offset_h", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_h_offset", "get_h_offset");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "offset_v", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_v_offset", "get_v_offset");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "offset_h", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_h_offset", "get_h_offset");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "offset_v", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_v_offset", "get_v_offset");
|
||||
|
||||
ADD_GROUP("Drag Margin", "drag_margin_");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "drag_margin_left", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_LEFT);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "drag_margin_top", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_TOP);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "drag_margin_right", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_RIGHT);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "drag_margin_bottom", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_BOTTOM);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "drag_margin_left", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_LEFT);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "drag_margin_top", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_TOP);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "drag_margin_right", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_RIGHT);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "drag_margin_bottom", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_BOTTOM);
|
||||
|
||||
ADD_GROUP("Editor", "editor_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editor_draw_screen"), "set_screen_drawing_enabled", "is_screen_drawing_enabled");
|
||||
|
|
|
@ -308,7 +308,7 @@ void CollisionPolygon2D::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "polygon"), "set_polygon", "get_polygon");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_way_collision"), "set_one_way_collision", "is_one_way_collision_enabled");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "one_way_collision_margin", PROPERTY_HINT_RANGE, "0,128,0.1"), "set_one_way_collision_margin", "get_one_way_collision_margin");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "one_way_collision_margin", PROPERTY_HINT_RANGE, "0,128,0.1"), "set_one_way_collision_margin", "get_one_way_collision_margin");
|
||||
|
||||
BIND_ENUM_CONSTANT(BUILD_SOLIDS);
|
||||
BIND_ENUM_CONSTANT(BUILD_SEGMENTS);
|
||||
|
|
|
@ -242,7 +242,7 @@ void CollisionShape2D::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape2D"), "set_shape", "get_shape");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_way_collision"), "set_one_way_collision", "is_one_way_collision_enabled");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "one_way_collision_margin", PROPERTY_HINT_RANGE, "0,128,0.1"), "set_one_way_collision_margin", "get_one_way_collision_margin");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "one_way_collision_margin", PROPERTY_HINT_RANGE, "0,128,0.1"), "set_one_way_collision_margin", "get_one_way_collision_margin");
|
||||
}
|
||||
|
||||
CollisionShape2D::CollisionShape2D() {
|
||||
|
|
|
@ -1273,13 +1273,13 @@ void CPUParticles2D::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "emitting"), "set_emitting", "is_emitting");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "amount", PROPERTY_HINT_EXP_RANGE, "1,1000000,1"), "set_amount", "get_amount");
|
||||
ADD_GROUP("Time", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime", PROPERTY_HINT_RANGE, "0.01,600.0,0.01,or_greater"), "set_lifetime", "get_lifetime");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lifetime", PROPERTY_HINT_RANGE, "0.01,600.0,0.01,or_greater"), "set_lifetime", "get_lifetime");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_shot"), "set_one_shot", "get_one_shot");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "preprocess", PROPERTY_HINT_RANGE, "0.00,600.0,0.01"), "set_pre_process_time", "get_pre_process_time");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed_scale", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_speed_scale", "get_speed_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime_randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_lifetime_randomness", "get_lifetime_randomness");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "preprocess", PROPERTY_HINT_RANGE, "0.00,600.0,0.01"), "set_pre_process_time", "get_pre_process_time");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "speed_scale", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_speed_scale", "get_speed_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lifetime_randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_lifetime_randomness", "get_lifetime_randomness");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "fixed_fps", PROPERTY_HINT_RANGE, "0,1000,1"), "set_fixed_fps", "get_fixed_fps");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fract_delta"), "set_fractional_delta", "get_fractional_delta");
|
||||
ADD_GROUP("Drawing", "");
|
||||
|
@ -1346,7 +1346,7 @@ void CPUParticles2D::_bind_methods() {
|
|||
|
||||
ADD_GROUP("Emission Shape", "emission_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "emission_shape", PROPERTY_HINT_ENUM, "Point,Sphere,Box,Points,Directed Points"), "set_emission_shape", "get_emission_shape");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_sphere_radius", PROPERTY_HINT_RANGE, "0.01,128,0.01"), "set_emission_sphere_radius", "get_emission_sphere_radius");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "emission_sphere_radius", PROPERTY_HINT_RANGE, "0.01,128,0.01"), "set_emission_sphere_radius", "get_emission_sphere_radius");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "emission_rect_extents"), "set_emission_rect_extents", "get_emission_rect_extents");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "emission_points"), "set_emission_points", "get_emission_points");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "emission_normals"), "set_emission_normals", "get_emission_normals");
|
||||
|
@ -1355,58 +1355,58 @@ void CPUParticles2D::_bind_methods() {
|
|||
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flag_align_y"), "set_particle_flag", "get_particle_flag", FLAG_ALIGN_Y_TO_VELOCITY);
|
||||
ADD_GROUP("Direction", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "direction"), "set_direction", "get_direction");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "spread", PROPERTY_HINT_RANGE, "0,180,0.01"), "set_spread", "get_spread");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "spread", PROPERTY_HINT_RANGE, "0,180,0.01"), "set_spread", "get_spread");
|
||||
ADD_GROUP("Gravity", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "gravity"), "set_gravity", "get_gravity");
|
||||
ADD_GROUP("Initial Velocity", "initial_");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "initial_velocity", PROPERTY_HINT_RANGE, "0,1000,0.01,or_greater"), "set_param", "get_param", PARAM_INITIAL_LINEAR_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "initial_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_INITIAL_LINEAR_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "initial_velocity", PROPERTY_HINT_RANGE, "0,1000,0.01,or_greater"), "set_param", "get_param", PARAM_INITIAL_LINEAR_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "initial_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_INITIAL_LINEAR_VELOCITY);
|
||||
ADD_GROUP("Angular Velocity", "angular_");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_velocity", PROPERTY_HINT_RANGE, "-720,720,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_ANGULAR_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGULAR_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_velocity", PROPERTY_HINT_RANGE, "-720,720,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_ANGULAR_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGULAR_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "angular_velocity_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ANGULAR_VELOCITY);
|
||||
ADD_GROUP("Orbit Velocity", "orbit_");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "orbit_velocity", PROPERTY_HINT_RANGE, "-1000,1000,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_ORBIT_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "orbit_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ORBIT_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "orbit_velocity", PROPERTY_HINT_RANGE, "-1000,1000,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_ORBIT_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "orbit_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ORBIT_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "orbit_velocity_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ORBIT_VELOCITY);
|
||||
ADD_GROUP("Linear Accel", "linear_");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_LINEAR_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_LINEAR_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_LINEAR_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_LINEAR_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "linear_accel_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_LINEAR_ACCEL);
|
||||
ADD_GROUP("Radial Accel", "radial_");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "radial_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_RADIAL_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "radial_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_RADIAL_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "radial_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_RADIAL_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "radial_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_RADIAL_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "radial_accel_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_RADIAL_ACCEL);
|
||||
ADD_GROUP("Tangential Accel", "tangential_");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "tangential_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_TANGENTIAL_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "tangential_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_TANGENTIAL_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "tangential_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_TANGENTIAL_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "tangential_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_TANGENTIAL_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "tangential_accel_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_TANGENTIAL_ACCEL);
|
||||
ADD_GROUP("Damping", "");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "damping", PROPERTY_HINT_RANGE, "0,100,0.01"), "set_param", "get_param", PARAM_DAMPING);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "damping_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_DAMPING);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "damping", PROPERTY_HINT_RANGE, "0,100,0.01"), "set_param", "get_param", PARAM_DAMPING);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "damping_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_DAMPING);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "damping_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_DAMPING);
|
||||
ADD_GROUP("Angle", "");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angle", PROPERTY_HINT_RANGE, "-720,720,0.1,or_lesser,or_greater"), "set_param", "get_param", PARAM_ANGLE);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angle_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGLE);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angle", PROPERTY_HINT_RANGE, "-720,720,0.1,or_lesser,or_greater"), "set_param", "get_param", PARAM_ANGLE);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angle_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGLE);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "angle_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ANGLE);
|
||||
ADD_GROUP("Scale", "");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "scale_amount", PROPERTY_HINT_RANGE, "0,1000,0.01,or_greater"), "set_param", "get_param", PARAM_SCALE);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "scale_amount_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_SCALE);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "scale_amount", PROPERTY_HINT_RANGE, "0,1000,0.01,or_greater"), "set_param", "get_param", PARAM_SCALE);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "scale_amount_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_SCALE);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "scale_amount_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_SCALE);
|
||||
ADD_GROUP("Color", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_color", "get_color");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "color_ramp", PROPERTY_HINT_RESOURCE_TYPE, "Gradient"), "set_color_ramp", "get_color_ramp");
|
||||
|
||||
ADD_GROUP("Hue Variation", "hue_");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "hue_variation", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_param", "get_param", PARAM_HUE_VARIATION);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "hue_variation_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_HUE_VARIATION);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "hue_variation", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_param", "get_param", PARAM_HUE_VARIATION);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "hue_variation_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_HUE_VARIATION);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "hue_variation_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_HUE_VARIATION);
|
||||
ADD_GROUP("Animation", "anim_");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_speed", PROPERTY_HINT_RANGE, "0,128,0.01,or_greater"), "set_param", "get_param", PARAM_ANIM_SPEED);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_speed_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_SPEED);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anim_speed", PROPERTY_HINT_RANGE, "0,128,0.01,or_greater"), "set_param", "get_param", PARAM_ANIM_SPEED);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anim_speed_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_SPEED);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "anim_speed_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ANIM_SPEED);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_offset", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_ANIM_OFFSET);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_offset_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_OFFSET);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anim_offset", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_ANIM_OFFSET);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anim_offset_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_OFFSET);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "anim_offset_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ANIM_OFFSET);
|
||||
|
||||
BIND_ENUM_CONSTANT(PARAM_INITIAL_LINEAR_VELOCITY);
|
||||
|
|
|
@ -158,7 +158,7 @@ void Joint2D::_bind_methods() {
|
|||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "node_a", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "CollisionObject2D"), "set_node_a", "get_node_a");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "node_b", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "CollisionObject2D"), "set_node_b", "get_node_b");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "bias", PROPERTY_HINT_RANGE, "0,0.9,0.001"), "set_bias", "get_bias");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bias", PROPERTY_HINT_RANGE, "0,0.9,0.001"), "set_bias", "get_bias");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disable_collision"), "set_exclude_nodes_from_collision", "get_exclude_nodes_from_collision");
|
||||
}
|
||||
|
||||
|
@ -215,7 +215,7 @@ void PinJoint2D::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("set_softness", "softness"), &PinJoint2D::set_softness);
|
||||
ClassDB::bind_method(D_METHOD("get_softness"), &PinJoint2D::get_softness);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "softness", PROPERTY_HINT_EXP_RANGE, "0.00,16,0.01"), "set_softness", "get_softness");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "softness", PROPERTY_HINT_EXP_RANGE, "0.00,16,0.01"), "set_softness", "get_softness");
|
||||
}
|
||||
|
||||
PinJoint2D::PinJoint2D() {
|
||||
|
@ -285,8 +285,8 @@ void GrooveJoint2D::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("set_initial_offset", "offset"), &GrooveJoint2D::set_initial_offset);
|
||||
ClassDB::bind_method(D_METHOD("get_initial_offset"), &GrooveJoint2D::get_initial_offset);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "length", PROPERTY_HINT_EXP_RANGE, "1,65535,1"), "set_length", "get_length");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "initial_offset", PROPERTY_HINT_EXP_RANGE, "1,65535,1"), "set_initial_offset", "get_initial_offset");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "length", PROPERTY_HINT_EXP_RANGE, "1,65535,1"), "set_length", "get_length");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "initial_offset", PROPERTY_HINT_EXP_RANGE, "1,65535,1"), "set_initial_offset", "get_initial_offset");
|
||||
}
|
||||
|
||||
GrooveJoint2D::GrooveJoint2D() {
|
||||
|
@ -394,10 +394,10 @@ void DampedSpringJoint2D::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("set_damping", "damping"), &DampedSpringJoint2D::set_damping);
|
||||
ClassDB::bind_method(D_METHOD("get_damping"), &DampedSpringJoint2D::get_damping);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "length", PROPERTY_HINT_EXP_RANGE, "1,65535,1"), "set_length", "get_length");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "rest_length", PROPERTY_HINT_EXP_RANGE, "0,65535,1"), "set_rest_length", "get_rest_length");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "stiffness", PROPERTY_HINT_EXP_RANGE, "0.1,64,0.1"), "set_stiffness", "get_stiffness");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "damping", PROPERTY_HINT_EXP_RANGE, "0.01,16,0.01"), "set_damping", "get_damping");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "length", PROPERTY_HINT_EXP_RANGE, "1,65535,1"), "set_length", "get_length");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rest_length", PROPERTY_HINT_EXP_RANGE, "0,65535,1"), "set_rest_length", "get_rest_length");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "stiffness", PROPERTY_HINT_EXP_RANGE, "0.1,64,0.1"), "set_stiffness", "get_stiffness");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "damping", PROPERTY_HINT_EXP_RANGE, "0.01,16,0.01"), "set_damping", "get_damping");
|
||||
}
|
||||
|
||||
DampedSpringJoint2D::DampedSpringJoint2D() {
|
||||
|
|
|
@ -426,12 +426,12 @@ void Light2D::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editor_only"), "set_editor_only", "is_editor_only");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "offset"), "set_texture_offset", "get_texture_offset");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "texture_scale", PROPERTY_HINT_RANGE, "0.01,50,0.01"), "set_texture_scale", "get_texture_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "texture_scale", PROPERTY_HINT_RANGE, "0.01,50,0.01"), "set_texture_scale", "get_texture_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_color", "get_color");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "energy", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_energy", "get_energy");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "energy", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_energy", "get_energy");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Add,Sub,Mix,Mask"), "set_mode", "get_mode");
|
||||
ADD_GROUP("Range", "range_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "range_height", PROPERTY_HINT_RANGE, "-2048,2048,0.1,or_lesser,or_greater"), "set_height", "get_height");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "range_height", PROPERTY_HINT_RANGE, "-2048,2048,0.1,or_lesser,or_greater"), "set_height", "get_height");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "range_z_min", PROPERTY_HINT_RANGE, itos(VS::CANVAS_ITEM_Z_MIN) + "," + itos(VS::CANVAS_ITEM_Z_MAX) + ",1"), "set_z_range_min", "get_z_range_min");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "range_z_max", PROPERTY_HINT_RANGE, itos(VS::CANVAS_ITEM_Z_MIN) + "," + itos(VS::CANVAS_ITEM_Z_MAX) + ",1"), "set_z_range_max", "get_z_range_max");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "range_layer_min", PROPERTY_HINT_RANGE, "-512,512,1"), "set_layer_range_min", "get_layer_range_min");
|
||||
|
@ -443,7 +443,7 @@ void Light2D::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "shadow_color"), "set_shadow_color", "get_shadow_color");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "shadow_buffer_size", PROPERTY_HINT_RANGE, "32,16384,1"), "set_shadow_buffer_size", "get_shadow_buffer_size");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "shadow_filter", PROPERTY_HINT_ENUM, "None,PCF5,PCF13"), "set_shadow_filter", "get_shadow_filter");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "shadow_filter_smooth", PROPERTY_HINT_RANGE, "0,64,0.1"), "set_shadow_smooth", "get_shadow_smooth");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "shadow_filter_smooth", PROPERTY_HINT_RANGE, "0,64,0.1"), "set_shadow_smooth", "get_shadow_smooth");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "shadow_item_cull_mask", PROPERTY_HINT_LAYERS_2D_RENDER), "set_item_shadow_cull_mask", "get_item_shadow_cull_mask");
|
||||
|
||||
BIND_ENUM_CONSTANT(MODE_ADD);
|
||||
|
|
|
@ -401,7 +401,7 @@ void Line2D::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("get_antialiased"), &Line2D::get_antialiased);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "points"), "set_points", "get_points");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "width"), "set_width", "get_width");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "width"), "set_width", "get_width");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "width_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_curve", "get_curve");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "default_color"), "set_default_color", "get_default_color");
|
||||
ADD_GROUP("Fill", "");
|
||||
|
@ -413,7 +413,7 @@ void Line2D::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::INT, "begin_cap_mode", PROPERTY_HINT_ENUM, "None,Box,Round"), "set_begin_cap_mode", "get_begin_cap_mode");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "end_cap_mode", PROPERTY_HINT_ENUM, "None,Box,Round"), "set_end_cap_mode", "get_end_cap_mode");
|
||||
ADD_GROUP("Border", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "sharp_limit"), "set_sharp_limit", "get_sharp_limit");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sharp_limit"), "set_sharp_limit", "get_sharp_limit");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "round_precision"), "set_round_precision", "get_round_precision");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "antialiased"), "set_antialiased", "get_antialiased");
|
||||
|
||||
|
|
|
@ -44,8 +44,8 @@ void Navigation2D::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("set_edge_connection_margin", "margin"), &Navigation2D::set_edge_connection_margin);
|
||||
ClassDB::bind_method(D_METHOD("get_edge_connection_margin"), &Navigation2D::get_edge_connection_margin);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "cell_size"), "set_cell_size", "get_cell_size");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "edge_connection_margin"), "set_edge_connection_margin", "get_edge_connection_margin");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "cell_size"), "set_cell_size", "get_cell_size");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "edge_connection_margin"), "set_edge_connection_margin", "get_edge_connection_margin");
|
||||
}
|
||||
|
||||
void Navigation2D::_notification(int p_what) {
|
||||
|
|
|
@ -74,13 +74,13 @@ void NavigationAgent2D::_bind_methods() {
|
|||
|
||||
ClassDB::bind_method(D_METHOD("_avoidance_done", "new_velocity"), &NavigationAgent2D::_avoidance_done);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "target_desired_distance", PROPERTY_HINT_RANGE, "0.1,100,0.01"), "set_target_desired_distance", "get_target_desired_distance");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_RANGE, "0.1,500,0.01"), "set_radius", "get_radius");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "neighbor_dist", PROPERTY_HINT_RANGE, "0.1,100000,0.01"), "set_neighbor_dist", "get_neighbor_dist");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "target_desired_distance", PROPERTY_HINT_RANGE, "0.1,100,0.01"), "set_target_desired_distance", "get_target_desired_distance");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_RANGE, "0.1,500,0.01"), "set_radius", "get_radius");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "neighbor_dist", PROPERTY_HINT_RANGE, "0.1,100000,0.01"), "set_neighbor_dist", "get_neighbor_dist");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "max_neighbors", PROPERTY_HINT_RANGE, "1,10000,1"), "set_max_neighbors", "get_max_neighbors");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "time_horizon", PROPERTY_HINT_RANGE, "0.1,10000,0.01"), "set_time_horizon", "get_time_horizon");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_speed", PROPERTY_HINT_RANGE, "0.1,100000,0.01"), "set_max_speed", "get_max_speed");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "path_max_distance", PROPERTY_HINT_RANGE, "10,100,1"), "set_path_max_distance", "get_path_max_distance");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "time_horizon", PROPERTY_HINT_RANGE, "0.1,10000,0.01"), "set_time_horizon", "get_time_horizon");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_speed", PROPERTY_HINT_RANGE, "0.1,100000,0.01"), "set_max_speed", "get_max_speed");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "path_max_distance", PROPERTY_HINT_RANGE, "10,100,1"), "set_path_max_distance", "get_path_max_distance");
|
||||
|
||||
ADD_SIGNAL(MethodInfo("path_changed"));
|
||||
ADD_SIGNAL(MethodInfo("target_reached"));
|
||||
|
|
|
@ -440,14 +440,14 @@ void Node2D::_bind_methods() {
|
|||
|
||||
ADD_GROUP("Transform", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "position"), "set_position", "get_position");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "rotation", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_rotation", "get_rotation");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "rotation_degrees", PROPERTY_HINT_RANGE, "-360,360,0.1,or_lesser,or_greater", PROPERTY_USAGE_EDITOR), "set_rotation_degrees", "get_rotation_degrees");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rotation", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_rotation", "get_rotation");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rotation_degrees", PROPERTY_HINT_RANGE, "-360,360,0.1,or_lesser,or_greater", PROPERTY_USAGE_EDITOR), "set_rotation_degrees", "get_rotation_degrees");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "scale"), "set_scale", "get_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "transform", PROPERTY_HINT_NONE, "", 0), "set_transform", "get_transform");
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "global_position", PROPERTY_HINT_NONE, "", 0), "set_global_position", "get_global_position");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "global_rotation", PROPERTY_HINT_NONE, "", 0), "set_global_rotation", "get_global_rotation");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "global_rotation_degrees", PROPERTY_HINT_NONE, "", 0), "set_global_rotation_degrees", "get_global_rotation_degrees");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "global_rotation", PROPERTY_HINT_NONE, "", 0), "set_global_rotation", "get_global_rotation");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "global_rotation_degrees", PROPERTY_HINT_NONE, "", 0), "set_global_rotation_degrees", "get_global_rotation_degrees");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "global_scale", PROPERTY_HINT_NONE, "", 0), "set_global_scale", "get_global_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "global_transform", PROPERTY_HINT_NONE, "", 0), "set_global_transform", "get_global_transform");
|
||||
|
||||
|
|
|
@ -384,12 +384,12 @@ void Particles2D::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "emitting"), "set_emitting", "is_emitting");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "amount", PROPERTY_HINT_EXP_RANGE, "1,1000000,1"), "set_amount", "get_amount");
|
||||
ADD_GROUP("Time", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime", PROPERTY_HINT_RANGE, "0.01,600.0,0.01,or_greater"), "set_lifetime", "get_lifetime");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lifetime", PROPERTY_HINT_RANGE, "0.01,600.0,0.01,or_greater"), "set_lifetime", "get_lifetime");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_shot"), "set_one_shot", "get_one_shot");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "preprocess", PROPERTY_HINT_RANGE, "0.00,600.0,0.01"), "set_pre_process_time", "get_pre_process_time");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed_scale", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_speed_scale", "get_speed_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "preprocess", PROPERTY_HINT_RANGE, "0.00,600.0,0.01"), "set_pre_process_time", "get_pre_process_time");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "speed_scale", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_speed_scale", "get_speed_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "fixed_fps", PROPERTY_HINT_RANGE, "0,1000,1"), "set_fixed_fps", "get_fixed_fps");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fract_delta"), "set_fractional_delta", "get_fractional_delta");
|
||||
ADD_GROUP("Drawing", "");
|
||||
|
|
|
@ -308,14 +308,14 @@ void PathFollow2D::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("set_lookahead", "lookahead"), &PathFollow2D::set_lookahead);
|
||||
ClassDB::bind_method(D_METHOD("get_lookahead"), &PathFollow2D::get_lookahead);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "offset", PROPERTY_HINT_RANGE, "0,10000,0.01,or_lesser,or_greater"), "set_offset", "get_offset");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_offset", PROPERTY_HINT_RANGE, "0,1,0.0001,or_lesser,or_greater", PROPERTY_USAGE_EDITOR), "set_unit_offset", "get_unit_offset");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "h_offset"), "set_h_offset", "get_h_offset");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "v_offset"), "set_v_offset", "get_v_offset");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "offset", PROPERTY_HINT_RANGE, "0,10000,0.01,or_lesser,or_greater"), "set_offset", "get_offset");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "unit_offset", PROPERTY_HINT_RANGE, "0,1,0.0001,or_lesser,or_greater", PROPERTY_USAGE_EDITOR), "set_unit_offset", "get_unit_offset");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "h_offset"), "set_h_offset", "get_h_offset");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "v_offset"), "set_v_offset", "get_v_offset");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "rotate"), "set_rotate", "is_rotating");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cubic_interp"), "set_cubic_interpolation", "get_cubic_interpolation");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "loop"), "set_loop", "has_loop");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "lookahead", PROPERTY_HINT_RANGE, "0.001,1024.0,0.001"), "set_lookahead", "get_lookahead");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lookahead", PROPERTY_HINT_RANGE, "0.001,1024.0,0.001"), "set_lookahead", "get_lookahead");
|
||||
}
|
||||
|
||||
void PathFollow2D::set_offset(float p_offset) {
|
||||
|
|
|
@ -221,7 +221,7 @@ void StaticBody2D::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("_reload_physics_characteristics"), &StaticBody2D::_reload_physics_characteristics);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "constant_linear_velocity"), "set_constant_linear_velocity", "get_constant_linear_velocity");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "constant_angular_velocity"), "set_constant_angular_velocity", "get_constant_angular_velocity");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "constant_angular_velocity"), "set_constant_angular_velocity", "get_constant_angular_velocity");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "physics_material_override", PROPERTY_HINT_RESOURCE_TYPE, "PhysicsMaterial"), "set_physics_material_override", "get_physics_material_override");
|
||||
}
|
||||
|
||||
|
@ -906,11 +906,11 @@ void RigidBody2D::_bind_methods() {
|
|||
BIND_VMETHOD(MethodInfo("_integrate_forces", PropertyInfo(Variant::OBJECT, "state", PROPERTY_HINT_RESOURCE_TYPE, "Physics2DDirectBodyState")));
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Rigid,Static,Character,Kinematic"), "set_mode", "get_mode");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "mass", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01"), "set_mass", "get_mass");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "inertia", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01", 0), "set_inertia", "get_inertia");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "weight", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01", PROPERTY_USAGE_EDITOR), "set_weight", "get_weight");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "mass", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01"), "set_mass", "get_mass");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "inertia", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01", 0), "set_inertia", "get_inertia");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "weight", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01", PROPERTY_USAGE_EDITOR), "set_weight", "get_weight");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "physics_material_override", PROPERTY_HINT_RESOURCE_TYPE, "PhysicsMaterial"), "set_physics_material_override", "get_physics_material_override");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity_scale", PROPERTY_HINT_RANGE, "-128,128,0.01"), "set_gravity_scale", "get_gravity_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "gravity_scale", PROPERTY_HINT_RANGE, "-128,128,0.01"), "set_gravity_scale", "get_gravity_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "custom_integrator"), "set_use_custom_integrator", "is_using_custom_integrator");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "continuous_cd", PROPERTY_HINT_ENUM, "Disabled,Cast Ray,Cast Shape"), "set_continuous_collision_detection_mode", "get_continuous_collision_detection_mode");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "contacts_reported", PROPERTY_HINT_RANGE, "0,64,1,or_greater"), "set_max_contacts_reported", "get_max_contacts_reported");
|
||||
|
@ -919,13 +919,13 @@ void RigidBody2D::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "can_sleep"), "set_can_sleep", "is_able_to_sleep");
|
||||
ADD_GROUP("Linear", "linear_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "linear_velocity"), "set_linear_velocity", "get_linear_velocity");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "linear_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "linear_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp");
|
||||
ADD_GROUP("Angular", "angular_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "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_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_velocity"), "set_angular_velocity", "get_angular_velocity");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"), "set_angular_damp", "get_angular_damp");
|
||||
ADD_GROUP("Applied Forces", "applied_");
|
||||
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_PROPERTY(PropertyInfo(Variant::FLOAT, "applied_torque"), "set_applied_torque", "get_applied_torque");
|
||||
|
||||
ADD_SIGNAL(MethodInfo("body_shape_entered", PropertyInfo(Variant::INT, "body_id"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape"), PropertyInfo(Variant::INT, "local_shape")));
|
||||
ADD_SIGNAL(MethodInfo("body_shape_exited", PropertyInfo(Variant::INT, "body_id"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape"), PropertyInfo(Variant::INT, "local_shape")));
|
||||
|
@ -1357,7 +1357,7 @@ void KinematicBody2D::_bind_methods() {
|
|||
|
||||
ClassDB::bind_method(D_METHOD("_direct_state_changed"), &KinematicBody2D::_direct_state_changed);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "collision/safe_margin", PROPERTY_HINT_RANGE, "0.001,256,0.001"), "set_safe_margin", "get_safe_margin");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "collision/safe_margin", PROPERTY_HINT_RANGE, "0.001,256,0.001"), "set_safe_margin", "get_safe_margin");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "motion/sync_to_physics"), "set_sync_to_physics", "is_sync_to_physics_enabled");
|
||||
}
|
||||
|
||||
|
|
|
@ -700,19 +700,19 @@ void Polygon2D::_bind_methods() {
|
|||
ADD_GROUP("Texture2D", "texture_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "texture_offset"), "set_texture_offset", "get_texture_offset");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "texture_scale"), "set_texture_scale", "get_texture_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "texture_rotation_degrees", PROPERTY_HINT_RANGE, "-360,360,0.1,or_lesser,or_greater"), "set_texture_rotation_degrees", "get_texture_rotation_degrees");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "texture_rotation", PROPERTY_HINT_NONE, "", 0), "set_texture_rotation", "get_texture_rotation");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "texture_rotation_degrees", PROPERTY_HINT_RANGE, "-360,360,0.1,or_lesser,or_greater"), "set_texture_rotation_degrees", "get_texture_rotation_degrees");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "texture_rotation", PROPERTY_HINT_NONE, "", 0), "set_texture_rotation", "get_texture_rotation");
|
||||
ADD_GROUP("Lighting", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "normal_map", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_normal_map", "get_normal_map");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "specular_map", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_specular_map", "get_specular_map");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "specular_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_specular_color", "get_specular_color");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "shininess", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_shininess", "get_shininess");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "shininess", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_shininess", "get_shininess");
|
||||
ADD_GROUP("Skeleton", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "skeleton", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "Skeleton2D"), "set_skeleton", "get_skeleton");
|
||||
|
||||
ADD_GROUP("Invert", "invert_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "invert_enable"), "set_invert", "get_invert");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "invert_border", PROPERTY_HINT_RANGE, "0.1,16384,0.1"), "set_invert_border", "get_invert_border");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "invert_border", PROPERTY_HINT_RANGE, "0.1,16384,0.1"), "set_invert_border", "get_invert_border");
|
||||
|
||||
ADD_GROUP("Data", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "polygon"), "set_polygon", "get_polygon");
|
||||
|
|
|
@ -96,7 +96,7 @@ void Position2D::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("_set_gizmo_extents", "extents"), &Position2D::set_gizmo_extents);
|
||||
ClassDB::bind_method(D_METHOD("_get_gizmo_extents"), &Position2D::get_gizmo_extents);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "gizmo_extents", PROPERTY_HINT_RANGE, "0,1000,0.1,or_greater", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_INTERNAL), "_set_gizmo_extents", "_get_gizmo_extents");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "gizmo_extents", PROPERTY_HINT_RANGE, "0,1000,0.1,or_greater", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_INTERNAL), "_set_gizmo_extents", "_get_gizmo_extents");
|
||||
}
|
||||
|
||||
Position2D::Position2D() {
|
||||
|
|
|
@ -90,7 +90,7 @@ void Bone2D::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("get_default_length"), &Bone2D::get_default_length);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "rest"), "set_rest", "get_rest");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "default_length", PROPERTY_HINT_RANGE, "1,1024,1"), "set_default_length", "get_default_length");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "default_length", PROPERTY_HINT_RANGE, "1,1024,1"), "set_default_length", "get_default_length");
|
||||
}
|
||||
|
||||
void Bone2D::set_rest(const Transform2D &p_rest) {
|
||||
|
|
|
@ -502,7 +502,7 @@ void Sprite::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "normal_map", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_normal_map", "get_normal_map");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "specular_map", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_specular_map", "get_specular_map");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "specular_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_specular_color", "get_specular_color");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "shininess", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_shininess", "get_shininess");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "shininess", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_shininess", "get_shininess");
|
||||
ADD_GROUP("Offset", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "centered"), "set_centered", "is_centered");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "offset"), "set_offset", "get_offset");
|
||||
|
|
|
@ -1909,8 +1909,8 @@ void TileMap::_bind_methods() {
|
|||
ADD_GROUP("Collision", "collision_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "collision_use_parent", PROPERTY_HINT_NONE, ""), "set_collision_use_parent", "get_collision_use_parent");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "collision_use_kinematic", PROPERTY_HINT_NONE, ""), "set_collision_use_kinematic", "get_collision_use_kinematic");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "collision_friction", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_collision_friction", "get_collision_friction");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "collision_bounce", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_collision_bounce", "get_collision_bounce");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "collision_friction", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_collision_friction", "get_collision_friction");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "collision_bounce", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_collision_bounce", "get_collision_bounce");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_layer", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_collision_layer", "get_collision_layer");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_collision_mask", "get_collision_mask");
|
||||
|
||||
|
|
|
@ -706,11 +706,11 @@ void Area::_bind_methods() {
|
|||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "space_override", PROPERTY_HINT_ENUM, "Disabled,Combine,Combine-Replace,Replace,Replace-Combine"), "set_space_override_mode", "get_space_override_mode");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "gravity_point"), "set_gravity_is_point", "is_gravity_a_point");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity_distance_scale", PROPERTY_HINT_EXP_RANGE, "0,1024,0.001,or_greater"), "set_gravity_distance_scale", "get_gravity_distance_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "gravity_distance_scale", PROPERTY_HINT_EXP_RANGE, "0,1024,0.001,or_greater"), "set_gravity_distance_scale", "get_gravity_distance_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "gravity_vec"), "set_gravity_vector", "get_gravity_vector");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity", PROPERTY_HINT_RANGE, "-1024,1024,0.01"), "set_gravity", "get_gravity");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "linear_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_angular_damp", "get_angular_damp");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "gravity", PROPERTY_HINT_RANGE, "-1024,1024,0.01"), "set_gravity", "get_gravity");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "linear_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_angular_damp", "get_angular_damp");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "priority", PROPERTY_HINT_RANGE, "0,128,1"), "set_priority", "get_priority");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitoring"), "set_monitoring", "is_monitoring");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitorable"), "set_monitorable", "is_monitorable");
|
||||
|
@ -723,8 +723,8 @@ void Area::_bind_methods() {
|
|||
ADD_GROUP("Reverb Bus", "reverb_bus_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "reverb_bus_enable"), "set_use_reverb_bus", "is_using_reverb_bus");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "reverb_bus_name", PROPERTY_HINT_ENUM, ""), "set_reverb_bus", "get_reverb_bus");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "reverb_bus_amount", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_reverb_amount", "get_reverb_amount");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "reverb_bus_uniformity", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_reverb_uniformity", "get_reverb_uniformity");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "reverb_bus_amount", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_reverb_amount", "get_reverb_amount");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "reverb_bus_uniformity", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_reverb_uniformity", "get_reverb_uniformity");
|
||||
|
||||
BIND_ENUM_CONSTANT(SPACE_OVERRIDE_DISABLED);
|
||||
BIND_ENUM_CONSTANT(SPACE_OVERRIDE_COMBINE);
|
||||
|
|
|
@ -252,7 +252,7 @@ void ARVRController::_bind_methods() {
|
|||
|
||||
ClassDB::bind_method(D_METHOD("get_rumble"), &ARVRController::get_rumble);
|
||||
ClassDB::bind_method(D_METHOD("set_rumble", "rumble"), &ARVRController::set_rumble);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "rumble", PROPERTY_HINT_RANGE, "0.0,1.0,0.01"), "set_rumble", "get_rumble");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rumble", PROPERTY_HINT_RANGE, "0.0,1.0,0.01"), "set_rumble", "get_rumble");
|
||||
ADD_PROPERTY_DEFAULT("rumble", 0.0);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_mesh"), &ARVRController::get_mesh);
|
||||
|
@ -544,7 +544,7 @@ String ARVROrigin::get_configuration_warning() const {
|
|||
void ARVROrigin::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_world_scale", "world_scale"), &ARVROrigin::set_world_scale);
|
||||
ClassDB::bind_method(D_METHOD("get_world_scale"), &ARVROrigin::get_world_scale);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "world_scale"), "set_world_scale", "get_world_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "world_scale"), "set_world_scale", "get_world_scale");
|
||||
};
|
||||
|
||||
void ARVROrigin::set_tracked_camera(ARVRCamera *p_tracked_camera) {
|
||||
|
|
|
@ -1012,24 +1012,24 @@ void AudioStreamPlayer3D::_bind_methods() {
|
|||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream"), "set_stream", "get_stream");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "attenuation_model", PROPERTY_HINT_ENUM, "Inverse,InverseSquare,Log,Disabled"), "set_attenuation_model", "get_attenuation_model");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_db", PROPERTY_HINT_RANGE, "-80,80"), "set_unit_db", "get_unit_db");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_size", PROPERTY_HINT_RANGE, "0.1,100,0.1"), "set_unit_size", "get_unit_size");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_db", PROPERTY_HINT_RANGE, "-24,6"), "set_max_db", "get_max_db");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "pitch_scale", PROPERTY_HINT_RANGE, "0.01,4,0.01,or_greater"), "set_pitch_scale", "get_pitch_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "unit_db", PROPERTY_HINT_RANGE, "-80,80"), "set_unit_db", "get_unit_db");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "unit_size", PROPERTY_HINT_RANGE, "0.1,100,0.1"), "set_unit_size", "get_unit_size");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_db", PROPERTY_HINT_RANGE, "-24,6"), "set_max_db", "get_max_db");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "pitch_scale", PROPERTY_HINT_RANGE, "0.01,4,0.01,or_greater"), "set_pitch_scale", "get_pitch_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playing", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "_set_playing", "is_playing");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autoplay"), "set_autoplay", "is_autoplay_enabled");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "stream_paused", PROPERTY_HINT_NONE, ""), "set_stream_paused", "get_stream_paused");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_distance", PROPERTY_HINT_EXP_RANGE, "0,4096,1,or_greater"), "set_max_distance", "get_max_distance");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_distance", PROPERTY_HINT_EXP_RANGE, "0,4096,1,or_greater"), "set_max_distance", "get_max_distance");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "out_of_range_mode", PROPERTY_HINT_ENUM, "Mix,Pause"), "set_out_of_range_mode", "get_out_of_range_mode");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "bus", PROPERTY_HINT_ENUM, ""), "set_bus", "get_bus");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "area_mask", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_area_mask", "get_area_mask");
|
||||
ADD_GROUP("Emission Angle", "emission_angle");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "emission_angle_enabled"), "set_emission_angle_enabled", "is_emission_angle_enabled");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_angle_degrees", PROPERTY_HINT_RANGE, "0.1,90,0.1"), "set_emission_angle", "get_emission_angle");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_angle_filter_attenuation_db", PROPERTY_HINT_RANGE, "-80,0,0.1"), "set_emission_angle_filter_attenuation_db", "get_emission_angle_filter_attenuation_db");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "emission_angle_degrees", PROPERTY_HINT_RANGE, "0.1,90,0.1"), "set_emission_angle", "get_emission_angle");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "emission_angle_filter_attenuation_db", PROPERTY_HINT_RANGE, "-80,0,0.1"), "set_emission_angle_filter_attenuation_db", "get_emission_angle_filter_attenuation_db");
|
||||
ADD_GROUP("Attenuation Filter", "attenuation_filter_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "attenuation_filter_cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_attenuation_filter_cutoff_hz", "get_attenuation_filter_cutoff_hz");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "attenuation_filter_db", PROPERTY_HINT_RANGE, "-80,0,0.1"), "set_attenuation_filter_db", "get_attenuation_filter_db");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "attenuation_filter_cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_attenuation_filter_cutoff_hz", "get_attenuation_filter_cutoff_hz");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "attenuation_filter_db", PROPERTY_HINT_RANGE, "-80,0,0.1"), "set_attenuation_filter_db", "get_attenuation_filter_db");
|
||||
ADD_GROUP("Doppler", "doppler_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "doppler_tracking", PROPERTY_HINT_ENUM, "Disabled,Idle,Physics"), "set_doppler_tracking", "get_doppler_tracking");
|
||||
|
||||
|
|
|
@ -174,7 +174,7 @@ void BakedLightmapData::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::AABB, "bounds", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_bounds", "get_bounds");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM, "cell_space_transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_cell_space_transform", "get_cell_space_transform");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "cell_subdiv", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_cell_subdiv", "get_cell_subdiv");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "energy", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_energy", "get_energy");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "energy", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_energy", "get_energy");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::PACKED_BYTE_ARRAY, "octree", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_octree", "get_octree");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "user_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_user_data", "_get_user_data");
|
||||
}
|
||||
|
@ -819,16 +819,16 @@ void BakedLightmap::_bind_methods() {
|
|||
ClassDB::set_method_flags(get_class_static(), _scs_create("debug_bake"), METHOD_FLAGS_DEFAULT | METHOD_FLAG_EDITOR);
|
||||
|
||||
ADD_GROUP("Bake", "bake_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "bake_cell_size", PROPERTY_HINT_RANGE, "0.01,64,0.01"), "set_bake_cell_size", "get_bake_cell_size");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bake_cell_size", PROPERTY_HINT_RANGE, "0.01,64,0.01"), "set_bake_cell_size", "get_bake_cell_size");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "bake_quality", PROPERTY_HINT_ENUM, "Low,Medium,High"), "set_bake_quality", "get_bake_quality");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "bake_mode", PROPERTY_HINT_ENUM, "ConeTrace,RayTrace"), "set_bake_mode", "get_bake_mode");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "bake_propagation", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_propagation", "get_propagation");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "bake_energy", PROPERTY_HINT_RANGE, "0,32,0.01"), "set_energy", "get_energy");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bake_propagation", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_propagation", "get_propagation");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bake_energy", PROPERTY_HINT_RANGE, "0,32,0.01"), "set_energy", "get_energy");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "bake_hdr"), "set_hdr", "is_hdr");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "bake_extents"), "set_extents", "get_extents");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "bake_default_texels_per_unit"), "set_bake_default_texels_per_unit", "get_bake_default_texels_per_unit");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bake_default_texels_per_unit"), "set_bake_default_texels_per_unit", "get_bake_default_texels_per_unit");
|
||||
ADD_GROUP("Capture", "capture_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "capture_cell_size", PROPERTY_HINT_RANGE, "0.01,64,0.01"), "set_capture_cell_size", "get_capture_cell_size");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "capture_cell_size", PROPERTY_HINT_RANGE, "0.01,64,0.01"), "set_capture_cell_size", "get_capture_cell_size");
|
||||
ADD_GROUP("Data", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::STRING, "image_path", PROPERTY_HINT_DIR), "set_image_path", "get_image_path");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "light_data", PROPERTY_HINT_RESOURCE_TYPE, "BakedLightmapData"), "set_light_data", "get_light_data");
|
||||
|
|
|
@ -545,16 +545,16 @@ void Camera::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::INT, "cull_mask", PROPERTY_HINT_LAYERS_3D_RENDER), "set_cull_mask", "get_cull_mask");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment"), "set_environment", "get_environment");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "effects", PROPERTY_HINT_RESOURCE_TYPE, "CameraEffects"), "set_effects", "get_effects");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "h_offset"), "set_h_offset", "get_h_offset");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "v_offset"), "set_v_offset", "get_v_offset");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "h_offset"), "set_h_offset", "get_h_offset");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "v_offset"), "set_v_offset", "get_v_offset");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "doppler_tracking", PROPERTY_HINT_ENUM, "Disabled,Idle,Physics"), "set_doppler_tracking", "get_doppler_tracking");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "projection", PROPERTY_HINT_ENUM, "Perspective,Orthogonal,Frustum"), "set_projection", "get_projection");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "current"), "set_current", "is_current");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "fov", PROPERTY_HINT_RANGE, "1,179,0.1"), "set_fov", "get_fov");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "size", PROPERTY_HINT_RANGE, "0.1,16384,0.01"), "set_size", "get_size");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "fov", PROPERTY_HINT_RANGE, "1,179,0.1"), "set_fov", "get_fov");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "size", PROPERTY_HINT_RANGE, "0.1,16384,0.01"), "set_size", "get_size");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "frustum_offset"), "set_frustum_offset", "get_frustum_offset");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "near", PROPERTY_HINT_EXP_RANGE, "0.01,8192,0.01,or_greater"), "set_znear", "get_znear");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "far", PROPERTY_HINT_EXP_RANGE, "0.1,8192,0.1,or_greater"), "set_zfar", "get_zfar");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "near", PROPERTY_HINT_EXP_RANGE, "0.01,8192,0.01,or_greater"), "set_znear", "get_znear");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "far", PROPERTY_HINT_EXP_RANGE, "0.1,8192,0.1,or_greater"), "set_zfar", "get_zfar");
|
||||
|
||||
BIND_ENUM_CONSTANT(PROJECTION_PERSPECTIVE);
|
||||
BIND_ENUM_CONSTANT(PROJECTION_ORTHOGONAL);
|
||||
|
@ -926,7 +926,7 @@ void ClippedCamera::_bind_methods() {
|
|||
|
||||
ClassDB::bind_method(D_METHOD("clear_exceptions"), &ClippedCamera::clear_exceptions);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "margin", PROPERTY_HINT_RANGE, "0,32,0.01"), "set_margin", "get_margin");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "margin", PROPERTY_HINT_RANGE, "0,32,0.01"), "set_margin", "get_margin");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_process_mode", "get_process_mode");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_mask", "get_collision_mask");
|
||||
|
||||
|
|
|
@ -191,7 +191,7 @@ void CollisionPolygon::_bind_methods() {
|
|||
|
||||
ClassDB::bind_method(D_METHOD("_is_editable_3d_polygon"), &CollisionPolygon::_is_editable_3d_polygon);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "depth"), "set_depth", "get_depth");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "depth"), "set_depth", "get_depth");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "polygon"), "set_polygon", "get_polygon");
|
||||
}
|
||||
|
|
|
@ -1327,13 +1327,13 @@ void CPUParticles::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "emitting"), "set_emitting", "is_emitting");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "amount", PROPERTY_HINT_EXP_RANGE, "1,1000000,1"), "set_amount", "get_amount");
|
||||
ADD_GROUP("Time", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime", PROPERTY_HINT_EXP_RANGE, "0.01,600.0,0.01,or_greater"), "set_lifetime", "get_lifetime");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lifetime", PROPERTY_HINT_EXP_RANGE, "0.01,600.0,0.01,or_greater"), "set_lifetime", "get_lifetime");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_shot"), "set_one_shot", "get_one_shot");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "preprocess", PROPERTY_HINT_EXP_RANGE, "0.00,600.0,0.01"), "set_pre_process_time", "get_pre_process_time");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed_scale", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_speed_scale", "get_speed_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime_randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_lifetime_randomness", "get_lifetime_randomness");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "preprocess", PROPERTY_HINT_EXP_RANGE, "0.00,600.0,0.01"), "set_pre_process_time", "get_pre_process_time");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "speed_scale", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_speed_scale", "get_speed_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lifetime_randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_lifetime_randomness", "get_lifetime_randomness");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "fixed_fps", PROPERTY_HINT_RANGE, "0,1000,1"), "set_fixed_fps", "get_fixed_fps");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fract_delta"), "set_fractional_delta", "get_fractional_delta");
|
||||
ADD_GROUP("Drawing", "");
|
||||
|
@ -1401,7 +1401,7 @@ void CPUParticles::_bind_methods() {
|
|||
|
||||
ADD_GROUP("Emission Shape", "emission_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "emission_shape", PROPERTY_HINT_ENUM, "Point,Sphere,Box,Points,Directed Points"), "set_emission_shape", "get_emission_shape");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_sphere_radius", PROPERTY_HINT_RANGE, "0.01,128,0.01"), "set_emission_sphere_radius", "get_emission_sphere_radius");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "emission_sphere_radius", PROPERTY_HINT_RANGE, "0.01,128,0.01"), "set_emission_sphere_radius", "get_emission_sphere_radius");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "emission_box_extents"), "set_emission_box_extents", "get_emission_box_extents");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR3_ARRAY, "emission_points"), "set_emission_points", "get_emission_points");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR3_ARRAY, "emission_normals"), "set_emission_normals", "get_emission_normals");
|
||||
|
@ -1412,59 +1412,59 @@ void CPUParticles::_bind_methods() {
|
|||
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flag_disable_z"), "set_particle_flag", "get_particle_flag", FLAG_DISABLE_Z);
|
||||
ADD_GROUP("Direction", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "direction"), "set_direction", "get_direction");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "spread", PROPERTY_HINT_RANGE, "0,180,0.01"), "set_spread", "get_spread");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "flatness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_flatness", "get_flatness");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "spread", PROPERTY_HINT_RANGE, "0,180,0.01"), "set_spread", "get_spread");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "flatness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_flatness", "get_flatness");
|
||||
ADD_GROUP("Gravity", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "gravity"), "set_gravity", "get_gravity");
|
||||
ADD_GROUP("Initial Velocity", "initial_");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "initial_velocity", PROPERTY_HINT_RANGE, "0,1000,0.01,or_greater"), "set_param", "get_param", PARAM_INITIAL_LINEAR_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "initial_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_INITIAL_LINEAR_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "initial_velocity", PROPERTY_HINT_RANGE, "0,1000,0.01,or_greater"), "set_param", "get_param", PARAM_INITIAL_LINEAR_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "initial_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_INITIAL_LINEAR_VELOCITY);
|
||||
ADD_GROUP("Angular Velocity", "angular_");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_velocity", PROPERTY_HINT_RANGE, "-720,720,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_ANGULAR_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGULAR_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_velocity", PROPERTY_HINT_RANGE, "-720,720,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_ANGULAR_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGULAR_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "angular_velocity_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ANGULAR_VELOCITY);
|
||||
ADD_GROUP("Orbit Velocity", "orbit_");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "orbit_velocity", PROPERTY_HINT_RANGE, "-1000,1000,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_ORBIT_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "orbit_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ORBIT_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "orbit_velocity", PROPERTY_HINT_RANGE, "-1000,1000,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_ORBIT_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "orbit_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ORBIT_VELOCITY);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "orbit_velocity_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ORBIT_VELOCITY);
|
||||
ADD_GROUP("Linear Accel", "linear_");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_LINEAR_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_LINEAR_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_LINEAR_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_LINEAR_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "linear_accel_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_LINEAR_ACCEL);
|
||||
ADD_GROUP("Radial Accel", "radial_");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "radial_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_RADIAL_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "radial_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_RADIAL_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "radial_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_RADIAL_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "radial_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_RADIAL_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "radial_accel_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_RADIAL_ACCEL);
|
||||
ADD_GROUP("Tangential Accel", "tangential_");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "tangential_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_TANGENTIAL_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "tangential_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_TANGENTIAL_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "tangential_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_TANGENTIAL_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "tangential_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_TANGENTIAL_ACCEL);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "tangential_accel_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_TANGENTIAL_ACCEL);
|
||||
ADD_GROUP("Damping", "");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "damping", PROPERTY_HINT_RANGE, "0,100,0.01"), "set_param", "get_param", PARAM_DAMPING);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "damping_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_DAMPING);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "damping", PROPERTY_HINT_RANGE, "0,100,0.01"), "set_param", "get_param", PARAM_DAMPING);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "damping_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_DAMPING);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "damping_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_DAMPING);
|
||||
ADD_GROUP("Angle", "");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angle", PROPERTY_HINT_RANGE, "-720,720,0.1,or_lesser,or_greater"), "set_param", "get_param", PARAM_ANGLE);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angle_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGLE);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angle", PROPERTY_HINT_RANGE, "-720,720,0.1,or_lesser,or_greater"), "set_param", "get_param", PARAM_ANGLE);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angle_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGLE);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "angle_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ANGLE);
|
||||
ADD_GROUP("Scale", "");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "scale_amount", PROPERTY_HINT_RANGE, "0,1000,0.01,or_greater"), "set_param", "get_param", PARAM_SCALE);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "scale_amount_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_SCALE);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "scale_amount", PROPERTY_HINT_RANGE, "0,1000,0.01,or_greater"), "set_param", "get_param", PARAM_SCALE);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "scale_amount_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_SCALE);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "scale_amount_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_SCALE);
|
||||
ADD_GROUP("Color", "");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_color", "get_color");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "color_ramp", PROPERTY_HINT_RESOURCE_TYPE, "Gradient"), "set_color_ramp", "get_color_ramp");
|
||||
|
||||
ADD_GROUP("Hue Variation", "hue_");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "hue_variation", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_param", "get_param", PARAM_HUE_VARIATION);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "hue_variation_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_HUE_VARIATION);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "hue_variation", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_param", "get_param", PARAM_HUE_VARIATION);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "hue_variation_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_HUE_VARIATION);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "hue_variation_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_HUE_VARIATION);
|
||||
ADD_GROUP("Animation", "anim_");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_speed", PROPERTY_HINT_RANGE, "0,128,0.01,or_greater"), "set_param", "get_param", PARAM_ANIM_SPEED);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_speed_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_SPEED);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anim_speed", PROPERTY_HINT_RANGE, "0,128,0.01,or_greater"), "set_param", "get_param", PARAM_ANIM_SPEED);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anim_speed_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_SPEED);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "anim_speed_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ANIM_SPEED);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_offset", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_ANIM_OFFSET);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_offset_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_OFFSET);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anim_offset", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_ANIM_OFFSET);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anim_offset_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_OFFSET);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "anim_offset_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ANIM_OFFSET);
|
||||
|
||||
BIND_ENUM_CONSTANT(PARAM_INITIAL_LINEAR_VELOCITY);
|
||||
|
|
|
@ -271,13 +271,13 @@ void GIProbeData::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_data", "_get_data");
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "dynamic_range", PROPERTY_HINT_RANGE, "0,8,0.01"), "set_dynamic_range", "get_dynamic_range");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "energy", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_energy", "get_energy");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "bias", PROPERTY_HINT_RANGE, "0,8,0.01"), "set_bias", "get_bias");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "normal_bias", PROPERTY_HINT_RANGE, "0,8,0.01"), "set_normal_bias", "get_normal_bias");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "propagation", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_propagation", "get_propagation");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "anisotropy_strength", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_anisotropy_strength", "get_anisotropy_strength");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "ao", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_ao", "get_ao");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "ao_size", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_ao_size", "get_ao_size");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "energy", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_energy", "get_energy");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bias", PROPERTY_HINT_RANGE, "0,8,0.01"), "set_bias", "get_bias");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "normal_bias", PROPERTY_HINT_RANGE, "0,8,0.01"), "set_normal_bias", "get_normal_bias");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "propagation", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_propagation", "get_propagation");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "anisotropy_strength", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_anisotropy_strength", "get_anisotropy_strength");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ao", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_ao", "get_ao");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ao_size", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_ao_size", "get_ao_size");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_two_bounces"), "set_use_two_bounces", "is_using_two_bounces");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "interior"), "set_interior", "is_interior");
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ void InterpolatedCamera::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("is_interpolation_enabled"), &InterpolatedCamera::is_interpolation_enabled);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "target"), "set_target_path", "get_target_path");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed"), "set_speed", "get_speed");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "speed"), "set_speed", "get_speed");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "enabled"), "set_interpolation_enabled", "is_interpolation_enabled");
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue