SkyDome Class Reference

This class controls the sky dome. See the documentation of the SkyDome entity on how to place a sky dome in your level. More...

List of all members.

Initialization Methods

Initialization methods can only be used in the initialization order. These methods are used to setup the sky dome and will have no effect if used outside the initialization order.

void SetTerrain (string heightmap, string texture)
 Define the grayscale bitmap used to generate the terrain and define the texture used on this terrain.
void SetVertScale (float scale)
 Set the scale used as a multiplier for the height of each point in the heightmap. Default is 1.
void SetLandscapeSize (int width)
 Set the width and depth of the terrain and the sky dome. This must be large enough to cover your level. Default is 4096.
void SetHorizScale (float scale)
 Set the scale used as a multiplier for the landscape width and depth. Default is 4.
void SetHeightOrigin (int height)
 Set the base origin of the terrain in the Y axis.
void SetDesiredTriangles (int value)
 Set the number of triangles used when creating the terrain or the sky dome.
void SetTwilightDistanceFromHorizon (float distance)
 Distance (percent of zenith) above and below horizon for twilight activation. Default is 0.4.
void SetSkyDome (int height, float resolution)
 Define the height and the resolution of the sky dome.
void SetSkyTexture (string texture)
 Define the bmp file used to texture the sky dome.
void DisableSun (bool Flag)
 If Flag is true then the Sun, Moon and Stars are disabled and will not appear as part of the SkyDome.
void SetSunScale (float scale)
 Set the scale for the size of the sun. Default is 4.
void SetDistanceFromSunFactor (float distance)
 Set the distance from the sky (or terrain) poly and the sun at which the light reflection is 1.0 (on a scale of 0-1.0). Default is 900.
void SetMoonColor (float red, float green, float blue, float alpha)
 Set the color used for the moon. Default is (255, 255, 255, 255).
void SetMoonPhase (int phase)
 Set the phase of the moon where the phase value corresponds to:
void DisableCloud (bool Flag)
 If Flag is true then clouds are disabled and will not appear in the level.
void SetLocation (float latitude, int month, int day, int hour)
 Set the location of the player and the starting time of the level.

Update Variables

These are variables that are used during the game to modify aspects of the sky dome.

string think
 A variable that is set to the name of the order that is to be executed the next time the SkyDome script is run.
float time
 A variable that contains the number of seconds since the SkyDome was initialized. This is used as an elapsed time counter.
float daytime
 A variable that contains the number seconds since midnight of the current day.

General Methods

General methods can be used during initialization or during the game and will have an effect at any time.

void SetWindDirection (string direction)
 Set the direction that the wind is blowing. This affects the direction that clouds move.
void SetTimeScale (float scale)
 Set the multiplier for the passing of time in the level.
void RenderWireframe (bool flag)
 If flag is true then the SkyDome and terrain will be rendered in wireframe mode.
void RenderLandscape (bool flag)
 If flag is false then the Landscape will not be rendered.
void SetSunColor (float red, float green, float blue, float alpha)
 Set the color used for the sun. Default is (255, 128, 0, 255).
void SetSkyColor (float red, float green, float blue, float alpha)
 Set the color used as lighting for the sky dome. Default is (164, 200, 255, 255).
void SetTwilightColor (float red, float green, float blue, float alpha)
 Set the color used as lighting for the twilight at dawn and dusk. Default is (255, 0, 0, 255).
void SetAmbientLightColor (float red, float green, float blue, float alpha)
 Set the color used as lighting for the terrain. Default is (255, 255, 255, 255).
void UseSkyFog (bool flag)
 If flag is true then color the level's distance fog the same color as the sky.
void ToggleMoveWithCamera ()
 whether to move the sky dome with the camera or not.

Detailed Description

This class controls the sky dome. See the documentation of the SkyDome entity on how to place a sky dome in your level.


Member Function Documentation

void SkyDome::SetTerrain ( string  heightmap,
string  texture 
)

Define the grayscale bitmap used to generate the terrain and define the texture used on this terrain.

The heightmap is an 8 bit grayscale bmp file that defines the height of the terrain at each pixel point. The height is measured in texels and ranges from a low of 0 to a high of 255. The heightmap should be square and a power of 2 in size to ensure that it works correctly. The texture is a normal bmp file that is used to texture the polys that make up the terrain.

void SkyDome::SetHeightOrigin ( int  height)

Set the base origin of the terrain in the Y axis.

By default the lowest point of the terrain is set to 0 in the Y axis. This location can be changed up or down so the terrain is underneath your level. Default is 0.

void SkyDome::SetDesiredTriangles ( int  value)

Set the number of triangles used when creating the terrain or the sky dome.

A larger number gives more detail but at the cost of rendering speed. Default is 500.

void SkyDome::SetSkyDome ( int  height,
float  resolution 
)

Define the height and the resolution of the sky dome.

The height is the number of texels from the base origin of the terrain to the highest point of the sky dome. Default is 400. The resolution is the number of polys used along each side of the dome. A larger number gives more detail but at the cost of rendering speed. Default is 32.

void SkyDome::SetMoonPhase ( int  phase)

Set the phase of the moon where the phase value corresponds to:

  • 0 - new moon
  • 1 - quarter waxing
  • 2 - full
  • 3 - quarter waning Default is a full moon.
void SkyDome::SetLocation ( float  latitude,
int  month,
int  day,
int  hour 
)

Set the location of the player and the starting time of the level.

The sky dome will reflect this information. The latitude is positive if north of the equator and negative if south. Month is 1 to 12, day is 1 to 31 and hour is 0 to 23. Default is 49, 10, 24, 12.

void SkyDome::SetWindDirection ( string  direction)

Set the direction that the wind is blowing. This affects the direction that clouds move.

Parameters:
directionString holding the name of a wind direction. The valid directions are:
  • "north"
  • "northeast"
  • "northwest"
  • "south"
  • "southeast"
  • "southwest"
  • "east"
  • "west"
void SkyDome::SetTimeScale ( float  scale)

Set the multiplier for the passing of time in the level.

This affects the speed of movement of the Sun, Moon and Starts. If the scale value is 10 then time passes at a rate of 6 minutes per hour.