AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agxOSG::SplineShader Class Reference

Class to encapsulate reading shader files and setting up rendering of a Spline. More...

#include <SplineRenderer.h>

+ Inheritance diagram for agxOSG::SplineShader:

Public Member Functions

 SplineShader (size_t initialBufferSize=256)
 
void add (const agx::Vec3 &startPoint, const agx::Vec3 &endPoint, agx::Real radius, agx::Vec2 redShift=agx::Vec2(0, 0))
 Add cylinder given world start- and end point, and radius. More...
 
void add (const agx::Vec3 &point, const agx::Quat &zToDir, agx::Real radius, agx::Real redShift=agx::Real(0))
 Continuous mesh, for splines. More...
 
void add (const agxCollide::Geometry *geometry)
 All compatible shapes in geometry will be rendered. More...
 
void add2 (const agx::Vec3 &point, const agx::Quat &quat, agx::Real radius, agx::Real xTexCoord, agx::Real redShift)
 
osg::Uniform * getCircleNormalUniform ()
 
const osg::Uniform * getCircleNormalUniform () const
 
osg::Uniform * getCircleResolutionUniform ()
 
const osg::Uniform * getCircleResolutionUniform () const
 
osg::Uniform * getCylinderColorUniform ()
 
const osg::Uniform * getCylinderColorUniform () const
 
osg::Program * getProgram ()
 
const osg::Program * getProgram () const
 
osg::Vec4Array * getQuatsInColorArray ()
 
osg::FloatArray * getRadiusArray ()
 
osg::Vec3Array * getVertexArray ()
 
void resetCounters ()
 Resets all internal counters. More...
 
void setNumActiveElements (size_t numActiveElements)
 
void setUseRedShiftScale (bool)
 
void update ()
 Push the data to the graphics card. More...
 

Protected Member Functions

virtual ~SplineShader ()
 

Protected Attributes

osg::ref_ptr< osg::Uniform > m_circleNormalUniform
 
osg::ref_ptr< osg::Uniform > m_circleResolutionUniform
 
osg::ref_ptr< osg::Uniform > m_cylinderColorUniform
 
size_t m_numActiveElements
 
osg::DrawArrays * m_primitiveSet
 
osg::Program * m_program
 
osg::Vec4Array * m_quatsInColorArray
 
osg::FloatArray * m_radiusArray
 
osg::FloatArray * m_redShiftArray
 
osg::ref_ptr< osg::Uniform > m_useRedShiftUniform
 
osg::Vec3Array * m_vertexArray
 
osg::FloatArray * m_xTexCoordArray
 

Detailed Description

Class to encapsulate reading shader files and setting up rendering of a Spline.

Definition at line 43 of file SplineRenderer.h.

Constructor & Destructor Documentation

agxOSG::SplineShader::SplineShader ( size_t  initialBufferSize = 256)
virtual agxOSG::SplineShader::~SplineShader ( )
protectedvirtual

Member Function Documentation

void agxOSG::SplineShader::add ( const agx::Vec3 &  startPoint,
const agx::Vec3 &  endPoint,
agx::Real  radius,
agx::Vec2  redShift = agx::Vec2(0, 0) 
)

Add cylinder given world start- and end point, and radius.

void agxOSG::SplineShader::add ( const agx::Vec3 &  point,
const agx::Quat &  zToDir,
agx::Real  radius,
agx::Real  redShift = agx::Real(0) 
)

Continuous mesh, for splines.

Add point and direction towards the next.

void agxOSG::SplineShader::add ( const agxCollide::Geometry *  geometry)

All compatible shapes in geometry will be rendered.

Parameters
geometry- geometry with one or several compatible shapes
void agxOSG::SplineShader::add2 ( const agx::Vec3 &  point,
const agx::Quat &  quat,
agx::Real  radius,
agx::Real  xTexCoord,
agx::Real  redShift 
)
osg::Uniform* agxOSG::SplineShader::getCircleNormalUniform ( )
inline

