13 #include <osg/Texture2DArray>
16 #include <osg/MatrixTransform>
17 #include <osg/Geometry>
26 class DtGlSimpleTexture;
45 float x,
float y,
float w,
float h);
48 static osg::Camera* CreateTextureQuadOverlay(
osg::Texture* texture,
49 float x,
float y,
float w,
float h);
52 static osg::Camera* CreateTextureQuadOverlay(
const std::string& shader_root, osg::Texture2DArray* textureArray,
53 float x,
float y,
float w,
float h);
62 static void makeRotate(osg::Quat& q,
const double&
angle,
const double& x,
const double& y,
const double& z);
65 static osg::Matrixf toOsgRotation(
const DtTaitBryan& orientation);
70 static void quatMult(osg::Quat& lhs,
const osg::Quat& rhs);
73 static osg::MatrixTransform * create_axis_primitive();
80 static osg::Matrix getOrthoMatrix(
bool useReverseZ,
double left,
double right,
81 double bottom,
double top,
double zNear,
double zFar);
85 static osg::Matrix getProjMatrix(
bool useReverseZ,
double left,
double right,
86 double bottom,
double top,
double zNear,
double zFar);
89 static osg::Matrixd getRevZOrthoMatrix(
double left,
double right,
double bottom,
90 double top,
double zNear,
double zFar);
94 static bool getRevZPerspectiveMatrixAsFrustum(
const osg::Matrix& mat,
double& left,
95 double& right,
double& bottom,
double& top,
double& zNear,
double& zFar);
99 static bool getRevZOrthoMatrixAsFrustum(
const osg::Matrix& orthoMat,
double& left,
100 double& right,
double& bottom,
double& top,
double& zNear,
double& zFar);
104 static bool getRevZPerspective(
const osg::Matrix& mat,
double& fovy,
105 double& aspectRatio,
double& zNear,
double& zFar);
109 static osg::Matrix makeRevZPerspective(
double fovy,
double aspectRatio,
110 double zNear,
double zFar);
113 static void getYPR(
const osg::Matrix& m,
double& yaw,
double& pitch,
double& roll);
116 static void osgPolytopeToFrustum(
Frustum_64& frustum,
const osg::Polytope& polytope,
bool hasNearFar);
121 static void computeOsgCameraFrustumPlanes(std::vector<osg::Vec4d>& planes,
const osg::Camera* camera);
124 static void debugDumpShaderState(osg::State* state);
127 static void debugDumpUniformState(
const osg::Node* node);
131 static osg::Vec2 rotateVec2(
const osg::Vec2& v,
double rad );
135 static osg::Vec2 translateVec2(
const osg::Vec2& v,
const osg::Vec2& translation );
138 static osg::Vec2 scaleVec2(
const osg::Vec2& v,
double s );
141 static osg::Vec2 scaleVec2(
const osg::Vec2& v,
double xScale,
double yScale );
145 static bool clipLine(
double xMin,
double xMax,
double yMin,
double yMax,
146 double x0src,
double y0src,
double x1src,
double y1src,
147 double &x0clip,
double &y0clip,
double &x1clip,
double &y1clip );
150 static void clipPolygon(
double xMin,
double xMax,
double yMin,
double yMax,
151 std::vector<osg::Vec2>& vertices );
154 template <
class VecType>
static VecType
DtModPerLoVec3(
const VecType& in,
double min,
double max )
157 double per = max - min;
159 for(
int i = 0; i < 3; ++i )
161 if( min <= in[i] && in[i] < max )
167 result[i] = fmod( in[i] - min, per );
169 if( result[i] < 0.0 )
186 static bool insideTriangulate(
const std::vector<osg::Vec2>& contour, std::vector<int>& results );
188 static osg::Matrixd calculateRevZProjectionMatrix(
double left,
double right
189 ,
double bottom,
double top
190 ,
double zNear,
double zFar);
192 static osg::Matrixd calculateOrthoMatrix(
double left,
double right
193 ,
double bottom,
double top
194 ,
double zNear,
double zFar);
196 static osg::Matrixd calculateRevZProjectionMatrixWithRevZAsNegativeOneForRttCamera(
double left,
double right
197 ,
double bottom,
double top
198 ,
double zNear,
double zFar);
202 static bool snipTriangle(
const std::vector<osg::Vec2>& contour,
int u,
int v,
int w,
int n,
int *V );
204 static bool insideTriangle(
float Ax,
float Ay,
float Bx,
float By,
float Cx,
float Cy,
float Px,
float Py );
206 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:154
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.
Definition: DtOsgUtils.h:40
DT_DLL_vrfutil double angle(double vec1[3], double vec2[3])
helper class, random osg debug helpers and math
Definition: DtOsgUtils.h:58
osg::ref_ptr< osg::Geometry > myGeometry
Definition: DtOsgUtils.h:37
DtOsgDebugFrustum(const osg::Vec4 &color)
helper for visualizing debug frustra
Definition: DtOsgUtils.h:30