mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Merge pull request #107868 from lawnjelly/quick_ancestry4
Provide quick access to `Object` ancestry
This commit is contained in:
commit
149a4b4ca1
18 changed files with 86 additions and 9 deletions
|
|
@ -925,6 +925,7 @@ void MeshInstance3D::_bind_methods() {
|
|||
}
|
||||
|
||||
MeshInstance3D::MeshInstance3D() {
|
||||
_define_ancestry(AncestralClass::MESH_INSTANCE_3D);
|
||||
}
|
||||
|
||||
MeshInstance3D::~MeshInstance3D() {
|
||||
|
|
|
|||
|
|
@ -1546,6 +1546,8 @@ void Node3D::_bind_methods() {
|
|||
|
||||
Node3D::Node3D() :
|
||||
xform_change(this), _client_physics_interpolation_node_3d_list(this) {
|
||||
_define_ancestry(AncestralClass::NODE_3D);
|
||||
|
||||
// Default member initializer for bitfield is a C++20 extension, so:
|
||||
|
||||
data.top_level = false;
|
||||
|
|
|
|||
|
|
@ -746,6 +746,8 @@ PackedStringArray CollisionObject3D::get_configuration_warnings() const {
|
|||
}
|
||||
|
||||
CollisionObject3D::CollisionObject3D() {
|
||||
_define_ancestry(AncestralClass::COLLISION_OBJECT_3D);
|
||||
|
||||
set_notify_transform(true);
|
||||
//owner=
|
||||
|
||||
|
|
@ -753,6 +755,8 @@ CollisionObject3D::CollisionObject3D() {
|
|||
}
|
||||
|
||||
CollisionObject3D::~CollisionObject3D() {
|
||||
_define_ancestry(AncestralClass::COLLISION_OBJECT_3D);
|
||||
|
||||
ERR_FAIL_NULL(PhysicsServer3D::get_singleton());
|
||||
PhysicsServer3D::get_singleton()->free(rid);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -220,6 +220,10 @@ PackedStringArray PhysicsBody3D::get_configuration_warnings() const {
|
|||
return warnings;
|
||||
}
|
||||
|
||||
PhysicsBody3D::PhysicsBody3D() {
|
||||
_define_ancestry(AncestralClass::PHYSICS_BODY_3D);
|
||||
}
|
||||
|
||||
///////////////////////////////////////
|
||||
|
||||
//so, if you pass 45 as limit, avoid numerical precision errors when angle is 45.
|
||||
|
|
|
|||
|
|
@ -65,4 +65,6 @@ public:
|
|||
TypedArray<PhysicsBody3D> get_collision_exceptions();
|
||||
void add_collision_exception_with(Node *p_node); //must be physicsbody
|
||||
void remove_collision_exception_with(Node *p_node);
|
||||
|
||||
PhysicsBody3D();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -202,6 +202,8 @@ RID VisualInstance3D::get_base() const {
|
|||
}
|
||||
|
||||
VisualInstance3D::VisualInstance3D() {
|
||||
_define_ancestry(AncestralClass::VISUAL_INSTANCE_3D);
|
||||
|
||||
instance = RenderingServer::get_singleton()->instance_create();
|
||||
RenderingServer::get_singleton()->instance_attach_object_instance_id(instance, get_instance_id());
|
||||
set_notify_transform(true);
|
||||
|
|
@ -643,6 +645,7 @@ void GeometryInstance3D::_bind_methods() {
|
|||
}
|
||||
|
||||
GeometryInstance3D::GeometryInstance3D() {
|
||||
_define_ancestry(AncestralClass::GEOMETRY_INSTANCE_3D);
|
||||
}
|
||||
|
||||
GeometryInstance3D::~GeometryInstance3D() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue