16 #ifndef SURGSIM_BLOCKS_GRAPHICSUTILITIES_H 17 #define SURGSIM_BLOCKS_GRAPHICSUTILITIES_H 20 #include <unordered_map> 41 typedef std::unordered_map<std::string, std::shared_ptr<SurgSim::Graphics::OsgMaterial>>
Materials;
52 void enable2DTexture(std::shared_ptr<SurgSim::Graphics::OsgMaterial> material,
53 const std::string& uniform,
55 const std::string& filename =
"",
bool repeat =
false);
63 const std::string& name,
76 const std::string& name,
80 const std::string& diffuseMap =
"");
92 const std::string& name,
96 const std::string& diffuseMap =
"",
97 const std::string& normalMap =
"");
119 void applyMaterials(std::shared_ptr<SurgSim::Framework::Scene> scene,
120 std::string materialFilename,
121 const Materials& materials);
void applyMaterials(std::shared_ptr< SurgSim::Framework::Scene > scene, std::string materialFilename, const Materials &materials)
Reads a material file, iterates over the components listed up in the material file and applies the ma...
Definition: GraphicsUtilities.cpp:163
Definition: CompoundShapeToGraphics.cpp:29
std::unordered_map< std::string, std::shared_ptr< SurgSim::Graphics::OsgMaterial > > Materials
Definition: GraphicsUtilities.h:41
Eigen::Matrix< float, 4, 1 > Vector4f
A 4D vector of floats.
Definition: Vector.h:45
void enable2DTexture(std::shared_ptr< SurgSim::Graphics::OsgMaterial > material, const std::string &uniform, int unit, const std::string &filename="", bool repeat=false)
Provide a consistent interface to add texture uniforms on materials, adds the actual texture with a g...
Definitions of small fixed-size vector types.
std::shared_ptr< Graphics::OsgMaterial > createNormalMappedMaterial(const std::string &name, SurgSim::Math::Vector4f diffuseColor, SurgSim::Math::Vector4f specularColor, float shininess, const std::string &diffuseMap, const std::string &normalMap)
Create a basic textured material.
Definition: GraphicsUtilities.cpp:128
std::shared_ptr< SurgSim::Graphics::OsgMaterial > createTexturedMaterial(const std::string &name, SurgSim::Math::Vector4f diffuseColor, SurgSim::Math::Vector4f specularColor, float shininess, const std::string &diffuseMap)
Create a basic textured material.
Definition: GraphicsUtilities.cpp:101
std::shared_ptr< SurgSim::Graphics::OsgMaterial > createPlainMaterial(const std::string &name, SurgSim::Math::Vector4f diffuseColor, SurgSim::Math::Vector4f specularColor, float shininess)
Create a basic material.
Definition: GraphicsUtilities.cpp:77