Style: Apply new clang-format 5.0 style to all files
This commit is contained in:
parent
a8ceb7e3f2
commit
13c2ff9320
|
@ -49,10 +49,10 @@ struct MethodDefinition {
|
||||||
StringName name;
|
StringName name;
|
||||||
Vector<StringName> args;
|
Vector<StringName> args;
|
||||||
MethodDefinition() {}
|
MethodDefinition() {}
|
||||||
MethodDefinition(const char *p_name)
|
MethodDefinition(const char *p_name) :
|
||||||
: name(p_name) {}
|
name(p_name) {}
|
||||||
MethodDefinition(const StringName &p_name)
|
MethodDefinition(const StringName &p_name) :
|
||||||
: name(p_name) {}
|
name(p_name) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
MethodDefinition D_METHOD(const char *p_name);
|
MethodDefinition D_METHOD(const char *p_name);
|
||||||
|
|
|
@ -31,22 +31,22 @@
|
||||||
|
|
||||||
CoreStringNames *CoreStringNames::singleton = NULL;
|
CoreStringNames *CoreStringNames::singleton = NULL;
|
||||||
|
|
||||||
CoreStringNames::CoreStringNames()
|
CoreStringNames::CoreStringNames() :
|
||||||
: _free(StaticCString::create("free")),
|
_free(StaticCString::create("free")),
|
||||||
changed(StaticCString::create("changed")),
|
changed(StaticCString::create("changed")),
|
||||||
_meta(StaticCString::create("__meta__")),
|
_meta(StaticCString::create("__meta__")),
|
||||||
_script(StaticCString::create("script")),
|
_script(StaticCString::create("script")),
|
||||||
script_changed(StaticCString::create("script_changed")),
|
script_changed(StaticCString::create("script_changed")),
|
||||||
___pdcdata(StaticCString::create("___pdcdata")),
|
___pdcdata(StaticCString::create("___pdcdata")),
|
||||||
__getvar(StaticCString::create("__getvar")),
|
__getvar(StaticCString::create("__getvar")),
|
||||||
_iter_init(StaticCString::create("_iter_init")),
|
_iter_init(StaticCString::create("_iter_init")),
|
||||||
_iter_next(StaticCString::create("_iter_next")),
|
_iter_next(StaticCString::create("_iter_next")),
|
||||||
_iter_get(StaticCString::create("_iter_get")),
|
_iter_get(StaticCString::create("_iter_get")),
|
||||||
get_rid(StaticCString::create("get_rid")),
|
get_rid(StaticCString::create("get_rid")),
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
_sections_unfolded(StaticCString::create("_sections_unfolded")),
|
_sections_unfolded(StaticCString::create("_sections_unfolded")),
|
||||||
#endif
|
#endif
|
||||||
_custom_features(StaticCString::create("_custom_features")) {
|
_custom_features(StaticCString::create("_custom_features")) {
|
||||||
|
|
||||||
x = StaticCString::create("x");
|
x = StaticCString::create("x");
|
||||||
y = StaticCString::create("y");
|
y = StaticCString::create("y");
|
||||||
|
|
|
@ -149,7 +149,7 @@ class PoolVector {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (old_alloc->refcount.unref() == true) {
|
if (old_alloc->refcount.unref() == true) {
|
||||||
//this should never happen but..
|
//this should never happen but..
|
||||||
|
|
||||||
#ifdef DEBUG_ENABLED
|
#ifdef DEBUG_ENABLED
|
||||||
MemoryPool::alloc_mutex->lock();
|
MemoryPool::alloc_mutex->lock();
|
||||||
|
|
|
@ -41,9 +41,9 @@ public:
|
||||||
struct Singleton {
|
struct Singleton {
|
||||||
StringName name;
|
StringName name;
|
||||||
Object *ptr;
|
Object *ptr;
|
||||||
Singleton(const StringName &p_name = StringName(), Object *p_ptr = NULL)
|
Singleton(const StringName &p_name = StringName(), Object *p_ptr = NULL) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
ptr(p_ptr) {
|
ptr(p_ptr) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -45,15 +45,15 @@ struct _GlobalConstant {
|
||||||
_GlobalConstant() {}
|
_GlobalConstant() {}
|
||||||
|
|
||||||
#ifdef DEBUG_METHODS_ENABLED
|
#ifdef DEBUG_METHODS_ENABLED
|
||||||
_GlobalConstant(const StringName &p_enum_name, const char *p_name, int p_value)
|
_GlobalConstant(const StringName &p_enum_name, const char *p_name, int p_value) :
|
||||||
: enum_name(p_enum_name),
|
enum_name(p_enum_name),
|
||||||
name(p_name),
|
name(p_name),
|
||||||
value(p_value) {
|
value(p_value) {
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
_GlobalConstant(const char *p_name, int p_value)
|
_GlobalConstant(const char *p_name, int p_value) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
value(p_value) {
|
value(p_value) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
|
@ -63,9 +63,9 @@ public:
|
||||||
TData data;
|
TData data;
|
||||||
|
|
||||||
Pair() {}
|
Pair() {}
|
||||||
Pair(const TKey &p_key, const TData &p_data)
|
Pair(const TKey &p_key, const TData &p_data) :
|
||||||
: key(p_key),
|
key(p_key),
|
||||||
data(p_data) {
|
data(p_data) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -44,10 +44,10 @@ Variant fieldwise_assign(const Variant &p_target, const Variant &p_source, const
|
||||||
|
|
||||||
ERR_FAIL_COND_V(p_target.get_type() != p_source.get_type(), p_target);
|
ERR_FAIL_COND_V(p_target.get_type() != p_source.get_type(), p_target);
|
||||||
|
|
||||||
switch (p_source.get_type()) {
|
/* clang-format makes a mess of this macro usage */
|
||||||
|
/* clang-format off */
|
||||||
|
|
||||||
/* clang-format makes a mess of this macro usage */
|
switch (p_source.get_type()) {
|
||||||
/* clang-format off */
|
|
||||||
|
|
||||||
case Variant::VECTOR2: {
|
case Variant::VECTOR2: {
|
||||||
|
|
||||||
|
@ -174,9 +174,8 @@ Variant fieldwise_assign(const Variant &p_target, const Variant &p_source, const
|
||||||
default: {
|
default: {
|
||||||
ERR_FAIL_V(p_target);
|
ERR_FAIL_V(p_target);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clang-format on */
|
|
||||||
}
|
}
|
||||||
|
/* clang-format on */
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // TOOLS_ENABLED
|
#endif // TOOLS_ENABLED
|
||||||
|
|
|
@ -313,9 +313,9 @@ bool FileAccessPack::file_exists(const String &p_name) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileAccessPack::FileAccessPack(const String &p_path, const PackedData::PackedFile &p_file)
|
FileAccessPack::FileAccessPack(const String &p_path, const PackedData::PackedFile &p_file) :
|
||||||
: pf(p_file),
|
pf(p_file),
|
||||||
f(FileAccess::open(pf.pack, FileAccess::READ)) {
|
f(FileAccess::open(pf.pack, FileAccess::READ)) {
|
||||||
if (!f) {
|
if (!f) {
|
||||||
ERR_EXPLAIN("Can't open pack-referenced file: " + String(pf.pack));
|
ERR_EXPLAIN("Can't open pack-referenced file: " + String(pf.pack));
|
||||||
ERR_FAIL_COND(!f);
|
ERR_FAIL_COND(!f);
|
||||||
|
|
|
@ -159,8 +159,8 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
|
||||||
r_variant = str;
|
r_variant = str;
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
// math types
|
|
||||||
|
|
||||||
|
// math types
|
||||||
case Variant::VECTOR2: {
|
case Variant::VECTOR2: {
|
||||||
|
|
||||||
ERR_FAIL_COND_V(len < (int)4 * 2, ERR_INVALID_DATA);
|
ERR_FAIL_COND_V(len < (int)4 * 2, ERR_INVALID_DATA);
|
||||||
|
@ -959,8 +959,8 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
|
||||||
_encode_string(p_variant, buf, r_len);
|
_encode_string(p_variant, buf, r_len);
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
// math types
|
|
||||||
|
|
||||||
|
// math types
|
||||||
case Variant::VECTOR2: {
|
case Variant::VECTOR2: {
|
||||||
|
|
||||||
if (buf) {
|
if (buf) {
|
||||||
|
|
|
@ -90,9 +90,9 @@ public:
|
||||||
PropertyInfo option;
|
PropertyInfo option;
|
||||||
Variant default_value;
|
Variant default_value;
|
||||||
|
|
||||||
ImportOption(const PropertyInfo &p_info, const Variant &p_default)
|
ImportOption(const PropertyInfo &p_info, const Variant &p_default) :
|
||||||
: option(p_info),
|
option(p_info),
|
||||||
default_value(p_default) {
|
default_value(p_default) {
|
||||||
}
|
}
|
||||||
ImportOption() {}
|
ImportOption() {}
|
||||||
};
|
};
|
||||||
|
|
|
@ -59,8 +59,8 @@ class AStar : public Reference {
|
||||||
Point *prev_point;
|
Point *prev_point;
|
||||||
real_t distance;
|
real_t distance;
|
||||||
|
|
||||||
Point()
|
Point() :
|
||||||
: list(this) {}
|
list(this) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
Map<int, Point *> points;
|
Map<int, Point *> points;
|
||||||
|
|
|
@ -101,9 +101,9 @@ public:
|
||||||
operator String() const;
|
operator String() const;
|
||||||
|
|
||||||
_FORCE_INLINE_ AABB() {}
|
_FORCE_INLINE_ AABB() {}
|
||||||
inline AABB(const Vector3 &p_pos, const Vector3 &p_size)
|
inline AABB(const Vector3 &p_pos, const Vector3 &p_size) :
|
||||||
: position(p_pos),
|
position(p_pos),
|
||||||
size(p_size) {
|
size(p_size) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -577,11 +577,11 @@ BSP_Tree::BSP_Tree(const PoolVector<Face3> &p_faces, real_t p_error_radius) {
|
||||||
error_radius = p_error_radius;
|
error_radius = p_error_radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
BSP_Tree::BSP_Tree(const Vector<Node> &p_nodes, const Vector<Plane> &p_planes, const AABB &p_aabb, real_t p_error_radius)
|
BSP_Tree::BSP_Tree(const Vector<Node> &p_nodes, const Vector<Plane> &p_planes, const AABB &p_aabb, real_t p_error_radius) :
|
||||||
: nodes(p_nodes),
|
nodes(p_nodes),
|
||||||
planes(p_planes),
|
planes(p_planes),
|
||||||
aabb(p_aabb),
|
aabb(p_aabb),
|
||||||
error_radius(p_error_radius) {
|
error_radius(p_error_radius) {
|
||||||
}
|
}
|
||||||
|
|
||||||
BSP_Tree::~BSP_Tree() {
|
BSP_Tree::~BSP_Tree() {
|
||||||
|
|
|
@ -195,9 +195,8 @@ bool Face3::intersects_aabb(const AABB &p_aabb) const {
|
||||||
if (!p_aabb.intersects_plane(get_plane()))
|
if (!p_aabb.intersects_plane(get_plane()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/** TEST FACE AXIS */
|
|
||||||
|
|
||||||
#define TEST_AXIS(m_ax) \
|
#define TEST_AXIS(m_ax) \
|
||||||
|
/** TEST FACE AXIS */ \
|
||||||
{ \
|
{ \
|
||||||
real_t aabb_min = p_aabb.position.m_ax; \
|
real_t aabb_min = p_aabb.position.m_ax; \
|
||||||
real_t aabb_max = p_aabb.position.m_ax + p_aabb.size.m_ax; \
|
real_t aabb_max = p_aabb.position.m_ax + p_aabb.size.m_ax; \
|
||||||
|
|
|
@ -385,13 +385,13 @@ struct Rect2 {
|
||||||
operator String() const { return String(position) + ", " + String(size); }
|
operator String() const { return String(position) + ", " + String(size); }
|
||||||
|
|
||||||
Rect2() {}
|
Rect2() {}
|
||||||
Rect2(real_t p_x, real_t p_y, real_t p_width, real_t p_height)
|
Rect2(real_t p_x, real_t p_y, real_t p_width, real_t p_height) :
|
||||||
: position(Point2(p_x, p_y)),
|
position(Point2(p_x, p_y)),
|
||||||
size(Size2(p_width, p_height)) {
|
size(Size2(p_width, p_height)) {
|
||||||
}
|
}
|
||||||
Rect2(const Point2 &p_pos, const Size2 &p_size)
|
Rect2(const Point2 &p_pos, const Size2 &p_size) :
|
||||||
: position(p_pos),
|
position(p_pos),
|
||||||
size(p_size) {
|
size(p_size) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -578,18 +578,18 @@ struct Rect2i {
|
||||||
operator String() const { return String(position) + ", " + String(size); }
|
operator String() const { return String(position) + ", " + String(size); }
|
||||||
|
|
||||||
operator Rect2() const { return Rect2(position, size); }
|
operator Rect2() const { return Rect2(position, size); }
|
||||||
Rect2i(const Rect2 &p_r2)
|
Rect2i(const Rect2 &p_r2) :
|
||||||
: position(p_r2.position),
|
position(p_r2.position),
|
||||||
size(p_r2.size) {
|
size(p_r2.size) {
|
||||||
}
|
}
|
||||||
Rect2i() {}
|
Rect2i() {}
|
||||||
Rect2i(int p_x, int p_y, int p_width, int p_height)
|
Rect2i(int p_x, int p_y, int p_width, int p_height) :
|
||||||
: position(Point2(p_x, p_y)),
|
position(Point2(p_x, p_y)),
|
||||||
size(Size2(p_width, p_height)) {
|
size(Size2(p_width, p_height)) {
|
||||||
}
|
}
|
||||||
Rect2i(const Point2 &p_pos, const Size2 &p_size)
|
Rect2i(const Point2 &p_pos, const Size2 &p_size) :
|
||||||
: position(p_pos),
|
position(p_pos),
|
||||||
size(p_size) {
|
size(p_size) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -272,7 +272,7 @@ public:
|
||||||
|
|
||||||
#elif defined(_MSC_VER) && _MSC_VER < 1800
|
#elif defined(_MSC_VER) && _MSC_VER < 1800
|
||||||
__asm fld a __asm fistp b
|
__asm fld a __asm fistp b
|
||||||
/*#elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) )
|
/*#elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) )
|
||||||
// use AT&T inline assembly style, document that
|
// use AT&T inline assembly style, document that
|
||||||
// we use memory as output (=m) and input (m)
|
// we use memory as output (=m) and input (m)
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
|
|
|
@ -74,9 +74,9 @@ public:
|
||||||
operator String() const;
|
operator String() const;
|
||||||
|
|
||||||
_FORCE_INLINE_ Plane() { d = 0; }
|
_FORCE_INLINE_ Plane() { d = 0; }
|
||||||
_FORCE_INLINE_ Plane(real_t p_a, real_t p_b, real_t p_c, real_t p_d)
|
_FORCE_INLINE_ Plane(real_t p_a, real_t p_b, real_t p_c, real_t p_d) :
|
||||||
: normal(p_a, p_b, p_c),
|
normal(p_a, p_b, p_c),
|
||||||
d(p_d){};
|
d(p_d){};
|
||||||
|
|
||||||
_FORCE_INLINE_ Plane(const Vector3 &p_normal, real_t p_d);
|
_FORCE_INLINE_ Plane(const Vector3 &p_normal, real_t p_d);
|
||||||
_FORCE_INLINE_ Plane(const Vector3 &p_point, const Vector3 &p_normal);
|
_FORCE_INLINE_ Plane(const Vector3 &p_point, const Vector3 &p_normal);
|
||||||
|
@ -100,14 +100,14 @@ bool Plane::has_point(const Vector3 &p_point, real_t _epsilon) const {
|
||||||
return (dist <= _epsilon);
|
return (dist <= _epsilon);
|
||||||
}
|
}
|
||||||
|
|
||||||
Plane::Plane(const Vector3 &p_normal, real_t p_d)
|
Plane::Plane(const Vector3 &p_normal, real_t p_d) :
|
||||||
: normal(p_normal),
|
normal(p_normal),
|
||||||
d(p_d) {
|
d(p_d) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Plane::Plane(const Vector3 &p_point, const Vector3 &p_normal)
|
Plane::Plane(const Vector3 &p_point, const Vector3 &p_normal) :
|
||||||
: normal(p_normal),
|
normal(p_normal),
|
||||||
d(p_normal.dot(p_point)) {
|
d(p_normal.dot(p_point)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Plane::Plane(const Vector3 &p_point1, const Vector3 &p_point2, const Vector3 &p_point3, ClockDirection p_dir) {
|
Plane::Plane(const Vector3 &p_point1, const Vector3 &p_point2, const Vector3 &p_point3, ClockDirection p_dir) {
|
||||||
|
|
|
@ -208,7 +208,7 @@ Transform::operator String() const {
|
||||||
return basis.operator String() + " - " + origin.operator String();
|
return basis.operator String() + " - " + origin.operator String();
|
||||||
}
|
}
|
||||||
|
|
||||||
Transform::Transform(const Basis &p_basis, const Vector3 &p_origin)
|
Transform::Transform(const Basis &p_basis, const Vector3 &p_origin) :
|
||||||
: basis(p_basis),
|
basis(p_basis),
|
||||||
origin(p_origin) {
|
origin(p_origin) {
|
||||||
}
|
}
|
||||||
|
|
168
core/object.cpp
168
core/object.cpp
|
@ -126,9 +126,9 @@ MethodInfo::operator Dictionary() const {
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
MethodInfo::MethodInfo()
|
MethodInfo::MethodInfo() :
|
||||||
: flags(METHOD_FLAG_NORMAL),
|
flags(METHOD_FLAG_NORMAL),
|
||||||
id(0) {
|
id(0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
MethodInfo MethodInfo::from_dict(const Dictionary &p_dict) {
|
MethodInfo MethodInfo::from_dict(const Dictionary &p_dict) {
|
||||||
|
@ -164,48 +164,48 @@ MethodInfo MethodInfo::from_dict(const Dictionary &p_dict) {
|
||||||
return mi;
|
return mi;
|
||||||
}
|
}
|
||||||
|
|
||||||
MethodInfo::MethodInfo(const String &p_name)
|
MethodInfo::MethodInfo(const String &p_name) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
flags(METHOD_FLAG_NORMAL),
|
flags(METHOD_FLAG_NORMAL),
|
||||||
id(0) {
|
id(0) {
|
||||||
}
|
}
|
||||||
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1)
|
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
flags(METHOD_FLAG_NORMAL),
|
flags(METHOD_FLAG_NORMAL),
|
||||||
id(0) {
|
id(0) {
|
||||||
arguments.push_back(p_param1);
|
arguments.push_back(p_param1);
|
||||||
}
|
}
|
||||||
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2)
|
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
flags(METHOD_FLAG_NORMAL),
|
flags(METHOD_FLAG_NORMAL),
|
||||||
id(0) {
|
id(0) {
|
||||||
arguments.push_back(p_param1);
|
arguments.push_back(p_param1);
|
||||||
arguments.push_back(p_param2);
|
arguments.push_back(p_param2);
|
||||||
}
|
}
|
||||||
|
|
||||||
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3)
|
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
flags(METHOD_FLAG_NORMAL),
|
flags(METHOD_FLAG_NORMAL),
|
||||||
id(0) {
|
id(0) {
|
||||||
arguments.push_back(p_param1);
|
arguments.push_back(p_param1);
|
||||||
arguments.push_back(p_param2);
|
arguments.push_back(p_param2);
|
||||||
arguments.push_back(p_param3);
|
arguments.push_back(p_param3);
|
||||||
}
|
}
|
||||||
|
|
||||||
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4)
|
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
flags(METHOD_FLAG_NORMAL),
|
flags(METHOD_FLAG_NORMAL),
|
||||||
id(0) {
|
id(0) {
|
||||||
arguments.push_back(p_param1);
|
arguments.push_back(p_param1);
|
||||||
arguments.push_back(p_param2);
|
arguments.push_back(p_param2);
|
||||||
arguments.push_back(p_param3);
|
arguments.push_back(p_param3);
|
||||||
arguments.push_back(p_param4);
|
arguments.push_back(p_param4);
|
||||||
}
|
}
|
||||||
|
|
||||||
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5)
|
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
flags(METHOD_FLAG_NORMAL),
|
flags(METHOD_FLAG_NORMAL),
|
||||||
id(0) {
|
id(0) {
|
||||||
arguments.push_back(p_param1);
|
arguments.push_back(p_param1);
|
||||||
arguments.push_back(p_param2);
|
arguments.push_back(p_param2);
|
||||||
arguments.push_back(p_param3);
|
arguments.push_back(p_param3);
|
||||||
|
@ -213,48 +213,48 @@ MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const
|
||||||
arguments.push_back(p_param5);
|
arguments.push_back(p_param5);
|
||||||
}
|
}
|
||||||
|
|
||||||
MethodInfo::MethodInfo(Variant::Type ret)
|
MethodInfo::MethodInfo(Variant::Type ret) :
|
||||||
: flags(METHOD_FLAG_NORMAL),
|
flags(METHOD_FLAG_NORMAL),
|
||||||
id(0) {
|
id(0) {
|
||||||
return_val.type = ret;
|
return_val.type = ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name)
|
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
flags(METHOD_FLAG_NORMAL),
|
flags(METHOD_FLAG_NORMAL),
|
||||||
id(0) {
|
id(0) {
|
||||||
return_val.type = ret;
|
return_val.type = ret;
|
||||||
}
|
}
|
||||||
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1)
|
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
flags(METHOD_FLAG_NORMAL),
|
flags(METHOD_FLAG_NORMAL),
|
||||||
id(0) {
|
id(0) {
|
||||||
return_val.type = ret;
|
return_val.type = ret;
|
||||||
arguments.push_back(p_param1);
|
arguments.push_back(p_param1);
|
||||||
}
|
}
|
||||||
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2)
|
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
flags(METHOD_FLAG_NORMAL),
|
flags(METHOD_FLAG_NORMAL),
|
||||||
id(0) {
|
id(0) {
|
||||||
return_val.type = ret;
|
return_val.type = ret;
|
||||||
arguments.push_back(p_param1);
|
arguments.push_back(p_param1);
|
||||||
arguments.push_back(p_param2);
|
arguments.push_back(p_param2);
|
||||||
}
|
}
|
||||||
|
|
||||||
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3)
|
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
flags(METHOD_FLAG_NORMAL),
|
flags(METHOD_FLAG_NORMAL),
|
||||||
id(0) {
|
id(0) {
|
||||||
return_val.type = ret;
|
return_val.type = ret;
|
||||||
arguments.push_back(p_param1);
|
arguments.push_back(p_param1);
|
||||||
arguments.push_back(p_param2);
|
arguments.push_back(p_param2);
|
||||||
arguments.push_back(p_param3);
|
arguments.push_back(p_param3);
|
||||||
}
|
}
|
||||||
|
|
||||||
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4)
|
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
flags(METHOD_FLAG_NORMAL),
|
flags(METHOD_FLAG_NORMAL),
|
||||||
id(0) {
|
id(0) {
|
||||||
return_val.type = ret;
|
return_val.type = ret;
|
||||||
arguments.push_back(p_param1);
|
arguments.push_back(p_param1);
|
||||||
arguments.push_back(p_param2);
|
arguments.push_back(p_param2);
|
||||||
|
@ -262,10 +262,10 @@ MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyIn
|
||||||
arguments.push_back(p_param4);
|
arguments.push_back(p_param4);
|
||||||
}
|
}
|
||||||
|
|
||||||
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5)
|
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
flags(METHOD_FLAG_NORMAL),
|
flags(METHOD_FLAG_NORMAL),
|
||||||
id(0) {
|
id(0) {
|
||||||
return_val.type = ret;
|
return_val.type = ret;
|
||||||
arguments.push_back(p_param1);
|
arguments.push_back(p_param1);
|
||||||
arguments.push_back(p_param2);
|
arguments.push_back(p_param2);
|
||||||
|
@ -274,56 +274,56 @@ MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyIn
|
||||||
arguments.push_back(p_param5);
|
arguments.push_back(p_param5);
|
||||||
}
|
}
|
||||||
|
|
||||||
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name)
|
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
flags(METHOD_FLAG_NORMAL),
|
flags(METHOD_FLAG_NORMAL),
|
||||||
return_val(p_ret),
|
return_val(p_ret),
|
||||||
id(0) {
|
id(0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1)
|
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
return_val(p_ret),
|
return_val(p_ret),
|
||||||
flags(METHOD_FLAG_NORMAL),
|
flags(METHOD_FLAG_NORMAL),
|
||||||
id(0) {
|
id(0) {
|
||||||
arguments.push_back(p_param1);
|
arguments.push_back(p_param1);
|
||||||
}
|
}
|
||||||
|
|
||||||
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2)
|
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
return_val(p_ret),
|
return_val(p_ret),
|
||||||
flags(METHOD_FLAG_NORMAL),
|
flags(METHOD_FLAG_NORMAL),
|
||||||
id(0) {
|
id(0) {
|
||||||
arguments.push_back(p_param1);
|
arguments.push_back(p_param1);
|
||||||
arguments.push_back(p_param2);
|
arguments.push_back(p_param2);
|
||||||
}
|
}
|
||||||
|
|
||||||
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3)
|
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
return_val(p_ret),
|
return_val(p_ret),
|
||||||
flags(METHOD_FLAG_NORMAL),
|
flags(METHOD_FLAG_NORMAL),
|
||||||
id(0) {
|
id(0) {
|
||||||
arguments.push_back(p_param1);
|
arguments.push_back(p_param1);
|
||||||
arguments.push_back(p_param2);
|
arguments.push_back(p_param2);
|
||||||
arguments.push_back(p_param3);
|
arguments.push_back(p_param3);
|
||||||
}
|
}
|
||||||
|
|
||||||
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4)
|
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
return_val(p_ret),
|
return_val(p_ret),
|
||||||
flags(METHOD_FLAG_NORMAL),
|
flags(METHOD_FLAG_NORMAL),
|
||||||
id(0) {
|
id(0) {
|
||||||
arguments.push_back(p_param1);
|
arguments.push_back(p_param1);
|
||||||
arguments.push_back(p_param2);
|
arguments.push_back(p_param2);
|
||||||
arguments.push_back(p_param3);
|
arguments.push_back(p_param3);
|
||||||
arguments.push_back(p_param4);
|
arguments.push_back(p_param4);
|
||||||
}
|
}
|
||||||
|
|
||||||
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5)
|
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
return_val(p_ret),
|
return_val(p_ret),
|
||||||
flags(METHOD_FLAG_NORMAL),
|
flags(METHOD_FLAG_NORMAL),
|
||||||
id(0) {
|
id(0) {
|
||||||
arguments.push_back(p_param1);
|
arguments.push_back(p_param1);
|
||||||
arguments.push_back(p_param2);
|
arguments.push_back(p_param2);
|
||||||
arguments.push_back(p_param3);
|
arguments.push_back(p_param3);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* object.h */
|
/* object.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
|
@ -144,18 +144,18 @@ struct PropertyInfo {
|
||||||
|
|
||||||
static PropertyInfo from_dict(const Dictionary &p_dict);
|
static PropertyInfo from_dict(const Dictionary &p_dict);
|
||||||
|
|
||||||
PropertyInfo()
|
PropertyInfo() :
|
||||||
: type(Variant::NIL),
|
type(Variant::NIL),
|
||||||
hint(PROPERTY_HINT_NONE),
|
hint(PROPERTY_HINT_NONE),
|
||||||
usage(PROPERTY_USAGE_DEFAULT) {
|
usage(PROPERTY_USAGE_DEFAULT) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PropertyInfo(Variant::Type p_type, const String p_name, PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_string = "", uint32_t p_usage = PROPERTY_USAGE_DEFAULT, const StringName &p_class_name = StringName())
|
PropertyInfo(Variant::Type p_type, const String p_name, PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_string = "", uint32_t p_usage = PROPERTY_USAGE_DEFAULT, const StringName &p_class_name = StringName()) :
|
||||||
: type(p_type),
|
type(p_type),
|
||||||
name(p_name),
|
name(p_name),
|
||||||
hint(p_hint),
|
hint(p_hint),
|
||||||
hint_string(p_hint_string),
|
hint_string(p_hint_string),
|
||||||
usage(p_usage) {
|
usage(p_usage) {
|
||||||
|
|
||||||
if (hint == PROPERTY_HINT_RESOURCE_TYPE) {
|
if (hint == PROPERTY_HINT_RESOURCE_TYPE) {
|
||||||
class_name = hint_string;
|
class_name = hint_string;
|
||||||
|
@ -164,11 +164,11 @@ struct PropertyInfo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PropertyInfo(const StringName &p_class_name)
|
PropertyInfo(const StringName &p_class_name) :
|
||||||
: type(Variant::OBJECT),
|
type(Variant::OBJECT),
|
||||||
class_name(p_class_name),
|
class_name(p_class_name),
|
||||||
hint(PROPERTY_HINT_NONE),
|
hint(PROPERTY_HINT_NONE),
|
||||||
usage(PROPERTY_USAGE_DEFAULT) {
|
usage(PROPERTY_USAGE_DEFAULT) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator<(const PropertyInfo &p_info) const {
|
bool operator<(const PropertyInfo &p_info) const {
|
||||||
|
@ -428,9 +428,9 @@ private:
|
||||||
|
|
||||||
_FORCE_INLINE_ bool operator<(const Target &p_target) const { return (_id == p_target._id) ? (method < p_target.method) : (_id < p_target._id); }
|
_FORCE_INLINE_ bool operator<(const Target &p_target) const { return (_id == p_target._id) ? (method < p_target.method) : (_id < p_target._id); }
|
||||||
|
|
||||||
Target(const ObjectID &p_id, const StringName &p_method)
|
Target(const ObjectID &p_id, const StringName &p_method) :
|
||||||
: _id(p_id),
|
_id(p_id),
|
||||||
method(p_method) {
|
method(p_method) {
|
||||||
}
|
}
|
||||||
Target() { _id = 0; }
|
Target() { _id = 0; }
|
||||||
};
|
};
|
||||||
|
|
|
@ -68,8 +68,10 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
_FORCE_INLINE_ Element()
|
_FORCE_INLINE_ Element() :
|
||||||
: list_element(NULL), prev_element(NULL), next_element(NULL) {
|
list_element(NULL),
|
||||||
|
prev_element(NULL),
|
||||||
|
next_element(NULL) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Element next() const {
|
Element next() const {
|
||||||
|
@ -80,10 +82,10 @@ public:
|
||||||
return Element(prev_element);
|
return Element(prev_element);
|
||||||
}
|
}
|
||||||
|
|
||||||
Element(const Element &other)
|
Element(const Element &other) :
|
||||||
: list_element(other.list_element),
|
list_element(other.list_element),
|
||||||
prev_element(other.prev_element),
|
prev_element(other.prev_element),
|
||||||
next_element(other.next_element) {
|
next_element(other.next_element) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Element &operator=(const Element &other) {
|
Element &operator=(const Element &other) {
|
||||||
|
@ -135,17 +137,17 @@ public:
|
||||||
|
|
||||||
const typename InternalList::Element *list_element;
|
const typename InternalList::Element *list_element;
|
||||||
|
|
||||||
ConstElement(const typename InternalList::Element *p_element)
|
ConstElement(const typename InternalList::Element *p_element) :
|
||||||
: list_element(p_element) {
|
list_element(p_element) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
_FORCE_INLINE_ ConstElement()
|
_FORCE_INLINE_ ConstElement() :
|
||||||
: list_element(NULL) {
|
list_element(NULL) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ConstElement(const ConstElement &other)
|
ConstElement(const ConstElement &other) :
|
||||||
: list_element(other.list_element) {
|
list_element(other.list_element) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ConstElement &operator=(const ConstElement &other) {
|
ConstElement &operator=(const ConstElement &other) {
|
||||||
|
|
|
@ -37,9 +37,9 @@ struct Pair {
|
||||||
S second;
|
S second;
|
||||||
|
|
||||||
Pair() {}
|
Pair() {}
|
||||||
Pair(F p_first, const S &p_second)
|
Pair(F p_first, const S &p_second) :
|
||||||
: first(p_first),
|
first(p_first),
|
||||||
second(p_second) {
|
second(p_second) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -58,18 +58,18 @@ protected:
|
||||||
Variant initial;
|
Variant initial;
|
||||||
bool hide_from_editor;
|
bool hide_from_editor;
|
||||||
bool overrided;
|
bool overrided;
|
||||||
VariantContainer()
|
VariantContainer() :
|
||||||
: order(0),
|
order(0),
|
||||||
persist(false),
|
persist(false),
|
||||||
hide_from_editor(false),
|
hide_from_editor(false),
|
||||||
overrided(false) {
|
overrided(false) {
|
||||||
}
|
}
|
||||||
VariantContainer(const Variant &p_variant, int p_order, bool p_persist = false)
|
VariantContainer(const Variant &p_variant, int p_order, bool p_persist = false) :
|
||||||
: order(p_order),
|
order(p_order),
|
||||||
persist(p_persist),
|
persist(p_persist),
|
||||||
variant(p_variant),
|
variant(p_variant),
|
||||||
hide_from_editor(false),
|
hide_from_editor(false),
|
||||||
overrided(false) {
|
overrided(false) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -378,8 +378,8 @@ void Resource::_bind_methods() {
|
||||||
BIND_VMETHOD(MethodInfo("_setup_local_to_scene"));
|
BIND_VMETHOD(MethodInfo("_setup_local_to_scene"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Resource::Resource()
|
Resource::Resource() :
|
||||||
: remapped_list(this) {
|
remapped_list(this) {
|
||||||
|
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
last_modified_time = 0;
|
last_modified_time = 0;
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
return m_val; \
|
return m_val; \
|
||||||
}
|
}
|
||||||
|
|
||||||
_ALWAYS_INLINE_ uint32_t _atomic_conditional_increment_impl(register uint32_t *pw) {
|
_ALWAYS_INLINE_ uint32_t _atomic_conditional_increment_impl(register uint32_t *pw){
|
||||||
|
|
||||||
ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONG, InterlockedCompareExchange, uint32_t)
|
ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONG, InterlockedCompareExchange, uint32_t)
|
||||||
}
|
}
|
||||||
|
@ -82,12 +82,12 @@ _ALWAYS_INLINE_ uint32_t _atomic_add_impl(register uint32_t *pw, register uint32
|
||||||
return InterlockedAdd((LONG volatile *)pw, val);
|
return InterlockedAdd((LONG volatile *)pw, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
_ALWAYS_INLINE_ uint32_t _atomic_exchange_if_greater_impl(register uint32_t *pw, register uint32_t val) {
|
_ALWAYS_INLINE_ uint32_t _atomic_exchange_if_greater_impl(register uint32_t *pw, register uint32_t val){
|
||||||
|
|
||||||
ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONG, InterlockedCompareExchange, uint32_t)
|
ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONG, InterlockedCompareExchange, uint32_t)
|
||||||
}
|
}
|
||||||
|
|
||||||
_ALWAYS_INLINE_ uint64_t _atomic_conditional_increment_impl(register uint64_t *pw) {
|
_ALWAYS_INLINE_ uint64_t _atomic_conditional_increment_impl(register uint64_t *pw){
|
||||||
|
|
||||||
ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONGLONG, InterlockedCompareExchange64, uint64_t)
|
ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONGLONG, InterlockedCompareExchange64, uint64_t)
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ _ALWAYS_INLINE_ uint64_t _atomic_add_impl(register uint64_t *pw, register uint64
|
||||||
return InterlockedAdd64((LONGLONG volatile *)pw, val);
|
return InterlockedAdd64((LONGLONG volatile *)pw, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
_ALWAYS_INLINE_ uint64_t _atomic_exchange_if_greater_impl(register uint64_t *pw, register uint64_t val) {
|
_ALWAYS_INLINE_ uint64_t _atomic_exchange_if_greater_impl(register uint64_t *pw, register uint64_t val){
|
||||||
|
|
||||||
ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONGLONG, InterlockedCompareExchange64, uint64_t)
|
ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONGLONG, InterlockedCompareExchange64, uint64_t)
|
||||||
}
|
}
|
||||||
|
|
|
@ -989,25 +989,25 @@ void ScriptDebuggerRemote::profiling_set_frame_times(float p_frame_time, float p
|
||||||
|
|
||||||
ScriptDebuggerRemote::ResourceUsageFunc ScriptDebuggerRemote::resource_usage_func = NULL;
|
ScriptDebuggerRemote::ResourceUsageFunc ScriptDebuggerRemote::resource_usage_func = NULL;
|
||||||
|
|
||||||
ScriptDebuggerRemote::ScriptDebuggerRemote()
|
ScriptDebuggerRemote::ScriptDebuggerRemote() :
|
||||||
: profiling(false),
|
profiling(false),
|
||||||
max_frame_functions(16),
|
max_frame_functions(16),
|
||||||
skip_profile_frame(false),
|
skip_profile_frame(false),
|
||||||
reload_all_scripts(false),
|
reload_all_scripts(false),
|
||||||
tcp_client(StreamPeerTCP::create_ref()),
|
tcp_client(StreamPeerTCP::create_ref()),
|
||||||
packet_peer_stream(Ref<PacketPeerStream>(memnew(PacketPeerStream))),
|
packet_peer_stream(Ref<PacketPeerStream>(memnew(PacketPeerStream))),
|
||||||
last_perf_time(0),
|
last_perf_time(0),
|
||||||
performance(Engine::get_singleton()->get_singleton_object("Performance")),
|
performance(Engine::get_singleton()->get_singleton_object("Performance")),
|
||||||
requested_quit(false),
|
requested_quit(false),
|
||||||
mutex(Mutex::create()),
|
mutex(Mutex::create()),
|
||||||
max_cps(GLOBAL_GET("network/limits/debugger_stdout/max_chars_per_second")),
|
max_cps(GLOBAL_GET("network/limits/debugger_stdout/max_chars_per_second")),
|
||||||
char_count(0),
|
char_count(0),
|
||||||
last_msec(0),
|
last_msec(0),
|
||||||
msec_count(0),
|
msec_count(0),
|
||||||
locking(false),
|
locking(false),
|
||||||
poll_every(0),
|
poll_every(0),
|
||||||
request_scene_tree(NULL),
|
request_scene_tree(NULL),
|
||||||
live_edit_funcs(NULL) {
|
live_edit_funcs(NULL) {
|
||||||
|
|
||||||
packet_peer_stream->set_stream_peer(tcp_client);
|
packet_peer_stream->set_stream_peer(tcp_client);
|
||||||
packet_peer_stream->set_output_buffer_max_size(1024 * 1024 * 8); //8mb should be way more than enough
|
packet_peer_stream->set_output_buffer_max_size(1024 * 1024 * 8); //8mb should be way more than enough
|
||||||
|
|
|
@ -387,10 +387,10 @@ void PlaceHolderScriptInstance::update(const List<PropertyInfo> &p_properties, c
|
||||||
//change notify
|
//change notify
|
||||||
}
|
}
|
||||||
|
|
||||||
PlaceHolderScriptInstance::PlaceHolderScriptInstance(ScriptLanguage *p_language, Ref<Script> p_script, Object *p_owner)
|
PlaceHolderScriptInstance::PlaceHolderScriptInstance(ScriptLanguage *p_language, Ref<Script> p_script, Object *p_owner) :
|
||||||
: owner(p_owner),
|
owner(p_owner),
|
||||||
language(p_language),
|
language(p_language),
|
||||||
script(p_script) {
|
script(p_script) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PlaceHolderScriptInstance::~PlaceHolderScriptInstance() {
|
PlaceHolderScriptInstance::~PlaceHolderScriptInstance() {
|
||||||
|
|
|
@ -876,8 +876,8 @@ void Translation::_bind_methods() {
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::STRING, "locale"), "set_locale", "get_locale");
|
ADD_PROPERTY(PropertyInfo(Variant::STRING, "locale"), "set_locale", "get_locale");
|
||||||
}
|
}
|
||||||
|
|
||||||
Translation::Translation()
|
Translation::Translation() :
|
||||||
: locale("en") {
|
locale("en") {
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////
|
///////////////////////////////////////////////
|
||||||
|
@ -1163,9 +1163,9 @@ void TranslationServer::load_translations() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TranslationServer::TranslationServer()
|
TranslationServer::TranslationServer() :
|
||||||
: locale("en"),
|
locale("en"),
|
||||||
enabled(true) {
|
enabled(true) {
|
||||||
singleton = this;
|
singleton = this;
|
||||||
|
|
||||||
for (int i = 0; locale_list[i]; ++i) {
|
for (int i = 0; locale_list[i]; ++i) {
|
||||||
|
|
|
@ -73,7 +73,7 @@ T *_nullptr() {
|
||||||
|
|
||||||
#define OFFSET_OF(st, m) \
|
#define OFFSET_OF(st, m) \
|
||||||
((size_t)((char *)&(_nullptr<st>()->m) - (char *)0))
|
((size_t)((char *)&(_nullptr<st>()->m) - (char *)0))
|
||||||
/**
|
/**
|
||||||
* Some platforms (devices) not define NULL
|
* Some platforms (devices) not define NULL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ T *_nullptr() {
|
||||||
#define NULL 0
|
#define NULL 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Windows defines a lot of badly stuff we'll never ever use. undefine it.
|
* Windows defines a lot of badly stuff we'll never ever use. undefine it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ T *_nullptr() {
|
||||||
#include "error_list.h"
|
#include "error_list.h"
|
||||||
#include "error_macros.h"
|
#include "error_macros.h"
|
||||||
|
|
||||||
/** Generic ABS function, for math uses please use Math::abs */
|
/** Generic ABS function, for math uses please use Math::abs */
|
||||||
|
|
||||||
#ifndef ABS
|
#ifndef ABS
|
||||||
#define ABS(m_v) ((m_v < 0) ? (-(m_v)) : (m_v))
|
#define ABS(m_v) ((m_v < 0) ? (-(m_v)) : (m_v))
|
||||||
|
|
|
@ -67,7 +67,6 @@ String Variant::get_type_name(Variant::Type p_type) {
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
// math types
|
// math types
|
||||||
|
|
||||||
case VECTOR2: {
|
case VECTOR2: {
|
||||||
|
|
||||||
return "Vector2";
|
return "Vector2";
|
||||||
|
@ -725,7 +724,6 @@ bool Variant::is_zero() const {
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
// math types
|
// math types
|
||||||
|
|
||||||
case VECTOR2: {
|
case VECTOR2: {
|
||||||
|
|
||||||
return *reinterpret_cast<const Vector2 *>(_data._mem) == Vector2();
|
return *reinterpret_cast<const Vector2 *>(_data._mem) == Vector2();
|
||||||
|
@ -934,7 +932,6 @@ void Variant::reference(const Variant &p_variant) {
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
// math types
|
// math types
|
||||||
|
|
||||||
case VECTOR2: {
|
case VECTOR2: {
|
||||||
|
|
||||||
memnew_placement(_data._mem, Vector2(*reinterpret_cast<const Vector2 *>(p_variant._data._mem)));
|
memnew_placement(_data._mem, Vector2(*reinterpret_cast<const Vector2 *>(p_variant._data._mem)));
|
||||||
|
@ -2506,7 +2503,6 @@ void Variant::operator=(const Variant &p_variant) {
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
// math types
|
// math types
|
||||||
|
|
||||||
case VECTOR2: {
|
case VECTOR2: {
|
||||||
|
|
||||||
*reinterpret_cast<Vector2 *>(_data._mem) = *reinterpret_cast<const Vector2 *>(p_variant._data._mem);
|
*reinterpret_cast<Vector2 *>(_data._mem) = *reinterpret_cast<const Vector2 *>(p_variant._data._mem);
|
||||||
|
@ -2645,8 +2641,8 @@ uint32_t Variant::hash() const {
|
||||||
|
|
||||||
return reinterpret_cast<const String *>(_data._mem)->hash();
|
return reinterpret_cast<const String *>(_data._mem)->hash();
|
||||||
} break;
|
} break;
|
||||||
// math types
|
|
||||||
|
|
||||||
|
// math types
|
||||||
case VECTOR2: {
|
case VECTOR2: {
|
||||||
|
|
||||||
uint32_t hash = hash_djb2_one_float(reinterpret_cast<const Vector2 *>(_data._mem)->x);
|
uint32_t hash = hash_djb2_one_float(reinterpret_cast<const Vector2 *>(_data._mem)->x);
|
||||||
|
|
|
@ -130,9 +130,9 @@ struct _VariantCall {
|
||||||
StringName name;
|
StringName name;
|
||||||
Variant::Type type;
|
Variant::Type type;
|
||||||
Arg() { type = Variant::NIL; }
|
Arg() { type = Variant::NIL; }
|
||||||
Arg(Variant::Type p_type, const StringName &p_name)
|
Arg(Variant::Type p_type, const StringName &p_name) :
|
||||||
: name(p_name),
|
name(p_name),
|
||||||
type(p_type) {
|
type(p_type) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -153,7 +153,7 @@ static Vector<Vector<Vector2> > _b2d_decompose(const Vector<Vector2> &p_polygon)
|
||||||
delete p;
|
delete p;
|
||||||
return res; // pdarray; //needs to be deleted after body is created
|
return res; // pdarray; //needs to be deleted after body is created
|
||||||
}
|
}
|
||||||
}
|
} // namespace b2ConvexDecomp
|
||||||
|
|
||||||
Vector<Vector<Vector2> > b2d_decompose(const Vector<Vector2> &p_polygon) {
|
Vector<Vector<Vector2> > b2d_decompose(const Vector<Vector2> &p_polygon) {
|
||||||
|
|
||||||
|
|
|
@ -1134,18 +1134,6 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material *p_m
|
||||||
state.current_depth_draw = p_material->shader->spatial.depth_draw_mode;
|
state.current_depth_draw = p_material->shader->spatial.depth_draw_mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
//glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
|
|
||||||
|
|
||||||
/*
|
|
||||||
if (p_material->flags[VS::MATERIAL_FLAG_WIREFRAME])
|
|
||||||
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
|
|
||||||
else
|
|
||||||
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
|
|
||||||
|
|
||||||
if (p_material->line_width)
|
|
||||||
glLineWidth(p_material->line_width);
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
//blend mode
|
//blend mode
|
||||||
if (state.current_blend_mode!=p_material->shader->spatial.blend_mode) {
|
if (state.current_blend_mode!=p_material->shader->spatial.blend_mode) {
|
||||||
|
|
|
@ -486,8 +486,8 @@ public:
|
||||||
bool uses_vertex_time;
|
bool uses_vertex_time;
|
||||||
bool uses_fragment_time;
|
bool uses_fragment_time;
|
||||||
|
|
||||||
Shader()
|
Shader() :
|
||||||
: dirty_list(this) {
|
dirty_list(this) {
|
||||||
|
|
||||||
shader = NULL;
|
shader = NULL;
|
||||||
ubo_size = 0;
|
ubo_size = 0;
|
||||||
|
@ -540,8 +540,9 @@ public:
|
||||||
bool can_cast_shadow_cache;
|
bool can_cast_shadow_cache;
|
||||||
bool is_animated_cache;
|
bool is_animated_cache;
|
||||||
|
|
||||||
Material()
|
Material() :
|
||||||
: list(this), dirty_list(this) {
|
list(this),
|
||||||
|
dirty_list(this) {
|
||||||
can_cast_shadow_cache = false;
|
can_cast_shadow_cache = false;
|
||||||
is_animated_cache = false;
|
is_animated_cache = false;
|
||||||
shader = NULL;
|
shader = NULL;
|
||||||
|
@ -764,8 +765,9 @@ public:
|
||||||
bool dirty_aabb;
|
bool dirty_aabb;
|
||||||
bool dirty_data;
|
bool dirty_data;
|
||||||
|
|
||||||
MultiMesh()
|
MultiMesh() :
|
||||||
: update_list(this), mesh_list(this) {
|
update_list(this),
|
||||||
|
mesh_list(this) {
|
||||||
dirty_aabb = true;
|
dirty_aabb = true;
|
||||||
dirty_data = true;
|
dirty_data = true;
|
||||||
xform_floats = 0;
|
xform_floats = 0;
|
||||||
|
@ -865,8 +867,8 @@ public:
|
||||||
SelfList<Skeleton> update_list;
|
SelfList<Skeleton> update_list;
|
||||||
Set<RasterizerScene::InstanceBase *> instances; //instances using skeleton
|
Set<RasterizerScene::InstanceBase *> instances; //instances using skeleton
|
||||||
|
|
||||||
Skeleton()
|
Skeleton() :
|
||||||
: update_list(this) {
|
update_list(this) {
|
||||||
size = 0;
|
size = 0;
|
||||||
|
|
||||||
use_2d = false;
|
use_2d = false;
|
||||||
|
@ -1116,8 +1118,8 @@ public:
|
||||||
|
|
||||||
Transform emission_transform;
|
Transform emission_transform;
|
||||||
|
|
||||||
Particles()
|
Particles() :
|
||||||
: particle_element(this) {
|
particle_element(this) {
|
||||||
cycle_number = 0;
|
cycle_number = 0;
|
||||||
emitting = false;
|
emitting = false;
|
||||||
one_shot = false;
|
one_shot = false;
|
||||||
|
|
|
@ -149,10 +149,7 @@ void IP_Unix::get_local_addresses(List<IP_Address> *r_addresses) const {
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
||||||
addrs = (IP_ADAPTER_ADDRESSES *)memalloc(buf_size);
|
addrs = (IP_ADAPTER_ADDRESSES *)memalloc(buf_size);
|
||||||
int err = GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_SKIP_ANYCAST |
|
int err = GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_MULTICAST | GAA_FLAG_SKIP_DNS_SERVER | GAA_FLAG_SKIP_FRIENDLY_NAME,
|
||||||
GAA_FLAG_SKIP_MULTICAST |
|
|
||||||
GAA_FLAG_SKIP_DNS_SERVER |
|
|
||||||
GAA_FLAG_SKIP_FRIENDLY_NAME,
|
|
||||||
NULL, addrs, &buf_size);
|
NULL, addrs, &buf_size);
|
||||||
if (err == NO_ERROR) {
|
if (err == NO_ERROR) {
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -48,8 +48,8 @@ class AudioDriverXAudio2 : public AudioDriver {
|
||||||
struct XAudio2DriverVoiceCallback : public IXAudio2VoiceCallback {
|
struct XAudio2DriverVoiceCallback : public IXAudio2VoiceCallback {
|
||||||
|
|
||||||
HANDLE buffer_end_event;
|
HANDLE buffer_end_event;
|
||||||
XAudio2DriverVoiceCallback()
|
XAudio2DriverVoiceCallback() :
|
||||||
: buffer_end_event(CreateEvent(NULL, FALSE, FALSE, NULL)) {}
|
buffer_end_event(CreateEvent(NULL, FALSE, FALSE, NULL)) {}
|
||||||
void STDMETHODCALLTYPE OnBufferEnd(void *pBufferContext) { /*print_line("buffer ended");*/
|
void STDMETHODCALLTYPE OnBufferEnd(void *pBufferContext) { /*print_line("buffer ended");*/
|
||||||
SetEvent(buffer_end_event);
|
SetEvent(buffer_end_event);
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,8 +122,9 @@ struct SharedObject {
|
||||||
String path;
|
String path;
|
||||||
Vector<String> tags;
|
Vector<String> tags;
|
||||||
|
|
||||||
SharedObject(const String &p_path, const Vector<String> &p_tags)
|
SharedObject(const String &p_path, const Vector<String> &p_tags) :
|
||||||
: path(p_path), tags(p_tags) {
|
path(p_path),
|
||||||
|
tags(p_tags) {
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedObject() {}
|
SharedObject() {}
|
||||||
|
|
|
@ -128,10 +128,12 @@ private:
|
||||||
String path;
|
String path;
|
||||||
bool is_file;
|
bool is_file;
|
||||||
|
|
||||||
FileOrFolder()
|
FileOrFolder() :
|
||||||
: path(""), is_file(false) {}
|
path(""),
|
||||||
FileOrFolder(const String &p_path, bool p_is_file)
|
is_file(false) {}
|
||||||
: path(p_path), is_file(p_is_file) {}
|
FileOrFolder(const String &p_path, bool p_is_file) :
|
||||||
|
path(p_path),
|
||||||
|
is_file(p_is_file) {}
|
||||||
};
|
};
|
||||||
FileOrFolder to_rename;
|
FileOrFolder to_rename;
|
||||||
Vector<FileOrFolder> to_move;
|
Vector<FileOrFolder> to_move;
|
||||||
|
|
|
@ -1913,8 +1913,6 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones
|
||||||
/*************************************** SCENE ***********************************/
|
/*************************************** SCENE ***********************************/
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
|
|
||||||
#define DEBUG_ANIMATION
|
|
||||||
|
|
||||||
uint32_t EditorSceneImporterCollada::get_import_flags() const {
|
uint32_t EditorSceneImporterCollada::get_import_flags() const {
|
||||||
|
|
||||||
return IMPORT_SCENE | IMPORT_ANIMATION;
|
return IMPORT_SCENE | IMPORT_ANIMATION;
|
||||||
|
|
|
@ -32,18 +32,21 @@
|
||||||
#include "canvas_item_editor_plugin.h"
|
#include "canvas_item_editor_plugin.h"
|
||||||
#include "core/os/keyboard.h"
|
#include "core/os/keyboard.h"
|
||||||
|
|
||||||
AbstractPolygon2DEditor::Vertex::Vertex()
|
AbstractPolygon2DEditor::Vertex::Vertex() :
|
||||||
: polygon(-1), vertex(-1) {
|
polygon(-1),
|
||||||
|
vertex(-1) {
|
||||||
// invalid vertex
|
// invalid vertex
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractPolygon2DEditor::Vertex::Vertex(int p_vertex)
|
AbstractPolygon2DEditor::Vertex::Vertex(int p_vertex) :
|
||||||
: polygon(-1), vertex(p_vertex) {
|
polygon(-1),
|
||||||
|
vertex(p_vertex) {
|
||||||
// vertex p_vertex of current wip polygon
|
// vertex p_vertex of current wip polygon
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractPolygon2DEditor::Vertex::Vertex(int p_polygon, int p_vertex)
|
AbstractPolygon2DEditor::Vertex::Vertex(int p_polygon, int p_vertex) :
|
||||||
: polygon(p_polygon), vertex(p_vertex) {
|
polygon(p_polygon),
|
||||||
|
vertex(p_vertex) {
|
||||||
// vertex p_vertex of polygon p_polygon
|
// vertex p_vertex of polygon p_polygon
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,12 +69,14 @@ AbstractPolygon2DEditor::PosVertex::PosVertex() {
|
||||||
// invalid vertex
|
// invalid vertex
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractPolygon2DEditor::PosVertex::PosVertex(const Vertex &p_vertex, const Vector2 &p_pos)
|
AbstractPolygon2DEditor::PosVertex::PosVertex(const Vertex &p_vertex, const Vector2 &p_pos) :
|
||||||
: Vertex(p_vertex.polygon, p_vertex.vertex), pos(p_pos) {
|
Vertex(p_vertex.polygon, p_vertex.vertex),
|
||||||
|
pos(p_pos) {
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractPolygon2DEditor::PosVertex::PosVertex(int p_polygon, int p_vertex, const Vector2 &p_pos)
|
AbstractPolygon2DEditor::PosVertex::PosVertex(int p_polygon, int p_vertex, const Vector2 &p_pos) :
|
||||||
: Vertex(p_polygon, p_vertex), pos(p_pos) {
|
Vertex(p_polygon, p_vertex),
|
||||||
|
pos(p_pos) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AbstractPolygon2DEditor::_is_empty() const {
|
bool AbstractPolygon2DEditor::_is_empty() const {
|
||||||
|
|
|
@ -69,8 +69,8 @@ class SnapDialog : public ConfirmationDialog {
|
||||||
SpinBox *rotation_step;
|
SpinBox *rotation_step;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SnapDialog()
|
SnapDialog() :
|
||||||
: ConfirmationDialog() {
|
ConfirmationDialog() {
|
||||||
const int SPIN_BOX_GRID_RANGE = 256;
|
const int SPIN_BOX_GRID_RANGE = 256;
|
||||||
const int SPIN_BOX_ROTATION_RANGE = 360;
|
const int SPIN_BOX_ROTATION_RANGE = 360;
|
||||||
Label *label;
|
Label *label;
|
||||||
|
|
|
@ -39,10 +39,10 @@ void CollisionPolygon2DEditor::_set_node(Node *p_polygon) {
|
||||||
node = Object::cast_to<CollisionPolygon2D>(p_polygon);
|
node = Object::cast_to<CollisionPolygon2D>(p_polygon);
|
||||||
}
|
}
|
||||||
|
|
||||||
CollisionPolygon2DEditor::CollisionPolygon2DEditor(EditorNode *p_editor)
|
CollisionPolygon2DEditor::CollisionPolygon2DEditor(EditorNode *p_editor) :
|
||||||
: AbstractPolygon2DEditor(p_editor) {
|
AbstractPolygon2DEditor(p_editor) {
|
||||||
}
|
}
|
||||||
|
|
||||||
CollisionPolygon2DEditorPlugin::CollisionPolygon2DEditorPlugin(EditorNode *p_node)
|
CollisionPolygon2DEditorPlugin::CollisionPolygon2DEditorPlugin(EditorNode *p_node) :
|
||||||
: AbstractPolygon2DEditorPlugin(p_node, memnew(CollisionPolygon2DEditor(p_node)), "CollisionPolygon2D") {
|
AbstractPolygon2DEditorPlugin(p_node, memnew(CollisionPolygon2DEditor(p_node)), "CollisionPolygon2D") {
|
||||||
}
|
}
|
||||||
|
|
|
@ -586,8 +586,10 @@ struct CanvasItemPlotCurve {
|
||||||
Color color1;
|
Color color1;
|
||||||
Color color2;
|
Color color2;
|
||||||
|
|
||||||
CanvasItemPlotCurve(CanvasItem &p_ci, Color p_color1, Color p_color2)
|
CanvasItemPlotCurve(CanvasItem &p_ci, Color p_color1, Color p_color2) :
|
||||||
: ci(p_ci), color1(p_color1), color2(p_color2) {}
|
ci(p_ci),
|
||||||
|
color1(p_color1),
|
||||||
|
color2(p_color2) {}
|
||||||
|
|
||||||
void operator()(Vector2 pos0, Vector2 pos1, bool in_definition) {
|
void operator()(Vector2 pos0, Vector2 pos1, bool in_definition) {
|
||||||
ci.draw_line(pos0, pos1, in_definition ? color1 : color2);
|
ci.draw_line(pos0, pos1, in_definition ? color1 : color2);
|
||||||
|
|
|
@ -61,10 +61,10 @@ void Line2DEditor::_action_set_polygon(int p_idx, const Variant &p_previous, con
|
||||||
undo_redo->add_undo_method(node, "set_points", p_previous);
|
undo_redo->add_undo_method(node, "set_points", p_previous);
|
||||||
}
|
}
|
||||||
|
|
||||||
Line2DEditor::Line2DEditor(EditorNode *p_editor)
|
Line2DEditor::Line2DEditor(EditorNode *p_editor) :
|
||||||
: AbstractPolygon2DEditor(p_editor) {
|
AbstractPolygon2DEditor(p_editor) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Line2DEditorPlugin::Line2DEditorPlugin(EditorNode *p_node)
|
Line2DEditorPlugin::Line2DEditorPlugin(EditorNode *p_node) :
|
||||||
: AbstractPolygon2DEditorPlugin(p_node, memnew(Line2DEditor(p_node)), "Line2D") {
|
AbstractPolygon2DEditorPlugin(p_node, memnew(Line2DEditor(p_node)), "Line2D") {
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,10 +120,10 @@ void NavigationPolygonEditor::_create_resource() {
|
||||||
_menu_option(MODE_CREATE);
|
_menu_option(MODE_CREATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
NavigationPolygonEditor::NavigationPolygonEditor(EditorNode *p_editor)
|
NavigationPolygonEditor::NavigationPolygonEditor(EditorNode *p_editor) :
|
||||||
: AbstractPolygon2DEditor(p_editor) {
|
AbstractPolygon2DEditor(p_editor) {
|
||||||
}
|
}
|
||||||
|
|
||||||
NavigationPolygonEditorPlugin::NavigationPolygonEditorPlugin(EditorNode *p_node)
|
NavigationPolygonEditorPlugin::NavigationPolygonEditorPlugin(EditorNode *p_node) :
|
||||||
: AbstractPolygon2DEditorPlugin(p_node, memnew(NavigationPolygonEditor(p_node)), "NavigationPolygonInstance") {
|
AbstractPolygon2DEditorPlugin(p_node, memnew(NavigationPolygonEditor(p_node)), "NavigationPolygonInstance") {
|
||||||
}
|
}
|
||||||
|
|
|
@ -459,8 +459,8 @@ Vector2 Polygon2DEditor::snap_point(Vector2 p_target) const {
|
||||||
return p_target;
|
return p_target;
|
||||||
}
|
}
|
||||||
|
|
||||||
Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor)
|
Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) :
|
||||||
: AbstractPolygon2DEditor(p_editor) {
|
AbstractPolygon2DEditor(p_editor) {
|
||||||
|
|
||||||
snap_step = Vector2(10, 10);
|
snap_step = Vector2(10, 10);
|
||||||
use_snap = false;
|
use_snap = false;
|
||||||
|
@ -609,6 +609,6 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor)
|
||||||
uv_edit_draw->set_clip_contents(true);
|
uv_edit_draw->set_clip_contents(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Polygon2DEditorPlugin::Polygon2DEditorPlugin(EditorNode *p_node)
|
Polygon2DEditorPlugin::Polygon2DEditorPlugin(EditorNode *p_node) :
|
||||||
: AbstractPolygon2DEditorPlugin(p_node, memnew(Polygon2DEditor(p_node)), "Polygon2D") {
|
AbstractPolygon2DEditorPlugin(p_node, memnew(Polygon2DEditor(p_node)), "Polygon2D") {
|
||||||
}
|
}
|
||||||
|
|
|
@ -3740,8 +3740,8 @@ void PropertyEditor::_item_edited() {
|
||||||
_edit_set(name, item->get_text(1), refresh_all);
|
_edit_set(name, item->get_text(1), refresh_all);
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
// math types
|
|
||||||
|
|
||||||
|
// math types
|
||||||
case Variant::VECTOR3: {
|
case Variant::VECTOR3: {
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
|
|
|
@ -168,7 +168,6 @@ static String get_full_version_string() {
|
||||||
}
|
}
|
||||||
|
|
||||||
//#define DEBUG_INIT
|
//#define DEBUG_INIT
|
||||||
|
|
||||||
#ifdef DEBUG_INIT
|
#ifdef DEBUG_INIT
|
||||||
#define MAIN_PRINT(m_txt) print_line(m_txt)
|
#define MAIN_PRINT(m_txt) print_line(m_txt)
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -1057,7 +1057,7 @@ MainLoop *test(TestType p_type) {
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
} // namespace TestGDScript
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
@ -1067,6 +1067,6 @@ MainLoop *test(TestType p_type) {
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
} // namespace TestGDScript
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -42,6 +42,6 @@ enum TestType {
|
||||||
};
|
};
|
||||||
|
|
||||||
MainLoop *test(TestType p_type);
|
MainLoop *test(TestType p_type);
|
||||||
}
|
} // namespace TestGDScript
|
||||||
|
|
||||||
#endif // TEST_GDSCRIPT_H
|
#endif // TEST_GDSCRIPT_H
|
||||||
|
|
|
@ -65,4 +65,4 @@ MainLoop *test() {
|
||||||
|
|
||||||
return memnew(TestMainLoop);
|
return memnew(TestMainLoop);
|
||||||
}
|
}
|
||||||
}
|
} // namespace TestImage
|
||||||
|
|
|
@ -118,7 +118,7 @@ MainLoop *test() {
|
||||||
|
|
||||||
return memnew(TestMainLoop);
|
return memnew(TestMainLoop);
|
||||||
}
|
}
|
||||||
}
|
} // namespace TestIO
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
@ -128,5 +128,5 @@ MainLoop *test() {
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
} // namespace TestIO
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -684,4 +684,4 @@ MainLoop *test() {
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
} // namespace TestMath
|
||||||
|
|
|
@ -435,4 +435,4 @@ MainLoop *test() {
|
||||||
|
|
||||||
return memnew(TestPhysicsMainLoop);
|
return memnew(TestPhysicsMainLoop);
|
||||||
}
|
}
|
||||||
}
|
} // namespace TestPhysics
|
||||||
|
|
|
@ -431,4 +431,4 @@ MainLoop *test() {
|
||||||
|
|
||||||
return memnew(TestPhysics2DMainLoop);
|
return memnew(TestPhysics2DMainLoop);
|
||||||
}
|
}
|
||||||
}
|
} // namespace TestPhysics2D
|
||||||
|
|
|
@ -241,4 +241,4 @@ MainLoop *test() {
|
||||||
|
|
||||||
return memnew(TestMainLoop);
|
return memnew(TestMainLoop);
|
||||||
}
|
}
|
||||||
}
|
} // namespace TestRender
|
||||||
|
|
|
@ -339,4 +339,4 @@ MainLoop *test() {
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
} // namespace TestShaderLang
|
||||||
|
|
|
@ -919,4 +919,4 @@ MainLoop *test() {
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
} // namespace TestString
|
||||||
|
|
|
@ -37,19 +37,19 @@
|
||||||
#include "collision_object_bullet.h"
|
#include "collision_object_bullet.h"
|
||||||
#include "space_bullet.h"
|
#include "space_bullet.h"
|
||||||
|
|
||||||
AreaBullet::AreaBullet()
|
AreaBullet::AreaBullet() :
|
||||||
: RigidCollisionObjectBullet(CollisionObjectBullet::TYPE_AREA),
|
RigidCollisionObjectBullet(CollisionObjectBullet::TYPE_AREA),
|
||||||
monitorable(true),
|
monitorable(true),
|
||||||
isScratched(false),
|
isScratched(false),
|
||||||
spOv_mode(PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED),
|
spOv_mode(PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED),
|
||||||
spOv_gravityPoint(false),
|
spOv_gravityPoint(false),
|
||||||
spOv_gravityPointDistanceScale(0),
|
spOv_gravityPointDistanceScale(0),
|
||||||
spOv_gravityPointAttenuation(1),
|
spOv_gravityPointAttenuation(1),
|
||||||
spOv_gravityVec(0, -1, 0),
|
spOv_gravityVec(0, -1, 0),
|
||||||
spOv_gravityMag(10),
|
spOv_gravityMag(10),
|
||||||
spOv_linearDump(0.1),
|
spOv_linearDump(0.1),
|
||||||
spOv_angularDump(1),
|
spOv_angularDump(1),
|
||||||
spOv_priority(0) {
|
spOv_priority(0) {
|
||||||
|
|
||||||
btGhost = bulletnew(btGhostObject);
|
btGhost = bulletnew(btGhostObject);
|
||||||
btGhost->setCollisionShape(compoundShape);
|
btGhost->setCollisionShape(compoundShape);
|
||||||
|
|
|
@ -47,8 +47,8 @@ public:
|
||||||
ObjectID event_callback_id;
|
ObjectID event_callback_id;
|
||||||
StringName event_callback_method;
|
StringName event_callback_method;
|
||||||
|
|
||||||
InOutEventCallback()
|
InOutEventCallback() :
|
||||||
: event_callback_id(0) {}
|
event_callback_id(0) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
enum OverlapState {
|
enum OverlapState {
|
||||||
|
@ -62,10 +62,12 @@ public:
|
||||||
CollisionObjectBullet *object;
|
CollisionObjectBullet *object;
|
||||||
OverlapState state;
|
OverlapState state;
|
||||||
|
|
||||||
OverlappingObjectData()
|
OverlappingObjectData() :
|
||||||
: object(NULL), state(OVERLAP_STATE_ENTER) {}
|
object(NULL),
|
||||||
OverlappingObjectData(CollisionObjectBullet *p_object, OverlapState p_state)
|
state(OVERLAP_STATE_ENTER) {}
|
||||||
: object(p_object), state(p_state) {}
|
OverlappingObjectData(CollisionObjectBullet *p_object, OverlapState p_state) :
|
||||||
|
object(p_object),
|
||||||
|
state(p_state) {}
|
||||||
OverlappingObjectData(const OverlappingObjectData &other) {
|
OverlappingObjectData(const OverlappingObjectData &other) {
|
||||||
operator=(other);
|
operator=(other);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,9 +33,9 @@
|
||||||
#include "LinearMath/btAabbUtil2.h"
|
#include "LinearMath/btAabbUtil2.h"
|
||||||
#include "math/math_funcs.h"
|
#include "math/math_funcs.h"
|
||||||
|
|
||||||
btRayShape::btRayShape(btScalar length)
|
btRayShape::btRayShape(btScalar length) :
|
||||||
: btConvexInternalShape(),
|
btConvexInternalShape(),
|
||||||
m_shapeAxis(0, 0, 1) {
|
m_shapeAxis(0, 0, 1) {
|
||||||
m_shapeType = CUSTOM_CONVEX_SHAPE_TYPE;
|
m_shapeType = CUSTOM_CONVEX_SHAPE_TYPE;
|
||||||
setLength(length);
|
setLength(length);
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,10 +78,10 @@ void BulletPhysicsServer::_bind_methods() {
|
||||||
//ClassDB::bind_method(D_METHOD("DoTest"), &BulletPhysicsServer::DoTest);
|
//ClassDB::bind_method(D_METHOD("DoTest"), &BulletPhysicsServer::DoTest);
|
||||||
}
|
}
|
||||||
|
|
||||||
BulletPhysicsServer::BulletPhysicsServer()
|
BulletPhysicsServer::BulletPhysicsServer() :
|
||||||
: PhysicsServer(),
|
PhysicsServer(),
|
||||||
active(true),
|
active(true),
|
||||||
active_spaces_count(0) {}
|
active_spaces_count(0) {}
|
||||||
|
|
||||||
BulletPhysicsServer::~BulletPhysicsServer() {}
|
BulletPhysicsServer::~BulletPhysicsServer() {}
|
||||||
|
|
||||||
|
|
|
@ -50,8 +50,14 @@ void CollisionObjectBullet::ShapeWrapper::set_transform(const btTransform &p_tra
|
||||||
transform = p_transform;
|
transform = p_transform;
|
||||||
}
|
}
|
||||||
|
|
||||||
CollisionObjectBullet::CollisionObjectBullet(Type p_type)
|
CollisionObjectBullet::CollisionObjectBullet(Type p_type) :
|
||||||
: RIDBullet(), space(NULL), type(p_type), collisionsEnabled(true), m_isStatic(false), bt_collision_object(NULL), body_scale(1., 1., 1.) {}
|
RIDBullet(),
|
||||||
|
space(NULL),
|
||||||
|
type(p_type),
|
||||||
|
collisionsEnabled(true),
|
||||||
|
m_isStatic(false),
|
||||||
|
bt_collision_object(NULL),
|
||||||
|
body_scale(1., 1., 1.) {}
|
||||||
|
|
||||||
CollisionObjectBullet::~CollisionObjectBullet() {
|
CollisionObjectBullet::~CollisionObjectBullet() {
|
||||||
// Remove all overlapping
|
// Remove all overlapping
|
||||||
|
@ -165,8 +171,9 @@ const btTransform &CollisionObjectBullet::get_transform__bullet() const {
|
||||||
return bt_collision_object->getWorldTransform();
|
return bt_collision_object->getWorldTransform();
|
||||||
}
|
}
|
||||||
|
|
||||||
RigidCollisionObjectBullet::RigidCollisionObjectBullet(Type p_type)
|
RigidCollisionObjectBullet::RigidCollisionObjectBullet(Type p_type) :
|
||||||
: CollisionObjectBullet(p_type), compoundShape(bulletnew(btCompoundShape(enableDynamicAabbTree, initialChildCapacity))) {
|
CollisionObjectBullet(p_type),
|
||||||
|
compoundShape(bulletnew(btCompoundShape(enableDynamicAabbTree, initialChildCapacity))) {
|
||||||
}
|
}
|
||||||
|
|
||||||
RigidCollisionObjectBullet::~RigidCollisionObjectBullet() {
|
RigidCollisionObjectBullet::~RigidCollisionObjectBullet() {
|
||||||
|
|
|
@ -70,16 +70,22 @@ public:
|
||||||
btTransform transform;
|
btTransform transform;
|
||||||
bool active;
|
bool active;
|
||||||
|
|
||||||
ShapeWrapper()
|
ShapeWrapper() :
|
||||||
: shape(NULL), bt_shape(NULL), active(true) {}
|
shape(NULL),
|
||||||
|
bt_shape(NULL),
|
||||||
|
active(true) {}
|
||||||
|
|
||||||
ShapeWrapper(ShapeBullet *p_shape, const btTransform &p_transform, bool p_active)
|
ShapeWrapper(ShapeBullet *p_shape, const btTransform &p_transform, bool p_active) :
|
||||||
: shape(p_shape), bt_shape(NULL), active(p_active) {
|
shape(p_shape),
|
||||||
|
bt_shape(NULL),
|
||||||
|
active(p_active) {
|
||||||
set_transform(p_transform);
|
set_transform(p_transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
ShapeWrapper(ShapeBullet *p_shape, const Transform &p_transform, bool p_active)
|
ShapeWrapper(ShapeBullet *p_shape, const Transform &p_transform, bool p_active) :
|
||||||
: shape(p_shape), bt_shape(NULL), active(p_active) {
|
shape(p_shape),
|
||||||
|
bt_shape(NULL),
|
||||||
|
active(p_active) {
|
||||||
set_transform(p_transform);
|
set_transform(p_transform);
|
||||||
}
|
}
|
||||||
~ShapeWrapper();
|
~ShapeWrapper();
|
||||||
|
|
|
@ -35,8 +35,8 @@
|
||||||
#include "bullet_utilities.h"
|
#include "bullet_utilities.h"
|
||||||
#include "rigid_body_bullet.h"
|
#include "rigid_body_bullet.h"
|
||||||
|
|
||||||
ConeTwistJointBullet::ConeTwistJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &rbAFrame, const Transform &rbBFrame)
|
ConeTwistJointBullet::ConeTwistJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &rbAFrame, const Transform &rbBFrame) :
|
||||||
: JointBullet() {
|
JointBullet() {
|
||||||
btTransform btFrameA;
|
btTransform btFrameA;
|
||||||
G_TO_B(rbAFrame, btFrameA);
|
G_TO_B(rbAFrame, btFrameA);
|
||||||
if (rbB) {
|
if (rbB) {
|
||||||
|
|
|
@ -33,8 +33,9 @@
|
||||||
#include "collision_object_bullet.h"
|
#include "collision_object_bullet.h"
|
||||||
#include "space_bullet.h"
|
#include "space_bullet.h"
|
||||||
|
|
||||||
ConstraintBullet::ConstraintBullet()
|
ConstraintBullet::ConstraintBullet() :
|
||||||
: space(NULL), constraint(NULL) {}
|
space(NULL),
|
||||||
|
constraint(NULL) {}
|
||||||
|
|
||||||
void ConstraintBullet::setup(btTypedConstraint *p_constraint) {
|
void ConstraintBullet::setup(btTypedConstraint *p_constraint) {
|
||||||
constraint = p_constraint;
|
constraint = p_constraint;
|
||||||
|
|
|
@ -35,8 +35,8 @@
|
||||||
#include "bullet_utilities.h"
|
#include "bullet_utilities.h"
|
||||||
#include "rigid_body_bullet.h"
|
#include "rigid_body_bullet.h"
|
||||||
|
|
||||||
Generic6DOFJointBullet::Generic6DOFJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB, bool useLinearReferenceFrameA)
|
Generic6DOFJointBullet::Generic6DOFJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB, bool useLinearReferenceFrameA) :
|
||||||
: JointBullet() {
|
JointBullet() {
|
||||||
|
|
||||||
btTransform btFrameA;
|
btTransform btFrameA;
|
||||||
G_TO_B(frameInA, btFrameA);
|
G_TO_B(frameInA, btFrameA);
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
#include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"
|
#include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"
|
||||||
#include "godot_ray_world_algorithm.h"
|
#include "godot_ray_world_algorithm.h"
|
||||||
|
|
||||||
GodotCollisionConfiguration::GodotCollisionConfiguration(const btDiscreteDynamicsWorld *world, const btDefaultCollisionConstructionInfo &constructionInfo)
|
GodotCollisionConfiguration::GodotCollisionConfiguration(const btDiscreteDynamicsWorld *world, const btDefaultCollisionConstructionInfo &constructionInfo) :
|
||||||
: btDefaultCollisionConfiguration(constructionInfo) {
|
btDefaultCollisionConfiguration(constructionInfo) {
|
||||||
|
|
||||||
void *mem = NULL;
|
void *mem = NULL;
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
|
|
||||||
const int GodotCollisionDispatcher::CASTED_TYPE_AREA = static_cast<int>(CollisionObjectBullet::TYPE_AREA);
|
const int GodotCollisionDispatcher::CASTED_TYPE_AREA = static_cast<int>(CollisionObjectBullet::TYPE_AREA);
|
||||||
|
|
||||||
GodotCollisionDispatcher::GodotCollisionDispatcher(btCollisionConfiguration *collisionConfiguration)
|
GodotCollisionDispatcher::GodotCollisionDispatcher(btCollisionConfiguration *collisionConfiguration) :
|
||||||
: btCollisionDispatcher(collisionConfiguration) {}
|
btCollisionDispatcher(collisionConfiguration) {}
|
||||||
|
|
||||||
bool GodotCollisionDispatcher::needsCollision(const btCollisionObject *body0, const btCollisionObject *body1) {
|
bool GodotCollisionDispatcher::needsCollision(const btCollisionObject *body0, const btCollisionObject *body1) {
|
||||||
if (body0->getUserIndex() == CASTED_TYPE_AREA || body1->getUserIndex() == CASTED_TYPE_AREA) {
|
if (body0->getUserIndex() == CASTED_TYPE_AREA || body1->getUserIndex() == CASTED_TYPE_AREA) {
|
||||||
|
|
|
@ -51,10 +51,10 @@ class GodotMotionState : public btMotionState {
|
||||||
RigidBodyBullet *owner;
|
RigidBodyBullet *owner;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GodotMotionState(RigidBodyBullet *p_owner)
|
GodotMotionState(RigidBodyBullet *p_owner) :
|
||||||
: bodyKinematicWorldTransf(btMatrix3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), btVector3(0., 0., 0.)),
|
bodyKinematicWorldTransf(btMatrix3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), btVector3(0., 0., 0.)),
|
||||||
bodyCurrentWorldTransform(btMatrix3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), btVector3(0., 0., 0.)),
|
bodyCurrentWorldTransform(btMatrix3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), btVector3(0., 0., 0.)),
|
||||||
owner(p_owner) {}
|
owner(p_owner) {}
|
||||||
|
|
||||||
/// IMPORTANT DON'T USE THIS FUNCTION TO KNOW THE CURRENT BODY TRANSFORM
|
/// IMPORTANT DON'T USE THIS FUNCTION TO KNOW THE CURRENT BODY TRANSFORM
|
||||||
/// This class is used internally by Bullet
|
/// This class is used internally by Bullet
|
||||||
|
|
|
@ -34,18 +34,18 @@
|
||||||
#include "btRayShape.h"
|
#include "btRayShape.h"
|
||||||
#include "collision_object_bullet.h"
|
#include "collision_object_bullet.h"
|
||||||
|
|
||||||
GodotRayWorldAlgorithm::CreateFunc::CreateFunc(const btDiscreteDynamicsWorld *world)
|
GodotRayWorldAlgorithm::CreateFunc::CreateFunc(const btDiscreteDynamicsWorld *world) :
|
||||||
: m_world(world) {}
|
m_world(world) {}
|
||||||
|
|
||||||
GodotRayWorldAlgorithm::SwappedCreateFunc::SwappedCreateFunc(const btDiscreteDynamicsWorld *world)
|
GodotRayWorldAlgorithm::SwappedCreateFunc::SwappedCreateFunc(const btDiscreteDynamicsWorld *world) :
|
||||||
: m_world(world) {}
|
m_world(world) {}
|
||||||
|
|
||||||
GodotRayWorldAlgorithm::GodotRayWorldAlgorithm(const btDiscreteDynamicsWorld *world, btPersistentManifold *mf, const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, bool isSwapped)
|
GodotRayWorldAlgorithm::GodotRayWorldAlgorithm(const btDiscreteDynamicsWorld *world, btPersistentManifold *mf, const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, bool isSwapped) :
|
||||||
: btActivatingCollisionAlgorithm(ci, body0Wrap, body1Wrap),
|
btActivatingCollisionAlgorithm(ci, body0Wrap, body1Wrap),
|
||||||
m_manifoldPtr(mf),
|
m_manifoldPtr(mf),
|
||||||
m_ownManifold(false),
|
m_ownManifold(false),
|
||||||
m_world(world),
|
m_world(world),
|
||||||
m_isSwapped(isSwapped) {}
|
m_isSwapped(isSwapped) {}
|
||||||
|
|
||||||
GodotRayWorldAlgorithm::~GodotRayWorldAlgorithm() {
|
GodotRayWorldAlgorithm::~GodotRayWorldAlgorithm() {
|
||||||
if (m_ownManifold && m_manifoldPtr) {
|
if (m_ownManifold && m_manifoldPtr) {
|
||||||
|
|
|
@ -52,8 +52,10 @@ struct GodotClosestRayResultCallback : public btCollisionWorld::ClosestRayResult
|
||||||
bool m_pickRay;
|
bool m_pickRay;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GodotClosestRayResultCallback(const btVector3 &rayFromWorld, const btVector3 &rayToWorld, const Set<RID> *p_exclude)
|
GodotClosestRayResultCallback(const btVector3 &rayFromWorld, const btVector3 &rayToWorld, const Set<RID> *p_exclude) :
|
||||||
: btCollisionWorld::ClosestRayResultCallback(rayFromWorld, rayToWorld), m_exclude(p_exclude), m_pickRay(false) {}
|
btCollisionWorld::ClosestRayResultCallback(rayFromWorld, rayToWorld),
|
||||||
|
m_exclude(p_exclude),
|
||||||
|
m_pickRay(false) {}
|
||||||
|
|
||||||
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
|
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
|
||||||
};
|
};
|
||||||
|
@ -66,8 +68,11 @@ public:
|
||||||
int count;
|
int count;
|
||||||
const Set<RID> *m_exclude;
|
const Set<RID> *m_exclude;
|
||||||
|
|
||||||
GodotAllConvexResultCallback(PhysicsDirectSpaceState::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude)
|
GodotAllConvexResultCallback(PhysicsDirectSpaceState::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude) :
|
||||||
: m_results(p_results), m_exclude(p_exclude), m_resultMax(p_resultMax), count(0) {}
|
m_results(p_results),
|
||||||
|
m_exclude(p_exclude),
|
||||||
|
m_resultMax(p_resultMax),
|
||||||
|
count(0) {}
|
||||||
|
|
||||||
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
|
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
|
||||||
|
|
||||||
|
@ -79,8 +84,10 @@ public:
|
||||||
const RigidBodyBullet *m_self_object;
|
const RigidBodyBullet *m_self_object;
|
||||||
const bool m_ignore_areas;
|
const bool m_ignore_areas;
|
||||||
|
|
||||||
GodotKinClosestConvexResultCallback(const btVector3 &convexFromWorld, const btVector3 &convexToWorld, const RigidBodyBullet *p_self_object, bool p_ignore_areas)
|
GodotKinClosestConvexResultCallback(const btVector3 &convexFromWorld, const btVector3 &convexToWorld, const RigidBodyBullet *p_self_object, bool p_ignore_areas) :
|
||||||
: btCollisionWorld::ClosestConvexResultCallback(convexFromWorld, convexToWorld), m_self_object(p_self_object), m_ignore_areas(p_ignore_areas) {}
|
btCollisionWorld::ClosestConvexResultCallback(convexFromWorld, convexToWorld),
|
||||||
|
m_self_object(p_self_object),
|
||||||
|
m_ignore_areas(p_ignore_areas) {}
|
||||||
|
|
||||||
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
|
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
|
||||||
};
|
};
|
||||||
|
@ -90,8 +97,9 @@ public:
|
||||||
const Set<RID> *m_exclude;
|
const Set<RID> *m_exclude;
|
||||||
int m_shapeId;
|
int m_shapeId;
|
||||||
|
|
||||||
GodotClosestConvexResultCallback(const btVector3 &convexFromWorld, const btVector3 &convexToWorld, const Set<RID> *p_exclude)
|
GodotClosestConvexResultCallback(const btVector3 &convexFromWorld, const btVector3 &convexToWorld, const Set<RID> *p_exclude) :
|
||||||
: btCollisionWorld::ClosestConvexResultCallback(convexFromWorld, convexToWorld), m_exclude(p_exclude) {}
|
btCollisionWorld::ClosestConvexResultCallback(convexFromWorld, convexToWorld),
|
||||||
|
m_exclude(p_exclude) {}
|
||||||
|
|
||||||
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
|
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
|
||||||
|
|
||||||
|
@ -106,8 +114,12 @@ public:
|
||||||
int m_count;
|
int m_count;
|
||||||
const Set<RID> *m_exclude;
|
const Set<RID> *m_exclude;
|
||||||
|
|
||||||
GodotAllContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude)
|
GodotAllContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude) :
|
||||||
: m_self_object(p_self_object), m_results(p_results), m_exclude(p_exclude), m_resultMax(p_resultMax), m_count(0) {}
|
m_self_object(p_self_object),
|
||||||
|
m_results(p_results),
|
||||||
|
m_exclude(p_exclude),
|
||||||
|
m_resultMax(p_resultMax),
|
||||||
|
m_count(0) {}
|
||||||
|
|
||||||
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
|
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
|
||||||
|
|
||||||
|
@ -123,8 +135,12 @@ public:
|
||||||
int m_count;
|
int m_count;
|
||||||
const Set<RID> *m_exclude;
|
const Set<RID> *m_exclude;
|
||||||
|
|
||||||
GodotContactPairContactResultCallback(btCollisionObject *p_self_object, Vector3 *p_results, int p_resultMax, const Set<RID> *p_exclude)
|
GodotContactPairContactResultCallback(btCollisionObject *p_self_object, Vector3 *p_results, int p_resultMax, const Set<RID> *p_exclude) :
|
||||||
: m_self_object(p_self_object), m_results(p_results), m_exclude(p_exclude), m_resultMax(p_resultMax), m_count(0) {}
|
m_self_object(p_self_object),
|
||||||
|
m_results(p_results),
|
||||||
|
m_exclude(p_exclude),
|
||||||
|
m_resultMax(p_resultMax),
|
||||||
|
m_count(0) {}
|
||||||
|
|
||||||
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
|
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
|
||||||
|
|
||||||
|
@ -141,8 +157,12 @@ public:
|
||||||
btVector3 m_rest_info_bt_point;
|
btVector3 m_rest_info_bt_point;
|
||||||
const Set<RID> *m_exclude;
|
const Set<RID> *m_exclude;
|
||||||
|
|
||||||
GodotRestInfoContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState::ShapeRestInfo *p_result, const Set<RID> *p_exclude)
|
GodotRestInfoContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState::ShapeRestInfo *p_result, const Set<RID> *p_exclude) :
|
||||||
: m_self_object(p_self_object), m_result(p_result), m_exclude(p_exclude), m_collided(false), m_min_distance(0) {}
|
m_self_object(p_self_object),
|
||||||
|
m_result(p_result),
|
||||||
|
m_exclude(p_exclude),
|
||||||
|
m_collided(false),
|
||||||
|
m_min_distance(0) {}
|
||||||
|
|
||||||
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
|
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
|
||||||
|
|
||||||
|
@ -158,12 +178,12 @@ struct GodotDeepPenetrationContactResultCallback : public btManifoldResult {
|
||||||
|
|
||||||
btScalar m_most_penetrated_distance;
|
btScalar m_most_penetrated_distance;
|
||||||
|
|
||||||
GodotDeepPenetrationContactResultCallback(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap)
|
GodotDeepPenetrationContactResultCallback(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap) :
|
||||||
: btManifoldResult(body0Wrap, body1Wrap),
|
btManifoldResult(body0Wrap, body1Wrap),
|
||||||
m_pointCollisionObject(NULL),
|
m_pointCollisionObject(NULL),
|
||||||
m_penetration_distance(0),
|
m_penetration_distance(0),
|
||||||
m_other_compound_shape_index(0),
|
m_other_compound_shape_index(0),
|
||||||
m_most_penetrated_distance(1e20) {}
|
m_most_penetrated_distance(1e20) {}
|
||||||
|
|
||||||
void reset() {
|
void reset() {
|
||||||
m_pointCollisionObject = NULL;
|
m_pointCollisionObject = NULL;
|
||||||
|
|
|
@ -35,8 +35,8 @@
|
||||||
#include "bullet_utilities.h"
|
#include "bullet_utilities.h"
|
||||||
#include "rigid_body_bullet.h"
|
#include "rigid_body_bullet.h"
|
||||||
|
|
||||||
HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameA, const Transform &frameB)
|
HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameA, const Transform &frameB) :
|
||||||
: JointBullet() {
|
JointBullet() {
|
||||||
btTransform btFrameA;
|
btTransform btFrameA;
|
||||||
G_TO_B(frameA, btFrameA);
|
G_TO_B(frameA, btFrameA);
|
||||||
|
|
||||||
|
@ -53,8 +53,8 @@ HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, c
|
||||||
setup(hingeConstraint);
|
setup(hingeConstraint);
|
||||||
}
|
}
|
||||||
|
|
||||||
HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Vector3 &pivotInA, const Vector3 &pivotInB, const Vector3 &axisInA, const Vector3 &axisInB)
|
HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Vector3 &pivotInA, const Vector3 &pivotInB, const Vector3 &axisInA, const Vector3 &axisInB) :
|
||||||
: JointBullet() {
|
JointBullet() {
|
||||||
|
|
||||||
btVector3 btPivotA;
|
btVector3 btPivotA;
|
||||||
btVector3 btAxisA;
|
btVector3 btAxisA;
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#include "joint_bullet.h"
|
#include "joint_bullet.h"
|
||||||
#include "space_bullet.h"
|
#include "space_bullet.h"
|
||||||
|
|
||||||
JointBullet::JointBullet()
|
JointBullet::JointBullet() :
|
||||||
: ConstraintBullet() {}
|
ConstraintBullet() {}
|
||||||
|
|
||||||
JointBullet::~JointBullet() {}
|
JointBullet::~JointBullet() {}
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
#include "bullet_types_converter.h"
|
#include "bullet_types_converter.h"
|
||||||
#include "rigid_body_bullet.h"
|
#include "rigid_body_bullet.h"
|
||||||
|
|
||||||
PinJointBullet::PinJointBullet(RigidBodyBullet *p_body_a, const Vector3 &p_pos_a, RigidBodyBullet *p_body_b, const Vector3 &p_pos_b)
|
PinJointBullet::PinJointBullet(RigidBodyBullet *p_body_a, const Vector3 &p_pos_a, RigidBodyBullet *p_body_b, const Vector3 &p_pos_b) :
|
||||||
: JointBullet() {
|
JointBullet() {
|
||||||
if (p_body_b) {
|
if (p_body_b) {
|
||||||
|
|
||||||
btVector3 btPivotA;
|
btVector3 btPivotA;
|
||||||
|
|
|
@ -176,9 +176,9 @@ PhysicsDirectSpaceState *BulletPhysicsDirectBodyState::get_space_state() {
|
||||||
return body->get_space()->get_direct_state();
|
return body->get_space()->get_direct_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
RigidBodyBullet::KinematicUtilities::KinematicUtilities(RigidBodyBullet *p_owner)
|
RigidBodyBullet::KinematicUtilities::KinematicUtilities(RigidBodyBullet *p_owner) :
|
||||||
: owner(p_owner),
|
owner(p_owner),
|
||||||
safe_margin(0.001) {
|
safe_margin(0.001) {
|
||||||
}
|
}
|
||||||
|
|
||||||
RigidBodyBullet::KinematicUtilities::~KinematicUtilities() {
|
RigidBodyBullet::KinematicUtilities::~KinematicUtilities() {
|
||||||
|
@ -250,22 +250,22 @@ void RigidBodyBullet::KinematicUtilities::just_delete_shapes(int new_size) {
|
||||||
shapes.resize(new_size);
|
shapes.resize(new_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
RigidBodyBullet::RigidBodyBullet()
|
RigidBodyBullet::RigidBodyBullet() :
|
||||||
: RigidCollisionObjectBullet(CollisionObjectBullet::TYPE_RIGID_BODY),
|
RigidCollisionObjectBullet(CollisionObjectBullet::TYPE_RIGID_BODY),
|
||||||
kinematic_utilities(NULL),
|
kinematic_utilities(NULL),
|
||||||
gravity_scale(1),
|
gravity_scale(1),
|
||||||
mass(1),
|
mass(1),
|
||||||
linearDamp(0),
|
linearDamp(0),
|
||||||
angularDamp(0),
|
angularDamp(0),
|
||||||
can_sleep(true),
|
can_sleep(true),
|
||||||
force_integration_callback(NULL),
|
force_integration_callback(NULL),
|
||||||
isTransformChanged(false),
|
isTransformChanged(false),
|
||||||
maxCollisionsDetection(0),
|
maxCollisionsDetection(0),
|
||||||
collisionsCount(0),
|
collisionsCount(0),
|
||||||
maxAreasWhereIam(10),
|
maxAreasWhereIam(10),
|
||||||
areaWhereIamCount(0),
|
areaWhereIamCount(0),
|
||||||
countGravityPointSpaces(0),
|
countGravityPointSpaces(0),
|
||||||
isScratchedSpaceOverrideModificator(false) {
|
isScratchedSpaceOverrideModificator(false) {
|
||||||
|
|
||||||
godotMotionState = bulletnew(GodotMotionState(this));
|
godotMotionState = bulletnew(GodotMotionState(this));
|
||||||
|
|
||||||
|
|
|
@ -156,8 +156,8 @@ public:
|
||||||
class btConvexShape *shape;
|
class btConvexShape *shape;
|
||||||
btTransform transform;
|
btTransform transform;
|
||||||
|
|
||||||
KinematicShape()
|
KinematicShape() :
|
||||||
: shape(NULL) {}
|
shape(NULL) {}
|
||||||
const bool is_active() const { return shape; }
|
const bool is_active() const { return shape; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -130,8 +130,8 @@ btRayShape *ShapeBullet::create_shape_ray(real_t p_length) {
|
||||||
|
|
||||||
/* PLANE */
|
/* PLANE */
|
||||||
|
|
||||||
PlaneShapeBullet::PlaneShapeBullet()
|
PlaneShapeBullet::PlaneShapeBullet() :
|
||||||
: ShapeBullet() {}
|
ShapeBullet() {}
|
||||||
|
|
||||||
void PlaneShapeBullet::set_data(const Variant &p_data) {
|
void PlaneShapeBullet::set_data(const Variant &p_data) {
|
||||||
setup(p_data);
|
setup(p_data);
|
||||||
|
@ -158,8 +158,8 @@ btCollisionShape *PlaneShapeBullet::create_bt_shape() {
|
||||||
|
|
||||||
/* Sphere */
|
/* Sphere */
|
||||||
|
|
||||||
SphereShapeBullet::SphereShapeBullet()
|
SphereShapeBullet::SphereShapeBullet() :
|
||||||
: ShapeBullet() {}
|
ShapeBullet() {}
|
||||||
|
|
||||||
void SphereShapeBullet::set_data(const Variant &p_data) {
|
void SphereShapeBullet::set_data(const Variant &p_data) {
|
||||||
setup(p_data);
|
setup(p_data);
|
||||||
|
@ -183,8 +183,8 @@ btCollisionShape *SphereShapeBullet::create_bt_shape() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Box */
|
/* Box */
|
||||||
BoxShapeBullet::BoxShapeBullet()
|
BoxShapeBullet::BoxShapeBullet() :
|
||||||
: ShapeBullet() {}
|
ShapeBullet() {}
|
||||||
|
|
||||||
void BoxShapeBullet::set_data(const Variant &p_data) {
|
void BoxShapeBullet::set_data(const Variant &p_data) {
|
||||||
setup(p_data);
|
setup(p_data);
|
||||||
|
@ -211,8 +211,8 @@ btCollisionShape *BoxShapeBullet::create_bt_shape() {
|
||||||
|
|
||||||
/* Capsule */
|
/* Capsule */
|
||||||
|
|
||||||
CapsuleShapeBullet::CapsuleShapeBullet()
|
CapsuleShapeBullet::CapsuleShapeBullet() :
|
||||||
: ShapeBullet() {}
|
ShapeBullet() {}
|
||||||
|
|
||||||
void CapsuleShapeBullet::set_data(const Variant &p_data) {
|
void CapsuleShapeBullet::set_data(const Variant &p_data) {
|
||||||
Dictionary d = p_data;
|
Dictionary d = p_data;
|
||||||
|
@ -244,8 +244,8 @@ btCollisionShape *CapsuleShapeBullet::create_bt_shape() {
|
||||||
|
|
||||||
/* Convex polygon */
|
/* Convex polygon */
|
||||||
|
|
||||||
ConvexPolygonShapeBullet::ConvexPolygonShapeBullet()
|
ConvexPolygonShapeBullet::ConvexPolygonShapeBullet() :
|
||||||
: ShapeBullet() {}
|
ShapeBullet() {}
|
||||||
|
|
||||||
void ConvexPolygonShapeBullet::set_data(const Variant &p_data) {
|
void ConvexPolygonShapeBullet::set_data(const Variant &p_data) {
|
||||||
setup(p_data);
|
setup(p_data);
|
||||||
|
@ -286,8 +286,9 @@ btCollisionShape *ConvexPolygonShapeBullet::create_bt_shape() {
|
||||||
|
|
||||||
/* Concave polygon */
|
/* Concave polygon */
|
||||||
|
|
||||||
ConcavePolygonShapeBullet::ConcavePolygonShapeBullet()
|
ConcavePolygonShapeBullet::ConcavePolygonShapeBullet() :
|
||||||
: ShapeBullet(), meshShape(NULL) {}
|
ShapeBullet(),
|
||||||
|
meshShape(NULL) {}
|
||||||
|
|
||||||
ConcavePolygonShapeBullet::~ConcavePolygonShapeBullet() {
|
ConcavePolygonShapeBullet::~ConcavePolygonShapeBullet() {
|
||||||
if (meshShape) {
|
if (meshShape) {
|
||||||
|
@ -359,8 +360,8 @@ btCollisionShape *ConcavePolygonShapeBullet::create_bt_shape() {
|
||||||
|
|
||||||
/* Height map shape */
|
/* Height map shape */
|
||||||
|
|
||||||
HeightMapShapeBullet::HeightMapShapeBullet()
|
HeightMapShapeBullet::HeightMapShapeBullet() :
|
||||||
: ShapeBullet() {}
|
ShapeBullet() {}
|
||||||
|
|
||||||
void HeightMapShapeBullet::set_data(const Variant &p_data) {
|
void HeightMapShapeBullet::set_data(const Variant &p_data) {
|
||||||
ERR_FAIL_COND(p_data.get_type() != Variant::DICTIONARY);
|
ERR_FAIL_COND(p_data.get_type() != Variant::DICTIONARY);
|
||||||
|
@ -411,8 +412,9 @@ btCollisionShape *HeightMapShapeBullet::create_bt_shape() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ray shape */
|
/* Ray shape */
|
||||||
RayShapeBullet::RayShapeBullet()
|
RayShapeBullet::RayShapeBullet() :
|
||||||
: ShapeBullet(), length(1) {}
|
ShapeBullet(),
|
||||||
|
length(1) {}
|
||||||
|
|
||||||
void RayShapeBullet::set_data(const Variant &p_data) {
|
void RayShapeBullet::set_data(const Variant &p_data) {
|
||||||
setup(p_data);
|
setup(p_data);
|
||||||
|
|
|
@ -35,8 +35,8 @@
|
||||||
#include "bullet_utilities.h"
|
#include "bullet_utilities.h"
|
||||||
#include "rigid_body_bullet.h"
|
#include "rigid_body_bullet.h"
|
||||||
|
|
||||||
SliderJointBullet::SliderJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB)
|
SliderJointBullet::SliderJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB) :
|
||||||
: JointBullet() {
|
JointBullet() {
|
||||||
btTransform btFrameA;
|
btTransform btFrameA;
|
||||||
G_TO_B(frameInA, btFrameA);
|
G_TO_B(frameInA, btFrameA);
|
||||||
if (rbB) {
|
if (rbB) {
|
||||||
|
|
|
@ -36,8 +36,18 @@
|
||||||
|
|
||||||
#include "scene/3d/immediate_geometry.h"
|
#include "scene/3d/immediate_geometry.h"
|
||||||
|
|
||||||
SoftBodyBullet::SoftBodyBullet()
|
SoftBodyBullet::SoftBodyBullet() :
|
||||||
: CollisionObjectBullet(CollisionObjectBullet::TYPE_SOFT_BODY), mass(1), simulation_precision(5), stiffness(0.5f), pressure_coefficient(50), damping_coefficient(0.005), drag_coefficient(0.005), bt_soft_body(NULL), soft_shape_type(SOFT_SHAPETYPE_NONE), isScratched(false), soft_body_shape_data(NULL) {
|
CollisionObjectBullet(CollisionObjectBullet::TYPE_SOFT_BODY),
|
||||||
|
mass(1),
|
||||||
|
simulation_precision(5),
|
||||||
|
stiffness(0.5f),
|
||||||
|
pressure_coefficient(50),
|
||||||
|
damping_coefficient(0.005),
|
||||||
|
drag_coefficient(0.005),
|
||||||
|
bt_soft_body(NULL),
|
||||||
|
soft_shape_type(SOFT_SHAPETYPE_NONE),
|
||||||
|
isScratched(false),
|
||||||
|
soft_body_shape_data(NULL) {
|
||||||
|
|
||||||
test_geometry = memnew(ImmediateGeometry);
|
test_geometry = memnew(ImmediateGeometry);
|
||||||
|
|
||||||
|
|
|
@ -50,8 +50,9 @@
|
||||||
#include "ustring.h"
|
#include "ustring.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
BulletPhysicsDirectSpaceState::BulletPhysicsDirectSpaceState(SpaceBullet *p_space)
|
BulletPhysicsDirectSpaceState::BulletPhysicsDirectSpaceState(SpaceBullet *p_space) :
|
||||||
: PhysicsDirectSpaceState(), space(p_space) {}
|
PhysicsDirectSpaceState(),
|
||||||
|
space(p_space) {}
|
||||||
|
|
||||||
int BulletPhysicsDirectSpaceState::intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude, uint32_t p_collision_mask) {
|
int BulletPhysicsDirectSpaceState::intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude, uint32_t p_collision_mask) {
|
||||||
|
|
||||||
|
@ -330,18 +331,18 @@ Vector3 BulletPhysicsDirectSpaceState::get_closest_point_to_object_volume(RID p_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SpaceBullet::SpaceBullet(bool p_create_soft_world)
|
SpaceBullet::SpaceBullet(bool p_create_soft_world) :
|
||||||
: broadphase(NULL),
|
broadphase(NULL),
|
||||||
dispatcher(NULL),
|
dispatcher(NULL),
|
||||||
solver(NULL),
|
solver(NULL),
|
||||||
collisionConfiguration(NULL),
|
collisionConfiguration(NULL),
|
||||||
dynamicsWorld(NULL),
|
dynamicsWorld(NULL),
|
||||||
soft_body_world_info(NULL),
|
soft_body_world_info(NULL),
|
||||||
ghostPairCallback(NULL),
|
ghostPairCallback(NULL),
|
||||||
godotFilterCallback(NULL),
|
godotFilterCallback(NULL),
|
||||||
gravityDirection(0, -1, 0),
|
gravityDirection(0, -1, 0),
|
||||||
gravityMagnitude(10),
|
gravityMagnitude(10),
|
||||||
contactDebugCount(0) {
|
contactDebugCount(0) {
|
||||||
|
|
||||||
create_empty_world(p_create_soft_world);
|
create_empty_world(p_create_soft_world);
|
||||||
direct_access = memnew(BulletPhysicsDirectSpaceState(this));
|
direct_access = memnew(BulletPhysicsDirectSpaceState(this));
|
||||||
|
@ -939,14 +940,14 @@ bool SpaceBullet::test_body_motion(RigidBodyBullet *p_body, const Transform &p_f
|
||||||
r_result->collider_shape = r_recover_result.other_compound_shape_index;
|
r_result->collider_shape = r_recover_result.other_compound_shape_index;
|
||||||
r_result->collision_local_shape = r_recover_result.local_shape_most_recovered;
|
r_result->collision_local_shape = r_recover_result.local_shape_most_recovered;
|
||||||
|
|
||||||
//{ /// Add manifold point to manage collisions
|
//{ /// Add manifold point to manage collisions
|
||||||
// btPersistentManifold* manifold = dynamicsWorld->getDispatcher()->getNewManifold(p_body->getBtBody(), btRigid);
|
// btPersistentManifold* manifold = dynamicsWorld->getDispatcher()->getNewManifold(p_body->getBtBody(), btRigid);
|
||||||
// btManifoldPoint manifoldPoint(result_callabck.m_pointWorld, result_callabck.m_pointWorld, result_callabck.m_pointNormalWorld, result_callabck.m_penetration_distance);
|
// btManifoldPoint manifoldPoint(result_callabck.m_pointWorld, result_callabck.m_pointWorld, result_callabck.m_pointNormalWorld, result_callabck.m_penetration_distance);
|
||||||
// manifoldPoint.m_index0 = r_result->collision_local_shape;
|
// manifoldPoint.m_index0 = r_result->collision_local_shape;
|
||||||
// manifoldPoint.m_index1 = r_result->collider_shape;
|
// manifoldPoint.m_index1 = r_result->collider_shape;
|
||||||
// manifold->addManifoldPoint(manifoldPoint);
|
// manifold->addManifoldPoint(manifoldPoint);
|
||||||
// p_body->get_kinematic_utilities()->m_generatedManifold.push_back(manifold);
|
// p_body->get_kinematic_utilities()->m_generatedManifold.push_back(manifold);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
#if debug_test_motion
|
#if debug_test_motion
|
||||||
Vector3 sup_line2;
|
Vector3 sup_line2;
|
||||||
|
@ -979,10 +980,10 @@ public:
|
||||||
Vector<btCollisionObject *> result_collision_objects;
|
Vector<btCollisionObject *> result_collision_objects;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RecoverPenetrationBroadPhaseCallback(const btCollisionObject *p_self_collision_object, uint32_t p_collision_layer, uint32_t p_collision_mask)
|
RecoverPenetrationBroadPhaseCallback(const btCollisionObject *p_self_collision_object, uint32_t p_collision_layer, uint32_t p_collision_mask) :
|
||||||
: self_collision_object(p_self_collision_object),
|
self_collision_object(p_self_collision_object),
|
||||||
collision_layer(p_collision_layer),
|
collision_layer(p_collision_layer),
|
||||||
collision_mask(p_collision_mask) {}
|
collision_mask(p_collision_mask) {}
|
||||||
|
|
||||||
virtual ~RecoverPenetrationBroadPhaseCallback() {}
|
virtual ~RecoverPenetrationBroadPhaseCallback() {}
|
||||||
|
|
||||||
|
|
|
@ -185,8 +185,8 @@ private:
|
||||||
const btCollisionObject *other_collision_object;
|
const btCollisionObject *other_collision_object;
|
||||||
int local_shape_most_recovered;
|
int local_shape_most_recovered;
|
||||||
|
|
||||||
RecoverResult()
|
RecoverResult() :
|
||||||
: hasPenetration(false) {}
|
hasPenetration(false) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
bool recover_from_penetration(RigidBodyBullet *p_body, const btTransform &p_from, btVector3 &r_recover_position, RecoverResult *r_recover_result = NULL);
|
bool recover_from_penetration(RigidBodyBullet *p_body, const btTransform &p_from, btVector3 &r_recover_position, RecoverResult *r_recover_result = NULL);
|
||||||
|
|
|
@ -219,7 +219,7 @@ extern "C" {
|
||||||
void GDAPI godot_arvr_register_interface(const godot_arvr_interface_gdnative *p_interface) {
|
void GDAPI godot_arvr_register_interface(const godot_arvr_interface_gdnative *p_interface) {
|
||||||
Ref<ARVRInterfaceGDNative> new_interface;
|
Ref<ARVRInterfaceGDNative> new_interface;
|
||||||
new_interface.instance();
|
new_interface.instance();
|
||||||
new_interface->set_interface((godot_arvr_interface_gdnative * const)p_interface);
|
new_interface->set_interface((godot_arvr_interface_gdnative *const)p_interface);
|
||||||
ARVRServer::get_singleton()->add_interface(new_interface);
|
ARVRServer::get_singleton()->add_interface(new_interface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,8 +106,8 @@ struct GDNativeCallRegistry {
|
||||||
return singleton;
|
return singleton;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline GDNativeCallRegistry()
|
inline GDNativeCallRegistry() :
|
||||||
: native_calls() {}
|
native_calls() {}
|
||||||
|
|
||||||
Map<StringName, native_call_cb> native_calls;
|
Map<StringName, native_call_cb> native_calls;
|
||||||
|
|
||||||
|
|
|
@ -468,8 +468,6 @@ static List<String> generate_c_api_json(const List<ClassAPI> &p_api) {
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -437,11 +437,11 @@ NativeScript::~NativeScript() {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// ScriptInstance stuff
|
// ScriptInstance stuff
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
||||||
#define GET_SCRIPT_DESC() script->get_script_desc()
|
#define GET_SCRIPT_DESC() script->get_script_desc()
|
||||||
|
|
||||||
|
|
|
@ -76,12 +76,12 @@ struct NativeScriptDesc {
|
||||||
|
|
||||||
bool is_tool;
|
bool is_tool;
|
||||||
|
|
||||||
inline NativeScriptDesc()
|
inline NativeScriptDesc() :
|
||||||
: methods(),
|
methods(),
|
||||||
properties(),
|
properties(),
|
||||||
signals_(),
|
signals_(),
|
||||||
base(),
|
base(),
|
||||||
base_native_type() {
|
base_native_type() {
|
||||||
zeromem(&create_func, sizeof(godot_instance_create_func));
|
zeromem(&create_func, sizeof(godot_instance_create_func));
|
||||||
zeromem(&destroy_func, sizeof(godot_instance_destroy_func));
|
zeromem(&destroy_func, sizeof(godot_instance_destroy_func));
|
||||||
}
|
}
|
||||||
|
|
|
@ -410,8 +410,8 @@ void PluginScriptLanguage::unlock() {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginScriptLanguage::PluginScriptLanguage(const godot_pluginscript_language_desc *desc)
|
PluginScriptLanguage::PluginScriptLanguage(const godot_pluginscript_language_desc *desc) :
|
||||||
: _desc(*desc) {
|
_desc(*desc) {
|
||||||
_resource_loader = memnew(ResourceFormatLoaderPluginScript(this));
|
_resource_loader = memnew(ResourceFormatLoaderPluginScript(this));
|
||||||
_resource_saver = memnew(ResourceFormatSaverPluginScript(this));
|
_resource_saver = memnew(ResourceFormatSaverPluginScript(this));
|
||||||
|
|
||||||
|
|
|
@ -423,8 +423,11 @@ ScriptInstance::RPCMode PluginScript::get_rset_mode(const StringName &p_variable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginScript::PluginScript()
|
PluginScript::PluginScript() :
|
||||||
: _data(NULL), _tool(false), _valid(false), _script_list(this) {
|
_data(NULL),
|
||||||
|
_tool(false),
|
||||||
|
_valid(false),
|
||||||
|
_script_list(this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginScript::init(PluginScriptLanguage *language) {
|
void PluginScript::init(PluginScriptLanguage *language) {
|
||||||
|
|
|
@ -100,7 +100,7 @@ GDScriptInstance *GDScript::_create_instance(const Variant **p_args, int p_argco
|
||||||
#endif
|
#endif
|
||||||
instance->owner->set_script_instance(instance);
|
instance->owner->set_script_instance(instance);
|
||||||
|
|
||||||
/* STEP 2, INITIALIZE AND CONSRTUCT */
|
/* STEP 2, INITIALIZE AND CONSRTUCT */
|
||||||
|
|
||||||
#ifndef NO_THREADS
|
#ifndef NO_THREADS
|
||||||
GDScriptLanguage::singleton->lock->lock();
|
GDScriptLanguage::singleton->lock->lock();
|
||||||
|
@ -876,8 +876,8 @@ void GDScript::get_script_signal_list(List<MethodInfo> *r_signals) const {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
GDScript::GDScript()
|
GDScript::GDScript() :
|
||||||
: script_list(this) {
|
script_list(this) {
|
||||||
|
|
||||||
_static_ref = this;
|
_static_ref = this;
|
||||||
valid = false;
|
valid = false;
|
||||||
|
|
|
@ -806,8 +806,8 @@ int GDScriptCompiler::_parse_expression(CodeGen &codegen, const GDScriptParser::
|
||||||
ERR_FAIL_COND_V(on->arguments.size() != 2, -1);
|
ERR_FAIL_COND_V(on->arguments.size() != 2, -1);
|
||||||
|
|
||||||
if (on->arguments[0]->type == GDScriptParser::Node::TYPE_OPERATOR && (static_cast<GDScriptParser::OperatorNode *>(on->arguments[0])->op == GDScriptParser::OperatorNode::OP_INDEX || static_cast<GDScriptParser::OperatorNode *>(on->arguments[0])->op == GDScriptParser::OperatorNode::OP_INDEX_NAMED)) {
|
if (on->arguments[0]->type == GDScriptParser::Node::TYPE_OPERATOR && (static_cast<GDScriptParser::OperatorNode *>(on->arguments[0])->op == GDScriptParser::OperatorNode::OP_INDEX || static_cast<GDScriptParser::OperatorNode *>(on->arguments[0])->op == GDScriptParser::OperatorNode::OP_INDEX_NAMED)) {
|
||||||
//SET (chained) MODE!!
|
|
||||||
|
|
||||||
|
// SET (chained) MODE!
|
||||||
#ifdef DEBUG_ENABLED
|
#ifdef DEBUG_ENABLED
|
||||||
if (static_cast<GDScriptParser::OperatorNode *>(on->arguments[0])->op == GDScriptParser::OperatorNode::OP_INDEX_NAMED) {
|
if (static_cast<GDScriptParser::OperatorNode *>(on->arguments[0])->op == GDScriptParser::OperatorNode::OP_INDEX_NAMED) {
|
||||||
const GDScriptParser::OperatorNode *inon = static_cast<GDScriptParser::OperatorNode *>(on->arguments[0]);
|
const GDScriptParser::OperatorNode *inon = static_cast<GDScriptParser::OperatorNode *>(on->arguments[0]);
|
||||||
|
|
|
@ -1795,8 +1795,8 @@ static void _find_type_arguments(GDScriptCompletionContext &context, const GDScr
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//regular method
|
|
||||||
|
|
||||||
|
//regular method
|
||||||
#if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED)
|
#if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED)
|
||||||
if (p_argidx < m->get_argument_count()) {
|
if (p_argidx < m->get_argument_count()) {
|
||||||
PropertyInfo pi = m->get_argument_info(p_argidx);
|
PropertyInfo pi = m->get_argument_info(p_argidx);
|
||||||
|
|
|
@ -250,7 +250,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
|
||||||
|
|
||||||
#ifdef DEBUG_ENABLED
|
#ifdef DEBUG_ENABLED
|
||||||
|
|
||||||
//GDScriptLanguage::get_singleton()->calls++;
|
//GDScriptLanguage::get_singleton()->calls++;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1432,8 +1432,8 @@ void GDScriptFunction::debug_get_stack_member_state(int p_line, List<Pair<String
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GDScriptFunction::GDScriptFunction()
|
GDScriptFunction::GDScriptFunction() :
|
||||||
: function_list(this) {
|
function_list(this) {
|
||||||
|
|
||||||
_stack_size = 0;
|
_stack_size = 0;
|
||||||
_call_size = 0;
|
_call_size = 0;
|
||||||
|
|
|
@ -253,9 +253,9 @@ bool GDScriptTokenizer::is_token_literal(int p_offset, bool variable_safe) const
|
||||||
case TK_BUILT_IN_FUNC:
|
case TK_BUILT_IN_FUNC:
|
||||||
|
|
||||||
case TK_OP_IN:
|
case TK_OP_IN:
|
||||||
//case TK_OP_NOT:
|
//case TK_OP_NOT:
|
||||||
//case TK_OP_OR:
|
//case TK_OP_OR:
|
||||||
//case TK_OP_AND:
|
//case TK_OP_AND:
|
||||||
|
|
||||||
case TK_PR_CLASS:
|
case TK_PR_CLASS:
|
||||||
case TK_PR_CONST:
|
case TK_PR_CONST:
|
||||||
|
@ -1125,7 +1125,7 @@ void GDScriptTokenizerText::advance(int p_amount) {
|
||||||
_advance();
|
_advance();
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#define BYTECODE_VERSION 12
|
#define BYTECODE_VERSION 12
|
||||||
|
|
||||||
|
|
|
@ -461,6 +461,7 @@ MobileVRInterface::MobileVRInterface() {
|
||||||
glGenBuffers(1, &half_screen_quad);
|
glGenBuffers(1, &half_screen_quad);
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, half_screen_quad);
|
glBindBuffer(GL_ARRAY_BUFFER, half_screen_quad);
|
||||||
{
|
{
|
||||||
|
/* clang-format off */
|
||||||
const float qv[16] = {
|
const float qv[16] = {
|
||||||
0, -1,
|
0, -1,
|
||||||
-1, -1,
|
-1, -1,
|
||||||
|
@ -471,6 +472,7 @@ MobileVRInterface::MobileVRInterface() {
|
||||||
1, -1,
|
1, -1,
|
||||||
1, -1,
|
1, -1,
|
||||||
};
|
};
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 16, qv, GL_STATIC_DRAW);
|
glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 16, qv, GL_STATIC_DRAW);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1885,8 +1885,8 @@ StringName CSharpScript::get_script_name() const {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
CSharpScript::CSharpScript()
|
CSharpScript::CSharpScript() :
|
||||||
: script_list(this) {
|
script_list(this) {
|
||||||
|
|
||||||
_clear();
|
_clear();
|
||||||
|
|
||||||
|
|
|
@ -117,4 +117,4 @@ void add_item(const String &p_project_path, const String &p_item_type, const Str
|
||||||
ERR_FAIL();
|
ERR_FAIL();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // CSharpProject
|
} // namespace CSharpProject
|
||||||
|
|
|
@ -39,6 +39,6 @@ String generate_editor_api_project(const String &p_dir, const String &p_core_dll
|
||||||
String generate_game_project(const String &p_dir, const String &p_name, const Vector<String> &p_files = Vector<String>());
|
String generate_game_project(const String &p_dir, const String &p_name, const Vector<String> &p_files = Vector<String>());
|
||||||
|
|
||||||
void add_item(const String &p_project_path, const String &p_item_type, const String &p_include);
|
void add_item(const String &p_project_path, const String &p_item_type, const String &p_include);
|
||||||
}
|
} // namespace CSharpProject
|
||||||
|
|
||||||
#endif // CSHARP_PROJECT_H
|
#endif // CSHARP_PROJECT_H
|
||||||
|
|
|
@ -192,4 +192,4 @@ String get_project_csproj_path() {
|
||||||
return _GodotSharpDirs::get_singleton().csproj_filepath;
|
return _GodotSharpDirs::get_singleton().csproj_filepath;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
} // namespace GodotSharpDirs
|
||||||
|
|
|
@ -53,6 +53,6 @@ String get_custom_project_settings_dir();
|
||||||
|
|
||||||
String get_project_sln_path();
|
String get_project_sln_path();
|
||||||
String get_project_csproj_path();
|
String get_project_csproj_path();
|
||||||
}
|
} // namespace GodotSharpDirs
|
||||||
|
|
||||||
#endif // GODOTSHARP_DIRS_H
|
#endif // GODOTSHARP_DIRS_H
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue