diff options
author | Pierre Caye <pierrecaye@laposte.net> | 2020-03-03 17:05:10 +0100 |
---|---|---|
committer | Pierre Caye <pierrecaye@laposte.net> | 2020-03-05 11:18:45 +0100 |
commit | ad227d9a85ad1164ba7e1b099b332bef99f1883b (patch) | |
tree | 5470a83e8a3c2afba29db45e21a76dac1d8237d3 /scene/3d/collision_shape.cpp | |
parent | e2b66cacf78ae39b94df748e9740b98a1f011e77 (diff) | |
download | redot-engine-ad227d9a85ad1164ba7e1b099b332bef99f1883b.tar.gz |
Add a new configuration warning to CollisionShape
In the case where a ConcavePolygonShape is used as a shape for a RigidBody
in another mode than static, a configuration warning will appear in the
editor.
Diffstat (limited to 'scene/3d/collision_shape.cpp')
-rw-r--r-- | scene/3d/collision_shape.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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(); } |