33#ifndef DART_GUI_OSG_UTILS_HPP_
34#define DART_GUI_OSG_UTILS_HPP_
36#include <Eigen/Geometry>
44template <
typename T =
double>
48template <
typename Scalar>
50 const Eigen::Transform<Scalar, 3, Eigen::Isometry>& tf);
53template <
typename Derived>
57template <
typename Derived>
58::osg::Vec3f
eigToOsgVec3f(
const Eigen::MatrixBase<Derived>& vec);
61template <
typename Derived>
62::osg::Vec3d
eigToOsgVec3d(
const Eigen::MatrixBase<Derived>& vec);
66template <
typename Derived>
67typename std::conditional<
68 std::is_same<typename Derived::Scalar, float>::value,
80template <
typename Derived>
81::osg::Vec4f
eigToOsgVec4f(
const Eigen::MatrixBase<Derived>& vec);
84template <
typename Derived>
85::osg::Vec4d
eigToOsgVec4d(
const Eigen::MatrixBase<Derived>& vec);
89template <
typename Derived>
91 std::is_same<typename Derived::Scalar, float>::value,
104 ::osg::Camera::BufferComponent buffer,
106 bool isAbsolute =
false);
111 double left = 0,
double right = 1,
double bottom = 0,
double top = 1);
114::osg::Geode*
createScreenQuad(
float width,
float height,
float scale = 1.0f);
std::string type
Definition SdfParser.cpp:82
Definition DefaultEventHandler.cpp:49
::osg::Vec3f eigToOsgVec3f(const Eigen::MatrixBase< Derived > &vec)
Converts Eigen::MatrixBase to osg::Vec3f.
Definition Utils-impl.hpp:107
::osg::Vec4f eigToOsgVec4f(const Eigen::MatrixBase< Derived > &vec)
Converts Eigen::MatrixBase to osg::Vec4f.
Definition Utils-impl.hpp:137
::osg::Camera * createHudCamera(double left, double right, double bottom, double top)
Creates a head-up display (HUD) camera that renders on the top after the main scene is drawn,...
Definition Utils.cpp:96
constexpr T getAlphaThreshold()
Returns the alpha threshold for demining if the object is a transparent object or not.
Definition Utils-impl.hpp:42
::osg::Matrix eigToOsgMatrix(const Eigen::Transform< Scalar, 3, Eigen::Isometry > &tf)
Converts Eigen::Isometry to osg::Matrix.
Definition Utils-impl.hpp:60
::osg::Camera * createRttCamera(::osg::Camera::BufferComponent buffer, ::osg::Texture *tex, bool isAbsolute)
Create a Render-To-Texture (RTT) camera.
Definition Utils.cpp:67
std::conditional< std::is_same< typename Derived::Scalar, float >::value, ::osg::Vec4f, ::osg::Vec4d > eigToOsgVec4(const Eigen::MatrixBase< Derived > &vec)
Converts Eigen::MatrixBase to osg::Vec4f or osg::Vec4d based on the scalar type.
Definition Utils-impl.hpp:155
Eigen::Vector3f osgToEigVec3(const ::osg::Vec3f &vec)
Converts osg::Vec3f to Eigen::Vector3f.
Definition Utils.cpp:43
::osg::Vec3d eigToOsgVec3d(const Eigen::MatrixBase< Derived > &vec)
Converts Eigen::MatrixBase to osg::Vec3d.
Definition Utils-impl.hpp:114
::osg::Vec4d eigToOsgVec4d(const Eigen::MatrixBase< Derived > &vec)
Converts Eigen::MatrixBase to osg::Vec4d.
Definition Utils-impl.hpp:144
::osg::Geode * createScreenQuad(float width, float height, float scale)
Creates a osg::Geode of quad shape.
Definition Utils.cpp:113
std::conditional< std::is_same< typenameDerived::Scalar, float >::value,::osg::Vec3f,::osg::Vec3d >::type eigToOsgVec3(const Eigen::MatrixBase< Derived > &vec)
Converts Eigen::MatrixBase to osg::Vec3f or osg::Vec3d based on the scalar type.
Definition Utils-impl.hpp:125
Eigen::Vector4f osgToEigVec4(const ::osg::Vec4f &vec)
Converts osg::Vec4f to Eigen::Vector4f.
Definition Utils.cpp:55