3 registered members (Ayumi, Akow, AndrewAMD),
1,505
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: physics in water
#15721
05/25/03 04:38
05/25/03 04:38
|
Joined: Oct 2001
Posts: 1,407 Helsinki, Finland
Phantom88
Expert
|
Expert
Joined: Oct 2001
Posts: 1,407
Helsinki, Finland
|
Maybe you should chane the "air" friction. Then you would get the effect you want: The terminal velocity would drop, thus speed falling.
~Phantom88~
Programmer, Gamer
ICQ #: 157485106 | Xfire: Phantom1988 | MSN: lauri_andler@hotmail.com | AIM: FinPhantom | YAHOO: FinPhantom
|
|
|
Re: physics in water
#15723
05/25/03 06:19
05/25/03 06:19
|
Anonymous
OP
Unregistered
|
Anonymous
OP
Unregistered
|
quote: You have to simulate the H2O molecules. fill the pool with millions of tiny invisible balls!
YES! YES! YES! Damned, why I didn't tried before, hehehe!!!
|
|
|
Re: physics in water
#15724
05/27/03 17:21
05/27/03 17:21
|
Joined: Nov 2001
Posts: 176
mss
Member
|
Member
Joined: Nov 2001
Posts: 176
|
quote: Originally posted by DocJoe: 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?
I think i have a code that should do. It works fine for me.
code:
var earthgravity[3] = 0,0, -386; function emit_sphere(); //prototype of the function
sound whamm = <explo.wav>; sound dump=<dump.wav>;
function shoot_event { if (EVENT_TYPE == EVENT_shoot) { ENT_playSOUND(MY,whamm,1000); vec_set(temp,normal); vec_scale(temp,40000); phent_addcentralforce ( my, temp ); } if (EVENT_TYPE == EVENT_friction) { ENT_playSOUND(MY,dump,1000); } if (EVENT_TYPE == EVENT_Block) { if(vec_length(bounce)>100) { my.skill41=snd_playing(my.skill40); if(my.skill41==0) {my.skill40=ENT_playSOUND(MY,dump,200);} } } // etc. ... }
function phset() //Normalbahaviour { phent_setmass(my, 0.5, PH_Sphere); phent_setfriction(my, 70); phent_setelasticity(my, 70,20); phent_setdamping(my, 20, 20 ); }
function wphset()//Waterbehaviour { phent_setmass(my, 0.001, PH_Sphere); phent_setfriction(my, 70); phent_setelasticity(my, 70,20); phent_setdamping(my, 95, 95 ); }
action sphere
{
var speedvec[3];//for waterbehaviour var onwater=0; my.metal=on; my.shadow=on; my.enable_block=on; my.ENABLE_shoot = ON; my.EVENT = shoot_event;
ph_setgravity( earthgravity ); phent_settype(my, PH_RIGID, PH_SPHERE); phent_setmaxspeed(my,30000, 5000);
phset(); wait(5);
vec_set(speedvec,nullvector); speedvec.z=1;
temp.x=cos(camera.pan)*cos(camera.tilt)*30000; temp.y=sin(camera.pan)*cos(camera.tilt)*30000; temp.z=sin(camera.tilt)*30000;
phent_addforcelocal(my,temp,nullvector);
while(1) {
if(content(my.x)==2) // Entity on passable Block? { if(onwater==0) { wphset(); //set Physic-Params for Waterbehaviour onwater=1; } phent_addcentralforce(my,speedvec); } else { if(onwater) { onwater=0; phset(); //No longer in Water->reset params } } wait(1); }
}
string mdl_sphere=<sphere3.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; temp.z=camera.z+sin(camera.tilt)*100; ent_create(mdl_sphere,temp,sphere); }
on_mouse_left=emit_sphere;
|
|
|
Re: physics in water
#15725
05/28/03 01:21
05/28/03 01:21
|
Anonymous
OP
Unregistered
|
Anonymous
OP
Unregistered
|
@mss: Ooooooops, many thanks for your big code, will try it tonight!
|
|
|
Re: physics in water
#15726
05/29/03 02:27
05/29/03 02:27
|
Joined: Jun 2002
Posts: 328
Master_Joe
Senior Member
|
Senior Member
Joined: Jun 2002
Posts: 328
|
|
|
|
Re: physics in water
#15727
05/29/03 05:08
05/29/03 05:08
|
Anonymous
OP
Unregistered
|
Anonymous
OP
Unregistered
|
I looked at the demo, but can not help you with the water problem right now, though I do have an idea of what might be causing the explosions. As for the patch: does reducing the mass help in fixing the problem? I would have thought increasing the mass should be more suitable in that it makes the sphere more resistant to movement (as does increasing the damping). Some more remarks on the demo: - no mirror/transparency effect - the warlock becomes invisible after being shot (is that by design?) - nice bleeding, though it would be neat if the puddle size was varying - great ripples, but for some reason the ripples also appear around the player's feet If you have not done so already, download the Half-Life 2 engine/game video from E3. It's 600MB but well worth it. Many of the physics effects shown there can be reproduced with A6 (buoyancy and "soft bodies" not yet). How about recreating a GameStudio demo with that gravity weapon ?
|
|
|
Re: physics in water
#15728
05/29/03 08:37
05/29/03 08:37
|
Joined: Nov 2001
Posts: 176
mss
Member
|
Member
Joined: Nov 2001
Posts: 176
|
quote: Originally posted by Marco Grubert: As for the patch: does reducing the mass help in fixing the problem? I would have thought increasing the mass should be more suitable in that it makes the sphere more resistant to movement (as does increasing the damping).
I have increased the mass to 1 and the speedvector.z to 1000 and it looks a bit more realistic. Increasing the linear damping is necessary, otherwise the sphere would jumping around the waterlevel.
|
|
|
Re: physics in water
#15729
05/29/03 11:46
05/29/03 11:46
|
Joined: May 2002
Posts: 7,441
ventilator
Senior Expert
|
Senior Expert
Joined: May 2002
Posts: 7,441
|
quote: Many of the physics effects shown there can be reproduced with A6 (buoyancy and "soft bodies" not yet).
i guess this mattress effect could be done with the new bonerotate commands and some invisible cubes connected with hinges.
quote: How about recreating a GameStudio demo with that gravity weapon ?
i tried it right after seeing the halflife2 video but it was trickier than i thought. it would be easier if all physics entities (not only constraints) had motors. or do you think i should just turn off physics for the object while holding it with the grav-gun?
|
|
|
|