A help class to store all information we need to copy a rigid body visualization to duplicate the rig...
osg::Group * getGroup() const
RigidBodyVisualGroup(osg::Group *group, std::vector< size_t > geometryIndex)
agxCollide::GeometryRef getGeometry(agx::RigidBody *newBody, size_t visualIndex) const
RigidBodyRenderCache is used to cache generated visuals and lookup mappings of RigidBodies cloned fro...
const RigidBodyRenderCache::RigidBodyVisualGroup & getOrCreateCachedTemplateBodyNode(agx::RigidBody *body)
Gets cached template body visual from the node cache if it exists, otherwise a new visual node will b...
void traverseAndInsert(osg::Group *rootNode)
bool shouldAddBody(agx::RigidBody *body) const
void setOnlyAddEmittedBodies(bool enable)
RigidBodyRenderCache(bool onlyAddEmittedBodies=true)
Default constructor.
const RigidBodyRenderCache::RigidBodyVisualGroup & addTemplateBodyToVisualCache(agx::RigidBody *body)
Add template body to visual cache that is used during playback in qtViewer.
bool getOnlyAddEmittedBodies() const
osg::Group * getNode(agx::RigidBody *body)
Get the current mapping in the cache between a RigidBody to a osg::Group.
virtual ~RigidBodyRenderCache()
const RigidBodyRenderCache::RigidBodyVisualGroup & getCachedTemplateBodyVisual(agx::RigidBody *body)
Get cached template body visual from the node cache if it exists.
void clear()
Clear the internal cache.
void addToCache(osg::Group *rootNode)
Add the osg::Group created from a RigidBody to the cache.
bool bodyIsTemplateEmitted(agx::RigidBody *body)
Checks wherever the specifed body is generated/cloned from the temlpate body via RigidBodyEmitter och...
The rigid body class, combining a geometric model and a frame of reference.