Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, VoroneTZ), 1,258 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
PhysX collision event and add shape #436899
02/05/14 10:06
02/05/14 10:06
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
I don't know if this is 3DGS related oder PhysX related:

If I set collision flags and event (http://www.conitec.net/beta/pXent_setcollisionflag.htm) the event is only triggered if the physX ent collides with its initialized body. If I add some more shapes with "pXent_addshape" the collision event is not triggered if the new added shapes collide with something.

Re: PhysX collision event and add shape [Re: oliver2s] #436996
02/07/14 12:00
02/07/14 12:00
Joined: Mar 2005
Posts: 68
Baesweiler
Tele Offline
Junior Member
Tele  Offline
Junior Member

Joined: Mar 2005
Posts: 68
Baesweiler
Correct, the Collison stops after a time or the collision event is not triggered.
I dont no why, its a Bug?

Re: PhysX collision event and add shape [Re: Tele] #436997
02/07/14 12:09
02/07/14 12:09
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
The collisions with added shapes works as they should be here, only the event isn't triggered.

Re: PhysX collision event and add shape [Re: Tele] #436998
02/07/14 12:09
02/07/14 12:09
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Have you tried adding the shapes first, then setting the collision flags?

Re: PhysX collision event and add shape [Re: jcl] #436999
02/07/14 12:21
02/07/14 12:21
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Yes.

Re: PhysX collision event and add shape [Re: oliver2s] #437067
02/08/14 17:43
02/08/14 17:43
Joined: Mar 2005
Posts: 68
Baesweiler
Tele Offline
Junior Member
Tele  Offline
Junior Member

Joined: Mar 2005
Posts: 68
Baesweiler
Hallo
Ok the problem
you cant sett NULL of this function.

pXent_setcollisionflag(eBlob, NULL, NX_NOTIFY_ON_START_TOUCH);

you must realy set the second entitie zb. bump of your terrain.

you = ent_for_name ("terrain_001"); // get pointer to that entity
pXent_setcollisionflag(my,you,NX_NOTIFY_ON_END_TOUCH);
my.event = Plop;

Then its work fine. ;-)

Tele

Re: PhysX collision event and add shape [Re: oliver2s] #437543
02/19/14 10:07
02/19/14 10:07
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Originally Posted By: oliver2s
I don't know if this is 3DGS related oder PhysX related:

If I set collision flags and event (http://www.conitec.net/beta/pXent_setcollisionflag.htm) the event is only triggered if the physX ent collides with its initialized body. If I add some more shapes with "pXent_addshape" the collision event is not triggered if the new added shapes collide with something.


Here I made a small test script where you can clearly see the problem. In the first line I made a #define for testing purpose, which adds a physX shape via pXent_addshape (no collision triggered). If the #define is commented out, no additional shape will be added (collision is triggered).

The physX test object can be move with A and D keys.

Code:
#define ADDITIONAL_SHAPE

#include <acknex.h>
#include <ackphysX.h>

void collision_event()
{
	if (event_type == EVENT_FRICTION) 
	{
		var time_=0;
		while(time_<2)
		{
			draw_text("collision detected",5,5,vector(0,0,255));
			time_+=time_step/16;
			wait(1);
		}
	}
}

void main()
{
	level_load(NULL);
	
	physX_open();

	ENTITY* ent1=ent_create(CUBE_MDL,vector(100,0,0),NULL);
	pXent_settype(ent1,PH_RIGID,PH_BOX);
	pXent_setbodyflag(ent1,NX_BF_FROZEN_POS_X,1);
	pXent_setbodyflag(ent1,NX_BF_FROZEN_POS_Z,1);
	pXent_setbodyflag(ent1,NX_BF_FROZEN_ROT,1);
	#ifdef ADDITIONAL_SHAPE
		ENTITY* ent1_shape=ent_create(CUBE_MDL,vector(100,16,0),NULL);
		pXent_addshape(ent1,ent1_shape,PH_BOX);
	#endif
	
	ENTITY* ent2=ent_create(CUBE_MDL,vector(100,40,0),NULL);
	pXent_settype(ent2,PH_STATIC,PH_POLY);
	
	pXent_setcollisionflag(ent1,ent2,NX_NOTIFY_ON_START_TOUCH);
	ent1.event=collision_event;

	while(1)
	{
		pXent_addvelcentral (ent1,vector(0,(key_a-key_d)*time_step*4,0));
		
		#ifdef ADDITIONAL_SHAPE
			ent1_shape.y=ent1.y+16;
		#endif

		wait(1);	
	}
}


Re: PhysX collision event and add shape [Re: oliver2s] #437545
02/19/14 10:27
02/19/14 10:27
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
I can confirm the problem. We'll implement a workaround in the next update.


Moderated by  jcl, Nems, Spirit, Tobias 

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