0
\$\begingroup\$

How a character controller's skin width is implemented?

I have a custom server with a traditional heightmap for terrains but when it comes to regions sitting on the terrain, I rely on 3D voxels that say whether a location is passable or not. The problem I'm having is that my makeshift character controller is getting stuck on everything within these regions instead of sliding along them as a client's character controller would (be it Unity or Unreal Engine). I have no idea how skin width is supposed to work but I'm intrigued by it. My C++ code takes a hard-stop approach when it encounters an impassable voxel. I would like to know more about how PhysX skin works.

\$\endgroup\$
12
  • \$\begingroup\$ The PhysX documentation describes this here and it looks like the source code is available here. \$\endgroup\$ Commented Mar 28, 2023 at 1:12
  • 2
    \$\begingroup\$ But I think this might be an XY Problem. It sounds like what you really want is "How do I implement a collide-and-slide behaviour between a capsule and voxels, without getting snagged on corners?" You think skin width could be a solution to that, but it might not be. Ask about your goal / the problem to solve, not about the stepping stone you're guessing might get you there. \$\endgroup\$ Commented Mar 28, 2023 at 1:17
  • \$\begingroup\$ I know one thing for sure, my "capsule" is really a point. On the server side (which is what I'm talking about), I've implemented everything myself and there is no capsule or circle for my character's "collider". I will look at the source you just pointed me to. \$\endgroup\$ Commented Mar 28, 2023 at 1:30
  • \$\begingroup\$ You probably want to model the character as having some radius if you want them to climb up over small ridges without a hard stop. \$\endgroup\$ Commented Mar 28, 2023 at 1:36
  • \$\begingroup\$ You're right. I shouldn't be focused on skin width. My end-goal is to be able to move smoothly throughout the level geometry without the use of any game engine and given only a 3D bitmap of what is passable/impassable. But I'm not even going to concern myself with the 3rd dimension at this point. So, instead of a capsule collider for my character, consider a circle collider. I want to be able to move smoothly throughout a 2D environment given a bitmap of valid positions. I could easily adapt any solution to work in 3 dimensions for when my character is jumping or flying. \$\endgroup\$ Commented Mar 28, 2023 at 1:41

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.