Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Nymphodora), 1,470 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Ph_wheel constraint isn't working correct sometime #74491
05/17/06 06:00
05/17/06 06:00
Joined: Sep 2004
Posts: 260
UB,Mongolia
Olzii Offline OP
Member
Olzii  Offline OP
Member

Joined: Sep 2004
Posts: 260
UB,Mongolia
Hi Marco,

My car wheel's 's ph_wheel constraints goes crazy sometimes. Ph_wheel has some angle limits, but it will ignore it sometimes. You can see it here : a6 car (Please use left and right key to steer when car is stopped and it will happen. )

I was ok before at 6.314. I think it is from new physics improvements.

Please tell me how to correct it. Is it a bug ?

Olzii


The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
Re: Ph_wheel constraint isn't working correct some [Re: Olzii] #74492
05/17/06 18:58
05/17/06 18:58
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
I can reproduce the problem by turning the wheels all the way to one direction and then all the way in the other direction. But without the C-Script code it's hard to say what the cause is.
I also noticed that you are creating the car partially inside the level. Make sure that the car starts on top of the floor.

Re: Ph_wheel constraint isn't working correct some [Re: Marco_Grubert] #74493
05/18/06 07:32
05/18/06 07:32
Joined: Sep 2004
Posts: 260
UB,Mongolia
Olzii Offline OP
Member
Olzii  Offline OP
Member

Joined: Sep 2004
Posts: 260
UB,Mongolia
Here is code :

1. Constraint create
you.wheelFL= phcon_add(PH_WHEEL, you, my);
phcon_setparams1(you.wheelFL, my.x, vecUp, vecRight);
phcon_setparams2(you.wheelFL, vector(0,0,0), nullvector, vector(you.suspensionERP, you.suspensionCFM,0));

2. Turning code
my.targetSteer=clamp(my.targetSteer,-40,40);
phcon_setparams2(my.wheelFL, vector(my.targetSteer,my.targetSteer,0), nullvector, vector(my.suspensionERP, my.suspensionCFM,0));
phcon_setparams2(my.wheelFR, vector(my.targetSteer,my.targetSteer,0), nullvector, vector(my.suspensionERP, my.suspensionCFM,0));

It does not matter that where is car creating. I have tried it.

Olzii


The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
Re: Ph_wheel constraint isn't working correct some [Re: Olzii] #74494
05/18/06 08:36
05/18/06 08:36
Joined: Sep 2004
Posts: 260
UB,Mongolia
Olzii Offline OP
Member
Olzii  Offline OP
Member

Joined: Sep 2004
Posts: 260
UB,Mongolia
Here is screenshots:



It will happen when i press left or right key until wheel steering reaches maximum angle. It will not happen if i make maximum steering angle to 30.

my.targetSteer=clamp(my.targetSteer,-30,30); // it is OK

But steering angle 30 is not enough for car steering.

Olzii


The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
Re: Ph_wheel constraint isn't working correct some [Re: Olzii] #74495
05/19/06 10:23
05/19/06 10:23
Joined: Sep 2004
Posts: 260
UB,Mongolia
Olzii Offline OP
Member
Olzii  Offline OP
Member

Joined: Sep 2004
Posts: 260
UB,Mongolia
Hi Marco,

You have requested code and i posted code and images. Why you dont answer ?
May be i should write these questions on beta forum ?

Olzii


The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
Re: Ph_wheel constraint isn't working correct some [Re: Olzii] #74496
05/19/06 14:45
05/19/06 14:45
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
Does this still happen with 6.40.5?


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: Ph_wheel constraint isn't working correct some [Re: FoxHound] #74497
05/19/06 21:22
05/19/06 21:22
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
Okay it seems that the PH_WHEEL does not like to be overly constrained. I am getting the same problem with 6.40.5 but it goes away when I change the code to this:

phcon_setparams2(my.wheelFL, vector(my.targetSteer-2,my.targetSteer+2,0), nullvector, vector(my.suspensionERP, my.suspensionCFM,0));
phcon_setparams2(my.wheelFR, vector(my.targetSteer-2,my.targetSteer+2,0), nullvector, vector(my.suspensionERP, my.suspensionCFM,0));

Re: Ph_wheel constraint isn't working correct some [Re: Marco_Grubert] #74498
05/20/06 04:16
05/20/06 04:16
Joined: Sep 2004
Posts: 260
UB,Mongolia
Olzii Offline OP
Member
Olzii  Offline OP
Member

Joined: Sep 2004
Posts: 260
UB,Mongolia
Wow, it goes away. Thanks Marco.

Why ? I dont understand purpose of adding +2, -2.

Olzii


The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
Re: Ph_wheel constraint isn't working correct some [Re: Olzii] #74499
05/22/06 20:48
05/22/06 20:48
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
Internally what the physics engine does is it solves dozens of equations. Due to machine precision some of these equations are ill-formed, e.g. when you're trying to solve
x-1=0 and x-1.1=0
at the same time you won't be able to come to a satisfying solution which visually means that the physics object will do something weird. The whole point of setting correction factors and adding the +/-2 values above is to allow for a fudge factor so that a satisfying solution can be found. Essentially you are now telling the PH_WHEEL that they should point roughly in the right direction as opposed to forcing them to be 100% aligned which leads to instability.


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | 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