R3d.SphereShape:setRadius

From GiderosMobile
Revision as of 04:32, 19 December 2025 by MoKaLux (talk | contribs) (Created page with "'''Available since:''' Gideros 2019.10<br/> '''Class:''' R3d.SphereShape<br/> === Description === Sets the radius of the collision sphere shape (fixture). <syntaxhighligh...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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)