30#include <osg/Geometry>
80 const osg::Program*
getProgram()
const {
return m_program; }
The geometry representation used by the collision detection engine.
Class for rendering a spline model.
virtual ~SplineRenderer()
agx::Vec4f getColor() const
agx::Real m_numSegmentsPerUnitLength
void initialize(osg::Group *root)
virtual void update(const agx::RealVector &radiiVector)
Use this update if this spline has variable radii.
agx::Real getNumSegmentsPerUnitLength() const
const agxUtil::Spline * getSplineModel() const
agx::Real getRadius() const
agxUtil::Spline * getSplineModel()
osg::ref_ptr< osg::Group > m_node
void setSplineModel(agxUtil::Spline *spline)
Assign spline model.
virtual void last(const agx::TimeStamp &)
Called after a step is taken in the simulation Implement this method in the derived class to get call...
agx::RealVector m_redShiftScales
Values from 0 to 1 how red the color of the node is (0 default color, 1 red color,...
void setColor(const agx::Vec4f &color)
Assign color to this spline.
virtual void update()
Given the current spline control points, data will be pushed for new update.
SplineRenderer(agxUtil::Spline *spline, osg::Group *root)
Construct spline (geometry shader) renderer.
virtual void removeNotification()
Called when this listener is removed from the simulation.
agx::RealVector & getRedShiftScales()
agxUtil::SplineRef m_spline
void setNumSegmentsPerUnitLength(agx::Real segmentsPerUnitLength)
Assign how many cylinder segments that should be used per unit length.
virtual void addNotification()
Called when this listener is added to the simulation.
void setRadius(agx::Real radius)
Assign new radius of the cylinder segments.
const agx::RealVector & getRedShiftScales() const
SplineShaderRef m_splineGeometry
Class to encapsulate reading shader files and setting up rendering of a Spline.
osg::Uniform * getCircleResolutionUniform()
void add(const agx::Vec3 &point, const agx::Quat &zToDir, agx::Real radius, agx::Real redShift=agx::Real(0))
Continuous mesh, for splines.
osg::ref_ptr< osg::Uniform > m_circleNormalUniform
osg::ref_ptr< osg::Uniform > m_circleResolutionUniform
osg::FloatArray * m_radiusArray
osg::Vec4Array * m_quatsInColorArray
void add(const agxCollide::Geometry *geometry)
All compatible shapes in geometry will be rendered.
void setUseRedShiftScale(bool)
osg::Vec4Array * getQuatsInColorArray()
osg::FloatArray * m_xTexCoordArray
osg::Uniform * getCircleNormalUniform()
void update()
Push the data to the graphics card.
const osg::Uniform * getCircleResolutionUniform() const
osg::Vec3Array * getVertexArray()
osg::FloatArray * getRadiusArray()
void resetCounters()
Resets all internal counters.
const osg::Uniform * getCircleNormalUniform() const
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 setNumActiveElements(size_t numActiveElements)
osg::ref_ptr< osg::Uniform > m_cylinderColorUniform
SplineShader(size_t initialBufferSize=256)
osg::Uniform * getCylinderColorUniform()
osg::Program * getProgram()
osg::DrawArrays * m_primitiveSet
size_t m_numActiveElements
const osg::Uniform * getCylinderColorUniform() const
const osg::Program * getProgram() const
osg::ref_ptr< osg::Uniform > m_useRedShiftUniform
osg::FloatArray * m_redShiftArray
void add2(const agx::Vec3 &point, const agx::Quat &quat, agx::Real radius, agx::Real xTexCoord, agx::Real redShift)
osg::Vec3Array * m_vertexArray
Derive from this class to implement a listener for simulation step events.
A class holding 4 dimensional vectors and providing basic arithmetic.
This namespace consists of a set of classes for handling geometric intersection tests including boole...
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
osg::ref_ptr< SplineShader > SplineShaderRef
agx::ref_ptr< SplineRenderer > SplineRendererRef