About Store Forum Documentation Contact
Donations:
327$/mo



Post Reply 
Material Friction
Author Message
aceio76 Offline
Silver Supporter

Post: #1
Material Friction
This might be very basic, but I've not seen this before. What makes the player character slide on one terrain texture (even on a slight slope) vs another terrain texture even on a steep slope?

www.thinkplaystudios.com
02-14-2012 01:10 AM
Visit this user's website Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #2
RE: Material Friction
Take a look at the Physics.h header file and you will see the PHYS_MATERIAL enum as well as the PhysMtrl struct. You can define your own custom PhysMtrls and set the friction on them.
02-14-2012 01:48 AM
Find all posts by this user Quote this message in a reply
aceio76 Offline
Silver Supporter

Post: #3
RE: Material Friction
I'm a bit confused by this. How do you assign physmtrl to a texture that is then painted over the terrain? Is there a tutorial I missed that I need to look at?

www.thinkplaystudios.com
02-14-2012 04:28 AM
Visit this user's website Find all posts by this user Quote this message in a reply
b1s Offline
Member

Post: #4
RE: Material Friction
I think from material editor.
02-14-2012 03:36 PM
Find all posts by this user Quote this message in a reply
aceio76 Offline
Silver Supporter

Post: #5
RE: Material Friction
Is this the Material User Type Enum? I thought that was used by custom shaders?

www.thinkplaystudios.com
02-15-2012 02:39 AM
Visit this user's website Find all posts by this user Quote this message in a reply
aceio76 Offline
Silver Supporter

Post: #6
RE: Material Friction
So, thinking that the following test code would put friction on all material types (if I understand how Esenthel uses friction on materials):
Code:
REP(PHYS_MTRL_NUM) Physics.material[i].frictionMode(PhysMtrl::MODE_MAX);
REP(PHYS_MTRL_NUM) Physics.material[i].frictionStatic(1000);
I was surprised to see that the characters can still slide on certain materials ingame (I did try several different combinations of values as well).

Can someone please elaborate more about what is the right way to control friction on specific materials as they are used (painted) over the terrain? I think it's funny on my part that I got this far without really querying this smile

www.thinkplaystudios.com
02-15-2012 04:53 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #7
RE: Material Friction
try frictionDynamic too (maybe anisotropic friction too)
the parameters are passed directly to PhysX, you can read PhysX documentation for more info (2.8.4 version is used)

to handle character sliding I recommend setting Physics.create(CSS_FREEZE..
02-16-2012 12:59 PM
Find all posts by this user Quote this message in a reply
aceio76 Offline
Silver Supporter

Post: #8
RE: Material Friction
Thanks Esenthel, I will give these a go as soon as I am able.

www.thinkplaystudios.com
02-17-2012 02:50 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply