Browse Source

Merge pull request #21197 from JPTeasdale/input-picking-bug

Bullet ray picking should ignore objects with input_ray_pickable=false
Rémi Verschelde 7 years ago
parent
commit
89f0d826ea
1 changed files with 2 additions and 2 deletions
  1. 2 2
      modules/bullet/godot_result_callbacks.cpp

+ 2 - 2
modules/bullet/godot_result_callbacks.cpp

@@ -51,8 +51,8 @@ bool GodotClosestRayResultCallback::needsCollision(btBroadphaseProxy *proxy0) co
 	if (needs) {
 		btCollisionObject *btObj = static_cast<btCollisionObject *>(proxy0->m_clientObject);
 		CollisionObjectBullet *gObj = static_cast<CollisionObjectBullet *>(btObj->getUserPointer());
-		if (m_pickRay && gObj->is_ray_pickable()) {
-			return true;
+		if (m_pickRay && !gObj->is_ray_pickable()) {
+			return false;
 		} else if (m_exclude->has(gObj->get_self())) {
 			return false;
 		}