-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pin joints don't hold bodies in fixed positions #213
Comments
Maybe an easier way to simulate the wheels: And the wheels will be only draw like a sprite without physics behavior. (If you see the weels on screen) |
The problem is - I want to make it simulation-ish, not arcade and I want to make wheels to steer and drive the vehicle :) I know that it's possible to achieve with Box2d but I wanted to try with Chipmunk first because I like the API and simplicity. Question is if joints in Chipmunk are able to provide correct behaviour in this case? |
Ok. |
I don't think I'm following. These boxes drawn in place of wheels are just debug shapes of the wheel shapes. Wheels itself are normal physical bodies and I want to make it this way. Anyway, I maybe found the reason for my problem with joints. I realized that to prevent vehicle to slide to the sides, I killed lateral velocity completely, so I suppose in some cases joints were forced to move from it's anchor point. I changed my calculation and now I'm killing only like 90% of lateral force, giving wheels possibility to adjust their positions a little bit, and now they behave correctly. At least it seems so for now. Issue can be closed. Thanks for answers. |
Hi. This is probably not a bug but I couldn't register on the forum to ask my question (I didn't get an email for account activation) so I will ask here.
I'm working on top-down vehicle simulation game and I want to build a vehicle with physical body as chassis and also physical bodies for wheels. Wheels are connected to chassis body with pin joints. However when I run the game and try to drive a vehicle, wheels are wiggling and front wheels don't hold their positions relative to the chassis. Like in the video below:
vehicle_joints.mp4.mp4
Chassis body has a mas of 10 and wheels - mas of 1.
I have a fixed step for physics implemented and it should be fine since I used similar code in some of my previous projects where I used Bullet Physics and it was working fine.
Is there a way to fix wheels to stay in correct positions, as wheels should, or it's just how they work in Chipmunk?
Thanks in advance for help.
And thanks for making Chipmunk :) I like it and I hope I will be able to use it in my game.
The text was updated successfully, but these errors were encountered: