Class: HeightfieldCollider

HeightfieldCollider


new HeightfieldCollider(heightData, worldSize, minHeight, maxHeight, rgbaEnc)

HeightfieldCollider is a Collider that works with heightfield data.

Parameters:
Name Type Description
heightData Array | Texture2D

An Array containing numbers, or a Texture2D containing texture data (this can be slow because of the data that needs to be read back).

worldSize number

The size of the height map width in world coordinates

minHeight number

The minimum height in the heightmap (only used if heightData is a texture)

maxHeight number

The maximum height in the heightmap (only used if heightData is a texture)

rgbaEnc boolean

Indicates the data in the texture are [0 - 1] numbers encoded over the RGBA channels (only used if heightData is a texture)

Author:
  • derschmale <http://www.derschmale.com>