Skip to content

Light Object Guide

Peter Robinson edited this page Jul 5, 2020 · 1 revision

Introduction

The LightObject dynamically draws a color at a location and radiates it outward. Collision objects cast shadows in the light as they pass through it. The color of the light is based on the blendColor of the lightObject. Since a lightObject is also a sceneObject, it can move, rotate, and even fade using all the same methods that a sceneObject uses, however, the size of the lightObject is controlled internally by the size of the light radius.

TorqueScript Bindings

Exposed Fields

The LightObject type exposes the following fields in addition to those it inherits. Shown are the equivalent methods available that perform the same action in setting and getting the respective field:

  • LightRadius The distance that the light travels before disappearing in world units.
  • setLightRadius(float)
  • getLightRadius()
  • LightSegments The number of segments used for the light. More segments will look better but will take more processing power.
  • setLightSegments(int)
  • getLightSegments()
Clone this wiki locally