R3d.SphereShape:setRadius
From GiderosMobile
Available since: Gideros 2019.10
Class: R3d.SphereShape
Description
Sets the radius of the collision sphere shape (fixture).
r3d.SphereShape:setRadius(radius)
Parameters
radius: (number) the new collision sphere shape radius
Example
-- a ball
local ballobj = loadObj("3d/balls", "ball.obj")
local ballvp = Viewport.new()
ballvp:setContent(ballobj)
ballvp.body = world:createBody(ballvp:getMatrix())
ballobj.shape = r3d.SphereShape.new(3)
ballobj.shape:setRadius(4)
ballvp.body:createFixture(ballobj.shape, nil, 64)