Reputation: 11
I am trying to create an evolution simulator, something very similar to this. As for tools I am using pymunk physics simulator with pygame.
My creatures consist of few circles with their respective bodies fixed together with DampedSprings as muscles. Springs give me a nice effect of expanding and contracting muscles however they do not hold their "angular position". What I mean by that is that when creature is spawned with triangular shape, in the moment it falls on the ground the top node just falls on the ground -> does not hold its shape. spawned creature deformated creature
What I wish would happen is that the creature would hold its shape when it falls down on the ground = the top node would stay at the top like it is at the moment of spawn while still maintaining the ability to simulate variable length of muscle.
Anybody have an idea how could I solve this issue please ? Thank you!
Upvotes: 1
Views: 188
Reputation: 4603
I guess the reason is the springs are not strong enough to hold back. But maybe if you make the springs stronger (stiffer?) the effect doesnt look well?
One idea I think you can try is to add a DampedRotarySpring (http://www.pymunk.org/en/latest/pymunk.constraint.html#pymunk.constraint.DampedRotarySpring) as well for each DampedSpring you have. That way you have one spring working to keep angles, and one to keep distance.
Upvotes: 0