Privacy
An open-source, flexible 3D physical simulation framework
osg_material_manager::OsgMaterial Class Reference

#include <OsgMaterial.h>

Public Member Functions

 OsgMaterial (std::string resPath)
 
virtual ~OsgMaterial ()
 
void setMaterial (const configmaps::ConfigMap &map)
 
void initMaterial ()
 
void setTexture (osg::Texture2D *texture)
 
void setNormalMap (const std::string &normalMap)
 
void setBumpMap (const std::string &bumpMap)
 
void updateShader (bool reload=false)
 
void edit (const std::string &key, const std::string &value)
 
void setMaxNumLights (int n)
 
void setUseShader (bool val)
 
void setNoiseImage (osg::Image *i)
 
void setShadowScale (float v)
 
void setShadowSamples (int v)
 
void addMaterialNode (MaterialNode *d)
 
void removeMaterialNode (MaterialNode *d)
 
void setShadowTextureSize (int size)
 
configmaps::ConfigMap getMaterialData ()
 
void update ()
 
void addTexture (configmaps::ConfigMap &config, bool nearest=false)
 
void disableTexture (std::string name)
 
void enableTexture (std::string name)
 
bool checkTexture (std::string name)
 

Protected Member Functions

osg::Vec4 getColor (std::string key)
 
void setColor (std::string color, std::string key, std::string value)
 
osg::Texture2D * loadTerrainTexture (std::string filename)
 

Protected Attributes

std::vector< osg::ref_ptr< MaterialNode > > materialNodeVector
 
osg::ref_ptr< osg::Program > lastProgram
 
osg::ref_ptr< osg::Uniform > noiseMapUniform
 
osg::ref_ptr< osg::Uniform > bumpNorFacUniform
 
osg::ref_ptr< osg::Uniform > texScaleUniform
 
osg::ref_ptr< osg::Uniform > sinUniform
 
osg::ref_ptr< osg::Uniform > cosUniform
 
osg::ref_ptr< osg::Uniform > shadowScaleUniform
 
osg::ref_ptr< osg::Uniform > shadowSamplesUniform
 
osg::ref_ptr< osg::Uniform > invShadowSamplesUniform
 
osg::ref_ptr< osg::Uniform > invShadowTextureSizeUniform
 
osg::ref_ptr< osg::Uniform > envMapSpecularUniform
 
osg::ref_ptr< osg::Uniform > envMapScaleUniform
 
osg::ref_ptr< osg::Uniform > terrainScaleZUniform
 
osg::ref_ptr< osg::Uniform > terrainDimUniform
 
osg::ref_ptr< osg::Group > group
 
osg::ref_ptr< osg::Material > material
 
osg::ref_ptr< osg::Texture2D > noiseMap
 
std::map< std::string, TextureInfotextures
 
bool hasShaderSources
 
bool isInit
 
bool useShader
 
int maxNumLights
 
bool getLight
 
double invShadowTextureSize
 
bool useWorldTexCoords
 
double t
 
std::string name
 
std::string resPath
 
configmaps::ConfigMap map
 
configmaps::ConfigMap unitMap
 
std::string loadPath
 

Detailed Description

Definition at line 77 of file OsgMaterial.h.

Constructor & Destructor Documentation

◆ OsgMaterial()

osg_material_manager::OsgMaterial::OsgMaterial ( std::string  resPath)

Definition at line 59 of file OsgMaterial.cpp.

◆ ~OsgMaterial()

osg_material_manager::OsgMaterial::~OsgMaterial ( )
virtual

Definition at line 106 of file OsgMaterial.cpp.

Member Function Documentation

◆ addMaterialNode()

void osg_material_manager::OsgMaterial::addMaterialNode ( MaterialNode d)

Definition at line 722 of file OsgMaterial.cpp.

◆ addTexture()

void osg_material_manager::OsgMaterial::addTexture ( configmaps::ConfigMap config,
bool  nearest = false 
)

Definition at line 231 of file OsgMaterial.cpp.

◆ checkTexture()

bool osg_material_manager::OsgMaterial::checkTexture ( std::string  name)

Definition at line 328 of file OsgMaterial.cpp.

◆ disableTexture()

void osg_material_manager::OsgMaterial::disableTexture ( std::string  name)

Definition at line 304 of file OsgMaterial.cpp.

◆ edit()

void osg_material_manager::OsgMaterial::edit ( const std::string &  key,
const std::string &  value 
)

