[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/bbcode.php on line 112: 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 112: 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 sliding horizontally (no friction)
Page 1 of 1

Objects sliding horizontally (no friction)

PostPosted: Fri Oct 12, 2007 9:05 pm
by ehudros
Hi :)
I have a basic "floor" shape and body as seen in the moon buggy tutorial which is totally horizontal and flat.
Balls are bouncing from the top of the screen towards the floor with no elasticity and fricition value of 5.0.
instead of losing speed upon impact and stopping, the slide as if on an ice plain towards the left part of the screen and then hit another wall and stop. Im only guessing this has something to do with the tangent of the floor being 0 cand thus causing all sorts of pain but i think i might just be missing something obvious here.
has anyone come across such an issue? Other than that its a great library, thanks a lot!

Ehud

Re: Objects sliding horizontally (no friction)

PostPosted: Fri Oct 12, 2007 11:49 pm
by Michael Buckley
Dud you assign a friction value to the floor as well? As it says in the chipmunk documentation, the friction coefficient between two objects is calculated by multiplying the friction of the two objects together. Therefore, if the floor has a friction of 0.0f (which is the default), then it you will have a friction coefficient of 5.0f * 0.0f = 0.0f.

Re: Objects sliding horizontally (no friction)

PostPosted: Sat Oct 13, 2007 8:44 am
by ehudros

Re: Objects sliding horizontally (no friction)

PostPosted: Tue Oct 16, 2007 7:23 pm
by ehudros
hmm... nobody? :(
some more research shows that the circles are actually rolling on the floor (I rendered them with the rotation values this time), and it is quite strange as I would expect them to stop after a short while if the friction value is high.
does chipmunk rely somehow on the coordinate system to be openGL based (meaning 0,0 is the center of the screen or something like that)?
Im using HGE as my game engine and everything else seems to be working fine, so i doubt i has something to do that.

the code is too complex to upload as it is, but if neccessary i can build a small demo.

Re: Objects sliding horizontally (no friction)

PostPosted: Tue Oct 16, 2007 7:52 pm
by maximile
Is it possible that this is expected behaviour? Because no surfaces are sliding against each other?

The way I imagine it, setting high friction values when it's a circle would just make the circle less likely to spin "against" something, rather than controlling its tendency to roll. Perhaps you'd have to change that some other way.

Re: Objects sliding horizontally (no friction)

PostPosted: Tue Oct 16, 2007 10:26 pm
by slembcke
Ah yes. I have not implemented rolling friction. The friction values just prevent the surfaces from slipping past each other. Rolling friction is caused by the objects deforming at the collision points and loosing energy that way. Not the same as normal friction.

Sorry about the late reply.

Re: Objects sliding horizontally (no friction)

PostPosted: Wed Oct 17, 2007 8:27 am
by ehudros
thanks Scott for your answer and the great engine :)
Is there a way to overcome the issue somehow? fake it?
do you have plans to get rolling friction in the engine anytime soon?

Thanks!

Re: Objects sliding horizontally (no friction)

PostPosted: Wed Oct 17, 2007 11:51 pm
by Michael Buckley
Well, you could set the inertial mass of the body to be INFINITY. It wouldn't roll anymore, but it should be affected by friction.

Re: Objects sliding horizontally (no friction)

PostPosted: Thu Oct 18, 2007 5:18 pm
by ehudros
I was able to fake rolling friction by multiplying the velocity of each ball by 0.95 every timestep.
It looks alright, and the effect is the same...

PS - I am also checking out box2d and I was wondering if someone could give me a rundown on the differences between the 2 engines?
It seems like the features are more or less the same.
thanks! :)

Re: Objects sliding horizontally (no friction)

PostPosted: Thu Oct 18, 2007 5:55 pm
by slembcke