R3d.Fixture:setMaterial

From GiderosMobile
Revision as of 07:47, 22 January 2020 by MoKaLux (talk | contribs) (Created page with "'''Available since:''' Gideros 2019.10<br/> '''Class:''' R3d.Body<br/> === Description === Sets the body material (bounciness, frictionCoefficient, rollingResistance). <s...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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)