diff options
author | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-11-10 15:57:11 -0700 |
---|---|---|
committer | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-11-10 17:43:35 -0700 |
commit | c3ae7ddedd8526fff273237cb61ebb866a723af5 (patch) | |
tree | 9260e8a42f83ed33921f5de3f8be6bd5c9ccfa68 /servers/physics_server_2d.cpp | |
parent | 3668312e786d0e06fee627e5255edef88710cc9b (diff) | |
download | redot-engine-c3ae7ddedd8526fff273237cb61ebb866a723af5.tar.gz |
Add raycast options to hit when starting inside / hit back faces
Makes the results consistent for all shape types with options to set
the desired behavior.
Diffstat (limited to 'servers/physics_server_2d.cpp')
-rw-r--r-- | servers/physics_server_2d.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/servers/physics_server_2d.cpp b/servers/physics_server_2d.cpp index fa89ccec65..849609e048 100644 --- a/servers/physics_server_2d.cpp +++ b/servers/physics_server_2d.cpp @@ -172,12 +172,16 @@ void PhysicsRayQueryParameters2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_collide_with_areas", "enable"), &PhysicsRayQueryParameters2D::set_collide_with_areas); ClassDB::bind_method(D_METHOD("is_collide_with_areas_enabled"), &PhysicsRayQueryParameters2D::is_collide_with_areas_enabled); + ClassDB::bind_method(D_METHOD("set_hit_from_inside", "enable"), &PhysicsRayQueryParameters2D::set_hit_from_inside); + ClassDB::bind_method(D_METHOD("is_hit_from_inside_enabled"), &PhysicsRayQueryParameters2D::is_hit_from_inside_enabled); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "from"), "set_from", "get_from"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "to"), "set_to", "get_to"); ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_collision_mask", "get_collision_mask"); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "exclude", PROPERTY_HINT_ARRAY_TYPE, "RID"), "set_exclude", "get_exclude"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "collide_with_bodies"), "set_collide_with_bodies", "is_collide_with_bodies_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "collide_with_areas"), "set_collide_with_areas", "is_collide_with_areas_enabled"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "hit_from_inside"), "set_hit_from_inside", "is_hit_from_inside_enabled"); } /////////////////////////////////////////////////////// |