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), 552 guests, and 1 spider.
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 3 1 2 3
physics in water #15710
05/23/03 07:18
05/23/03 07:18

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



I let fall the following ball on/in a passable block (water). I really get stange behaviour (the ball becomes like a shark, hehehe!) . What do you think about? Is there a way of improvement?

code:
VAR earthgravity[3] = 0,0, -386;

ACTION physik_ball
{
ph_setgravity( earthgravity );

phent_settype(my, PH_RIGID, PH_SPHERE);
phent_setmass(my, 50, PH_SPHERE);
phent_setfriction(my, 90); phent_setelasticity(my, 90, 10);
phent_setdamping(my, 30, 20 );
}



Re: physics in water #15711
05/23/03 10:30
05/23/03 10:30
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
i don't think there is a simple solution for this. after watching the halflife2 videos i also thought about how this could be done...

there would be some kind of force field needed inside the water which causes light (low density) objects to swim and heavy objects to sink.

Re: physics in water #15712
05/23/03 16:37
05/23/03 16:37

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Yes, I learned a long time before in physics that you call that density (mass/volume). I did't test to give the water physic properties. Theoretically, if I give the water a mass, maybe the engine count the density(?). But I think that's not the only problem. I also noticed very strange turbulance forces (I gave the water the turbulence texture flag) and my balls (the ones in the game, hehehe) played crazy.

PS: @Marco Grubert: Gratulation, the physic engine is a real great and phantastic stuff!!

Re: physics in water #15713
05/23/03 22:22
05/23/03 22:22
Joined: Oct 2001
Posts: 1,407
Helsinki, Finland
Phantom88 Offline
Expert
Phantom88  Offline
Expert

Joined: Oct 2001
Posts: 1,407
Helsinki, Finland
My water sim is working quite well, i just need to add the waves, and its perfect [Wink]
[EDIT]Heres how i do it(hey, it's not elegant, but it works [Wink] ): I go through all vertices of the model, and if the vertex is under the sea level, i apply a small force to it.[/EDIT]
Il'l maybe make a demo if i get the waves working...

~Phantom88~


Programmer, Gamer ICQ #: 157485106 | Xfire: Phantom1988 | MSN: lauri_andler@hotmail.com | AIM: FinPhantom | YAHOO: FinPhantom
Re: physics in water #15714
05/24/03 00:21
05/24/03 00:21

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Sounds interesting!

I didn't used a model for the water, I used a level block. I'll also make a demo to show the "crazy behaviour" in passable blocks. Give me a day...

Re: physics in water #15715
05/24/03 04:59
05/24/03 04:59

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Quick answer: there is no buoyancy (sp? - Auftrieb) in the physics engine. It can however be simulated manually. If you see any turbulent behavior then it's either due to a bug in the script or in the engine.

Re: physics in water #15716
05/24/03 08:42
05/24/03 08:42

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Ok, as promised, I made a primitiv test level with Delivery, if anybody's interested. The water is a passable level block with a horizontal mirror and a water texture from the standard WAD.

Download: here (3.5 MB)

Screenshot:

 -

Re: physics in water #15717
05/24/03 08:50
05/24/03 08:50
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
the warlock is a great dancer! [Big Grin] ...the water wasn't transparent on my computer...

the balls behave like a piece of sodium when they touch the water! [Smile]

Re: physics in water #15718
05/24/03 15:21
05/24/03 15:21

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



code:
...the warlock is a great dancer!

Damned! I told him not to drink more than 6 glases of whisky! [Big Grin] (ACTION: patrol_path() with a simple event_function()).

Re: physics in water #15719
05/24/03 21:34
05/24/03 21:34

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



I tested some adding functions, but the physic engine seems not to like water (passable entities) ... (?) Did anybody succeed in this stuff?

Code snipplets

code:
 Example 1

VAR earthgravity[3];
earthgravity[0] = 0;
earthgravity[1] = 0;
earthgravity[2] = 386;

VAR watergravity[3];
watergravity[0] = 0;
watergravity[1] = 0;
watergravity[2] = 6;

WHILE(1)
{
IF (IN_PASSABLE == 1)
{
ph_setgravity( watergravity );
}
ELSE
{
ph_setgravity( earthgravity );
}
wait (1);
}

Example 2

VAR force_up_in_passable[3];
force_up_in_passable[0] = 0;
force_up_in_passable[1] = 0;
force_up_in_passable[2] = 50;

WHILE(1)
{
IF (IN_PASSABLE == 1)
{
phent_addforceglobal(my,force_up_in_passable,nullvector);
}
wait (1);
}



Page 1 of 3 1 2 3

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