Definition at line 345 of file OsgMaterial.cpp.

◆ enableTexture()

void osg_material_manager::OsgMaterial::enableTexture ( std::string  name)

Definition at line 316 of file OsgMaterial.cpp.

◆ getColor()

osg::Vec4 osg_material_manager::OsgMaterial::getColor ( std::string  key)
protected

Definition at line 109 of file OsgMaterial.cpp.

◆ getMaterialData()

configmaps::ConfigMap osg_material_manager::OsgMaterial::getMaterialData ( )
inline

Definition at line 102 of file OsgMaterial.h.

◆ initMaterial()

void osg_material_manager::OsgMaterial::initMaterial ( )

Definition at line 129 of file OsgMaterial.cpp.

◆ loadTerrainTexture()

osg::Texture2D * osg_material_manager::OsgMaterial::loadTerrainTexture ( std::string  filename)
protected

Definition at line 741 of file OsgMaterial.cpp.

◆ removeMaterialNode()

void osg_material_manager::OsgMaterial::removeMaterialNode ( MaterialNode d)

Definition at line 707 of file OsgMaterial.cpp.

◆ setBumpMap()

void osg_material_manager::OsgMaterial::setBumpMap ( const std::string &  bumpMap)

Definition at line 432 of file OsgMaterial.cpp.

◆ setColor()

void osg_material_manager::OsgMaterial::setColor ( std::string  color,
std::string  key,
std::string  value 
)
protected

Definition at line 336 of file OsgMaterial.cpp.

◆ setMaterial()

void osg_material_manager::OsgMaterial::setMaterial ( const configmaps::ConfigMap map)

Definition at line 121 of file OsgMaterial.cpp.

◆ setMaxNumLights()

void osg_material_manager::OsgMaterial::setMaxNumLights ( int  n)

Definition at line 735 of file OsgMaterial.cpp.

◆ setNoiseImage()

void osg_material_manager::OsgMaterial::setNoiseImage ( osg::Image *  i)

Definition at line 691 of file OsgMaterial.cpp.

◆ setNormalMap()

void osg_material_manager::OsgMaterial::setNormalMap ( const std::string &  normalMap)

Definition at line 436 of file OsgMaterial.cpp.

◆ setShadowSamples()

void osg_material_manager::OsgMaterial::setShadowSamples ( int  v)

Definition at line 702 of file OsgMaterial.cpp.

◆ setShadowScale()

void osg_material_manager::OsgMaterial::setShadowScale ( float  v)

Definition at line 448 of file OsgMaterial.cpp.

◆ setShadowTextureSize()

void osg_material_manager::OsgMaterial::setShadowTextureSize ( int  size)

Definition at line 717 of file OsgMaterial.cpp.

◆ setTexture()

void osg_material_manager::OsgMaterial::setTexture ( osg::Texture2D *  texture)

Definition at line 420 of file OsgMaterial.cpp.

◆ setUseShader()

void osg_material_manager::OsgMaterial::setUseShader ( bool  val)

Definition at line 440 of file OsgMaterial.cpp.

◆ update()

void osg_material_manager::OsgMaterial::update ( )

Definition at line 695 of file OsgMaterial.cpp.

◆ updateShader()

void osg_material_manager::OsgMaterial::updateShader ( bool  reload = false)

Definition at line 452 of file OsgMaterial.cpp.

Member Data Documentation

◆ bumpNorFacUniform

osg::ref_ptr<osg::Uniform> osg_material_manager::OsgMaterial::bumpNorFacUniform
protected

Definition at line 114 of file OsgMaterial.h.

◆ cosUniform

osg::ref_ptr<osg::Uniform> osg_material_manager::OsgMaterial::cosUniform
protected

Definition at line 117 of file OsgMaterial.h.

◆ envMapScaleUniform

osg::ref_ptr<osg::Uniform> osg_material_manager::OsgMaterial::envMapScaleUniform
protected

Definition at line 123 of file OsgMaterial.h.

◆ envMapSpecularUniform

osg::ref_ptr<osg::Uniform> osg_material_manager::OsgMaterial::envMapSpecularUniform
protected

Definition at line 122 of file OsgMaterial.h.

◆ getLight

bool osg_material_manager::OsgMaterial::getLight
protected

Definition at line 136 of file OsgMaterial.h.

◆ group

osg::ref_ptr<osg::Group> osg_material_manager::OsgMaterial::group
protected

Definition at line 126 of file OsgMaterial.h.

