Game Development Reference
In-Depth Information
How it works...
Lights are not
Spatials
in the scene graph, and it can be tricky to move them around. It
can be added to nodes but then it will only illuminate the node (and its children) that it is
added to. The
LightControl
class bridges the gap since it can be added as a control to
Spatial
, and it controls the position (and direction of a light). In this recipe, we used it
so that the light will follow the camera around using a
CamNode
, but it works just as well
for any other
spatial
.