R3d.CapsuleShape:setRadius
From GiderosMobile
Available since: Gideros 2019.10
Class: R3d.CapsuleShape
Description
Sets the radius of a collision capsule shape (fixture).
r3d.CapsuleShape:setRadius(radius)
Parameters
radius: (number) the new radius of the spheres
Example
-- a ship
local shipobj = loadObj("3d/ship", "ship.obj")
local shipvp = Viewport.new()
shipvp:setContent(shipobj)
shipvp.body = world:createBody(shipvp:getMatrix())
shipobj.shape1 = r3d.CapsuleShape.new(4, 2)
shipobj.shape1:setRadius(3)
shipobj.mass = 128
shipvp.body:createFixture(shipobj.shape1, nil, shipobj.mass)