◆ hasShaderSources

bool osg_material_manager::OsgMaterial::hasShaderSources
protected

Definition at line 133 of file OsgMaterial.h.

◆ invShadowSamplesUniform

osg::ref_ptr<osg::Uniform> osg_material_manager::OsgMaterial::invShadowSamplesUniform
protected

Definition at line 120 of file OsgMaterial.h.

◆ invShadowTextureSize

double osg_material_manager::OsgMaterial::invShadowTextureSize
protected

Definition at line 137 of file OsgMaterial.h.

◆ invShadowTextureSizeUniform

osg::ref_ptr<osg::Uniform> osg_material_manager::OsgMaterial::invShadowTextureSizeUniform
protected

Definition at line 121 of file OsgMaterial.h.

◆ isInit

bool osg_material_manager::OsgMaterial::isInit
protected

Definition at line 133 of file OsgMaterial.h.

◆ lastProgram

osg::ref_ptr<osg::Program> osg_material_manager::OsgMaterial::lastProgram
protected

Definition at line 112 of file OsgMaterial.h.

◆ loadPath

std::string osg_material_manager::OsgMaterial::loadPath
protected

Definition at line 142 of file OsgMaterial.h.

◆ map

configmaps::ConfigMap osg_material_manager::OsgMaterial::map
protected

Definition at line 141 of file OsgMaterial.h.

◆ material

osg::ref_ptr<osg::Material> osg_material_manager::OsgMaterial::material
protected

Definition at line 127 of file OsgMaterial.h.

◆ materialNodeVector

std::vector<osg::ref_ptr<MaterialNode> > osg_material_manager::OsgMaterial::materialNodeVector
protected

Definition at line 110 of file OsgMaterial.h.

◆ maxNumLights

int osg_material_manager::OsgMaterial::maxNumLights
protected

Definition at line 135 of file OsgMaterial.h.

◆ name

std::string osg_material_manager::OsgMaterial::name
protected

Definition at line 140 of file OsgMaterial.h.

◆ noiseMap

osg::ref_ptr<osg::Texture2D> osg_material_manager::OsgMaterial::noiseMap
protected

Definition at line 128 of file OsgMaterial.h.

◆ noiseMapUniform

osg::ref_ptr<osg::Uniform> osg_material_manager::OsgMaterial::noiseMapUniform
protected

Definition at line 113 of file OsgMaterial.h.

◆ resPath

std::string osg_material_manager::OsgMaterial::resPath
protected

Definition at line 140 of file OsgMaterial.h.

◆ shadowSamplesUniform

osg::ref_ptr<osg::Uniform> osg_material_manager::OsgMaterial::shadowSamplesUniform
protected

Definition at line 120 of file OsgMaterial.h.

◆ shadowScaleUniform

osg::ref_ptr<osg::Uniform> osg_material_manager::OsgMaterial::shadowScaleUniform
protected

Definition at line 118 of file OsgMaterial.h.

◆ sinUniform

osg::ref_ptr<osg::Uniform> osg_material_manager::OsgMaterial::sinUniform
protected

Definition at line 116 of file OsgMaterial.h.

◆ t

double osg_material_manager::OsgMaterial::t
protected

Definition at line 139 of file OsgMaterial.h.

◆ terrainDimUniform

osg::ref_ptr<osg::Uniform> osg_material_manager::OsgMaterial::terrainDimUniform
protected

Definition at line 124 of file OsgMaterial.h.

◆ terrainScaleZUniform

osg::ref_ptr<osg::Uniform> osg_material_manager::OsgMaterial::terrainScaleZUniform
protected

Definition at line 124 of file OsgMaterial.h.

◆ texScaleUniform

osg::ref_ptr<osg::Uniform> osg_material_manager::OsgMaterial::texScaleUniform
protected

Definition at line 115 of file OsgMaterial.h.

◆ textures

std::map<std::string, TextureInfo> osg_material_manager::OsgMaterial::textures
protected

Definition at line 131 of file OsgMaterial.h.

◆ unitMap

configmaps::ConfigMap osg_material_manager::OsgMaterial::unitMap
protected

Definition at line 141 of file OsgMaterial.h.

◆ useShader

bool osg_material_manager::OsgMaterial::useShader
protected

Definition at line 134 of file OsgMaterial.h.

◆ useWorldTexCoords

bool osg_material_manager::OsgMaterial::useWorldTexCoords
protected

Definition at line 138 of file OsgMaterial.h.


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