Using surface velocity to move bodies

Official forum for the Chipmunk2D Physics Library.
Post Reply
Night Elf
Posts: 6
Joined: Tue Apr 28, 2009 7:35 pm
Contact:

Using surface velocity to move bodies

Post by Night Elf »

As suggested in this topic: http://www.slembcke.net/forums/viewtopi ... form#p1532, I'm trying to move a body through the surface_v property. I've tried assigning a value to the surface_v of the ground and also to the surface_v of the body's shape, but none of them produce any results. Can you help me make this work?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Using surface velocity to move bodies

Post by slembcke »

Have you set any friction? Surface velocities only affect friction calculations.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Night Elf
Posts: 6
Joined: Tue Apr 28, 2009 7:35 pm
Contact:

Re: Using surface velocity to move bodies

Post by Night Elf »

Ah! So, both bodies need to have at least some friction. Thank you very much, it's working now!
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Using surface velocity to move bodies

Post by slembcke »

Yep. I chose to multiply the friction and elasticity values together to get the final value used in the calculations. It seems to make the most sense to do it that way to me, but unfortunately I don't think that there is a "correct" way to do it.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests