SilverLining for Android 1.0 Skies, 3D clouds, and weather for Android

- Main Page
- Related Pages
- Packages
- Classes
- Files

- Class List
- Class Index
- Class Members

Public Member Functions | Static Public Member Functions | Static Package Functions | Package Attributes
com::sundogsoftware::silverlining::SilverLining Class Reference

List of all members.

## Public Member Functions
boolean | Initialize (String username, String licenseKey, AssetManager assetManager)
void | SetMatrices (float[] modelView, float[] projection)
void | SetDate (int year, int month, int day)
void | SetTime (int hour, int minute, int second, float offsetGMT, boolean daylightSavingsTime)
LocalTime | GetDateTime ()
void | SetLocation (float latitude, float longitude, float altitude)
Location | GetLocation ()
void | SetWind (float windSpeed, float windDirection)
CloudLayer | AddCumulusCongestusLayer (float altitude, float size, float coverage)
CloudLayer | AddCumulusMediocrisLayer (float altitude, float size, float coverage)
CloudLayer | AddCirrusLayer (float altitude, float size)
CloudLayer | AddCirroCumulusLayer (float altitude, float size)
CloudLayer | AddCumulonimbusCloud (float altitude, float xPos, float zPos, float size)
CloudLayer | AddStratusLayer (float altitude, float coverage, float thickness)
void | SetRain (float mmPerHour)
void | SetSleet (float mmPerHour)
void | SetSnow (float mmPerHour, boolean wetSnow)
void | DrawSky ()
void | DrawClouds ()
## Static Public Member Functions
static native boolean | SetAssetManager (AssetManager manager, long atmosphere)
## Static Package Functions
| [static initializer]
## Package Attributes
Atmosphere | mAtmosphere

## Detailed Description

A simplified Java interface for the SilverLining Sky, Cloud, and Weather SDK. Allows for creation of the various cloud types with the most common settings, and basic configuration of the simulated time, place, and wind conditions. The full SilverLining API is exposed via JNI if you need to expand upon this class.

## Member Function Documentation

CloudLayer com::sundogsoftware::silverlining::SilverLining::AddCirroCumulusLayer | ( | float | altitude,
|  | float | size
| ) |  |

Adds a cirrus cloud layer to the scene (high, lumpy planar clouds.) Must be called after Initialize().

Parameters:

  altitude | The altitude of the cloud layer in meters.
  size | The width and length of the cloud layer, in meters.

Returns:
  A CloudLayer object representing this cloud layer.

CloudLayer com::sundogsoftware::silverlining::SilverLining::AddCirrusLayer | ( | float | altitude,
|  | float | size
| ) |  |

Adds a cirrus cloud layer to the scene (high, wispy, planar clouds.) Must be called after Initialize().

Parameters:

  altitude | The altitude of the cloud layer in meters.
  size | The width and length of the cloud layer, in meters.

Returns:
  A CloudLayer object representing this cloud layer.

CloudLayer com::sundogsoftware::silverlining::SilverLining::AddCumulonimbusCloud | ( | float | altitude,
|  | float | xPos,
|  | float | zPos,
|  | float | size
| ) |  |

Adds a cumulonimbus thunderhead to the scene. Must be called after Initialize().

Parameters:

  altitude | The height of the base of the cloud, in meters.
  xPos | The east/west position of the cloud center.
  zPos | The north/south position of the cloud center.
  size | The length and width of the cumulonimbus cloud, in meters.

CloudLayer com::sundogsoftware::silverlining::SilverLining::AddCumulusCongestusLayer | ( | float | altitude,
|  | float | size,
|  | float | coverage
| ) |  |

Adds a layer of cumulus congestus clouds (large volumetric, puffy clouds) to the scene. Must be called after Initialize().

Parameters:

  altitude | The altitude in MSL of the bottom of the cloud layer, in meters.
  size | The width and length of the cloud layer, in meters.
  coverage | The cloud coverage of the layer, from 0 to 1.0.

Returns:
  A CloudLayer object used to represent this layer.

CloudLayer com::sundogsoftware::silverlining::SilverLining::AddCumulusMediocrisLayer | ( | float | altitude,
|  | float | size,
|  | float | coverage
| ) |  |

Adds a layer of cumulus mediocris clouds (small volumetric, puffy clouds) to the scene. Must be called after Initialize().

Parameters:

  altitude | The altitude in MSL of the bottom of the cloud layer, in meters.
  size | The width and length of the cloud layer, in meters.
  coverage | The cloud coverage of the layer, from 0 to 1.0.

Returns:
  A CloudLayer object used to represent this layer.

CloudLayer com::sundogsoftware::silverlining::SilverLining::AddStratusLayer | ( | float | altitude,
|  | float | coverage,
|  | float | thickness
| ) |  |

Adds a stratus cloud layer (low, thick clouds) to the scene. Must be called after Initialize().

Parameters:

  altitude | The altitude of the base of the cloud, in meters.
  coverage | The percent of the sky covered by the cloud (0.0 - 1.0.) Specify 1.0 for dark, rainy conditions.
  thickness | The thickness of the cloud layer, in meters.

Returns:
  A CloudLayer object describing this cloud.

