R3d.Fixture:setMaterial

From GiderosMobile
Revision as of 20:52, 17 December 2020 by MoKaLux (talk | contribs) (MoKaLux moved page R3d.Body:setMaterial to R3d.Fixture:setMaterial: update to r3d v0.8)

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)