SpriteAnimation.lua
Tile.lua
Neo3D.lua
QuadTree.lua
Widget.lua
Sprite.lua
Collision.lua
OEntity.lua
Button.lua
Graphics2D.lua
InputField.lua
LuaUnit.lua
Tests.lua
OCamera.lua
Object3d.lua
class.lua
OLight.lua
SpriteSheet.lua
OSound.lua
Utils.lua
Canvas.lua
Label.lua
Api.lua

The OLight class

An 'OLight' instance is an light object in a scene which can be
manipulated. The 'OLight' class is mostly used to manage lights in your
3D scene.

See also: Widget

OLight(object3d)

Create a new OLight object with the given Object3d
as the base. Will return 'nil' if the given object is not of type 'Light'.

If you give 'nil' as the base object it will create a new light in the current scene and

Return: the new OLight object.

function OLight:getIntensity()

Returns the intensity of the light object.

Return: The intensity as a number.

function OLight:setIntensity(intensity)

Sets the intensity of the light source
You will be going for an intensity between 0.0 and 1.0 most of the time
to prevent over saturation.

Parameter

intensity

The light intensity.

function OLight:setColor(color)

Sets the light color

Parameter

color

The new color as a vec3

function OLight:getColor()

Gets the light color

Return: The color as a vec3

function OLight:setRadius(r)

Sets the light radius in unit

Parameter

r

The new radius as a number.

function OLight:getRadius()

Gets the light radius

Parameter

return

The light radius as a number.

function OLight:enableShadows()

Enables shadows

function OLight:disableShadows()

Disables shadows

function OLight:hasShadows()

Checks if the light has shadows enabled.

Return: A boolean value.

function OLight:setShadowBlur(b)

Sets the shadow blur.

Keep in mind that higher values are slower to calculate
since they cause more blur iterations in the GLSL shader!

The value has to be be bigger than 0!

Parameter

b

The new blur value as an integer number > 0

function OLight:getShadowBlur()

Returns the the shadow blur.

Parameter

return

The shadow blur as a number.

function OLight:setShadowBias(b)

Sets the shadow bias

Parameter

b

The bias as a number.

function OLight:getShadowBias()

Gets the shadow bias.

Return: The bias as a number.

function OLight:setSpotAngle(angle)

Sets the spot angle.

The angle needs to be given in degrees and
should be in the range 0 <= angle < 180.

A value of 0° turns the light into a directional
light source.

A value of 180° turns the light into a point light.

Parameter

angle

The new angle as a number.

function OLight:getSpotAngle()

Gets the spot angle

Return: The angle as a number in degrees.

function OLight:makeDirectional()

Turns the light into a directional light

function OLight:makePointLight()

Turns the light into a point light.