ODE Middleware

Another question regarding line 1359 in odeWorldManager.py

if body1 or body2 and type1 not in ignoredTypes and type2 not in ignoredTypes:

I’m confused what this if statement is supposed to be doing, because to me it looks like it is making sure that there is at least one body, and that neither type is in ignoredTypes. But when it runs it seems to go into the following code if either type isn’t in the ignoredTypes array.

I noticed this when trying to figure out when I was trying to make a ‘bullet’ seems sometimes when two dynamic objects hit each other the collision callback isn’t triggered (so in my case the bullet sometimes bounces off stuff it should destroy itself on). I’m sure these two things aren’t related but just explaining what made me stumble onto this if statement.

Oh and I tried using () to make the statement the way I thought it was by doing this:

if (body1 or body2) and (type1 not in ignoredTypes and type2 not in ignoredTypes):

but then stuff just starts falling through the world cause statics are ignored.

Thanks for yet another answer.