[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 - Joint separation/gap/stretch

Joint separation/gap/stretch

Official forum for the .

Joint separation/gap/stretch

Postby faraday » Wed Feb 25, 2009 11:14 pm

Hi,
Thanks for this great library! I love playing around with it.

My question: I've built a ragdoll with torso, head, arms, hands, legs, feet with pivot joints and slide joints for angle constraints. When I click the mouse I apply an impulse to the torso body to throw the actor around. Such fun! Now, if if click a few times, the actor's velocity gets faster and the torso stretches at the shoulder, hip and neck joints. The other joints stay intact (elbow, wrist, knee, ankle). So basically, the torso is way out in front and the head and limbs trail behind. Once the actor slows down and comes to rest, the joints realign.

Is there anything I can do to mitigate the amount of joint stretching?
faraday
 
Posts: 5
Joined: Mon Feb 16, 2009 10:32 pm

Re: Joint separation/gap/stretch

Postby slembcke » Thu Feb 26, 2009 2:00 am

They stay stretched even when the body doesn't have any forces applied to it? When it's just in freefall?
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: Joint separation/gap/stretch

Postby faraday » Thu Feb 26, 2009 9:15 am

All the joints look ok, when in free fall or under mild velocity. They only seem to stretch out after applying several impulses. Attached a few screens.
The joint types I've used are
Pivot Joints - shoulder, elbow, wrist, hip, knee, ankle, and neck
Slide Joints - hip, elbow, wrist, neck (these are only for angle constraints)
faraday
 
Posts: 5
Joined: Mon Feb 16, 2009 10:32 pm

Re: Joint separation/gap/stretch

Postby faraday » Fri Feb 27, 2009 8:43 am

I've found that if I call cpSpaceStep more frequently, the joints stay tighter. Is that a good approach though?

I havent tried this yet, but maybe applying the same impulse to each cpBody member of the ragdoll would keep the joints together better. I'll test it out.
faraday
 
Posts: 5
Joined: Mon Feb 16, 2009 10:32 pm

Re: Joint separation/gap/stretch

Postby faraday » Fri Feb 27, 2009 10:16 am

Found another tip from the docs. Increasing the cp_joint_bias_coef. I put mine at .8 and it seems to keep the joints tighter. This also seems like it performs better (fps) than calling cpSpaceStep more often.
faraday
 
Posts: 5
Joined: Mon Feb 16, 2009 10:32 pm

Re: Joint separation/gap/stretch

Postby faraday » Fri Feb 27, 2009 1:34 pm

Ok, final update! The source of the problem was my own blunder :oops: . I added the torso's cpBody and cpShape to the space twice. For whatever reason, that caused the torso to be off sync (under med-high velocity) with the rest of the body (as seen in the screens). Now everything looks awesome! I love it. :D
faraday
 
Posts: 5
Joined: Mon Feb 16, 2009 10:32 pm

Re: Joint separation/gap/stretch

Postby slembcke » Fri Feb 27, 2009 2:47 pm

Ah, yes. That would make things pretty wonky. That would update the body's velocity and position twice per frame. It would sort of work, but would make the problem much much more noticeable for sure.

A note on changing cp_joint_bias_coef: The closer you get to 1.0, the faster the joints will fix themselves, but it can also make it much worse and oscillate like mad if your joint gets separated by a large amount.
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


Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 0 guests

cron