R3d.Body:setMaterial

Available since: Gideros 2019.10
Class: R3d.Body

Description

Sets the body material (bounciness, frictionCoefficient, rollingResistance).

r3d.Body:setMaterial(material)

Parameters

material: (table) the body material table

Example

local mat = shipvp.body:getMaterial()
mat.bounciness = 0.1 -- default = 0.5
mat.frictionCoefficient = 0.5 -- default = 0.3
mat.rollingResistance = 1 -- default = 0 no rolling resistance
shipvp.body:setMaterial(mat)