Can't get elasticity?
-
- Posts: 15
- Joined: Wed Aug 20, 2008 8:11 pm
- Contact:
Can't get elasticity?
I was using an older version of chipmunk, one that still had the ball with a stick attached for demo 6 instead of the bricks in water. Anyway, elasticity used to work great, but I can't get anything to bounce in the new version. I haven't altered it since checkout except to up the shape->e in a few places for testing. I'm on Mac OS X using the default xCode project. Does anyone know what I'm missing?
-
- Posts: 157
- Joined: Mon Aug 20, 2007 12:53 pm
- Location: London, UK
- Contact:
Re: Can't get elasticity?
I've just tested this and noticed the same problem.
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: Can't get elasticity?
as part of the solution to solve jittering elastic resting collisions I separated out elastic collision solving. You now have to set space.elasticIterations separately from normal iterations. It also defaults to 0 to avoid slowing don simulations without elasticity.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
-
- Posts: 15
- Joined: Wed Aug 20, 2008 8:11 pm
- Contact:
Re: Can't get elasticity?
Perfect!
Thanks for a great physics engine!
Thanks for a great physics engine!
-
- Posts: 56
- Joined: Tue Sep 11, 2007 2:30 pm
- Contact:
Re: Can't get elasticity?
I also remember spending a few hours scratching my head over why my boxes wouldn't bounce, when I moved to the latest version. Wouldn't it be more user-friendly to default space.elasticIterations to 10 or whatever, and let those who need that extra bit of speed change it to 0?
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: Can't get elasticity?
I guess I didn't expect elasticity to be that widely used.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
-
- Posts: 56
- Joined: Tue Sep 11, 2007 2:30 pm
- Contact:
Re: Can't get elasticity?
Well, I guess it would depend what kind of environment you want to simulate. I'd think most everyday objects (balls, boxes, rocks, knives) would be at least semi-elastic.
-
- Posts: 4
- Joined: Fri Apr 04, 2008 8:58 am
- Contact:
Re: Can't get elasticity?
HI,
there is a way to set elasticIterations in ruby binding?
I can't find the relates function in rb_cpSpace.c
thanks
there is a way to set elasticIterations in ruby binding?
I can't find the relates function in rb_cpSpace.c
thanks
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: Can't get elasticity?
No there is not. I totally missed that.
Edit: I added one in trunk.
Edit: I added one in trunk.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
-
- Posts: 4
- Joined: Fri Apr 04, 2008 8:58 am
- Contact:
Re: Can't get elasticity?
Yeah many thanks.
I have updted the doc_dummy.rb files (in docsrc) to follow this change...
may be you want to add it also to the trunk? thanks
svn diff:
I have updted the doc_dummy.rb files (in docsrc) to follow this change...
may be you want to add it also to the trunk? thanks
svn diff:
Code: Select all
===================================================================
--- doc_dummy.rb (revision 28)
+++ doc_dummy.rb (working copy)
@@ -278,6 +278,10 @@
# The amount of gravity in the system. Must be a CP::Vect.
attr_accessor :gravity
+ # Coefficient of restitution. (elasticity)
+ attr_accessor :elastic_iterations
+
+
def initialize; end
# Add a block to be called when a collision between a shape with a
Who is online
Users browsing this forum: No registered users and 19 guests