|
@@ -322,26 +322,18 @@ void ShapeCast2D::add_exception_rid(const RID &p_rid) {
|
|
|
exclude.insert(p_rid);
|
|
|
}
|
|
|
|
|
|
-void ShapeCast2D::add_exception(const Object *p_object) {
|
|
|
- ERR_FAIL_NULL(p_object);
|
|
|
- const CollisionObject2D *co = Object::cast_to<CollisionObject2D>(p_object);
|
|
|
- if (!co) {
|
|
|
- return;
|
|
|
- }
|
|
|
- add_exception_rid(co->get_rid());
|
|
|
+void ShapeCast2D::add_exception(const CollisionObject2D *p_node) {
|
|
|
+ ERR_FAIL_NULL_MSG(p_node, "The passed Node must be an instance of CollisionObject2D.");
|
|
|
+ add_exception_rid(p_node->get_rid());
|
|
|
}
|
|
|
|
|
|
void ShapeCast2D::remove_exception_rid(const RID &p_rid) {
|
|
|
exclude.erase(p_rid);
|
|
|
}
|
|
|
|
|
|
-void ShapeCast2D::remove_exception(const Object *p_object) {
|
|
|
- ERR_FAIL_NULL(p_object);
|
|
|
- const CollisionObject2D *co = Object::cast_to<CollisionObject2D>(p_object);
|
|
|
- if (!co) {
|
|
|
- return;
|
|
|
- }
|
|
|
- remove_exception_rid(co->get_rid());
|
|
|
+void ShapeCast2D::remove_exception(const CollisionObject2D *p_node) {
|
|
|
+ ERR_FAIL_NULL_MSG(p_node, "The passed Node must be an instance of CollisionObject2D.");
|
|
|
+ remove_exception_rid(p_node->get_rid());
|
|
|
}
|
|
|
|
|
|
void ShapeCast2D::clear_exceptions() {
|