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 (dr_panther, 1 invisible), 620 guests, and 2 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
Page 2 of 2 1 2
Re: pX_setgroupcollision doesn't work? [Re: rojart] #416209
01/29/13 05:26
01/29/13 05:26
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline
Senior Member
3dgs_snake  Offline
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
Quote:
I tried to use it, to disable the collusions between player and the platform. I use PH_CHAR for both of them (one CAPSULE and another one BOX).


I think you should not use PH_CHAR for a moving platform. You should use kinematic body instead.

Re: pX_setgroupcollision doesn't work? [Re: 3run] #416280
01/30/13 00:27
01/30/13 00:27
Joined: Oct 2004
Posts: 900
Lgh
rojart Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
Ok I checked the CCT and I found what was going wrong.

Originally Posted By: 3run
... does pXent_setbodyflag work with PH_CHAR? I can't get it to work as well (it works with PH_RIGID very well).

pXent_setbodyflag works only with dynamic physics object.

Originally Posted By: 3run
Doesn't it work with PH_CHAR?? Manual said nothing about that.. I tried to use it, to disable the collusions between player and the platform. I use PH_CHAR for both of them (one CAPSULE and another one BOX)...

Firstly check this dll, should work because in the CCT definition I found out that interactionFlag option was not used and by default your PH_CHAR model always collide.

Note: If a character controller will collide with another controller. There are 3 options: always collide, never collide and collide based on the shape group (NXIF_INTERACTION_INCLUDE, NXIF_INTERACTION_EXCLUDE, NXIF_INTERACTION_USE_FILTER)

In the dll I changed to NXIF_INTERACTION_EXCLUDE for both Capsule and Box, I known it's not the best for now, but I will make it better.


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: pX_setgroupcollision doesn't work? [Re: rojart] #416282
01/30/13 00:55
01/30/13 00:55
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
rojart@ thank you very much. I'll test it now. One more question, is there a way, to make platform ignore player, but to keep collusions for player?

Edit: problem is, that when platform collides with player, it's starts changing it's Z position, in order to pass throw the player.. I can't keep Z position fixed, so I need platform to ignore the player, but player itself should be able to collide with it.

Last edited by 3run; 01/30/13 00:59.

Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: pX_setgroupcollision doesn't work? [Re: 3run] #416284
01/30/13 04:52
01/30/13 04:52
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline
Senior Member
3dgs_snake  Offline
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
Hi,

As I said, you can't use CCT grin , CCT has an "auto stepping" behaviour, that's why the z position is not fixed. You really should use a kinematic body (You need only to change the way you integrate your character).

Re: pX_setgroupcollision doesn't work? [Re: 3run] #416404
01/31/13 06:12
01/31/13 06:12
Joined: Oct 2004
Posts: 900
Lgh
rojart Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
Originally Posted By: 3run
rojart@ thank you very much. I'll test it now. One more question, is there a way, to make platform ignore player, but to keep collusions for player?

Edit: problem is, that when platform collides with player, it's starts changing it's Z position, in order to pass throw the player.. I can't keep Z position fixed, so I need platform to ignore the player, but player itself should be able to collide with it.

I'm glad I could help, so if I understand right, your player should Collide when moving to the platform, but if platform move to the player his Collision should not occur?

Well, I've changed a bit the source code and added new var type PH_CHAR2 which register the entity as a character controller without Collision.

Try the new dll and play with PH_CHAR2 type for the platform, too.

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

#define PH_CHAR2 5 //!< Never collide character controllers.

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

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

	ENTITY *ePlayer = ent_create("CUBE.MDL", vector(0, 30, 0), NULL);
	vec_set(ePlayer.scale_x,vector(.5,.5,1));
	vec_set(ePlayer.blue,COLOR_RED);	set(ePlayer,LIGHT|CAST); c_setminmax(ePlayer);
	pXent_settype(ePlayer, PH_CHAR2, PH_BOX);
	
	ENTITY *platform = ent_create("CUBE.MDL", vector(0, -30, 0), NULL);
	vec_set(platform.scale_x,vector(1,.5,.5));
	vec_set(platform.blue,COLOR_GREEN); set(platform,LIGHT|CAST); c_setminmax(platform);	
	pXent_settype(platform, PH_CHAR, PH_BOX);
	
	ENTITY *eStatic = ent_create("CUBE.MDL", vector(0, 0, 0), NULL);
	vec_set(eStatic.blue,COLOR_WHITE); set(eStatic,LIGHT|CAST); c_setminmax(eStatic);
	pXent_settype(eStatic, PH_STATIC, PH_BOX);

	while(1)
	{
		draw_text("[WASD] Move Red Player", 5, 5, COLOR_RED);
		draw_text("[Arrow keys] Move Green Platform", 5, 30, COLOR_GREEN);
		draw_text("Static Entity", 5, 60, COLOR_WHITE);
		ePlayer.skill1 = 5 * (key_a - key_d) * time_step;
		ePlayer.skill2 = 5 * (key_w - key_s) * time_step;
		platform.skill1 = 5 * (key_cul - key_cur) * time_step;
		platform.skill2 = 5 * (key_cuu - key_cud) * time_step;
		pXent_move(ePlayer, NULL, vector(0, ePlayer.skill1, ePlayer.skill2));
		pXent_move(platform, NULL, vector(0, platform.skill1, platform.skill2));
		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: pX_setgroupcollision doesn't work? [Re: rojart] #416425
01/31/13 12:36
01/31/13 12:36
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Thank you very much man! This will be useful.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: pX_setgroupcollision doesn't work? [Re: 3run] #416502
02/01/13 00:51
02/01/13 00:51
Joined: Oct 2004
Posts: 900
Lgh
rojart Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
I'm always happy if I can help.

But subject question has annoyed me, why it does not work and I found a bug.

pX_setgroupcollision works very well, but pXent_setgroup not.

I'll describe this later in the bug thread.


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
Page 2 of 2 1 2

Moderated by  HeelX, Spirit 

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