[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 - How to make a dumbbell ?

How to make a dumbbell ?

Official forum for the .

How to make a dumbbell ?

Postby wissme » Fri Feb 04, 2011 9:56 am

Hi !
I am just starting to try Chipmunk (old version, around 2.5, please don't tell me to use another more recent version, I'm not in C and use a special FFI). I want to make a dumbbell, so I make two balls and I join them by a joint. But the joint acts as a spring. I would like it to be rigid. How can I do that ? Thanks a lot !
-w
wissme
 
Posts: 5
Joined: Fri Feb 04, 2011 9:27 am

Re: How to make a dumbbell ?

Postby slembcke » Fri Feb 04, 2011 10:38 am

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 make a dumbbell ?

Postby wissme » Fri Feb 04, 2011 11:10 am

You tell me to do 1 body and several shapes ?
But in my case, I have 3 bodies, right ? Two balls and a segment.
Should I add one shape around them ?

-w
wissme
 
Posts: 5
Joined: Fri Feb 04, 2011 9:27 am

Re: How to make a dumbbell ?

Postby slembcke » Fri Feb 04, 2011 11:21 am

What you want is to have 1 body and 3 shapes then. What you want is 1 single rigid object, you represent that creating one rigid body and giving it a shape by adding a few collision shapes for 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: How to make a dumbbell ?

Postby wissme » Fri Feb 04, 2011 11:44 am

Well, I still don't see. Maybe can I narrow the problem to having a ball with a rigid stick firmly attached.
What would I use to build the body ? cpMomentForCircle ? cpMomentForSegment ?....
Could you show me the C code ? It's probably a snip when you know the software, but my ideas are not that clear. That should give me a start...
Thanks !

-w
wissme
 
Posts: 5
Joined: Fri Feb 04, 2011 9:27 am

Re: How to make a dumbbell ?

Postby slembcke » Fri Feb 04, 2011 12:42 pm

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 make a dumbbell ?

Postby wissme » Sat Feb 05, 2011 3:31 am

Thanks a lot, I appreciate very much ! I will translate this in Scheme :

(define offset 10.0)
(define center1 (cpv offset 0.0)
etc.

By the way, Jay McCarthy has done an FFI interface with your C API to be used with Racket (http://racket-lang.org) which is the major dialect of the Scheme language. His port should be in :
http://planet.plt-scheme.org
but I don't see it today, maybe is he updating the (old 2.5) port to latest Chipmunk version ?... You will find something there :
http://planet.plt-scheme.org/display.ss ... hangerep=2
wissme
 
Posts: 5
Joined: Fri Feb 04, 2011 9:27 am

Re: How to make a dumbbell ?

Postby wissme » Sat Feb 05, 2011 4:36 am

I forgot : do you mean I will have no joint do define ?...
wissme
 
Posts: 5
Joined: Fri Feb 04, 2011 9:27 am

Re: How to make a dumbbell ?

Postby slembcke » Sat Feb 05, 2011 11:42 am

No joints. You just have one body, so there is nothing to join together.
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 2 guests

cron