AGX Dynamics 2.40.1.0
Loading...
Searching...
No Matches
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 &point, const agx::Quat &zToDir, agx::Real radius, agx::Real redShift=agx::Real(0))
 Continuous mesh, for splines.
 
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.
 
void add (const agxCollide::Geometry *geometry)
 All compatible shapes in geometry will be rendered.
 
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.
 
void setNumActiveElements (size_t numActiveElements)
 
void setUseRedShiftScale (bool)
 
void update ()
 Push the data to the graphics card.
 

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

◆ SplineShader()

agxOSG::SplineShader::SplineShader ( size_t  initialBufferSize = 256)

◆ ~SplineShader()

virtual agxOSG::SplineShader::~SplineShader ( )
protectedvirtual

Member Function Documentation

◆ add() [1/3]

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.

◆ add() [2/3]

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.

◆ add() [3/3]

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

◆ add2()

void agxOSG::SplineShader::add2 ( const agx::Vec3 point,
const agx::Quat quat,
agx::Real  radius,
agx::Real  xTexCoord,
agx::Real  redShift 
)

◆ getCircleNormalUniform() [1/2]

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

Definition at line 94 of file SplineRenderer.h.

◆ getCircleNormalUniform() [2/2]

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

Definition at line 95 of file SplineRenderer.h.

◆ getCircleResolutionUniform() [1/2]

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.

◆ getCircleResolutionUniform() [2/2]

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

Definition at line 86 of file SplineRenderer.h.

◆ getCylinderColorUniform() [1/2]

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

Definition at line 91 of file SplineRenderer.h.

◆ getCylinderColorUniform() [2/2]

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

Definition at line 92 of file SplineRenderer.h.

◆ getProgram() [1/2]

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

Definition at line 79 of file SplineRenderer.h.

◆ getProgram() [2/2]

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

Definition at line 80 of file SplineRenderer.h.

◆ getQuatsInColorArray()

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

Definition at line 98 of file SplineRenderer.h.

◆ getRadiusArray()

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

Definition at line 99 of file SplineRenderer.h.

◆ getVertexArray()

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

Definition at line 97 of file SplineRenderer.h.

◆ resetCounters()

void agxOSG::SplineShader::resetCounters ( )

Resets all internal counters.

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

◆ setNumActiveElements()

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

Definition at line 100 of file SplineRenderer.h.

◆ setUseRedShiftScale()

void agxOSG::SplineShader::setUseRedShiftScale ( bool  )

◆ update()

void agxOSG::SplineShader::update ( )

Push the data to the graphics card.

Member Data Documentation

◆ m_circleNormalUniform

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

Definition at line 117 of file SplineRenderer.h.

◆ m_circleResolutionUniform

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

Definition at line 118 of file SplineRenderer.h.

◆ m_cylinderColorUniform

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

Definition at line 119 of file SplineRenderer.h.

◆ m_numActiveElements

size_t agxOSG::SplineShader::m_numActiveElements
protected

Definition at line 108 of file SplineRenderer.h.

◆ m_primitiveSet

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

Definition at line 110 of file SplineRenderer.h.

◆ m_program

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

Definition at line 116 of file SplineRenderer.h.

◆ m_quatsInColorArray

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

Definition at line 113 of file SplineRenderer.h.

◆ m_radiusArray

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

Definition at line 114 of file SplineRenderer.h.

◆ m_redShiftArray

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

Definition at line 115 of file SplineRenderer.h.

◆ m_useRedShiftUniform

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

Definition at line 120 of file SplineRenderer.h.

◆ m_vertexArray

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

Definition at line 111 of file SplineRenderer.h.

◆ m_xTexCoordArray

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: