VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Static Public Member Functions | Static Protected Member Functions
makVrv::DtOsgUtils Class Reference

helper class, random osg debug helpers and math More...

Static Public Member Functions

static void makeRotate (osg::Quat &q, const double &angle, const double &x, const double &y, const double &z)
 Make a quaternion that rotates angle radians around (x, y, z) More...
 
static osg::Matrixf toOsgRotation (const DtTaitBryan &orientation)
 tait bryan to osg matrix helper function More...
 
static void quatMult (osg::Quat &lhs, const osg::Quat &rhs)
 Multiply two quaternions together. More...
 
static osg::Camera * CreateTextureQuadOverlay (DtGlSimpleTexture *texture, float x, float y, float w, float h)
 adds an on screen quad for texture debugging (used by shadows and triton) More...
 
static osg::Camera * CreateTextureQuadOverlay (osg::Texture *texture, float x, float y, float w, float h)
 adds an on screen quad for texture debugging (used by shadows and triton) More...
 
static osg::Camera * CreateTextureQuadOverlay (const std::string &shader_root, osg::Texture2DArray *textureArray, float x, float y, float w, float h)
 adds an array of on screen quads for texture debugging (used by shadows) More...
 
static osg::MatrixTransform * create_axis_primitive ()
 helper for visualizing a coordinate system More...
 
static osg::Matrix getOrthoMatrix (bool useReverseZ, double left, double right, double bottom, double top, double zNear, double zFar)
 helpers for matrix and reverse z matrixes More...
 
static osg::Matrix getProjMatrix (bool useReverseZ, double left, double right, double bottom, double top, double zNear, double zFar)
 Create a regular or reverse perspective projection matrix (near = 1, far = 0) out of frustum parameters. More...
 
static osg::Matrixd getRevZOrthoMatrix (double left, double right, double bottom, double top, double zNear, double zFar)
 For Reverse Z buffer - get a reverse (near = 1, far = 0) orthographic matrix. More...
 
static bool getRevZPerspectiveMatrixAsFrustum (const osg::Matrix &mat, double &left, double &right, double &bottom, double &top, double &zNear, double &zFar)
 For Reverse Z buffer - extract the frustum parameters out of a reverse perspective projection matrix (near = 1, far = 0) More...
 
static bool getRevZOrthoMatrixAsFrustum (const osg::Matrix &orthoMat, double &left, double &right, double &bottom, double &top, double &zNear, double &zFar)
 For Reverse Z buffer - extract the frustum parameters out of a reverse orthographic matrix (near = 1, far = 0) More...
 
static bool getRevZPerspective (const osg::Matrix &mat, double &fovy, double &aspectRatio, double &zNear, double &zFar)
 For Reverse Z buffer - extract the frustum parameters out of a reverse projection matrix (near = 1, far = 0) More...
 
static osg::Matrix makeRevZPerspective (double fovy, double aspectRatio, double zNear, double zFar)
 For Reverse Z buffer - create a reverse projection matrix (near = 1, far = 0) out of frustum parameters. More...
 
static void getYPR (const osg::Matrix &m, double &yaw, double &pitch, double &roll)
 converts a matrix to a human readable yaw/pitch/roll representation More...
 
static void osgPolytopeToFrustum (Frustum_64 &frustum, const osg::Polytope &polytope, bool hasNearFar)
 gets a converts a osg polytope to a vrv friendly class. More...
 
static void computeOsgCameraFrustumPlanes (std::vector< osg::Vec4d > &planes, const osg::Camera *camera)
 computes culling frustum planes from the given osg camera. More...
 
static void debugDumpShaderState (osg::State *state)
 only used for debugging prints out a bunch of uniform state for the current shader. More...
 
static void debugDumpUniformState (const osg::Node *node)
 only used for debugging More...
 
static bool clipLine (double xMin, double xMax, double yMin, double yMax, double x0src, double y0src, double x1src, double y1src, double &x0clip, double &y0clip, double &x1clip, double &y1clip)
 2D clipping routine. Implements Liang / Barsky Clipping More...
 
static void clipPolygon (double xMin, double xMax, double yMin, double yMax, std::vector< osg::Vec2 > &vertices)
 2D clipping routine. Implements Sutherland–Hodgman clipping More...
 
template<class VecType >
static VecType DtModPerLoVec3 (const VecType &in, double min, double max)
 
