13 #include <osg/Texture2DArray>
16 #include <osg/MatrixTransform>
17 #include <osg/Geometry>
26 class DtGlSimpleTexture;
46 static void makeRotate(osg::Quat& q,
const double&
angle,
const double& x,
const double& y,
const double& z);
49 static osg::Matrixf toOsgRotation(
const DtTaitBryan& orientation);
54 static void quatMult(osg::Quat& lhs,
const osg::Quat& rhs);
58 float x,
float y,
float w,
float h);
61 static osg::Camera * CreateTextureQuadOverlay(
osg::Texture * texture,
62 float x,
float y,
float w,
float h);
65 static osg::Camera * CreateTextureQuadOverlay(
const std::string& shader_root, osg::Texture2DArray * textureArray,
66 float x,
float y,
float w,
float h);
69 static osg::MatrixTransform * create_axis_primitive();
76 static osg::Matrix getOrthoMatrix(
bool useReverseZ,
double left,
double right,
77 double bottom,
double top,
double zNear,
double zFar);
81 static osg::Matrix getProjMatrix(
bool useReverseZ,
double left,
double right,
82 double bottom,
double top,
double zNear,
double zFar);
85 static osg::Matrixd getRevZOrthoMatrix(
double left,
double right,
double bottom,
86 double top,
double zNear,
double zFar);
90 static bool getRevZPerspectiveMatrixAsFrustum(
const osg::Matrix& mat,
double& left,
91 double& right,
double& bottom,
double& top,
double& zNear,
double& zFar);
95 static bool getRevZOrthoMatrixAsFrustum(
const osg::Matrix& orthoMat,
double& left,
96 double& right,
double& bottom,
double& top,
double& zNear,
double& zFar);
100 static bool getRevZPerspective(
const osg::Matrix& mat,
double& fovy,
101 double& aspectRatio,
double& zNear,
double& zFar);
105 static osg::Matrix makeRevZPerspective(
double fovy,
double aspectRatio,
106 double zNear,
double zFar);
109 static void getYPR(
const osg::Matrix& m,
double& yaw,
double& pitch,
double& roll);
112 static void osgPolytopeToFrustum(
Frustum_64& frustum,
const osg::Polytope& polytope,
bool hasNearFar);
117 static void computeOsgCameraFrustumPlanes(std::vector<osg::Vec4d>& planes,
const osg::Camera* camera);
120 static void debugDumpShaderState(osg::State* state);
123 static void debugDumpUniformState(
const osg::Node* node);
127 static osg::Vec2 rotateVec2(
const osg::Vec2& v,
double rad );
131 static osg::Vec2 translateVec2(
const osg::Vec2& v,
const osg::Vec2& translation );
134 static osg::Vec2 scaleVec2(
const osg::Vec2& v,
double s );
137 static osg::Vec2 scaleVec2(
const osg::Vec2& v,
double xScale,
double yScale );
141 static bool clipLine(
double xMin,
double xMax,
double yMin,
double yMax,
142 double x0src,
double y0src,
double x1src,
double y1src,
143 double &x0clip,
double &y0clip,
double &x1clip,
double &y1clip );
146 static void clipPolygon(
double xMin,
double xMax,
double yMin,
double yMax,
147 std::vector<osg::Vec2>& vertices );
150 template <
class VecType>
static VecType
DtModPerLoVec3(
const VecType& in,
double min,
double max )
153 double per = max - min;
155 for(
int i = 0; i < 3; ++i )
157 if( min <= in[i] && in[i] < max )
163 result[i] = fmod( in[i] - min, per );
165 if( result[i] < 0.0 )
182 static bool insideTriangulate(
const std::vector<osg::Vec2>& contour, std::vector<int>& results );
185 static bool snipTriangle(
const std::vector<osg::Vec2>& contour,
int u,
int v,
int w,
int n,
int *V );
187 static bool insideTriangle(
float Ax,
float Ay,
float Bx,
float By,
float Cx,
float Cy,
float Px,
float Py );
189 static float triangulateAreaSize(
const std::vector<osg::Vec2> &contour );
Diagonal crossing liens.
Definition: DtTacticalGraphicUtilities.h:93
static VecType DtModPerLoVec3(const VecType &in, double min, double max)
Definition: DtOsgUtils.h:150
void updateDebugFrustum(osg::Vec3d *frustumVertices)
Contains makVrv::DtOsgShaderUtils class.
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Wrapper for OpenGL Texture.
Definition: DtGlSimpleTexture.h:35
osg::ref_ptr< osg::MatrixTransform > myTransform
Definition: DtOsgUtils.h:36
Camera forward declarations.
DT_DLL_vrfutil double angle(double vec1[3], double vec2[3])
helper class, random osg debug helpers and math
Definition: DtOsgUtils.h:42
osg::ref_ptr< osg::Geometry > myGeometry
Definition: DtOsgUtils.h:37
DtOsgDebugFrustum(const osg::Vec4 &color)
helper for visualizing debug frustra
Definition: DtOsgUtils.h:30