R3d.SphereShape.new
From GiderosMobile
Revision as of 02:52, 23 January 2020 by MoKaLux (talk | contribs) (Created page with "'''Available since:''' Gideros 2019.10<br/> '''Class:''' R3d.SphereShape<br/> === Description === Creates a new collision sphere shape (fixture). <source lang="lua"> r3d....")
Available since: Gideros 2019.10
Class: R3d.SphereShape
Description
Creates a new collision sphere shape (fixture).
r3d.SphereShape.new(radius)
Parameters
radius: (number) the sphere radius
Example
-- a ball
local ballobj = loadObj("3d/balls", "ball.obj")
ballobj.shape = r3d.SphereShape.new(3)
local ballvp = Viewport.new()
ballvp:setContent(ballobj)
ballvp.body = world:createBody(ballvp:getMatrix())
ballvp.body:createFixture(ballobj.shape, nil, 64)