Conitec's Vehicle Physics: tyres colliding

Posted By: James_Burke

Conitec's Vehicle Physics: tyres colliding - 04/03/05 13:26

Hi,
I'm using Conitec's code for the vehicle physics (avaliable from the downloads page). I have replaced the standed 'buggy' with another model. The problem I have is when driving it becomes 'jumpy'. It seems that the tyres are colliding with the body of the vehicle. I would guess I've set it up wrong, because it works fine with the 'buggy', but maybe I've forgotten to set something?
The body of the vehicle (in MED)


The tyre of the vehicle (in MED)


The vehicle set up (in WED)


Thanks,
James
Posted By: MatAllum

Re: Conitec's Vehicle Physics: tyres colliding - 04/04/05 04:48

Collision type should be set to PH_POLY.

Do not let the tires of the car touch anything from the start. Double-check it in WED, and make sure there are no situations when the tires hit the body.
Posted By: Pappenheimer

Re: Conitec's Vehicle Physics: tyres colliding - 04/04/05 06:24

Not sure, if this helps, but the origin isn't precisely in the center of the tyre (wheel)!
Posted By: William

Re: Conitec's Vehicle Physics: tyres colliding - 04/04/05 13:09

The origin for each wheel in MED should be exactly at the point where the axel connects to the wheel(on outside of wheel, axel side). If that doesnt fix it be sure that the tires and your chassis are all set within the same group - "phent_setgroup(my,2);" apply that for all wheels and chassis. Be sure your wheels are using spherical collision, it does not matter what your chassis is using. Finally, be sure that when your creating your wheels their verticie positions are right.

Heres a quick example:

Code:
  
//Put this in your chassis action after your chassis is applyed to physics engine
vec_for_vertex(temp,my,952); ent_create(mdl_tyrefr,temp,FRInit);
vec_for_vertex(temp,my,953); ent_create(mdl_tyrefl,temp,FLInit);
vec_for_vertex(temp,my,950); ent_create(mdl_tyrebl,temp,RRInit);
vec_for_vertex(temp,my,951); ent_create(mdl_tyrebr,temp,RLInit);

//An example of the wheels action, it is applied via its "my.x" position, so be sure your origin is right.
action FLInit
{
phent_settype(my, PH_RIGID, PH_sphere);
phent_setmass(my, massWheel, PH_sphere);
phent_setfriction(my, fricWheel);
phent_setdamping(my, 0,dampWheel);
phent_setelasticity(my, 0, 100); // bounciness
phent_setgroup(my, 2);
my.FL_wheel_ID= phcon_add(PH_WHEEL, you, my);
phcon_setparams1(my.FL_wheel_ID, my.x, vecUp, vecRight);
phcon_setparams2(my.FL_wheel_ID, vector(0,0,0), nullvector, vector(suspensionERP, suspensionCFM,0));
}



P.S - I would reccomend creating the wheels through script as shown above instead of placing them beside the chassis in WED. That way, its precise and instant. Just be sure to place a vert's at the end of each axel(in the middle...) and create the wheels according to the verticie positions.
Posted By: James_Burke

Re: Conitec's Vehicle Physics: tyres colliding - 04/05/05 14:42

Thanks all.
I've tried your code idea with no success. Could you explain a little more about the posistion of the wheels in MED?
Thanks,
James
Posted By: William

Re: Conitec's Vehicle Physics: tyres colliding - 04/05/05 17:01

From what I can see, I am not completely sure what you are doing wrong. The best advice I can give is to try changing the position of the wheels in MED and see what happens. I'd really like to see this in action. If you cannot solve it please either upload your wheels and chassis models online, or send me a PM and I can help you via email(send it through email). I currently dont have anyway of hosting pictures online right now, so I cannot post a picture of how I line my wheels up.
Posted By: James_Burke

Re: Conitec's Vehicle Physics: tyres colliding - 04/05/05 18:29

Quote:

From what I can see, I am not completely sure what you are doing wrong. The best advice I can give is to try changing the position of the wheels in MED and see what happens. I'd really like to see this in action. If you cannot solve it please either upload your wheels and chassis models online, or send me a PM and I can help you via email(send it through email). I currently dont have anyway of hosting pictures online right now, so I cannot post a picture of how I line my wheels up.



Thanks William, I'll send you an email with a link to the models.
EDIT: What is your email? :P
Posted By: James_Burke

Re: Conitec's Vehicle Physics: tyres colliding - 04/05/05 20:23

Never mind about the email address I sent it to you via PM.
Thanks,
James
Posted By: Pappenheimer

Re: Conitec's Vehicle Physics: tyres colliding - 04/09/05 18:14

Just curious how you solved the problem!
Posted By: James_Burke

Re: Conitec's Vehicle Physics: tyres colliding - 04/10/05 06:12

The tires need to be set to the right of the plane in MED
EG:
|
-------|-----
[---]
|
[---] = tire
Posted By: Pappenheimer

Re: Conitec's Vehicle Physics: tyres colliding - 04/10/05 10:56

Thanks for your reply!

Don't understand completely what you mean with'plane', but if I copy the way that the tyre of the 'buggy' is placed in MED, it should work?
© 2024 lite-C Forums