TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class EnvironmentMapImage in Tinman.AddOns.Components

An IEnvironmentMap implementation that samples the given ColorBuffer.

sealed class EnvironmentMapImage extends EnvironmentMap

Public / Attributes

HasHemisphericFog

Should hemispheric fog be used for this environment map?

public override property HasHemisphericFog { get }
type bool
value true if hemispheric fog should be used, false if not.
implements EnvironmentMap.HasHemisphericFog

LightLatitude

Latitude of the prominent light in this environment map, if applicable.

public override property LightLatitude { get }
type float64
value [-90..90] The latitude angle in degrees or NanD if there is no prominent light.
overrides EnvironmentMap.LightLatitude

LightLongitude

Longitude of the prominent light in this environment map, if applicable.

public override property LightLongitude { get }
type float64
value [-180..180] The longitude angle in degrees or NanD if there is no prominent light.
overrides EnvironmentMap.LightLongitude

LightSize

Apparent size of prominent light in this environment map, if applicable.

public override property LightSize { get }
type float64
value [>=0] The apparent diameter of the prominent light, given as an angle in degrees. Will be NanD if there is no prominent light.
overrides EnvironmentMap.LightSize

SetLightMask

Can the SetLight method be used to configure the prominent light?

public virtual property SetLightMask { get }
type int32
value Zero or more of the following bits:
1: LightLatitude can be configured.
2: LightLongitude can be configured.
4: LightSize can be configured.
inherited EnvironmentMap.SetLightMask

Version

Returns the current version of object.

public property Version { get }
type int32
value The current version number.
inherited VersionedBase.Version

Remarks:

For each modification, the version is incremented by at least one.

Public / Constructors

EnvironmentMapImage

Creates a new instance of EnvironmentMapImage.

public constructor EnvironmentMapImage (ColorBuffer pixels, bool hemisphericFog = true)
params pixels [not-null] The environment map image. The top-left corner is mapped to 90°N 180°W, the bottom-right corner is mapped to 90°S 180°E.
  hemisphericFog Should hemispheric fog be used for this environment map? Defaults to true.

Remarks:

The environment map will not have a prominent light.


Creates a new instance of EnvironmentMapImage.

public constructor EnvironmentMapImage (ColorBuffer pixels, Vec2I lightCoords, bool hemisphericFog = true)
params pixels [not-null] The environment map image. The top-left corner is mapped to 90°N 180°W, the bottom-right corner is mapped to 90°S 180°E.
  lightCoords The pixel coordinates of the prominent light.
  hemisphericFog Should hemispheric fog be used for this environment map? Defaults to true.

Remarks:

The environment map will have an infinitely small prominent light.


Creates a new instance of EnvironmentMapImage.

public constructor EnvironmentMapImage (ColorBuffer pixels, Vec2I lightCoords, Vec2I lightOuter, bool hemisphericFog = true)
params pixels [not-null] The environment map image. The top-left corner is mapped to 90°N 180°W, the bottom-right corner is mapped to 90°S 180°E.
  lightCoords The pixel coordinates of the center of the prominent light.
  lightOuter The pixel coordinates of a point on the outer edge of the prominent light.
  hemisphericFog Should hemispheric fog be used for this environment map? Defaults to true.

Remarks:

The environment map will have a prominent light of the given size.

Public / Methods

ComputeEnvironmentColor

Computes the environment color at the given coordinates.

[Pure]
public override method ComputeEnvironmentColor (float64 latitude, float64 longitude)
type int64
params latitude The latitude angle of the view direction, in the range [-90..90] degrees. The vertical center of the environment map is at 0° latitude.. The zenith is at 90° latitude.
  longitude The longitude angle of the view direction, in the range [-180..180] degrees. The horizontal center of the environment map is at 0° longitude.
returns The computed environment map color.
implements EnvironmentMap.ComputeEnvironmentColor

See also:

Colors

CreateResource

Creates a new resource object, using the given graphics context.

[OwnerReturn]
public method CreateResource (Graphics graphics)
type IResource
params graphics [not-null] The graphics context to use.
returns The resource object or null.
inherited EnvironmentMap.CreateResource

Remarks:

Resource objects may implement the IMemoryConsumption interface. In this case, the reported memory consumption will be interpreted as an estimate on how much GPU memory is consumed by the resource. This estimate can then be used for resource caching (e.g. CacheMemory).

Equals

Compares this object with the given one.

[Pure]
public method Equals (IResourceHandle other)
type bool
params other The object to compare to.
returns true if this object is equal to other, false if not.
inherited EnvironmentMap.Equals

GetHashCode

[Pure]
public override sealed method GetHashCode ()
type int32
inherited EnvironmentMap.GetHashCode

LatLonToPixel

Converts the given latitude and longitude angles to pixel coordinates.

[Pure]
public method LatLonToPixel (LatLon latLon)
type Vec2D
params latLon The latitude and longitude angles.
returns The pixel coordinates.

Converts the given latitude and longitude angles to pixel coordinates.

[Pure]
public method LatLonToPixel (float64 latitude, float64 longitude)
type Vec2D
params latitude The latitude angle, in degrees.
  longitude The longitude angle, in degrees.
returns The pixel coordinates.

PixelToLatLon

Converts the given pixel coordinates into latitude and longitude angles.

[Pure]
public method PixelToLatLon (Vec2I v)
type LatLon
params v The pixel coordinates.
returns The latitude and longitude angles.

Converts the given pixel coordinates into latitude and longitude angles.

[Pure]
public method PixelToLatLon (int32 x, int32 y)
type LatLon
params x The pixel X-coordinate.
  y The pixel X-coordinate.
returns The latitude and longitude angles.

SetLight

Configures the prominent light.

public virtual method SetLight (float64 latitude, float64 longitude, float64 size)
params latitude Latitude of the prominent light in this environment map (see LightLatitude).
  longitude Longitude of the prominent light in this environment map (see LightLongitude).
  size Apparent size of prominent light in this environment map, in degrees (see LightSize).
inherited EnvironmentMap.SetLight