Two physics questions: Pausing and multiple sources.

I'm just not getting into Corona, I've been oscillation between iTGB, Cocos2d and this, so I'm trying to figure out some mechanics.

First, I'd like to make a Skeleton for animations. There have been a few topics on this, which I've looked at and think I'm good with.

My question though is this: Is there a way to toggle physics on or off for an object or group of objects? IE. I want to animate a movement sequence manually, then turn on physics and they "body" falls over, then turn it off, and animate it getting back up.

Second, Is there a way to have multiple gravity sources? Say we're in space and there is the Earth and Moon can I have both of those objects emit/effect gravity using the built in physics?

The best way I know of to turn physics on/off for an object is to use a joint associated with the object. The joint an be added or removed programmatically as needed. I had a similar situation where I wanted collisions to selectively occur, and changed the attribute object.isSensor to either true or false.

Gravity is a global setting, but adjusting the density of specific objects will impact the effects of gravity and give you the same net effect you are seeking.

Perhaps others have better ideas.

-David

views:1663 update:2011/11/14 9:16:56
corona forums © 2003-2011