[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 - How to apply "swinging" to a rope...??

How to apply "swinging" to a rope...??

Official forum for the .

How to apply "swinging" to a rope...??

Postby hm50 » Wed Mar 16, 2011 9:41 am

Hello All!

I have created a rope class using rects and pivot joints. It works great and looks realistic, I'm struggling with how to make it swing though. I have tried applying impulses at time interval, but you can probably imagine how that turned out lol. I want my player body to be able to jump from rope to rope, but I want to be able to create a swinging effect (for ropes that are farther apart) perhaps by pressing a button apply an impulse while button is pressed, or perhaps a force that gets multiplied based on how long the button is held and then reset forces when button is released. (Im not sure if I should apply it to just the bottom segment or all segments) Anyone have any suggestions?

The other issue I have, is that I want a collision to occur between my player and the rope segments, but I also need the player to stay "attached" to the rope . Suggestions?


Thanks for your time!

Harvey
~~Support Indie Devs~~
[url]http://www.2BPMSoftware.com[/url]
hm50
 
Posts: 5
Joined: Wed Mar 16, 2011 9:24 am

Re: How to apply "swinging" to a rope...??

Postby slembcke » Wed Mar 16, 2011 10:10 am

Have you tried forces to only the player?

If you are putting all the rope collision shapes into a group to avoid self collisions, you can still use the layers bitmask or a collision handler to filter out collisions with parts of the rope the player is holding on to.
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: How to apply "swinging" to a rope...??

Postby hm50 » Wed Mar 16, 2011 10:32 am

I tried impulses on the player (at timed intervals, that sucked, lol) I'll try the multiplied forces on up swing and reset forces on down swing. (EDIT: Come to think of it, I think the issue might be that I am trying to apply forces at the wrong angle, ie. if the rope has swung to say a 45 deg angle, my forces are still being applied basically to the right side of the screen instead of up and right. My forces would then need to reverse on down swing or at least once past center point and heading left, correct?)

I haven't tried groups, but I did type them and used a collision handler to ignore those types colliding, problem was I also needed to use the same ignore collision methodology to keep the player from jumping back off of the rope. Best luck I have had was to make the player a STATIC_MASS, ignore collisions with rope segments, and just adjust player position in tick based on segment position.

I'll have to read up on how to implement the layer bitmask stuff.

Thanks!
~~Support Indie Devs~~
[url]http://www.2BPMSoftware.com[/url]
hm50
 
Posts: 5
Joined: Wed Mar 16, 2011 9:24 am


Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 0 guests