CS::Math::Noise::Model::Sphere Class Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
CS::Math::Noise::Model::Sphere Class Reference
Models

Model that defines the surface of a sphere. More...

`#include <cstool/noise/model/sphere.h>`

List of all members.

## Public Member Functions
const CS::Math::Noise::Module::Module & | GetModule () const
| Returns the noise module that is used to generate the output values.
double | GetValue (double lat, double lon) const
| Returns the output value from the noise module given the (latitude, longitude) coordinates of the specified input value located on the surface of the sphere.
void | SetModule (const CS::Math::Noise::Module::Module &module)
| Sets the noise module that is used to generate the output values.
| Sphere ()
| Constructor.
| Sphere (const CS::Math::Noise::Module::Module &module)
| Constructor.

## Detailed Description

Model that defines the surface of a sphere.

This model returns an output value from a noise module given the coordinates of an input value located on the surface of a sphere.

To generate an output value, pass the (latitude, longitude) coordinates of an input value to the GetValue() method.

This model is useful for creating:

- seamless textures that can be mapped onto a sphere
- terrain height maps for entire planets

This sphere has a radius of 1.0 unit and its center is located at the origin.

Definition at line 56 of file sphere.h.

## Constructor & Destructor Documentation

CS::Math::Noise::Model::Sphere::Sphere | ( |  | ) |

Constructor.

CS::Math::Noise::Model::Sphere::Sphere | ( | const CS::Math::Noise::Module::Module & | module | ) |

Constructor.

Parameters:

  module | The noise module that is used to generate the output values.

## Member Function Documentation

const CS::Math::Noise::Module::Module& CS::Math::Noise::Model::Sphere::GetModule | ( |  | ) | const`[inline]`

Returns the noise module that is used to generate the output values.

Returns:
  A reference to the noise module.

Precondition:
  A noise module was passed to the SetModule() method.

Definition at line 76 of file sphere.h.

double CS::Math::Noise::Model::Sphere::GetValue | ( | double | lat,
|  | double | lon
| ) |  | const

Returns the output value from the noise module given the (latitude, longitude) coordinates of the specified input value located on the surface of the sphere.

Parameters:

  lat | The latitude of the input value, in degrees.
  lon | The longitude of the input value, in degrees.

Returns:
  The output value from the noise module.

Precondition:
  A noise module was passed to the SetModule() method.

This output value is generated by the noise module passed to the SetModule() method.

Use a negative latitude if the input value is located on the southern hemisphere.

Use a negative longitude if the input value is located on the western hemisphere.

void CS::Math::Noise::Model::Sphere::SetModule | ( | const CS::Math::Noise::Module::Module & | module | ) | `[inline]`

Sets the noise module that is used to generate the output values.

Parameters:

  module | The noise module that is used to generate the output values.

This noise module must exist for the lifetime of this object, until you pass a new noise module to this method.

Definition at line 110 of file sphere.h.

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

- cstool/noise/model/sphere.h