Definition at line 94 of file SplineRenderer.h.

const osg::Uniform* agxOSG::SplineShader::getCircleNormalUniform ( ) const
inline

Definition at line 95 of file SplineRenderer.h.

osg::Uniform* agxOSG::SplineShader::getCircleResolutionUniform ( )
inline
Returns
the uniform holding the number of cylinder segments in the shader

Definition at line 85 of file SplineRenderer.h.

const osg::Uniform* agxOSG::SplineShader::getCircleResolutionUniform ( ) const
inline

Definition at line 86 of file SplineRenderer.h.

osg::Uniform* agxOSG::SplineShader::getCylinderColorUniform ( )
inline
Returns
the uniform holding the color of the cylinders

Definition at line 91 of file SplineRenderer.h.

const osg::Uniform* agxOSG::SplineShader::getCylinderColorUniform ( ) const
inline

Definition at line 92 of file SplineRenderer.h.

osg::Program* agxOSG::SplineShader::getProgram ( )
inline
Returns
the program

Definition at line 79 of file SplineRenderer.h.

const osg::Program* agxOSG::SplineShader::getProgram ( ) const
inline

Definition at line 80 of file SplineRenderer.h.

osg::Vec4Array* agxOSG::SplineShader::getQuatsInColorArray ( )
inline

Definition at line 98 of file SplineRenderer.h.

osg::FloatArray* agxOSG::SplineShader::getRadiusArray ( )
inline

Definition at line 99 of file SplineRenderer.h.

osg::Vec3Array* agxOSG::SplineShader::getVertexArray ( )
inline

Definition at line 97 of file SplineRenderer.h.

void agxOSG::SplineShader::resetCounters ( )

Resets all internal counters.

I.e., all old data will be forgotten.

void agxOSG::SplineShader::setNumActiveElements ( size_t  numActiveElements)
inline

Definition at line 100 of file SplineRenderer.h.

void agxOSG::SplineShader::setUseRedShiftScale ( bool  )
void agxOSG::SplineShader::update ( )

Push the data to the graphics card.

Member Data Documentation

osg::ref_ptr<osg::Uniform> agxOSG::SplineShader::m_circleNormalUniform
protected

Definition at line 117 of file SplineRenderer.h.

osg::ref_ptr<osg::Uniform> agxOSG::SplineShader::m_circleResolutionUniform
protected

Definition at line 118 of file SplineRenderer.h.

osg::ref_ptr<osg::Uniform> agxOSG::SplineShader::m_cylinderColorUniform
protected

Definition at line 119 of file SplineRenderer.h.

size_t agxOSG::SplineShader::m_numActiveElements
protected

Definition at line 108 of file SplineRenderer.h.

osg::DrawArrays* agxOSG::SplineShader::m_primitiveSet
protected

Definition at line 110 of file SplineRenderer.h.

osg::Program* agxOSG::SplineShader::m_program
protected

Definition at line 116 of file SplineRenderer.h.

osg::Vec4Array* agxOSG::SplineShader::m_quatsInColorArray
protected

Definition at line 113 of file SplineRenderer.h.

osg::FloatArray* agxOSG::SplineShader::m_radiusArray
protected

Definition at line 114 of file SplineRenderer.h.

osg::FloatArray* agxOSG::SplineShader::m_redShiftArray
protected

Definition at line 115 of file SplineRenderer.h.

osg::ref_ptr<osg::Uniform> agxOSG::SplineShader::m_useRedShiftUniform
protected

Definition at line 120 of file SplineRenderer.h.

osg::Vec3Array* agxOSG::SplineShader::m_vertexArray
protected

Definition at line 111 of file SplineRenderer.h.

osg::FloatArray* agxOSG::SplineShader::m_xTexCoordArray
protected

Definition at line 112 of file SplineRenderer.h.


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