|
|
|
|
|
|
|
|
|
|
|
|
SGT_FW
by Aku_Aku. 05/31/26 11:05
|
|
|
|
|
1 registered members (Grant),
6,529
guests, and 3
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
physX explosion
#340170
09/01/10 16:48
09/01/10 16:48
|
Joined: Feb 2010
Posts: 886
Random
OP
User
|
OP
User
Joined: Feb 2010
Posts: 886
|
So why is this not working? I can`t find a damm wrong thing...  Take a look at it; VECTOR temp_dir; VECTOR ex_dir;
function physX_boom() { my.event = NULL; set(my, PASSABLE); set(my, INVISIBLE); ent_create("explo.tga", my.x, explo_sprite); effect(fire_effect, 1000, my.x, nullvector); effect(smoke_effect, 100, my.x, nullvector); my.alpha = 100; set(my, TRANSLUCENT); while (my.alpha > 0) { my.alpha -= 1 * time_step; wait (1); } wait(1); c_scan(my.x,my.pan,vector(360,0,1000),IGNORE_ME); if (event_type == EVENT_SCAN) { vec_set(ex_dir,you.x); vec_set(temp_dir,my.x); vec_sub(temp_dir,ex_dir); vec_normalize(temp_dir,1000-result); pXent_addvelcentral(me,temp_dir); } }Of course the PhysX objets are set my.emask |= ENABLE_SCAN;. So could it be that my mistake is in the function pXent_addvelcentral(me,temp_dir);, when yes, damm I don`t know any other functions with physX...
Last edited by Random; 09/01/10 16:52.
|
|
|
Re: physX explosion
[Re: Random]
#340173
09/01/10 17:01
09/01/10 17:01
|
Joined: Nov 2007
Posts: 2,568 Germany, BW, Stuttgart
MasterQ32
Expert
|
Expert
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
|
look at this (from the manual):
pXent_addexplosion ( entity, VECTOR* vPos, var force, var radius);
maybe it will help you otherwise, your code is strange!
if (event_type == EVENT_SCAN)
{
vec_set(ex_dir,you.x);
vec_set(temp_dir,my.x);
vec_sub(temp_dir,ex_dir);
vec_normalize(temp_dir,1000-result);
pXent_addvelcentral(me,temp_dir);
}
this should be in the EVENT functions of your entities and not in the loop which raises the ev!ent
|
|
|
|