Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 18,731 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Tires get left behind #67558
03/21/06 14:21
03/21/06 14:21
Joined: Mar 2006
Posts: 35
Sao Paulo, Brazil
EdMercer Offline OP
Newbie
EdMercer  Offline OP
Newbie

Joined: Mar 2006
Posts: 35
Sao Paulo, Brazil
I dunno what is happening here. No matter what technique I use to move my physics car forward (either applying torque to the wheels or a central force to the main hull) its tires lag behind and then suddenly catch up, creating a freaky visual effect. Also if the car tips over the tires stay aligned with their anchor points, but touching the ground. Here's the physics activation code:

function pimp_my_ride()
{
me = ptr_for_name("carro");
phent_settype(me, ph_rigid, ph_poly);
phent_setmass(me, 10, ph_poly);
phent_setfriction(me,50);
phent_setdamping (me, 10, 10);
phent_setelasticity(me,5,200);
phent_setgroup(me, 6);
me.enable_friction=on;
while (wheels < 4)
{
wheels += 1;
if (wheels == 1) {you = ptr_for_name("pneutd");}
if (wheels == 2) {you = ptr_for_name("pneute");}
if (wheels == 3) {you = ptr_for_name("pneufd");}
if (wheels == 4) {you = ptr_for_name("pneufe");}
phent_settype(you,ph_rigid,ph_sphere);
phent_setmass(you,1,ph_sphere);
phent_setfriction(you,90);
phent_setdamping (you, 10, 10);
phent_setelasticity(you,30,200);
phent_setgroup(you, 6);
if (wheels == 1) {
td = phcon_add(ph_wheel, me ,you);
phcon_setparams1(td, you.x, vector(0,0,10), vector(10,0,0));
phcon_setparams2(td, vector(0,0,0), nullvector, vector(100000,0,0));
}
if (wheels == 2) {
te = phcon_add(ph_wheel, me ,you);
phcon_setparams1(te, you.x, vector(0,0,10), vector(10,0,0));
phcon_setparams2(te, vector(0,0,0), nullvector, vector(100000,0,0));
}
if (wheels == 3) {
fd = phcon_add(ph_wheel, me ,you);
phcon_setparams1(fd, you.x, vector(0,0,10), vector(10,0,0));
phcon_setparams2(fd, vector(0,0,0), nullvector, vector(100000,0,0));
}
if (wheels == 4) {
fe = phcon_add(ph_wheel, me ,you);
phcon_setparams1(fe, you.x, vector(0,0,10), vector(10,0,0));
phcon_setparams2(fe, vector(0,0,0), nullvector, vector(100000,0,0));
}
}
}

I've tweaked it's values no end and still cannot get it to work. Nothing in the forum seems to quite resemble the problems I'm having here. Any help would be higly appreciatted.

*Looking Desperate*

Re: Tires get left behind [Re: EdMercer] #67559
03/21/06 22:45
03/21/06 22:45
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
For debugging purposes move the whole car up into the sky and set gravity to 0. When accelerating the car should spin with all wheels attached.
Next add a small amount of gravity and see if the car falls properly and whether you can drive it.

Re: Tires get left behind [Re: Marco_Grubert] #67560
03/22/06 17:07
03/22/06 17:07
Joined: Mar 2006
Posts: 35
Sao Paulo, Brazil
EdMercer Offline OP
Newbie
EdMercer  Offline OP
Newbie

Joined: Mar 2006
Posts: 35
Sao Paulo, Brazil
Just tried zero gravity... The car spins but the wheels stay put. Bummer. When I add a small ammount of gravity the car falls alone until it hits the ground, then the wheels catch up. Where did I go wrong ?

Last edited by EdMercer; 03/22/06 17:09.
Re: Tires get left behind [Re: EdMercer] #67561
03/22/06 18:18
03/22/06 18:18
Joined: Mar 2006
Posts: 35
Sao Paulo, Brazil
EdMercer Offline OP
Newbie
EdMercer  Offline OP
Newbie

Joined: Mar 2006
Posts: 35
Sao Paulo, Brazil
Just figured it out. I created a do-nothing loop-and-wait action and associated it to each of my wheels. Now they refresh at every physics frame instead of only on collision (THAT was the problem). Thanks for your time Marco.

For those who wonder what I mean by do-nothing-loop-and-wait:

action be_a_wheel()
{
while(1)
{
wait(1);
}
}

Re: Tires get left behind [Re: EdMercer] #67562
03/22/06 20:02
03/22/06 20:02
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
That does not sound right. Are you saying that by adding this empty action to all the wheels they work and without it they are stuck ?

Re: Tires get left behind [Re: Marco_Grubert] #67563
03/23/06 15:07
03/23/06 15:07
Joined: Mar 2006
Posts: 35
Sao Paulo, Brazil
EdMercer Offline OP
Newbie
EdMercer  Offline OP
Newbie

Joined: Mar 2006
Posts: 35
Sao Paulo, Brazil
Exactly. The wheels are now fully operational and they had not been without actions attached to them.
The problem was first present with my original 6.1 version and I upgraded first to 6.3 then 6.4 trying to address it; the "action" fix never occurred to me prior to yesterday (during the tests you suggested, thanks for the change in perspective, BTW).

Re: Tires get left behind [Re: EdMercer] #67564
03/23/06 17:02
03/23/06 17:02
Joined: Oct 2003
Posts: 1,550
United Kingdom
indiGLOW Offline
Serious User
indiGLOW  Offline
Serious User

Joined: Oct 2003
Posts: 1,550
United Kingdom
loving the action title: be_a_wheel LOL!


The Art of Conversation is dead : Discuss

Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1