static bool insideTriangulate (const std::vector< osg::Vec2 > &contour, std::vector< int > &results)
 OSG version of DtInsideTriangulate Triangulates the given points and returns the indicies that form the triangles. More...
 
static osg::Vec2 rotateVec2 (const osg::Vec2 &v, double rad)
 Vec2 Helpers for DtOsgWindow classes. More...
 
static osg::Vec2 translateVec2 (const osg::Vec2 &v, const osg::Vec2 &translation)
 Utility function to translate a vec2. More...
 
static osg::Vec2 scaleVec2 (const osg::Vec2 &v, double s)
 Utility function to scale a vec2. More...
 
static osg::Vec2 scaleVec2 (const osg::Vec2 &v, double xScale, double yScale)
 Utility function to scale a vec2. More...
 

Static Protected Member Functions

static bool snipTriangle (const std::vector< osg::Vec2 > &contour, int u, int v, int w, int n, int *V)
 Utility function used in insideTriangulate. More...
 
static bool insideTriangle (float Ax, float Ay, float Bx, float By, float Cx, float Cy, float Px, float Py)
 Utility function used in insideTriangulate. More...
 
static float triangulateAreaSize (const std::vector< osg::Vec2 > &contour)
 Utility function used in insideTriangulate. More...
 

Detailed Description

helper class, random osg debug helpers and math

Member Function Documentation

static void makVrv::DtOsgUtils::makeRotate ( osg::Quat &  q,
const double angle,
const double x,
const double y,
const double z 
)
static

Make a quaternion that rotates angle radians around (x, y, z)

static osg::Matrixf makVrv::DtOsgUtils::toOsgRotation ( const DtTaitBryan &  orientation)
static

tait bryan to osg matrix helper function

static void makVrv::DtOsgUtils::quatMult ( osg::Quat &  lhs,
const osg::Quat &  rhs 
)
static

Multiply two quaternions together.

This is more efficient than the OSG built in implementation

static osg::Camera* makVrv::DtOsgUtils::CreateTextureQuadOverlay ( DtGlSimpleTexture texture,
float  x,
float  y,
float  w,
float  h 
)
static

adds an on screen quad for texture debugging (used by shadows and triton)

static osg::Camera* makVrv::DtOsgUtils::CreateTextureQuadOverlay ( osg::Texture *  texture,
float  x,
float  y,
float  w,
float  h 
)
static

adds an on screen quad for texture debugging (used by shadows and triton)

static osg::Camera* makVrv::DtOsgUtils::CreateTextureQuadOverlay ( const std::string &  shader_root,
osg::Texture2DArray *  textureArray,
float  x,
float  y,
float  w,
float  h 
)
static

adds an array of on screen quads for texture debugging (used by shadows)

static osg::MatrixTransform* makVrv::DtOsgUtils::create_axis_primitive ( )
static

helper for visualizing a coordinate system

static osg::Matrix makVrv::DtOsgUtils::getOrthoMatrix ( bool  useReverseZ,
double  left,
double  right,
double  bottom,
double  top,
double  zNear,
double  zFar 
)
static

helpers for matrix and reverse z matrixes

Create a regular or reverse orthographic projection matrix (near = 1, far = 0) out of frustum parameters

static osg::Matrix makVrv::DtOsgUtils::getProjMatrix ( bool  useReverseZ,
double  left,
double  right,
double  bottom,
double  top,
double  zNear,
double  zFar 
)
static

Create a regular or reverse perspective projection matrix (near = 1, far = 0) out of frustum parameters.

static osg::Matrixd makVrv::DtOsgUtils::getRevZOrthoMatrix ( double  left,
double  right,
double  bottom,
double  top,
double  zNear,
double  zFar 
)
static

For Reverse Z buffer - get a reverse (near = 1, far = 0) orthographic matrix.

static bool makVrv::DtOsgUtils::getRevZPerspectiveMatrixAsFrustum ( const osg::Matrix &  mat,
double left,
double right,
double bottom,
double top,
double zNear,
double zFar 
)
static

For Reverse Z buffer - extract the frustum parameters out of a reverse perspective projection matrix (near = 1, far = 0)

static bool makVrv::DtOsgUtils::getRevZOrthoMatrixAsFrustum ( const osg::Matrix &  orthoMat,
double left,
double right,
double bottom,
double top,
double zNear,
double zFar 
)
static

For Reverse Z buffer - extract the frustum parameters out of a reverse orthographic matrix (near = 1, far = 0)

