Thanks!, When you set the acceleration that high, the force is great enough to press the box completely against the wall, and then all the forces are directed horizontal, so the box can't spring back easily.
Thanks =D
I was going over your code and I was just wondering (I'm no expert with doubles) if, instead of drawing the lines for the image, you could draw the lines onto the actor and move the actor itself...
Just to clarify, instead of having double x as the X location on the image, I'm trying to make it so that it does something like setLocation(x, y) so that I can find if another actor intersects...
I'm not great at explaining stuff like this, I'm only 13, so, it's not a wonder.
Thanks again Builderboy.
In the spring class, it would make the code more readable to change the places where you do
"Math.sqrt(Math.pow(someValue, 2) + Math.pow(someOtherValue, 2))"
to
"Math.hypot(someValue, someOtherValue)"
Hi, BuilderBoy. This scenarios is awesome. I'm looking into soft body these days.
May I ask, how did it expands to other shape.
I looked into your code and find out it was based on the "mass point - spring net" model. If it is a shape with N sides, the number of springs would come to N(N - 1) / 2 (if you put a spring between every two mass points), when N is lager than about 30, things became slow.
I search on the internet and find there is an other model called PSB(pressure soft body), it's similar with this one, but the amount of calculation is much less(I think it's about 2N). I tried PSB in greenfoot, but the the effect is not ideal.
I thought I'd better share the infomation with you(or anybody who was interested in soft body simulation), hope we can have a better model one day.
@Duta thanks for replying. I looked into your code. You were using the same model with this one.For the JellyPentagon class, you build 10 springs in a soft body. As I said, it would need N(N - 1) / 2 springs for a shape has N sides. When N comes lager, the scenario comes slow. I was looking for another model which is better. It's called "Pressure Soft Body" which suppose there were some ideal "gas" in the soft body to support it.
2009/3/20
2009/3/21
2009/3/21
2009/3/21
2009/3/21
2009/3/21
2009/3/21
2009/6/21
2010/10/27
2010/10/27
2010/10/28
2012/7/15
2012/7/15
2013/1/1
2013/6/22
2013/6/22
2013/6/23