summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/arvr_nodes.cpp2
-rw-r--r--scene/3d/arvr_nodes.h2
-rw-r--r--scene/3d/collision_shape.cpp8
-rw-r--r--scene/3d/navigation_region.cpp14
-rw-r--r--scene/3d/physics_body.cpp1
5 files changed, 18 insertions, 9 deletions
diff --git a/scene/3d/arvr_nodes.cpp b/scene/3d/arvr_nodes.cpp
index bf85a8bd53..d23e5ffa08 100644
--- a/scene/3d/arvr_nodes.cpp
+++ b/scene/3d/arvr_nodes.cpp
@@ -300,7 +300,7 @@ int ARVRController::get_joystick_id() const {
return tracker->get_joy_id();
};
-int ARVRController::is_button_pressed(int p_button) const {
+bool ARVRController::is_button_pressed(int p_button) const {
int joy_id = get_joystick_id();
if (joy_id == -1) {
return false;
diff --git a/scene/3d/arvr_nodes.h b/scene/3d/arvr_nodes.h
index 44dfda15a6..e968e33c9d 100644
--- a/scene/3d/arvr_nodes.h
+++ b/scene/3d/arvr_nodes.h
@@ -88,7 +88,7 @@ public:
String get_controller_name(void) const;
int get_joystick_id() const;
- int is_button_pressed(int p_button) const;
+ bool is_button_pressed(int p_button) const;
float get_joystick_axis(int p_axis) const;
real_t get_rumble() const;
diff --git a/scene/3d/collision_shape.cpp b/scene/3d/collision_shape.cpp
index 35e4a61cd6..d825c8daf7 100644
--- a/scene/3d/collision_shape.cpp
+++ b/scene/3d/collision_shape.cpp
@@ -123,6 +123,14 @@ String CollisionShape::get_configuration_warning() const {
return TTR("A shape must be provided for CollisionShape to function. Please create a shape resource for it.");
}
+ if (Object::cast_to<RigidBody>(get_parent())) {
+ if (Object::cast_to<ConcavePolygonShape>(*shape)) {
+ if (Object::cast_to<RigidBody>(get_parent())->get_mode() != RigidBody::MODE_STATIC) {
+ return TTR("ConcavePolygonShape doesn't support RigidBody in another mode than static.");
+ }
+ }
+ }
+
return String();
}
diff --git a/scene/3d/navigation_region.cpp b/scene/3d/navigation_region.cpp
index d96d095797..53b707a29a 100644
--- a/scene/3d/navigation_region.cpp
+++ b/scene/3d/navigation_region.cpp
@@ -162,22 +162,22 @@ Ref<NavigationMesh> NavigationRegion::get_navigation_mesh() const {
}
struct BakeThreadsArgs {
- NavigationRegion *nav_mesh_instance;
+ NavigationRegion *nav_region;
};
void _bake_navigation_mesh(void *p_user_data) {
BakeThreadsArgs *args = static_cast<BakeThreadsArgs *>(p_user_data);
- if (args->nav_mesh_instance->get_navigation_mesh().is_valid()) {
- Ref<NavigationMesh> nav_mesh = args->nav_mesh_instance->get_navigation_mesh()->duplicate();
+ if (args->nav_region->get_navigation_mesh().is_valid()) {
+ Ref<NavigationMesh> nav_mesh = args->nav_region->get_navigation_mesh()->duplicate();
- NavigationServer::get_singleton()->region_bake_navmesh(nav_mesh, args->nav_mesh_instance);
- args->nav_mesh_instance->call_deferred("_bake_finished", nav_mesh);
+ NavigationServer::get_singleton()->region_bake_navmesh(nav_mesh, args->nav_region);
+ args->nav_region->call_deferred("_bake_finished", nav_mesh);
memdelete(args);
} else {
ERR_PRINT("Can't bake the navigation mesh if the `NavigationMesh` resource doesn't exist");
- args->nav_mesh_instance->call_deferred("_bake_finished", Ref<NavigationMesh>());
+ args->nav_region->call_deferred("_bake_finished", Ref<NavigationMesh>());
memdelete(args);
}
}
@@ -186,7 +186,7 @@ void NavigationRegion::bake_navigation_mesh() {
ERR_FAIL_COND(bake_thread != NULL);
BakeThreadsArgs *args = memnew(BakeThreadsArgs);
- args->nav_mesh_instance = this;
+ args->nav_region = this;
bake_thread = Thread::create(_bake_navigation_mesh, args);
ERR_FAIL_COND(bake_thread == NULL);
diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp
index eba45a5604..2f8dc31cb6 100644
--- a/scene/3d/physics_body.cpp
+++ b/scene/3d/physics_body.cpp
@@ -518,6 +518,7 @@ void RigidBody::set_mode(Mode p_mode) {
PhysicsServer::get_singleton()->body_set_mode(get_rid(), PhysicsServer::BODY_MODE_KINEMATIC);
} break;
}
+ update_configuration_warning();
}
RigidBody::Mode RigidBody::get_mode() const {