Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 559 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 9 1 2 3 4 5 6 7 8 9
some a6 physics questions #15401
04/26/03 06:17
04/26/03 06:17
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
i played around with a6's physics engine for a while now and have some questions...

is PH_CYLINDER already implemented as collision hull? i saw it in the manual under physics constants but it isn't listed under collision hulls and it didn't seem to work when i tried to use it.

i would like to set up a car with realistic physics. i know i have to attach the wheels to the chassis per constraints (probably with the PH_WHEEL constraint?). how does the car move then? do i have to add a force to the chassis or should i add torque to the wheels (wheel constraint motor?) and the chassis moves automatically with the wheels then? and where should the chassis model's point of origin be? in the middle between the rear wheels?

Re: some a6 physics questions #15402
04/26/03 06:57
04/26/03 06:57

A
Anonymous
Unregistered
Anonymous
Unregistered
A



quote:
Originally posted by ventilator:
is PH_CYLINDER already implemented as collision hull? i saw it in the manual under physics constants but it isn't listed under collision hulls and it didn't seem to work when i tried to use it.

PH_CYLINDER can be used for testing purposes- it is not officially implemented. The part that is missing (and I would need to double-check that) is Cylinder to Mesh collisions. So if you create a box or sphere entity and set another one to cylinder, they should collide. Because the level is a mesh though, cylinders will fall straight through it. [Frown]

quote:
i would like to set up a car with realistic physics. i know i have to attach the wheels to the chassis per constraints (probably with the PH_WHEEL constraint?).
Use PH_WHEEL for the joint between the wheel and the chassis. Then use phcon_setmotor to apply a torque to the wheel. The wheels then rotate, undergo frictional forces from the ground and thereby drag the chassis along with them. Finding the right numbers for mass, friction, damping, torque, etc. can be difficult. Also make sure your setmotor parameters are not too large or the wheels will start to slip. There is one unresolved issue with the axle bending when the chassis is too heavy, or the wheels spin too fast.

Re: some a6 physics questions #15403
04/26/03 07:01
04/26/03 07:01

A
Anonymous
Unregistered
Anonymous
Unregistered
A



Would it be possible to use the physics engine for a car or other complex/multiple-part object using the one object physics in commercial edition?

P.S. @Ventilator: How did you get your update to A6 already?

Re: some a6 physics questions #15404
04/26/03 07:07
04/26/03 07:07

A
Anonymous
Unregistered
Anonymous
Unregistered
A



quote:
Originally posted by Fredmaster:
Would it be possible to use the physics engine for a car or other complex/multiple-part object using the one object physics in commercial edition?

Not in the way I described below. For the commercial edition it would make more sense to use a single MDL car model including wheels and turn this into a physics entity. Then add forces and torques to it for accelerating/turning.

Re: some a6 physics questions #15405
04/26/03 07:36
04/26/03 07:36
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
quote:
Because the level is a mesh though, cylinders will fall straight through it.
that's exactly what i experienced. so i have to use PH_SPHERE instead of it for the wheels of my car. should work too...

if i want the car to go around a curve, do i just need to turn the front wheels? [Smile] or do i need to apply torque/motor (front wheel drive) so that they "pull" the car around the corner?

...
the physics engine is really cool! in my experiments i had over 200 active physics entities and didn't have any jerks or any noticeable framerate drop. i didn't expect that!

quote:
P.S. @Ventilator: How did you get your update to A6 already?
ordered yesterday, got it today! [Smile]

Re: some a6 physics questions #15406
04/26/03 16:55
04/26/03 16:55
Joined: Oct 2002
Posts: 120
India
G
greyplasma Offline
Member
greyplasma  Offline
Member
G

Joined: Oct 2002
Posts: 120
India
Hi Ventilator,

Need your help can you post a small example of a working physics code. Since you said you have some 200 entities working.

I am unabble to compile my script.
I have updated all the dlls and everything.

It gives error:
Code:

action ball
{
myCrate=my;
phent_settype(myCrate,PH_RIGID,PH_SPHERE);
phent_setmass(crateMass);
}

MISSING/WRONG PARAMETER, COMMA UNEXPECTED.

Also is their a probelm with SED and mouse scrolling, the script just scrolls up whether using mouse scroll up or down.....

Re: some a6 physics questions #15407
04/26/03 17:20
04/26/03 17:20
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
i think this function needs more parameters: phent_setmass(crateMass);

i also have the scrollwheel problem in sed...

Re: some a6 physics questions #15408
04/26/03 17:24
04/26/03 17:24
Joined: Oct 2002
Posts: 120
India
G
greyplasma Offline
Member
greyplasma  Offline
Member
G

Joined: Oct 2002
Posts: 120
India
But error is caused in the first line..

phent_settype(myCrate,PH_RIGID,PH_SPHERE);

Re: some a6 physics questions #15409
04/26/03 17:34
04/26/03 17:34
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
this is some working code from my tests:

code:
action sphere
{
my.shadow=on;

phent_settype(my, PH_RIGID, PH_SPHERE);
phent_setmass(my, 5, PH_SPHERE);
phent_setfriction(my, 70);
phent_setelasticity(my, 50, 10);
phent_setdamping(my, 20, 20 );

temp.x=cos(camera.pan)*cos(camera.tilt)*300000;
temp.y=sin(camera.pan)*cos(camera.tilt)*300000;
temp.z=sin(camera.tilt)*300000;
phent_addforcelocal(my,temp,nullvector);
}

string mdl_sphere=<sphere_0.mdl>;
function emit_sphere()
{
temp.x=camera.x+cos(camera.pan)*cos(camera.tilt)*100;
temp.y=camera.y+sin(camera.pan)*cos(camera.tilt)*100;
temp.z=camera.z+sin(camera.tilt)*100;
ent_create(mdl_sphere,temp,sphere);
}

on_mouse_left=emit_sphere;

it emits spheres from the camera position! [Smile]

Re: some a6 physics questions #15410
04/27/03 07:00
04/27/03 07:00

A
Anonymous
Unregistered
Anonymous
Unregistered
A



Thanks Dude,
There's realy not much working script examples in the manual and none template scripts for the new physics engine(as far as I know)

I added some gravity and had to end the loop after one model was emited (com edition) [Confused]

Page 1 of 9 1 2 3 4 5 6 7 8 9

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