void com::sundogsoftware::silverlining::SilverLining::DrawClouds | ( |  | ) |

Draws the clouds and effects. Should be called once per frame, after your scene's objects have been drawn. Requires Initialize() was called successfully.

void com::sundogsoftware::silverlining::SilverLining::DrawSky | ( |  | ) |

Draws the sky box and clears the depth buffer. Should be called once per frame. Requires Initialize() was called successfully.

LocalTime com::sundogsoftware::silverlining::SilverLining::GetDateTime | ( |  | ) |

Retrieves the date and time currently being simulated.

See also:
  SetTime
  SetDate

Returns:
  The LocalTime object containing the date and time.

Location com::sundogsoftware::silverlining::SilverLining::GetLocation | ( |  | ) |

Retrieves the location currently being simulated.

See also:
  SetLocation

boolean com::sundogsoftware::silverlining::SilverLining::Initialize | ( | String | username,
|  | String | licenseKey,
|  | AssetManager | assetManager
| ) |  |

Initializes SilverLining and associates it with an Android Asset Manager. This method assumes "up" is along the positive Y axis, and "right" is along the positive X axis - modify this method if your convention is different, or if you are in a geocentric / ECEF coordinate system.

Parameters:

  username | The registration name associated with your license, or pass any string if you have not yet purchased a license. If novalid license info is provided, SilverLining will terminate after five minutes.
  licenseKey | The registration code associated with your license, or any string if you don't yet have a license. If a valid key is not provided, SilverLining will terminate after five minutes.
  assetManager | The AssetManager instance from your Activity class, used for loading SilverLining's resources. Ensure the Resources folder from the SilverLining SDK for Android is included in your app's assets directory.

Returns:
  true if SilverLining initialized successfully.

void com::sundogsoftware::silverlining::SilverLining::SetDate | ( | int | year,
|  | int | month,
|  | int | day
| ) |  |

Sets the simulated date, which influences the positions of the sun and moon and the phase of the moon.

Parameters:

  year | The year in YYYY format
  month | The month (1-12)
  day | The day of the month (1-31)

void com::sundogsoftware::silverlining::SilverLining::SetLocation | ( | float | latitude,
|  | float | longitude,
|  | float | altitude
| ) |  |

Sets the simulated location, which influences the position of the sun and moon. The altitude will influence the appearance of the sky.

Parameters:

  latitude | The simulated latitude (-90.0 - 90.0, positive is North.)
  longitude | The simualted longitude (-180.0 - 180.0, positive is East.)
  altitude | The simulated altitude above mean sea level, in meters.

void com::sundogsoftware::silverlining::SilverLining::SetMatrices | ( | float[] | modelView,
|  | float[] | projection
| ) |  |

Sets the projection and view matrices for your scene; must be called once per frame (or whenever your view changes.) These matrices are used to draw the sky and clouds consistently with the rest of your scene.

Parameters:

  modelView | An array of 16 floats describing the 4x4 view matrix.
  projection | An array of 16 floats describing the 4x4 projection matrix.

void com::sundogsoftware::silverlining::SilverLining::SetRain | ( | float | mmPerHour | ) |

Adds rain to the scene.

Parameters:

  mmPerHour | The rate of precipitation in millimeters per hour. (0.0 - 20.0)

void com::sundogsoftware::silverlining::SilverLining::SetSleet | ( | float | mmPerHour | ) |

Adds sleet to the scene.

Parameters:

  mmPerHour | The rate of precipitation in millimeters per hour. (0.0 - 20.0)

void com::sundogsoftware::silverlining::SilverLining::SetSnow | ( | float | mmPerHour,
|  | boolean | wetSnow
| ) |  |

Adds snow to the scene.

Parameters:

  mmPerHour | The rate of precipitation in millimeters per hour. (0.0 - 20.0)
  wetSnow | Whether the snow is 'wet', which influences the rate at which it falls.

void com::sundogsoftware::silverlining::SilverLining::SetTime | ( | int | hour,
|  | int | minute,
|  | int | second,
|  | float | offsetGMT,
|  | boolean | daylightSavingsTime
| ) |  |

Sets the simulated time of day. For local time, pass in the GMT offset of your time zone and ensure the location specified via SetLocation is consistent with the time zone you've specified. Or, pass in GMT time and a GMT offset of zero to avoid the complexities of figuring out the time zone for a given location.

Parameters:

  hour | The simulated hour of the day (0-23)
  minute | The simulated minute of the hour (0-59)
  second | The simulated second of the minute (0-59)
  offsetGMT | The GMT offset of the local time zone. For example, Pacific Time (Los Angeles) would be specified as -8.0.
  daylightSavingsTime | If local time is specified, whether daylight savings time is being observed.

void com::sundogsoftware::silverlining::SilverLining::SetWind | ( | float | windSpeed,
|  | float | windDirection
| ) |  |

Sets the simulated wind speed and direction, will will cause the clouds to move.

Parameters:

  windSpeed | The simulated wind speed in meters per second.
  windDirection | The direction of the wind, in degrees. 0 = North, 90 = East, 180 = South, 270 = West.

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

- C:/sl/android/SilverLiningAndroidLibrary/src/com/sundogsoftware/silverlining/SilverLining.java