R3d.HeightFieldShape.new

From GiderosMobile
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Available since: Gideros 2019.10
Class: R3d.HeightFieldShape

Description

Creates a new collision height field shape (fixture).

r3d.HeightFieldShape.new(nbColumns,nbRows,minAltitude,maxAltitude,heights)

Parameters

nbColumns: (number) the number of columns in the shape
nbRows: (number) the number of rows in the shape
minAltitude: (number) the minimum point altitude of the shape
maxAltitude: (number) the maximum point altitude of the shape
heights: (table) the heights table of the shape

Example

A simple terrain

local nbc, nbr = 4, 4
local minh, maxh = 0, 2
local ht = {
	0,0,0,0,
	0,2,2,0,
	0,2,2,0,
	0,0,0,0,
}
local shape = r3d.HeightFieldShape.new(nbc, nbr, minh, maxh, ht)