How can I know if an object has already attached with physics

Hi,

How can I know if an object has already attached with physics (using the addBody) ?

More Information:
I have pool of 100 display objects in which some physics have been attached to (by using the addBody() API).
In some place in the application I need to remove the physics body from all 100 objects by using the removeBody() API. But since not all objects have physics attach to, when trying to remove the physics body from object that doesn’t has physics it throwing warning message. Is there a way to identify for a given display object if it has physics or not?

Thanks 

 Yuval

You can check to see if the various physics method have been added to the display object:

if obj.setLinearVelocity and type(obj.setLinearVelocity) == “function” then

     – has physics

else

     – doesn’t have physics

end

or some test like that.

Rob

You can check to see if the various physics method have been added to the display object:

if obj.setLinearVelocity and type(obj.setLinearVelocity) == “function” then

     – has physics

else

     – doesn’t have physics

end

or some test like that.

Rob