User Guide

384 Chapter 16: Working with Models and Model Resources
Light methods
Use these methods to work with lights:
spotAngle
Get and set Angle of the light’s projection cone.
If type equals
#spot, setting a value less
than the umbra causes a “property not
found” error.
90.0
attenuation
Get and set A three-value vector controlling the
constant, linear, and quadratic
attenuation factors for spotlights.
vector
(1.0,0.0,0.0)
specular
Get and set TRUE (1)/FALSE (0) value that controls
whether or not the light produces
specular effects on surfaces. The
property is ignored for ambient lights.
Although
TRUE (1) is the default,
switching to
FALSE (0) may improve
performance.
TRUE (1)
spotDecay
Get and set TRUE (1)/FALSE (0) value that controls
whether or not spotlight intensity falls off
with camera distance.
FALSE (0)
pointAt
Orientation
Get and set Two orthogonal vectors
(objectRelativeDirection and
objectRelativeUp) controlling how the
light’s
pointAt method works.
None
boundingSphere
Get A list containing a vector and a floating-
point value, with the vector representing
the position and the value the radius of a
bounding sphere surrounding the light
and all its children.
[vector
(0,0,0), 0.0]
worldPosition
Get and set Position of the light in world coordinates.
Shortcut for the method
node.getWorldTransform
().position
.
Vector object
Method Description Returns
addChild
(aNode,
preserveWorld)
Adds the node aNode to this light’s list of children. An
equivalent operation is to set
aNode.parent = this light.
The
preserveWorld argument is optional. It can have two
values:
#preserveWorld or #preserveParent. If the value is
#preserveWorld, the world transform of the child being
added remains intact. If
#preserveParent, the child’s
transform is interpreted as remaining parent-relative.
Nothing
child[index]
Returns the child at the specified position in the index. Light object
child(name)
Returns a reference to the named child. Light object
Property Name Access Description Default