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