Hi,
When a dynamic object is in rest I don't want rotation. I do this like this:
local bodyDef = {type = b2.DYNAMIC_BODY,
position = {x = startX, y = startY},
fixedRotation = true,
linearDamping = 0.5} |
When I'll launch the object by touching the screen I like to change the
fixedRotation parameter to false. Is this possible?
I was also wondering if you can turn static bodies into dynamic bodies
after a certain time for example?
Thanks,
Marc
Comments
in the onEnterFrame() handler. But the body will not.
Marc
sprite.body:setrotation(angle) will work in enterframe just you have to take care about radian and degree some calculation with pi will do the trick.
Edit :- sprite.body:setAngle(angle) should be the right one
- b2.Body:setBullet
- b2.Body:isBullet
- b2.Body:setFixedRotation
- b2.Body:isFixedRotation
They'll be available with the next version. (I was thinking I've wrapped all b2.Body functions but apparently I haven't)
While waiting, I think any of the above solutions will work.
@hgvyas123 where did you find this function?
http://www.giderosmobile.com/forum/discussion/1266/millisecond-timer/p1
Let's not go that way again )
Likes: SinisterSoft
functions, great!
Marc