pXent_setfriction

Posted By: Reconnoiter

pXent_setfriction - 04/24/16 20:05

Hi,

How to get automatic friction to work for pXent_move?

I tried setting pXent_setfriction(my, 100); for objects but it doesn't seem to do anything. While pXent_setelasticity (bounce effect) does seem to work.
Basically what I want is that if characters move through objects like crates they not only push away the crates but their movement speed is also reduced while doing so.

ps: pXent_settype for objects like e.g. crates is set to PH_RIGID, the player is set to PH_CHAR.

Posted By: 3run

Re: pXent_setfriction - 04/24/16 20:40

Originally Posted By: Reconnoiter
How to get automatic friction to work for pXent_move?
If you move RIGID body with 'pXent_move' it won't have any collisions.. For CHAR you can't set friction (at least via pXent_setfriction).


Greets
Posted By: Reconnoiter

Re: pXent_setfriction - 04/25/16 10:49

Hi 3run,

I have set friction for the RIGID body (/crates) and move the CHAR through pXent_move against them, that should work right? But it doesn't the player CHAR just keep walking at full speed through a hundred of crates and pushes them away like its nothing. grin Maybe I am missing some flag?

ps: this what I have set for the player CHAR:

Code:
wait(1);
c_setminmax(my);
pXent_setskinwidth(my, phy_skinwidth); //permitted penetration of objects 
pXent_settype(my, PH_CHAR, PH_CAPSULE); //PH_BOX

Posted By: 3run

Re: pXent_setfriction - 04/25/16 15:00

Originally Posted By: Reconnoiter
Hi 3run,

I have set friction for the RIGID body (/crates) and move the CHAR through pXent_move against them, that should work right? But it doesn't the player CHAR just keep walking at full speed through a hundred of crates and pushes them away like its nothing. grin Maybe I am missing some flag?

ps: this what I have set for the player CHAR:

Code:
wait(1);
c_setminmax(my);
pXent_setskinwidth(my, phy_skinwidth); //permitted penetration of objects 
pXent_settype(my, PH_CHAR, PH_CAPSULE); //PH_BOX

No, you have to know that CHAR ignores all RIGID bodies (that's the way native physX plugin works in Acknex). You can't change that by friction or by anything else. You can do some nasty workarounds, f.e. use traces to disable input, when trace hit RIGID bodies (take a look at my latest movement code that uses CHAR with BOX shape). BTW as far as I know, when you set friction via 'set_friction', it will affect only when you move that object against other bodies, not visa versa (as in your example), but I might be wrong grin


Best regards
Posted By: Reconnoiter

Re: pXent_setfriction - 04/26/16 11:08

Ty for the info.

Also I noticed that adding a "EVENT_FRICTION" in the event of e.g. the player and setting "pXent_setcollisionflag(player, my, NX_NOTIFY_ON_START_TOUCH);" in the action of the rigid bodies also works for a collision event. laugh

I haven't checked yet if it is possible to set "pXent_setcollisionflag" multiple times to link each rigid body with each character, but that would be pretty sweet if that is possible (for enemies etc.).
© 2024 lite-C Forums