1 registered members (flink),
767
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
pXent_setfriction
#459140
04/24/16 20:05
04/24/16 20:05
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
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.
Last edited by Reconnoiter; 04/24/16 20:06.
|
|
|
Re: pXent_setfriction
[Re: Reconnoiter]
#459141
04/24/16 20:40
04/24/16 20:40
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
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
|
|
|
Re: pXent_setfriction
[Re: 3run]
#459158
04/25/16 10:49
04/25/16 10:49
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
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. Maybe I am missing some flag? ps: this what I have set for the player CHAR:
wait(1);
c_setminmax(my);
pXent_setskinwidth(my, phy_skinwidth); //permitted penetration of objects
pXent_settype(my, PH_CHAR, PH_CAPSULE); //PH_BOX
Last edited by Reconnoiter; 04/25/16 10:52.
|
|
|
Re: pXent_setfriction
[Re: Reconnoiter]
#459167
04/25/16 15:00
04/25/16 15:00
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
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. Maybe I am missing some flag? ps: this what I have set for the player CHAR:
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 Best regards
|
|
|
Re: pXent_setfriction
[Re: 3run]
#459186
04/26/16 11:08
04/26/16 11:08
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
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. 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.).
|
|
|
|