SgSphere

Reference

class SgSphere
module:
create(options, parent)

Create a new sphere object in the scenegraph.

Parameters:
  • options (table) – A table of options to fill the parameters

  • parent (SceneObject) – The parent scene object to add this to

Returns:

a promise which will resolve to the created object

Return type:

Promise

Usage:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
-- Options can be omitted. This example shows the defaults,
-- only specify the ones you want different.
SgSphere:create({
    active = true,
    name = "",
    transform = Transform.new(),
    layers = {0},
    tags = {},
    receiveShadow = false,
    castShadow = false,
    material = nil,
    radius = 1,
    widthSegments = 8,
    heightSegments = 6,
    phiStart = 0.
    phiLength = 360,
    thetaStart = 0,
    thetaLength = 360
})
fromObject(obj)

Create a sphere from an object

Parameters:

obj (Object) – The object to cast

fromHandle(handle, nodeId)

create a sphere object from a handle. Used internally.

Parameters:
  • handle (number)

  • nodeId (str)

Returns:

result object

Return type:

SgSphere

Examples