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 string &fg_root, const SGPropertyNode *props, const char *season)
 Construct a material from a set of properties.
 SGMaterial (const string &texpath)
 Construct a material from an absolute texture path.
 SGMaterial (osg::StateSet *s)
 Construct a material around an existing state.
 ~SGMaterial (void)
 Destructor.
osg::StateSet * get_state (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_tree_coverage () const
 Get the forest coverage.
double get_tree_height () const
 Get the forest height.
double get_tree_width () const
 Get the forest width.
double get_tree_range () const
 Get the forest LoD range.
int get_tree_varieties () const
 Get the number of tree varieties available.
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 vector< string > & get_names () const
 Get the list of names for this material.
void add_name (const 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 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 66 of file mat.hxx.


Constructor & Destructor Documentation

SGMaterial::SGMaterial ( const string &  fg_root,
const SGPropertyNode props,
const char *  season 
)

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 60 of file mat.cxx.

SGMaterial::SGMaterial ( const string &  texpath  ) 

Construct a material from an absolute texture path.

Parameters:
texture_path A string containing an absolute path to a texture file (usually RGB).

Definition at line 67 of file mat.cxx.

SGMaterial::SGMaterial ( osg::StateSet *  s  ) 

Construct a material around an existing state.

This constructor allows the application to create a custom, low-level state for the scene graph and wrap a material around it. Note: the pointer ownership is transferred to the material.

Parameters:
s The state for this material.

Definition at line 77 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 147 of file mat.hxx.

double SGMaterial::get_tree_coverage (  )  const [inline]

Get the forest coverage.

A smaller number means more generated forest canopy.

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

Definition at line 156 of file mat.hxx.

double SGMaterial::get_tree_height (  )  const [inline]

Get the forest height.

Returns:
The average height of the trees.

Definition at line 163 of file mat.hxx.

double SGMaterial::get_tree_width (  )  const [inline]

Get the forest width.

Returns:
The average width of the trees.

Definition at line 170 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 177 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 184 of file mat.hxx.

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 191 of file mat.hxx.


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

Generated on Thu Dec 18 15:17:27 2008 for SimGear by  doxygen 1.5.6