box2dgame-physicsbox2d-iphonephysics-enginetrampolines

How can I tune this trampoline/rubber band object with box2d?


I'm trying to create this trampoline/rubber band using box2d and cocos2d. I got to a point where in my head it should all just work except I don't get the expected effect. My trampoline looks like this:

enter image description here

frequency = 10.0 dampingRatio = 0.1

friction = 0.0 restitution = 0.3 density = 20.0

frequency = 4.0 dampingRatio = 0.5

fiction = 0.0 restitution = 0.5 density = 100.0

The effect I'm getting using this configuration when I drop the object on the trampoline is more of a mattress drop effect, my object is bounced up once or twice but not by much and than it stops.

My questions are:

  1. Is this a good approach? How can I tweak this trampoline to behave more like a trampoline and less like a mattress?

  2. Once #1 is answered how can I make my blue dummy/ghost object not respond to any collisions and therefore be invisible/non existent as far as the user is concerned?

Thanks!


Solution

  • If you are getting the desired effect initially but then it fades away, it could be that the damping of the distance joints is just too high. That said, I don't think objects bounce up and down forever on a trampoline in real life...

    To make a body be invisible/non existent you can set the fixture to be a sensor fixture, or se the collision filter bits to zero, or just not give it any fixtures in the first place.