Hi I am learning chipmunk and I am trying to get a simple circle shape ball to rotate on a surface like a wheel and move forward. How can I do this?
Thanks
How to rotate and move wheels
-
- Posts: 3
- Joined: Wed May 26, 2010 2:50 pm
- Contact:
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: How to rotate and move wheels
You can attach a motor constraint to it if you want it to be powered, or you can just set the rotational velocity of the body if you just want to get it rolling.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
-
- Posts: 3
- Joined: Wed May 26, 2010 2:50 pm
- Contact:
Re: How to rotate and move wheels
Thanks for your reply slembcke. Setting the rotational velocity seems to work, but I'm not sure what the two constrained bodies would be for a simple motor on a single wheel.
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: How to rotate and move wheels
The motor adds torque between two bodies. In the real world it's impossible to make a wheel twist against itself (or nothing). On a vehicle, you would attach the motor from the wheel to the chassis. If you just want to make a self powered wheel you can attach the other end of the motor to the static body that you attach your static geometry to.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Who is online
Users browsing this forum: No registered users and 32 guests