Go to the documentation of this file.
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!";
48 SURGSIM_ASSERT(m_uniform->setType(osgUniformType)) <<
"Failed to set OSG uniform type!";
49 m_uniform->setNumElements(1);
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!";
78 SURGSIM_ASSERT(m_uniform->setType(osgUniformType)) <<
"Failed to set OSG uniform type!";
80 m_uniform->setNumElements(numElements);
86 return m_uniform->getNumElements();
92 SURGSIM_ASSERT(m_uniform->setElement(index,
toOsg(value))) <<
"Failed to set OSG uniform value!" <<
93 " Uniform: " << getName() <<
" index: " << index <<
" value: " << value;
94 m_value[index] = value;
101 "Number of elements (" << value.size() <<
") must match uniform's number of elements (" <<
102 m_uniform->getNumElements() <<
")! Uniform: " << getName();
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>>());
119 return m_value[index];
132 #endif // SURGSIM_GRAPHICS_OSGUNIFORM_INL_H
#define SURGSIM_ASSERT(condition)
Assert that condition is true.
Definition: Assert.h:77
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
Definition: CompoundShapeToGraphics.cpp:29
set(SURGSIM_COLLISION_SOURCES BoxCapsuleContact.cpp BoxDoubleSidedPlaneContact.cpp BoxPlaneContact.cpp BoxSphereContact.cpp CapsuleSphereContact.cpp CollisionPair.cpp CompoundShapeContact.cpp ContactCalculation.cpp ContactFilter.cpp DefaultContactCalculation.cpp ElementContactFilter.cpp OctreeCapsuleContact.cpp OctreeContact.cpp OctreeDoubleSidedPlaneContact.cpp OctreePlaneContact.cpp OctreeSphereContact.cpp Representation.cpp SegmentMeshTriangleMeshContact.cpp SegmentSegmentCcdIntervalCheck.cpp SegmentSegmentCcdMovingContact.cpp SegmentSegmentCcdStaticContact.cpp SegmentSelfContact.cpp ShapeCollisionRepresentation.cpp SphereDoubleSidedPlaneContact.cpp SpherePlaneContact.cpp SphereSphereContact.cpp TriangleMeshParticlesContact.cpp TriangleMeshPlaneContact.cpp TriangleMeshSurfaceMeshContact.cpp TriangleMeshTriangleMeshContact.cpp) set(SURGSIM_COLLISION_HEADERS BoxCapsuleContact.h BoxDoubleSidedPlaneContact.h BoxPlaneContact.h BoxSphereContact.h CapsuleSphereContact.h CcdDcdCollision.h CollisionPair.h CompoundShapeContact.h ContactCalculation.h ContactFilter.h DefaultContactCalculation.h ElementContactFilter.h OctreeCapsuleContact.h OctreeContact.h OctreeDoubleSidedPlaneContact.h OctreePlaneContact.h OctreeSphereContact.h Representation.h SegmentMeshTriangleMeshContact.h SegmentSegmentCcdIntervalCheck.h SegmentSegmentCcdMovingContact.h SegmentSegmentCcdStaticContact.h SegmentSelfContact.h ShapeCollisionRepresentation.h ShapeShapeContactCalculation.h SphereDoubleSidedPlaneContact.h SpherePlaneContact.h SphereSphereContact.h TriangleMeshParticlesContact.h TriangleMeshPlaneContact.h TriangleMeshSurfaceMeshContact.h TriangleMeshTriangleMeshContact.h) surgsim_create_library_header(Collision.h "$
Definition: CMakeLists.txt:16
const T & toOsg(const T &value)
Default type conversion to OSG.
Definition: OsgUniform-inl.h:37
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38