[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
Chipmunk Physics • View topic - Objects Overlap on Low Speeds

Objects Overlap on Low Speeds

Official forum for the .

Objects Overlap on Low Speeds

Postby cmuser » Fri Jun 20, 2008 10:36 am

Hi all,

First of all, let me point out how I love the chipmunk lib! :)

I need to create some kind of a billiard game.
Instead of billiard balls I'm using square polygons.
I have created 8 identical polygons and a space (the "table") with no gravitation, but with damping=0.5 to emulate the friction of the billiard table.
I set an initial speed vector to a polygon and watch the polygons collide.

Direct collisions work well, especially at high speed.
But when a polygon is spinning at low speed (when it's about to stop), sometimes its corner can overlap an other polygon without generating a collision.

I've been playing with different chipmunk parameters for several days, but still haven't eliminated the overlap completely, which happens from time to time.

Could anybody advise me what parameter to play with, please?

Please, help.
cmuser
 
Posts: 2
Joined: Fri Jun 20, 2008 10:06 am

Re: Objects Overlap on Low Speeds

Postby maximile » Fri Jun 20, 2008 11:23 am

Have you set cp_collision_slop to 0? If that's not it, then I guess it could be this (from the docs): "Pointy or thin polygons aren’t handled well. Collision points are generated at the poly’s vertexes. I haven’t decided what to do about this yet."
maximile
 
Posts: 157
Joined: Mon Aug 20, 2007 12:53 pm
Location: London, UK

Re: Objects Overlap on Low Speeds

Postby slembcke » Fri Jun 20, 2008 4:31 pm

cmuser: Could you be more specific? How much do they overlap? Are you sure it isn't a drawing issue?

maximile: That's describing when two polygons overlap, but neither contains vertexes from the other poly (like a David's Star for example).
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Objects Overlap on Low Speeds

Postby cmuser » Mon Jun 23, 2008 3:17 am

to maximile & slembcke:
thank you very much for your advices!

Sorry, it was really a bug in drawing! Used wrong angle in rotation. :oops:

One more question:
I'm moving objects on a table (top view).
The objects are moving in zero-gravity in the space (= table surface), to substitute the friction of the table I use the space damping parameter.
Is there a better way to represent the table friction (in order not to use space damping)?
cmuser
 
Posts: 2
Joined: Fri Jun 20, 2008 10:06 am

Re: Objects Overlap on Low Speeds

Postby Michael Buckley » Mon Jun 23, 2008 12:19 pm

You could probably stop the apply a small force opposing the object each frame. When the speed of the object gets too slow in a direction, you'll want to stop the object and stop applying the force.
Michael Buckley
 
Posts: 46
Joined: Tue Aug 21, 2007 10:30 am


Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 1 guest

cron