Posted By: Nikozu86
HELP! pXent_setcollisionflag() doesn`t work!! - 08/22/10 00:05
I trying to prog a plane with PhysX. I want a sound playing when the plane hits something (i.e. terains)
I looked at earthball.c, i copied the most parts. But the event isn`t triggering!
DEUTSCH:
Ich versuche ein Flugzeug mit PhysX zu proggen. Ich will, dass ein sound abspielt, sobald das Flugzeug mit Etwas zusammenstösst. Ich habe Code-teile von earthball.c übernommen. Warum klapt es nicht?? die function Plop wird nicht ausgelöst.
CODE:
I looked at earthball.c, i copied the most parts. But the event isn`t triggering!
DEUTSCH:
Ich versuche ein Flugzeug mit PhysX zu proggen. Ich will, dass ein sound abspielt, sobald das Flugzeug mit Etwas zusammenstösst. Ich habe Code-teile von earthball.c übernommen. Warum klapt es nicht?? die function Plop wird nicht ausgelöst.
CODE:
Code:
SOUND* hit1 = "sfx1.wav"; function Plop() { ent_playsound(my,hit1,1500); wait(-1); my.ambient = 100; // Event Test } action plane1() { player = me; my._health = 100; my._aero = engine / 55; //2.1; // my.ambient = 0; // test event set(my,SHADOW); pXent_settype(my,PH_RIGID,PH_CONVEX); //CONVEX PH_BOX pXent_setmass( my, 80); pXent_setmassoffset(my,vector(10,0,-10),NULL); pXent_setdamping (my, 95,220 ); //20,30 pXent_setfriction(my,76); // 10 pXent_setelasticity(my,93); //HIT EVENT //wait(1); // PH_CHAR NEEDs IT! pXent_setcollisionflag(my,NULL,NX_NOTIFY_ON_START_TOUCH); my.event = Plop; // That DOES NOT WORK!!!!!!!! // Plop(); //TEST that works, but it`s useless!! while(1) ///////////////////////////////////////////////// { ..........