Skip to content

Hardness

Steffenvy edited this page Apr 17, 2020 · 6 revisions

Hardness is a part of the SurfaceOutputs result that you get from sampling. You can use it to apply less damage on impact if you e.g. fall into dirt vs concrete. It also affects how big the particles of an impact are.

To me I think of the (arbitrary unit) of hardness to be similar to this:

  • Flesh: on average .25 (although bones can make the hardness more like .5)
  • Dirt: .5
  • Wood: 1 - I generally use wood as the mental "reference" for 1
  • Hollow Metal: 2
  • Rock: 3
  • Metal: 4

But again, it's a very arbitrary unit. For CollisionEffects' approximate impact duration calculation (which uses hardnesses), you have control over the constant multiplier: public static float IMPACT_DURATION_CONSTANT = .1f;.

Clone this wiki locally