Difference between revisions of "R3d.Fixture:setMaterial"

From GiderosMobile
(Created page with "'''Available since:''' Gideros 2019.10<br/> '''Class:''' R3d.Body<br/> === Description === Sets the body material (bounciness, frictionCoefficient, rollingResistance). <s...")
 
m (MoKaLux moved page R3d.Body:setMaterial to R3d.Fixture:setMaterial: update to r3d v0.8)
(No difference)

Revision as of 21:52, 17 December 2020

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)