Hi,
I am back to work on my game. I still like to make a catapult/slingshot based game. I am
no trying to implement the Wheel Joint (instead of the rope/chain stuff) like explained in
the "Elastic Joint" example. I also use a Mouse Joint. I case of the mouse joint I can place
my finger anywhere on the screen.
What's still not working is that I want to break (destroy?) the wheel joint and let the object
(like the the sun from the example) shoot away when it crosses the centerpoint of the wheel
(so it will not bounce back). I don't know if I can use the physics from the wheel joint def to
let it shoot or that I need to apply a new applyLinearImpulse.
Thanks,
Marc
Comments
Can't tell if you'll need additional impulse, thats based on settings you have etc, but it would be rather easy to apply it in same place in code if needed (as you can get current linear velocity vector and multiply it by some factor to apply as impulse)
Thanks again for you quick response. I did what you explained. I have
two joints, the mouseJoint and the wheelJoint. It looks if I destroy the
mouseJoint before the wheelJoint, the wheelJoint will be destroyed too
and I will get the message: "Joint is already destroyed." So I think that
the wheelJoint will be destroyed to early.
Regards,
Marc
Dislikes: JuanZambrano
But yes, this is a problem in box2d that you can't destroy something twice and you can't check if it was destroyed so I usually safe one property to joints (can be also applied to body's), like joint.isDestroyed = false
So everythime before destroying it I check
I think that I am not completely understand the joints. In the example
it looks that it acts more like a wheel joint. How is it possible that the
distance can be variable in a distance joint? The sun in the demo can
go through the ground point.
Regards,
Marc
http://www.cocos2d-iphone.org/archives/1112
It's called "Verlet Integration". Never heard it before.
Hope it's easy to implement in Gideros LUA.
Thanx,
Marc