 |
AGXDynamics
2.35.0.2
|
Go to the documentation of this file.
17 #ifndef AGXOSG_FRAME_TRAJECTORY_DRAWABLE_H
18 #define AGXOSG_FRAME_TRAJECTORY_DRAWABLE_H
21 #include <osg/Drawable>
22 #include <osgViewer/Viewer>
23 #include <osg/Version>
36 typedef std::deque<agx::Vec3> PositionBuffer;
37 typedef std::deque<agx::Vec4f> ColorsBuffer;
38 typedef std::pair<PositionBuffer, ColorsBuffer> TrajectoryData;
49 virtual const char*
className()
const {
return "FrameTrajectoryDrawable"; }
53 # if OSG_VERSION_GREATER_OR_EQUAL(3,4,0)
54 virtual osg::BoundingSphere computeBound()
const;
55 virtual osg::BoundingBox computeBoundingBox()
const;
57 virtual osg::BoundingBox computeBound()
const;
61 virtual void drawImplementation(osg::RenderInfo& renderInfo)
const;
64 void updateTrajectories();
67 void setNumTrajectoryPositions(
agx::UInt num);
70 agx::UInt getNumTrajectoryPositions()
const;
73 void setDefaultTrajectoryColor(
const agx::Vec4f& color);
76 void resetTrajectories();
88 void setEnable(
bool enable);
91 bool getEnable()
const;
99 void updateKernelBuffers();
101 void popOldPositionsInDeadTrajectories();
agx::Vec4f m_defaultTrajectoryColor
agxData::BufferRef m_colorBuffer
virtual const char * className() const
agxData::BufferRef m_verticesBuffer
agxData::BufferRef m_firstsBuffer
virtual osg::Object * clone(const osg::CopyOp &) const
agx::Vector< std::tuple< agx::FrameRef, agx::Vec4f, TrajectoryData > > m_activeTrajectories
A class holding 4 dimensional vectors and providing basic arithmetic.
agxData::BufferRef m_countBuffer
agx::TaskGroupRef m_renderTask
agxSDK::Simulation * getSimulation()
Get the simulation related to the drawable.
bool getEnable() const
Return true of the drawable is enabled.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
virtual const char * libraryName() const
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
void setEnable(bool enable)
Enable the drawable.
Inheritance with partial specialization due to bug with ref_ptr containers.
agx::Vector< TrajectoryData > m_destroyedTrajectories
agx::UInt getNumTrajectoryPositions() const
Get the number of positions used in the trajectories.
#define AGX_DECLARE_POINTER_TYPES(type)
virtual osg::Object * cloneType() const
virtual bool isSameKindAs(const osg::Object *obj) const
The object defining a frame of reference and providing transformations operations.
agxSDK::SimulationObserver m_simulation
void setDefaultTrajectoryColor(const agx::Vec4f &color)
Set default color of trajectories.