Terrain · function
clipmapFrame
Snap a camera to each level's block, once, for a frame.
Explained in Terrain.
function clipmapFrame(terrain: Terrain, cameraX: number, cameraZ: number, options?: ClipmapOptions): ClipmapFrameimport { clipmapFrame } from '@driftengine/terrain';Parameters
| Parameter | Type | Description |
|---|---|---|
terrain | Terrain | |
cameraX | number | |
cameraZ | number | |
options? | ClipmapOptions |
In depth
The camera is in world coordinates and the blocks are in field cells, because that is what
heightfieldPatch indexes by and converting in one place is one place to be wrong.