SGMaterial Class Reference

A material in the scene graph. More...

#include <mat.hxx>

Inheritance diagram for SGMaterial:
SGReferenced

List of all members.

Public Member Functions

 SGMaterial (const osgDB::ReaderWriter::Options *, const SGPropertyNode *props)
 Construct a material from a set of properties.
 ~SGMaterial (void)
 Destructor.
simgear::Effect * get_effect (int n=-1)
 Get the textured state.
int get_num () const
 Get the number of textures assigned to this material.
double get_xsize () const
 Get the xsize of the texture, in meters.
double get_ysize () const
 Get the ysize of the texture, in meters.
double get_light_coverage () const
 Get the light coverage.
double get_wood_coverage () const
 Get the wood coverage.
double get_tree_density () const
 Get the density of the wood.
double get_wood_size () const
 Get the size of each wood.
double get_tree_height () const
 Get the tree height.
double get_tree_width () const
 Get the tree width.
double get_tree_range () const
 Get the forest LoD range.
int get_tree_varieties () const
 Get the number of tree varieties available.
std::string get_tree_texture () const
 Get the texture strip to use for trees.
bool get_solid () const
 Return if the surface material is solid, if it is not solid, a fluid can be assumed, that is usually water.
double get_friction_factor () const
 Get the friction factor for that material.
double get_rolling_friction () const
 Get the rolling friction for that material.
double get_bumpiness () const
 Get the bumpines for that material.
double get_load_resistance () const
 Get the load resistance.
const std::vector< std::string > & get_names () const
 Get the list of names for this material.
void add_name (const std::string &name)
 add the given name to the list of names this material is known
int get_object_group_count () const
 Get the number of randomly-placed objects defined for this material.
SGMatModelGroupget_object_group (int index) const
 Get a randomly-placed object for this material.
SGMaterialGlyph * get_glyph (const std::string &name) const
 Return pointer to glyph class, or 0 if it doesn't exist.

Protected Member Functions

void init ()
 Initialization method, invoked by all public constructors.

Detailed Description

A material in the scene graph.

A material represents information about a single surface type in the 3D scene graph, including texture, colour, lighting, tiling, and so on; most of the materials in FlightGear are defined in the $FG_ROOT/materials.xml file, and can be changed at runtime.

Definition at line 72 of file mat.hxx.


Constructor & Destructor Documentation

SGMaterial::SGMaterial ( const osgDB::ReaderWriter::Options *  options,
const SGPropertyNode props 
)

Construct a material from a set of properties.

Parameters:
props A property node containing subnodes with the state information for the material. This node is usually loaded from the $FG_ROOT/materials.xml file.

Definition at line 76 of file mat.cxx.


Member Function Documentation

double SGMaterial::get_light_coverage (  )  const [inline]

Get the light coverage.

A smaller number means more generated night lighting.

Returns:
The area (m^2) covered by each light.

Definition at line 131 of file mat.hxx.

double SGMaterial::get_tree_density (  )  const [inline]

Get the density of the wood.

Returns:
The area (m^2) covered by each tree in the wood.

Definition at line 147 of file mat.hxx.

double SGMaterial::get_tree_height (  )  const [inline]

Get the tree height.

Returns:
The average height of the trees.

Definition at line 161 of file mat.hxx.

double SGMaterial::get_tree_range (  )  const [inline]

Get the forest LoD range.

Returns:
The LoD range for the trees.

Definition at line 175 of file mat.hxx.

std::string SGMaterial::get_tree_texture (  )  const [inline]

Get the texture strip to use for trees.

Returns:
the texture to use for trees.

Definition at line 189 of file mat.hxx.

int SGMaterial::get_tree_varieties (  )  const [inline]

Get the number of tree varieties available.

Returns:
the number of different trees defined in the texture strip

Definition at line 182 of file mat.hxx.

double SGMaterial::get_tree_width (  )  const [inline]

Get the tree width.

Returns:
The average width of the trees.

Definition at line 168 of file mat.hxx.

double SGMaterial::get_wood_coverage (  )  const [inline]

Get the wood coverage.

A smaller number means more generated woods within the forest.

Returns:
The area (m^2) covered by each wood.

Definition at line 140 of file mat.hxx.

double SGMaterial::get_wood_size (  )  const [inline]

Get the size of each wood.

Returns:
the average area (m^2) of each wood

Definition at line 154 of file mat.hxx.


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

Generated on 23 Feb 2010 for SimGear by  doxygen 1.6.1