Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/19/24 18:45
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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
3 registered members (7th_zorro, AndrewAMD, TedMar), 837 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Car Physics #31095
07/25/04 01:16
07/25/04 01:16
Joined: Dec 2001
Posts: 941
England
LoneWolf Offline OP
Developer
LoneWolf  Offline OP
Developer

Joined: Dec 2001
Posts: 941
England
I have a working car using the physics system but it does have some problems. At the moment i have the main body of the car which is connected to 4 suspension blocks using PH_SLIDER. The wheels are then connected to these suspension blocks using PH_WHEEL. The can moves when i rotate the wheels and the car turns when i turn the front wheels using phcon_setmotor.
there are however some strange results i get. Sometimes the wheels seem to begin to fall off to the side etc even though they are on a slider. I think its because i am using PH_SPHERE when i set the wheels type and mass but PH_CYLINDER does not seem to work at all. The car will not move if i use PH_CYLINDER. Is there a bug that i am missing or am i doing it right using PH_SPHERE???
I might be able to upload a demo a bit later on if needed

any ideas?

thanks in advance


Wolfpack Software (www.wolfpacksoftware.com) A catalyst in the evolution of games Available for paid work
Re: Car Physics [Re: LoneWolf] #31096
07/25/04 01:56
07/25/04 01:56
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
try ph_poly, that works for me (atleast if i understood youre question right, else paste the code here please or speak to me over msn/icq).

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Car Physics [Re: Helghast] #31097
07/25/04 05:38
07/25/04 05:38
Joined: Dec 2001
Posts: 941
England
LoneWolf Offline OP
Developer
LoneWolf  Offline OP
Developer

Joined: Dec 2001
Posts: 941
England
Thanks for the reply

PH_POLY does not seem to work very well because the wheels arent perfectly round and i dont want to add any more detail to them if i can help it

My wheel action looks like this

Code:
action Car_Wheel
{
wait (1);
phent_settype (my, PH_RIGID, PH_SPHERE);
phent_setmass (my, 20, PH_SPHERE);
phent_setdamping (my, 0, 100);
phent_setfriction (my, 100);
phent_setelasticity (my, 60, 5);
phent_setgroup (my, 2);
// ph_setgravity (vector (0, 0, -386)); // Set gravity for the world
}



thanks again


Wolfpack Software (www.wolfpacksoftware.com) A catalyst in the evolution of games Available for paid work
Re: Car Physics [Re: LoneWolf] #31098
07/25/04 15:50
07/25/04 15:50
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
well, that should work, though i dont get where you set the "hinge" to attach the wheels to the car.

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Car Physics [Re: LoneWolf] #31099
07/27/04 09:19
07/27/04 09:19
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
Remember that PH_WHEELs have built-in suspension (see Constraints in manual). You can get away with creating a chassis, 4 wheels (PH_SPHEREs) and each linked to the chassis via PH_WHEEL.

Re: Car Physics [Re: Marco_Grubert] #31100
07/27/04 14:28
07/27/04 14:28
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
that's what i have, i dont know why he added extra models to it and jointed them with sliders...
maybe he wanted to make a moonbuggy or something.

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Car Physics [Re: Helghast] #31101
07/27/04 19:14
07/27/04 19:14
Joined: Dec 2001
Posts: 941
England
LoneWolf Offline OP
Developer
LoneWolf  Offline OP
Developer

Joined: Dec 2001
Posts: 941
England
I tried just using the car body and 4 wheels but if could not get the suspension working.

I guess you are talking about

Quote:

Parameter 6 : nullvector or spring-damper constants in the 0..100000 range, e.g. (90000,100,0)




I tried this but the wheels would slowly fall off the car. If i used a high value and suspended the car above the ground they dropped to the ground quickly. If i used a small value they slowly fell to the ground. They never stopped falling till they hit something though, should it not be limited to how far they move?

ive been playing about with different values whenever i get the chance and the car seems to be working quite well now. I made the back wheels into hinges because if i used PH_WHEEL the wheels would suddenly begin turning (as in turning the car) under speed. I also still have a problem where the wheels begin to fall of (to the side) whenever i make a sharp turn, im guessing thats the bug mentioned on the bug pages?

thanks again


Wolfpack Software (www.wolfpacksoftware.com) A catalyst in the evolution of games Available for paid work
Re: Car Physics [Re: LoneWolf] #31102
07/28/04 00:43
07/28/04 00:43
Joined: May 2004
Posts: 46
Hanover, Germany
JRAV Offline
Newbie
JRAV  Offline
Newbie

Joined: May 2004
Posts: 46
Hanover, Germany
Hi,

I'm also working on a car physics model, and also encountered problems with the hinge, such as wheels turning into the wrong direction or in worst case fly of the car.

The only solution seems to be setting friction to zero, at least in higher speeds,, then, however, you have the problem that when the car drives against another physics object (e.g. a 15kg cone), the car starts flying but not the cone.

I did not worry about suspension yet.

Re: Car Physics [Re: JRAV] #31103
07/29/04 22:20
07/29/04 22:20
Joined: Dec 2001
Posts: 941
England
LoneWolf Offline OP
Developer
LoneWolf  Offline OP
Developer

Joined: Dec 2001
Posts: 941
England
I cant set friction to 0 because i am using the turning of the wheels to move the car (phent_setmotor)

thanks anyway


Wolfpack Software (www.wolfpacksoftware.com) A catalyst in the evolution of games Available for paid work

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