Ver Fonte

-fixed silly bug in trigger check (#1051)

Juan Linietsky há 10 anos atrás
pai
commit
bbaddfa70f
1 ficheiros alterados com 2 adições e 3 exclusões
  1. 2 3
      scene/3d/physics_body.cpp

+ 2 - 3
scene/3d/physics_body.cpp

@@ -852,6 +852,8 @@ Vector3 KinematicBody::move(const Vector3& p_motion) {
 		//motion recover
 		for(int i=0;i<get_shape_count();i++) {
 
+			if (is_shape_set_as_trigger(i))
+				continue;
 
 			if (dss->collide_shape(get_shape(i)->get_rid(), get_global_transform() * get_shape_transform(i),m,sr,max_shapes,res_shapes,exclude,get_layer_mask(),mask)) {
 				collided=true;
@@ -870,9 +872,6 @@ Vector3 KinematicBody::move(const Vector3& p_motion) {
 		for(int j=0;j<8;j++) {
 			for(int i=0;i<res_shapes;i++) {
 
-				if (is_shape_set_as_trigger(i))
-					continue;
-
 				Vector3 a = sr[i*2+0];
 				Vector3 b = sr[i*2+1];
 				//print_line(String()+a+" -> "+b);