16 #ifndef SURGSIM_GRAPHICS_OSGUNIFORM_INL_H 17 #define SURGSIM_GRAPHICS_OSGUNIFORM_INL_H 38 const T&
toOsg(
const T& value)
47 osg::Uniform::Type osgUniformType = getOsgUniformType<T>();
48 SURGSIM_ASSERT(osgUniformType != osg::Uniform::UNDEFINED) <<
"Failed to get OSG uniform type!";
57 " Uniform: " <<
getName() <<
" value: " << value;
76 return SurgSim::Graphics::getGlslType<T>();
83 osg::Uniform::Type osgUniformType = getOsgUniformType<T>();
84 SURGSIM_ASSERT(osgUniformType != osg::Uniform::UNDEFINED) <<
"Failed to get OSG uniform type!";
86 m_value.resize(numElements);
100 " Uniform: " <<
getName() <<
" index: " << index <<
" value: " << value;
101 m_value[index] = value;
108 "Number of elements (" << value.size() <<
") must match uniform's number of elements (" <<
110 for (
size_t i = 0; i < value.size(); ++i)
112 setElement(i, value[i]);
119 SURGSIM_ASSERT(node.IsSequence()) <<
"Yaml setter called on vector uniform with non-sequence yaml node.";
120 set(node.as<std::vector<T>>());
126 return m_value[index];
138 auto baseType = SurgSim::Graphics::getGlslType<T>();
139 return baseType +
"[]";
148 #endif // SURGSIM_GRAPHICS_OSGUNIFORM_INL_H Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Conversions to and from OSG types.
Definition: MockObjects.h:47
#define SURGSIM_ASSERT(condition)
Assert that condition is true.
Definition: Assert.h:77
This contains a series of functions to encode and decode Eigen data structures to and from YAML nodes...
const osg::Matrix2 toOsg(const Eigen::Matrix< float, 2, 2, MOpt > &matrix)
Convert a fixed-size 2x2 matrix of floats to OSG.
Definition: OsgMatrixConversions.h:56
The header that provides the assertion API.