16 #ifndef SURGSIM_GRAPHICS_OSGUNIFORM_INL_H 17 #define SURGSIM_GRAPHICS_OSGUNIFORM_INL_H 46 osg::Uniform::Type osgUniformType = getOsgUniformType<T>();
47 SURGSIM_ASSERT(osgUniformType != osg::Uniform::UNDEFINED) <<
"Failed to get OSG uniform type!";
56 " Uniform: " <<
getName() <<
" value: " << value;
76 osg::Uniform::Type osgUniformType = getOsgUniformType<T>();
77 SURGSIM_ASSERT(osgUniformType != osg::Uniform::UNDEFINED) <<
"Failed to get OSG uniform type!";
93 " Uniform: " <<
getName() <<
" index: " << index <<
" value: " << value;
101 "Number of elements (" << value.size() <<
") must match uniform's number of elements (" <<
103 for (
size_t i = 0; i < value.size(); ++i)
105 setElement(i, value[i]);
112 SURGSIM_ASSERT(node.IsSequence()) <<
"Yaml setter called on vector uniform with non-sequence yaml node.";
113 set(node.as<std::vector<T>>());
132 #endif // SURGSIM_GRAPHICS_OSGUNIFORM_INL_H Definition: CompoundShapeToGraphics.cpp:29
Conversions to and from OSG types.
#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.