static bool makVrv::DtOsgUtils::getRevZPerspective ( const osg::Matrix &  mat,
double fovy,
double aspectRatio,
double zNear,
double zFar 
)
static

For Reverse Z buffer - extract the frustum parameters out of a reverse projection matrix (near = 1, far = 0)

static osg::Matrix makVrv::DtOsgUtils::makeRevZPerspective ( double  fovy,
double  aspectRatio,
double  zNear,
double  zFar 
)
static

For Reverse Z buffer - create a reverse projection matrix (near = 1, far = 0) out of frustum parameters.

static void makVrv::DtOsgUtils::getYPR ( const osg::Matrix &  m,
double yaw,
double pitch,
double roll 
)
static

converts a matrix to a human readable yaw/pitch/roll representation

static void makVrv::DtOsgUtils::osgPolytopeToFrustum ( Frustum_64 frustum,
const osg::Polytope &  polytope,
bool  hasNearFar 
)
static

gets a converts a osg polytope to a vrv friendly class.

static void makVrv::DtOsgUtils::computeOsgCameraFrustumPlanes ( std::vector< osg::Vec4d > &  planes,
const osg::Camera *  camera 
)
static

computes culling frustum planes from the given osg camera.

planes The computed culling planes (vector will be resized to 6). camera The camera used to compute the culling planes.

static void makVrv::DtOsgUtils::debugDumpShaderState ( osg::State *  state)
static

only used for debugging prints out a bunch of uniform state for the current shader.

static void makVrv::DtOsgUtils::debugDumpUniformState ( const osg::Node *  node)
static

only used for debugging

static osg::Vec2 makVrv::DtOsgUtils::rotateVec2 ( const osg::Vec2 &  v,
double  rad 
)
static

Vec2 Helpers for DtOsgWindow classes.

Utility function to rotate a vec2

static osg::Vec2 makVrv::DtOsgUtils::translateVec2 ( const osg::Vec2 &  v,
const osg::Vec2 &  translation 
)
static

Utility function to translate a vec2.

static osg::Vec2 makVrv::DtOsgUtils::scaleVec2 ( const osg::Vec2 &  v,
double  s 
)
static

Utility function to scale a vec2.

static osg::Vec2 makVrv::DtOsgUtils::scaleVec2 ( const osg::Vec2 &  v,
double  xScale,
double  yScale 
)
static

Utility function to scale a vec2.

static bool makVrv::DtOsgUtils::clipLine ( double  xMin,
double  xMax,
double  yMin,
double  yMax,
double  x0src,
double  y0src,
double  x1src,
double  y1src,
double x0clip,
double y0clip,
double x1clip,
double y1clip 
)
static

2D clipping routine. Implements Liang / Barsky Clipping

static void makVrv::DtOsgUtils::clipPolygon ( double  xMin,
double  xMax,
double  yMin,
double  yMax,
std::vector< osg::Vec2 > &  vertices 
)
static

2D clipping routine. Implements Sutherland–Hodgman clipping

template<class VecType >
static VecType makVrv::DtOsgUtils::DtModPerLoVec3 ( const VecType &  in,
double  min,
double  max 
)
inlinestatic
static bool makVrv::DtOsgUtils::insideTriangulate ( const std::vector< osg::Vec2 > &  contour,
std::vector< int > &  results 
)
static

OSG version of DtInsideTriangulate Triangulates the given points and returns the indicies that form the triangles.

The triangles will be constrained to the inside of the polygon being triangulated. Note that if this polygon has crossing lines it will not be triangulated. This is also only a 2D triangulation routine. The Z value is ignored, however it can be passed in. Rearranges contour into results;

static bool makVrv::DtOsgUtils::snipTriangle ( const std::vector< osg::Vec2 > &  contour,
int  u,
int  v,
int  w,
int  n,
int V 
)
staticprotected

Utility function used in insideTriangulate.

static bool makVrv::DtOsgUtils::insideTriangle ( float  Ax,
float  Ay,
float  Bx,
float  By,
float  Cx,
float  Cy,
float  Px,
float  Py 
)
staticprotected

Utility function used in insideTriangulate.

static float makVrv::DtOsgUtils::triangulateAreaSize ( const std::vector< osg::Vec2 > &  contour)
staticprotected

Utility function used in insideTriangulate.


The documentation for this class was generated from the following file:

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)