summaryrefslogtreecommitdiff
path: root/scene/3d/collision_shape_3d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d/collision_shape_3d.cpp')
-rw-r--r--scene/3d/collision_shape_3d.cpp14
1 files changed, 0 insertions, 14 deletions
diff --git a/scene/3d/collision_shape_3d.cpp b/scene/3d/collision_shape_3d.cpp
index a66e84ac3c..711dfd6fb9 100644
--- a/scene/3d/collision_shape_3d.cpp
+++ b/scene/3d/collision_shape_3d.cpp
@@ -45,20 +45,16 @@
//TODO: Implement CylinderShape and HeightMapShape?
void CollisionShape3D::make_convex_from_brothers() {
-
Node *p = get_parent();
if (!p)
return;
for (int i = 0; i < p->get_child_count(); i++) {
-
Node *n = p->get_child(i);
MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(n);
if (mi) {
-
Ref<Mesh> m = mi->get_mesh();
if (m.is_valid()) {
-
Ref<Shape3D> s = m->create_convex_shape();
set_shape(s);
}
@@ -74,9 +70,7 @@ void CollisionShape3D::_update_in_shape_owner(bool p_xform_only) {
}
void CollisionShape3D::_notification(int p_what) {
-
switch (p_what) {
-
case NOTIFICATION_PARENTED: {
parent = Object::cast_to<CollisionObject3D>(get_parent());
if (parent) {
@@ -111,12 +105,10 @@ void CollisionShape3D::_notification(int p_what) {
}
void CollisionShape3D::resource_changed(RES res) {
-
update_gizmo();
}
String CollisionShape3D::get_configuration_warning() const {
-
if (!Object::cast_to<CollisionObject3D>(get_parent())) {
return TTR("CollisionShape3D only serves to provide a collision shape to a CollisionObject3D derived node. Please only use it as a child of Area3D, StaticBody3D, RigidBody3D, KinematicBody3D, etc. to give them a shape.");
}
@@ -137,7 +129,6 @@ String CollisionShape3D::get_configuration_warning() const {
}
void CollisionShape3D::_bind_methods() {
-
//not sure if this should do anything
ClassDB::bind_method(D_METHOD("resource_changed", "resource"), &CollisionShape3D::resource_changed);
ClassDB::bind_method(D_METHOD("set_shape", "shape"), &CollisionShape3D::set_shape);
@@ -154,7 +145,6 @@ void CollisionShape3D::_bind_methods() {
}
void CollisionShape3D::set_shape(const Ref<Shape3D> &p_shape) {
-
if (!shape.is_null()) {
shape->unregister_owner(this);
shape->disconnect("changed", callable_mp(this, &CollisionShape3D::_shape_changed));
@@ -178,12 +168,10 @@ void CollisionShape3D::set_shape(const Ref<Shape3D> &p_shape) {
}
Ref<Shape3D> CollisionShape3D::get_shape() const {
-
return shape;
}
void CollisionShape3D::set_disabled(bool p_disabled) {
-
disabled = p_disabled;
update_gizmo();
if (parent) {
@@ -192,12 +180,10 @@ void CollisionShape3D::set_disabled(bool p_disabled) {
}
bool CollisionShape3D::is_disabled() const {
-
return disabled;
}
CollisionShape3D::CollisionShape3D() {
-
//indicator = RenderingServer::get_singleton()->mesh_create();
disabled = false;
debug_shape = nullptr;