[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 - Pseudo static object responding to forces but not impacts

Pseudo static object responding to forces but not impacts

Discuss new features and future development.

Pseudo static object responding to forces but not impacts

Postby theisegeberg » Fri Sep 14, 2012 8:15 am

theisegeberg
 
Posts: 6
Joined: Tue Aug 28, 2012 5:32 am

Re: Pseudo static object responding to forces but not impact

Postby slembcke » Fri Sep 14, 2012 6:34 pm

You'll need to integrate the forces to the object yourself, but that's super easy to do.

Give the pseudo static object (PSO) infinite mass. Objects colliding with it will treat it as static. Then create a velocity integration function for it (cpBody.velocity_func, see the Planet demo for an example). You can really just copy/paste the source of the default velocity function, cpBodyUpdateVelocity(). The only change you'd need to make is to use a finite mass for the body instead of the infinite one stored on it.
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: Pseudo static object responding to forces but not impact

Postby theisegeberg » Sat Sep 15, 2012 1:56 am

Thank you for the reply, you guys are super helpful.

I ended up using the collision method, because I can allow two PSO's to collide even if they act as if they have infinite mass towards some other objects. So I detect if both are PSO's and then collide then normally (or in a very heavy way).

Again thank you for the quick reply, I love this physics engine! :)
theisegeberg
 
Posts: 6
Joined: Tue Aug 28, 2012 5:32 am


Return to Features/Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron