Difference between revisions of "R3d.Fixture:setCollisionCategoryBits"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
Line 6: Line 6:
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
 
r3d.Fixture:setCollisionCategoryBits(bits)
 
r3d.Fixture:setCollisionCategoryBits(bits)
</source>
+
</syntaxhighlight>
  
 
=== Parameters ===
 
=== Parameters ===
Line 15: Line 15:
 
local fixture = ship.body:createFixture(shape, nil, mass) -- shape, transform, mass
 
local fixture = ship.body:createFixture(shape, nil, mass) -- shape, transform, mass
 
fixture:setCollisionCategoryBits(8)
 
fixture:setCollisionCategoryBits(8)
</source>
+
</syntaxhighlight>
  
 
{{R3d.Fixture}}
 
{{R3d.Fixture}}

Latest revision as of 14:32, 13 July 2023

Available since: Gideros 2019.10
Class: R3d.Fixture

Description

Sets the fixture category bit.

r3d.Fixture:setCollisionCategoryBits(bits)

Parameters

bits: (number) the fixture category bit (power of 2)

Example

local fixture = ship.body:createFixture(shape, nil, mass) -- shape, transform, mass
fixture:setCollisionCategoryBits(8)