threejs-grass
    Preparing search index...

    Function raycastHeight

    • Intersects a ray with a height function by ray-marching then bisecting. Works for baked meshes and procedural terrain alike (used by TerrainPainter).

      Parameters

      • sample: HeightFn
      • origin: Vector3
      • dir: Vector3

        Normalised ray direction.

      • maxDistance: number = 2000
      • step: number = 0.5

        March step in metres; smaller catches thinner ridges.

      Returns Vector3 | null

      The hit point (a new Vector3), or null.