Skyline Lua API  Version 1.0 RC1
Lua Script Reference for Skyline Game Engine.
scene Class Reference

#include <LUA_API_Scene.h>

Public Member Functions

void setFogEnabled (int state)
 Enable or Disable the use of fog in a scene through lua. More...
 
int isFogEnabled ()
 Return whether fog is enabled. 1 = enabled, 0 = disabled. More...
 
void setFogMode (int mode)
 Set the fog mode to use. Choices are Linear, Exp or Exp2. More...
 
void setFogDensity (float density)
 Control the density of the fog for an Exp or Exp2 fog mode. More...
 
void setFogLinearStart (float linearStart)
 Set the linear Starting range (close to camera) for a linear Fog mode. More...
 
void setFogLinearEnd (float linearEnd)
 Set the linear End range (Far from camera) for a linear Fog mode. More...
 
void setFogColour (float r, float g, float b)
 Set the colour of the fog in the scene using an RGB param set. More...
 
float3 getFogColour ()
 Return the colour of the current fog in the scene. More...
 
int getFogMode ()
 Get the current fog mode whether it is Linear, Exp or Exp2. More...
 
float getFogDensity ()
 Get the density of the fog if using an Exp or Exp2 fog mode. If using Linear, then please use getFogLinearStart() and getFogLinearEnd() More...
 
float getFogLinearStart ()
 Get the Linear start (close to camera) of the fog if using a linear fog mode. If using Exp or Exp2, then please use getFogDensity() More...
 
float getFogLinearEnd ()
 Get the Linear end (far from camera) of the fog if using a linear fog mode. If using Exp or Exp2, then please use getFogDensity() More...
 

Detailed Description

The following scene functions can be used to control scene features such as fog.
Use as scene.function()
For more information on how these functions can be used please visit the User Manual - http://home.aurasoft-skyline.co.uk

Member Function Documentation

float3 scene::getFogColour ( )

Return the colour of the current fog in the scene.

The following is a Small Example on how to use this function:

function onInit(objID)
    r,g,b = scene.getFogColour();
end
float scene::getFogDensity ( )

Get the density of the fog if using an Exp or Exp2 fog mode. If using Linear, then please use getFogLinearStart() and getFogLinearEnd()

The following is a Small Example on how to use this function:

function onInit(objID)
    density = scene.getFogDensity();
end
float scene::getFogLinearEnd ( )

Get the Linear end (far from camera) of the fog if using a linear fog mode. If using Exp or Exp2, then please use getFogDensity()

The following is a Small Example on how to use this function:

function onInit(objID)
    linEnd = scene.getFogLinearEnd();
end
float scene::getFogLinearStart ( )

Get the Linear start (close to camera) of the fog if using a linear fog mode. If using Exp or Exp2, then please use getFogDensity()

The following is a Small Example on how to use this function:

function onInit(objID)
    linStart = scene.getFogLinearStart();
end
int scene::getFogMode ( )

Get the current fog mode whether it is Linear, Exp or Exp2.

See setFogMode() for more information.

The following is a Small Example on how to use this function:

function onInit(objID)
    fogMode = scene.getFogMode();
end
int scene::isFogEnabled ( )

Return whether fog is enabled. 1 = enabled, 0 = disabled.

The following is a Small Example on how to use this function:

function onInit(objID)
    fog_enabled = scene.isFogEnabled()
    lprint("fog state: "..fog_enabled); 
end
void scene::setFogColour ( float  r,
float  g,
float  b 
)

Set the colour of the fog in the scene using an RGB param set.

Parameters
R: Set the Red channel in range of 0.0 - 1.0. Values over 1.0 can be used to power the fog colour
G: Set the Green channel in range of 0.0 - 1.0. Values over 1.0 can be used to power the fog colour
B: Set the Blue channel in range of 0.0 - 1.0. Values over 1.0 can be used to power the fog colour

Not passing any params will default to a white fog.

The following is a Small Example on how to use this function:

function onInit(objID)
    scene.setFogColour(0.0, 0.5, 0.0); -- Give a darker green fog.
end
void scene::setFogDensity ( float  density)

Control the density of the fog for an Exp or Exp2 fog mode.

Parameters
density: This is a float to control the density of an Exp or Exp2 fog. It will throw a warning if used with linear. See setLinearStart and setLinearEnd

The following is a Small Example on how to use this function:

function onInit(objID)
    scene.setFogDensity(0.002);
end
void scene::setFogEnabled ( int  state)

Enable or Disable the use of fog in a scene through lua.

Parameters
state: Send in 1 or above to enable or 0 to disable fog

The following is a Small Example on how to use this function:

function onInit(objID)
    scene.setFogEnabled(1); -- This will enable fog
end
function onStop()
    scene.setFogEnabled(0); -- This will disable fog
end
void scene::setFogLinearEnd ( float  linearEnd)

Set the linear End range (Far from camera) for a linear Fog mode.

Parameters
linearEnd: This is a float to control the density of an Exp or Exp2 fog. It will throw a warning if used with Exp or Exp2 type fogs. See setFogDensity

The value is measured in 1 unit = 1 meter. e.g. 5 is 5 meters from camera.

The following is a Small Example on how to use this function:

function onInit(objID)
    scene.setFogLinearEnd(50);
end
void scene::setFogLinearStart ( float  linearStart)

Set the linear Starting range (close to camera) for a linear Fog mode.

Parameters
linearStart: This is a float to control the density of an Exp or Exp2 fog. It will throw a warning if used with Exp or Exp2 type fogs. See setFogDensity

The value is measured in 1 unit = 1 meter. e.g. 5 is 5 meters from camera.

The following is a Small Example on how to use this function:

function onInit(objID)
    scene.setFogLinearStart(5);
end
void scene::setFogMode ( int  mode)

Set the fog mode to use. Choices are Linear, Exp or Exp2.

Parameters
mode: This is an integer value representing: 0 = Linear 1 = EXP 2 = EXP2

You can use the special enums also: enum.fog_Linear() - Return value 0 enum.fog_Exp() - Return value 1 enum.fog_Exp2() - Return value 2

The following is a Small Example on how to use this function:

function onInit(objID)
    scene.setFogMode(enum.fog_Exp());
end

The documentation for this class was generated from the following file: