R3d.HeightFieldShape:setScale

From GiderosMobile

Available since: Gideros 2019.10
Class: R3d.HeightFieldShape

Description

Scales the collision height field shape (fixture).

r3d.HeightFieldShape:setScale(sx,sy,sz)

Parameters

sx: (number) the new collision height field shape scale on the x axis
sy: (number) the new collision height field shape scale on the y axis
sz: (number) the new collision height field shape scale on the z axis

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)
shape:setScale(2,3,2)