Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 900 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
pXent_setgroup #416553
02/01/13 15:38
02/01/13 15:38
Joined: Oct 2004
Posts: 900
Lgh
rojart Offline OP
User
rojart  Offline OP
User

Joined: Oct 2004
Posts: 900
Lgh
I found a bug in the ackphysx.dll, but do not know if it has been changed, because I still have the old code from October 2011, please provide the new source code.

I noticed that actor->setGroup((NxActorGroup)_INT(groupID)); in DLLFUNC var pXent_setgroup (ENTITY* entity, var groupID) does not work properly, because it gruops are always the same, like after pXent_settype was used.
Quote:
When an entity is registered for physics (pxent_settype), its group parameter is automatically set to 1.


Should be changed from:
Code:
actor->setGroup((NxActorGroup)_INT(groupID));

to:
Code:
NxU32 nbShapes = actor->getNbShapes();
	NxShape * const*shapes = actor->getShapes();

	while (nbShapes--)
	{
		shapes[nbShapes]->setGroup(_INT(groupID));
	}


Try code below with default ackphysx.dll and my dll.

You can see that default dll works if I use pX_setgroupcollision(0, 1, 0); , but if I try with pX_setgroupcollision(2, 3, 0); still does not work.

Code:
#include <default.c>
#include <ackphysx.h>

BOOL bCollide = 1;

function on_space_event()
{
	while (key_space){wait (1);}

	bCollide = !bCollide;
	
	pX_setgroupcollision (2, 3, bCollide);
}

void main()
{
	physX_open();
	
	level_load(""); pXent_settype(NULL,PH_STATIC,PH_PLANE);	

	vec_set(camera->x, vector(-150, 0, 50));
	vec_set(camera->pan, vector(0, -10, 0));

	ENTITY *Cube1 = ent_create("CUBE.MDL", vector(0, 0, 60), NULL);
	vec_set(Cube1.blue,COLOR_RED); set(Cube1,LIGHT|CAST);
	pXent_settype(Cube1, PH_RIGID, PH_BOX);
	pXent_setgroup(Cube1,2);
	
	ENTITY *Cube2 = ent_create("CUBE.MDL", vector(0, 0, 30), NULL);
	vec_set(Cube2.blue,COLOR_GREEN); set(Cube2,LIGHT|CAST);
	pXent_settype(Cube2, PH_RIGID, PH_BOX);
	pXent_setgroup(Cube2,3);
	
	while(1)
	{
		draw_text("[SPACE] - Toggle collision", 5, 5, COLOR_WHITE);
		pX_pick();
		wait(1);
	}
}



Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
Re: pXent_setgroup [Re: rojart] #416761
02/04/13 10:48
02/04/13 10:48
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Thanks! We'll look into that.


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