diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-08-21 15:30:41 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2018-08-21 15:31:23 -0300 |
commit | ee07fb5ebee339559da46f9d183418bbee2188e5 (patch) | |
tree | 4117451bf06046e2916596edc84a4d3f6cbcd592 /scene/main/viewport.cpp | |
parent | 28e9aedbddb41f240ff7b416c8359673d3505a79 (diff) |
Changes to ClippedCamera, RayCast,Raycast2D and 2D physics API to add ability to choose between bodies and areas when colliding.
Diffstat (limited to 'scene/main/viewport.cpp')
-rw-r--r-- | scene/main/viewport.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index e43c2da02d..f92b6e7583 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -444,7 +444,7 @@ void Viewport::_notification(int p_what) { Vector2 point = get_canvas_transform().affine_inverse().xform(pos); Physics2DDirectSpaceState::ShapeResult res[64]; - int rc = ss2d->intersect_point(point, res, 64, Set<RID>(), 0xFFFFFFFF, true); + int rc = ss2d->intersect_point(point, res, 64, Set<RID>(), 0xFFFFFFFF, true, true, true); for (int i = 0; i < rc; i++) { if (res[i].collider_id && res[i].collider) { @@ -527,7 +527,7 @@ void Viewport::_notification(int p_what) { PhysicsDirectSpaceState *space = PhysicsServer::get_singleton()->space_get_direct_state(find_world()->get_space()); if (space) { - bool col = space->intersect_ray(from, from + dir * 10000, result, Set<RID>(), 0xFFFFFFFF, true); + bool col = space->intersect_ray(from, from + dir * 10000, result, Set<RID>(), 0xFFFFFFFF, true, true, true); ObjectID new_collider = 0; if (col) { @@ -563,7 +563,7 @@ void Viewport::_notification(int p_what) { PhysicsDirectSpaceState *space = PhysicsServer::get_singleton()->space_get_direct_state(find_world()->get_space()); if (space) { - bool col = space->intersect_ray(from, from + dir * 10000, result, Set<RID>(), 0xFFFFFFFF, true); + bool col = space->intersect_ray(from, from + dir * 10000, result, Set<RID>(), 0xFFFFFFFF, true, true, true); ObjectID new_collider = 0; if (col) { CollisionObject *co = Object::cast_to<CollisionObject>(result.collider); |