cpJoint type

Official forum for the Chipmunk2D Physics Library.
Post Reply
Blue Prawn
Posts: 22
Joined: Thu Jan 03, 2008 1:36 pm
Contact:

cpJoint type

Post by Blue Prawn »

Hi,
Is there a way to check joint type with an unmodified Chipmunk distribution?
thanks in advance
Pipo
Posts: 13
Joined: Thu Jan 03, 2008 11:27 am
Contact:

Re: cpJoint type

Post by Pipo »

I think you can define a method for each joint class which return the joint type.
In ruby, you can also use the .class method, which return the class of the object:

Code: Select all

joint = CP::Joint::Pin.new
joint.class
=> CP::Joint::Pin
Blue Prawn
Posts: 22
Joined: Thu Jan 03, 2008 1:36 pm
Contact:

Re: cpJoint type

Post by Blue Prawn »

sorry, I forgot to say my question was for the C interface.
Esch
Posts: 3
Joined: Fri Jan 04, 2008 4:02 am
Contact:

Re: cpJoint type

Post by Esch »

I know you said you wanted it for an unmodified version, but W. P. van Paassen made an easily-applied patch --you just swap out cpJoint.h and cpJoint.c and recompile. You can find it here: http://www.slembcke.net/forums/viewtopic.php?f=3&t=17

If you need it compiled as a lib or a dll for Windows, I have patched copies of both lying around.
Blue Prawn
Posts: 22
Joined: Thu Jan 03, 2008 1:36 pm
Contact:

Re: cpJoint type

Post by Blue Prawn »

I have seen this post, but the reason I want to use an unchanged Chipmunk is because I'm writing a language binding, so I don't want every user to have to patch Chipmunk.
I would prefer to make it simple for users.
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests