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 (SBGuy), 712 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 7 of 9 1 2 3 4 5 6 7 8 9
Re: some a6 physics questions #15461
04/29/03 23:59
04/29/03 23:59
Joined: Jan 2003
Posts: 10
france
T
thuan Offline
Newbie
thuan  Offline
Newbie
T

Joined: Jan 2003
Posts: 10
france
Wao, i just find my bug. I add this line :
ent_remove(my);

in the end of the action sphere and now it work fine; this is the good script:

var earthgravity[3] = 0,0, -386;
function emit_sphere(); //prototype of the function
action sphere

{

my.shadow=on;
ph_setgravity( earthgravity );
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);
on_mouse_left=null;
sleep(5);
on_mouse_left=emit_sphere;
ent_remove(my);
}

string mdl_sphere=<roue.wmb>;

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;
temp.z=camera.z+sin(camera.tilt)*100;
ent_create(mdl_sphere,temp,sphere);
}

on_mouse_left=emit_sphere;

One more time , great thanks to Ventilator.

[Smile] [Smile]

Re: some a6 physics questions #15462
04/30/03 02:18
04/30/03 02:18
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
@clemens:
code:
<edit>newer code above!</edit>

i haven't continued working on it but this is my current code... the car doesn't jump around but the front wheels don't rotate properly (see screenshot below) and so i can't steer. driving forwards and backwards works! [Smile]

the wheels are attached stiffly. i though the wheel constraint has dampers? is that what the spring/damper constants should set?

Re: some a6 physics questions #15463
04/30/03 02:43
04/30/03 02:43

A
Anonymous
Unregistered
Anonymous
Unregistered
A



thuan: I don't understad why the other code doesn't go, but if it is okey now: Nice! [Smile]

ventilator: Yes, the same code I have, too... Perhabs the models are the problem, but I have used a cube for the car and symple cylinders for the wheels for testing it: same result [Frown]
I think there was a change between the actually A6 Physics Engine and the Beta Physics Engine - and because I have to use the Beta Physics Engine, yet - I have a car, which jumps around the room... could this be right [Wink] ?

Re: some a6 physics questions #15464
04/30/03 04:16
04/30/03 04:16
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
it works for thuan now because he has com and com does only support 1 physics object! [Smile]

Re: some a6 physics questions #15465
04/30/03 04:27
04/30/03 04:27

A
Anonymous
Unregistered
Anonymous
Unregistered
A



@Venti:
Would you mind sending me a zip with your car script/level/models, so I can inspect it ?

Re: some a6 physics questions #15466
04/30/03 06:04
04/30/03 06:04
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
marco, i sent you an email!

clemens, your car probably jumps around because you use cylinders for collision. they don't have collision detection with level geometry yet. or do they in the beta?

Re: some a6 physics questions #15467
04/30/03 08:49
04/30/03 08:49

A
Anonymous
Unregistered
Anonymous
Unregistered
A



From the A6 manual:
quote:

max_ph_entites
Determines the number of entities that can be registered for physics.

Type:
Variable, read/only.

Range:
0 - no physics engine available (S E)
1 - physics for 1 object (C)
999999 - unlimited physics (P)

CAPS_PHYSICS
Defined if the engine is capable of physics (C P).

By checking for these values it's possible to avoid obscure error messages if a user does not have the required engine version..

@Ventilator:
Got your e-mail and I will be looking into it.

Re: some a6 physics questions #15468
05/01/03 07:08
05/01/03 07:08

A
Anonymous
Unregistered
Anonymous
Unregistered
A



@Ventilator: I have it working now, but I still need to figure out, why it did not work. Before I get back to you on this, some general tips:
- use hinges for the back wheels
- don't use addtorque on the wheels- set a motor value, otherwise the wheels will get kicked away in different directions by the environment. Motor values try to maintain a certain speed/direction no matter what.
- don't set the spring-damper values unless you have to, just pass a nullvector in order to use the defaults

Now how do I get that boulder off of the roof of my car? [Wink]

Re: some a6 physics questions #15469
05/01/03 09:40
05/01/03 09:40

A
Anonymous
Unregistered
Anonymous
Unregistered
A



Some corrections to the manual concerning PH_WHEEL:
- axis 1 is specified relative to the first entity's frame
- axis 2 is specified relative to the second entity's frame
- only axis 1 can have a limit set on its turning range

What this means is that you should model your tires in the same direction that your car frame has been modeled. For setting up the constraint use the illustration provided in the manual with axis 1 pointing up. Ignore the angle limit for axis 2. Here's a sample:
code:
FR_wheel_ID=phcon_add(PH_WHEEL,car_frame, wheel);
phcon_setparams1(FR_wheel_ID,wheel.x,vector(0,0,1),vector(0,1,0));
phcon_setparams2(FR_wheel_ID,vector(-40,40,0),nullvector,nullvector);

This expects the wheel's axle to be aligned with the y axis and allows a steering angle of +/-40 degrees.

Re: some a6 physics questions #15470
05/01/03 17:56
05/01/03 17:56
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
thank you very much marco!

it works now! all i had to change was the order of the entities in the wheel constraint definition... now i am ready for some more experiments! [Smile]

i still don't know what the spring/damper constant specifies?

if i want to have shocks / suspension, do i have to use an additional slider constraint for each wheel? and how would i set this constrain up so that it works like a spring? just set a motor for the slider which is active all the time?

Page 7 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