2 registered members (dr_panther, 1 invisible),
620
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
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
Senior Member
|
Senior Member
Joined: Feb 2010
Posts: 320
TANA/Madagascar
|
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
User
|
User
Joined: Oct 2004
Posts: 900
Lgh
|
Ok I checked the CCT and I found what was going wrong. ... 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. 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.
|
|
|
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
OP
Senior Expert
|
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.
|
|
|
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
Senior Member
|
Senior Member
Joined: Feb 2010
Posts: 320
TANA/Madagascar
|
Hi, As I said, you can't use CCT , 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
User
|
User
Joined: Oct 2004
Posts: 900
Lgh
|
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.
#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);
}
}
|
|
|
|