AGX Dynamics  2.37.2.0
RenderManager.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGXRENDER_RENDERMANAGER_H
18 #define AGXRENDER_RENDERMANAGER_H
19 
20 #include <agx/agxPhysics_export.h>
21 #include <agx/Referenced.h>
22 #include <agx/HashVector.h>
23 #include <agx/AffineMatrix4x4.h>
24 #include <agxCollide/Space.h>
25 
26 #include <agxRender/RenderProxy.h>
27 #include <agxRender/Renderable.h>
28 #include <agxRender/Graph.h>
29 
30 namespace agxSDK
31 {
32  class Simulation;
33  class StatisticsEntries;
34 }
35 
36 namespace agxRender
37 {
38 
39  class RenderProxyFactory;
40  class RenderProxy;
41  class SpaceListener;
42  class SphereProxy;
43  class BoxProxy;
44  class LineProxy;
45  class HeightFieldProxy;
46  class CylinderProxy;
47  class HollowCylinderProxy;
48  class ConeProxy;
49  class TruncatedConeProxy;
50  class HollowTruncatedConeProxy;
51  class CapsuleProxy;
52  class TextProxy;
53  class PlaneProxy;
54  class GraphRenderer;
55  class Graph;
56 
58  enum Flags {
64  RENDER_CONSTRAINTS = 1 << 5,
65  RENDER_BODIES = 1 << 6,
68  RENDER_TEXT = 1 << 9,
69  RENDER_AABB_TREES = 1 << 10,
70  RENDER_SENSORS = 1 << 11,
71  RENDER_MESH = 1 << 12,
73  RENDER_STATISTICS = 1 << 14,
74  RENDER_RENDERABLES = 1 << 15,
77  RENDER_BATCH_BODIES = 1 << 18,
78  RENDER_BATCH_WIRES = 1 << 19,
91  RENDER_MESH |
93  };
94 
96 
107  {
108  public:
109 
115 
120  void update();
121 
126  void setProxyFactory ( RenderProxyFactory* factory );
127 
131  RenderProxyFactory* getProxyFactory();
132 
137  void setEnable( bool flag );
138 
142  bool getEnable( ) const;
143 
147  bool isEnabled() const;
148 
153  void setAlpha( float alpha );
154 
158  float getAlpha( ) const;
159 
164  void disableFlags( unsigned int flags );
165 
170  void enableFlags( unsigned int flags );
171 
175  bool isEnabledFlags( unsigned int flags ) const;
176 
180  void setFlags( unsigned int flags );
181 
186  void updateAllProxies( agxRender::RenderProxy::EventType eventType );
187 
193  SphereProxy* acquireSphere( float radius );
194 
200  BoxProxy* acquireBox( const agx::Vec3& halfExtents );
201 
207  LineProxy* acquireLine( const agx::Vec3& p1, const agx::Vec3& p2 );
208 
215  TextProxy* acquireText( const agx::String& text, const agx::Vec3& pos );
216 
222  PlaneProxy* acquirePlane( const agx::Vec3& normal, agx::Real distance );
223 
230  CylinderProxy* acquireCylinder( float radius, float height );
231 
239  CylinderProxy* acquireCylinder( const agx::Vec3& begin, const agx::Vec3& end, float radius );
240 
247  HollowCylinderProxy* acquireHollowCylinder( float radius, float height, float thickness );
248 
249 
257  ConeProxy* acquireCone( const agx::Vec3& p1, const agx::Vec3& p2, float radius );
258 
267  TruncatedConeProxy* acquireTruncatedCone( const agx::Vec3& p1, const agx::Vec3& p2, float topRadius, float bottomRadius );
268 
278  HollowTruncatedConeProxy* acquireHollowTruncatedCone( const agx::Vec3& p1, const agx::Vec3& p2, float topRadius, float bottomRadius, float thickness );
279 
286  CapsuleProxy* acquireCapsule( float radius, float height );
287 
295  CapsuleProxy* acquireCapsule( const agx::Vec3& begin, const agx::Vec3& end, float radius );
296 
303  ContactsProxy* acquireContacts( const agxCollide::GeometryContactPtrVector& contacts, float scale );
304 
311  RigidBodyBatchRenderProxy* acquireRigidBodies( const agx::RigidBodyPtrSetVector* enabledBodies, float scale );
312 
318  WireRenderProxy* acquireWire( float radius, const agx::Vec3& color );
319 
325  void clear( bool clearText = true, bool clearGlobalProxies = true );
326 
331  void addRenderable( Renderable* renderable );
332 
336  bool hasRenderable( Renderable* renderable ) const;
337 
342  bool removeRenderable( Renderable* renderable );
343 
344  void acquireGeometry( const agxCollide::Geometry* geometry, const agx::Vec3& color );
345 
351  RenderProxy* findShapeProxy( const agxCollide::Shape* shape );
352 
357  void setDefaultRenderMode( RenderProxy::RenderMode mode );
358 
365  void setScaleFactor( float scaleFactor = 1.0f );
366 
370  float getScaleFactor() const;
371 
372  public:
373  typedef std::pair< const agx::ParticleSystem*, agxRender::RenderProxyRef > ConstParticleSystemPtrRenderProxyPtrPair;
375 
376  protected:
377 
381  void flush();
382 
383  friend class SpaceListener;
384  friend class agxCollide::Space;
385  friend class agxSDK::Simulation;
387 
388 
392  void setSpace( agxCollide::Space* space );
393 
397  Graph* getGraph();
398 
399  void add( const agx::ParticleSystem* particleSystem );
400  void remove( const agx::ParticleSystem* particleSystem );
401 
408  void add( const agxCollide::Geometry* geometry, const agx::Vec3& color = agx::Vec3( -1, 0, 0 ), bool addToProxies = true );
409 
417  RenderProxy* add( agxCollide::Shape* shape, const agxCollide::Geometry* geometry, const agx::Vec3& color = agx::Vec3( -1, 0, 0 ), bool addToProxies = true );
418 
423  void remove( const agxCollide::Shape* shape );
424 
429  void remove( const agxCollide::Geometry* geometry );
430 
432  void renderBoundingVolume( const agxCollide::Geometry* geometry );
433 
435  void renderAABBTrees( RenderProxy* proxy );
436 
438  void addAllGeometries();
439 
441  void updateText();
442 
444  void updateGraphs();
445 
447  void updateAABBProxies( );
448 
450  void updateObserverFrames();
451 
453  void renderObserverFrame(const agx::ObserverFrame* observerFrame);
454 
456  void updateBodyProxies( agxData::EntityStorage* islandStorage = nullptr );
457 
459  void updateShapeProxies(agxData::EntityStorage* islandStorage = nullptr );
460 
462  void updateParticleSystemProxies();
463 
465  void updateRenderables();
466 
468  void updateContactProxies();
469 
470 
471  void updateParticleContactProxies();
472  void updateParticleGeometryContactProxies();
473 
475  void updateConstraintProxies();
476 
478  void clearShapeProxies();
479 
481  void updateProxy( RenderProxy* proxy, agxData::EntityStorage* islandStorage = nullptr );
482 
484  virtual ~RenderManager();
485 
486  // Attributes
488  RenderProxyHashVector m_proxies;
490  bool m_enable;
491  float m_alpha;
494 
497 
498  ParticleSystemProxyContainer m_particleSystems;
499 
500  // Abstract base class for a ProxyCache
501  struct CacheBase {
502  CacheBase( RenderManager* mgr ) : m_mgr( mgr ) {
503  m_mgr->m_cacheVector.push_back( this );
504  }
505 
506  virtual void clear() = 0;
507  virtual void flush() = 0;
508  virtual void setAlpha( float alpha ) = 0;
510 
511  virtual ~CacheBase() {}
512  };
513 
514 
518  template <typename T>
519  class PrimitiveCache : public CacheBase
520  {
521  public:
522 
525  typedef typename ProxyVector::iterator iterator;
526 
528  PrimitiveCache( RenderManager* mgr ) : CacheBase( mgr ), m_index( 0 ) {}
529 
533  T* acquire();
534 
538  void flush() {
539  for ( size_t i = m_index; i < m_pool.size(); i++ )
540  m_pool[i]->callOnChange( RenderProxy::REMOVE );
541 
542  m_pool.resize( std::min( m_index, m_pool.size() ) );
543  m_index = 0;
544  }
545 
550  void setAlpha( float alpha ) {
551  for ( size_t i = 0; i < m_pool.size(); i++ )
552  m_pool[i]->setAlpha( alpha );
553  }
554 
558  void clear() {
559  for ( typename ProxyVector::iterator it = m_pool.begin(); it != m_pool.end(); ++it )
560  ( *it )->callOnChange( RenderProxy::REMOVE );
561  m_pool.clear( agx::Container::SHRINK_BUFFER );
562  m_index = 0;
563  }
564 
566  virtual ~PrimitiveCache() {
567  clear();
568  }
569 
570  iterator begin() { return m_pool.begin(); }
571  const_iterator begin() const { return m_pool.begin(); }
572 
573  iterator end() { return m_pool.end(); }
574  const_iterator end() const { return m_pool.end(); }
575 
576  protected:
577 
578  ProxyVector m_pool;
579  size_t m_index;
580  };
581 
585  template <typename T, typename P1>
586  class PrimitiveCache1 : public PrimitiveCache<T>
587  {
588  public:
589 
592 
596  T* acquire( const P1& param );
597 
598  private:
599 
600  T* acquire() { return nullptr; }
601  };
602 
604  CacheVector m_cacheVector;
605 
619 
621 
624  RenderableRefVector m_renderables;
626  RenderProxyRefContainer m_globalProxies;
628 
635 
636  };
637 
638 
648  {
649  public:
651 
653  virtual SphereProxy* createSphere( float radius ) = 0;
654 
656  virtual BoxProxy* createBox( const agx::Vec3& halfExtents ) = 0;
657 
659  virtual LineProxy* createLine( const agx::Vec3& p1, const agx::Vec3& p2 ) = 0;
660 
662  virtual CylinderProxy* createCylinder( float radius, float height ) = 0;
663 
665  virtual HollowCylinderProxy* createHollowCylinder( float radius, float height, float thickness ) = 0;
666 
668  virtual ConeProxy* createCone( float radius, float height ) = 0;
669 
671  virtual TruncatedConeProxy* createTruncatedCone( float topRadius, float bottomRadius, float height ) = 0;
672 
674  virtual HollowTruncatedConeProxy* createHollowTruncatedCone( float topRadius, float bottomRadius, float height, float thickness ) = 0;
675 
677  virtual CapsuleProxy* createCapsule( float radius, float height ) = 0;
678 
680  virtual WireShapeProxy* createWireShape( float radius, float height,
681  const agx::Vec3& previousEndPoint0, const agx::Vec3& previousEndPoint1 ) = 0;
682 
684  virtual TextProxy* createText( const agx::String& text, const agx::Vec3& pos ) = 0;
685 
687  virtual PlaneProxy* createPlane( const agx::Vec3& normal, agx::Real distance ) = 0;
688 
690  virtual HeightFieldProxy* createHeightfield( agxCollide::HeightField* hf ) = 0;
691 
693  virtual ContactsProxy* createContacts( const agxCollide::GeometryContactPtrVector& ) = 0;
694 
696  virtual RigidBodyBatchRenderProxy* createRigidBodies( const agx::RigidBodyPtrSetVector* /*enabledBodies*/ ) = 0;
697 
698  virtual WireRenderProxy* createWire( float radius, const agx::Vec3& color ) = 0;
699 
700  virtual RenderProxy* createSphereBatchRenderer(
701  agxData::Buffer *positions,
702  agxData::Buffer *rotations,
703  agxData::Buffer *radii,
704  agxData::Buffer *colors,
705  agxData::Buffer *enableRendering,
706  agxData::Value *bound,
707  agx::Component *context ) = 0;
708 
710  virtual TrimeshProxy* createTrimesh( agxCollide::Trimesh* mesh ) = 0;
711 
713  SphereProxy* create( float radius );
714 
716  BoxProxy* create( const agx::Vec3& halfExtents );
717 
719  LineProxy* create( const LineProxy* );
720 
722  CylinderProxy* create( const CylinderProxy* );
723 
725  HollowCylinderProxy* create( const HollowCylinderProxy* );
726 
728  ConeProxy* create( const ConeProxy* );
729 
731  TruncatedConeProxy* create( const TruncatedConeProxy* );
732 
735 
737  CapsuleProxy* create( const CapsuleProxy* );
738 
740  TextProxy* create( const TextProxy* );
741 
743  PlaneProxy* create( const PlaneProxy* );
744 
746  ContactsProxy* create( const agxCollide::GeometryContactPtrVector& contacts );
747 
749  RigidBodyBatchRenderProxy* create( const agx::RigidBodyPtrSetVector* enabledBodies );
750 
756  virtual Graph::GraphRenderer* getGraphRenderer() = 0;
757 
762  void setDefaultRenderMode( RenderProxy::RenderMode mode );
763 
767  RenderProxy::RenderMode getDefaultRenderMode( ) const;
768 
769  void setEnable( bool flag );
770  bool getEnable( ) const;
771 
772  protected:
773  friend class RenderManager;
775  m_mgr = mgr;
776  }
777  virtual ~RenderProxyFactory();
780  bool m_enabled;
781  };
782 
783  inline void RenderProxyFactory::setEnable( bool flag )
784  {
785  m_enabled = flag;
786  }
787  inline bool RenderProxyFactory::getEnable( ) const
788  {
789  return m_enabled;
790  }
791 
794  {
795  public:
796 
799 
800  agxCollide::Space* getSpace();
801  protected:
802 
804  virtual ~SpaceListener();
805 
807  void addNotification( agxCollide::Space* space );
808 
810  void addGeometryNotification( agxCollide::Space* space, agxCollide::Geometry* geometry );
812  void removeGeometryNotification( agxCollide::Space* space, agxCollide::Geometry* geometry );
814  void addShapeNotification( agxCollide::Space* space, agxCollide::Geometry* geometry, agxCollide::Shape* shape );
816  void removeShapeNotification( agxCollide::Space* space, agxCollide::Geometry* geometry, agxCollide::Shape* shape );
817 
820  };
821 
822 
823 
824 
825  // Implementation
826 
827  inline bool RenderManager::getEnable( ) const
828  {
829  return m_enable;
830  }
831 
832 
833  inline float RenderManager::getAlpha( ) const
834  {
835  return m_alpha;
836  }
837 
838 
839  inline bool RenderManager::isEnabled() const
840  {
841  return getEnable();
842  }
843 
844 
846  inline SphereProxy* RenderProxyFactory::create( float radius )
847  {
848  return createSphere( radius );
849  }
851  inline BoxProxy* RenderProxyFactory::create( const agx::Vec3& halfExtents )
852  {
853  return createBox( halfExtents );
854  }
856  inline LineProxy* RenderProxyFactory::create( const LineProxy* )
857  {
858  return createLine( agx::Vec3( agx::Real( 0 ) ), agx::Vec3( agx::Real( 1 ) ) );
859  }
861  inline CylinderProxy* RenderProxyFactory::create( const CylinderProxy* )
862  {
863  return createCylinder( 1, 1 );
864  }
866  inline HollowCylinderProxy* RenderProxyFactory::create( const HollowCylinderProxy* )
867  {
868  return createHollowCylinder( 1, 1, 0.1f );
869  }
870 
872  inline ConeProxy* RenderProxyFactory::create( const ConeProxy* )
873  {
874  return createCone( 1, 1 );
875  }
877  inline TruncatedConeProxy* RenderProxyFactory::create( const TruncatedConeProxy* )
878  {
879  return createTruncatedCone( 1, 1, 1 );
880  }
882  inline HollowTruncatedConeProxy* RenderProxyFactory::create( const HollowTruncatedConeProxy* )
883  {
884  return createHollowTruncatedCone( 1, 1, 1, 0.1f );
885  }
886 
888  inline CapsuleProxy* RenderProxyFactory::create( const CapsuleProxy* )
889  {
890  return createCapsule( 1, 1 );
891  }
893  inline TextProxy* RenderProxyFactory::create( const TextProxy* )
894  {
895  return createText( "", agx::Vec3( 0, 0, 0 ) );
896  }
898  inline PlaneProxy* RenderProxyFactory::create( const PlaneProxy* )
899  {
900  return createPlane( agx::Vec3( 0, 0, 1 ), 0 );
901  }
902 
904  inline ContactsProxy* RenderProxyFactory::create( const agxCollide::GeometryContactPtrVector& contacts )
905  {
906  return createContacts( contacts );
907  }
908 
909  inline RigidBodyBatchRenderProxy* RenderProxyFactory::create( const agx::RigidBodyPtrSetVector* enabledBodies )
910  {
911  return createRigidBodies( enabledBodies );
912  }
913 
914  inline RenderProxy::RenderMode RenderProxyFactory::getDefaultRenderMode() const
915  {
916  return m_defaultRenderMode;
917  }
918 
919  template< typename T>
921  {
922  if ( m_index < m_pool.size() ) {
923  T* proxy = m_pool[m_index++];
924 
925  // Reset color, alpha and enabled state
926  proxy->reset();
927  return proxy;
928  } else {
929  const void* p = nullptr;
930  const T* px = static_cast<const T*>( p );
931  T* proxy = m_mgr->getProxyFactory()->create( px);
932  proxy->setEnable( true );
933  m_pool.push_back( proxy );
934  m_index = m_pool.size();
935  return proxy;
936  }
937  }
938 
939  template< typename T, typename P1>
941  {
942  if ( this->m_index < this->m_pool.size() ) {
943  T* proxy = this->m_pool[this->m_index++];
944  // Reset color, alpha and enabled state
945  proxy->reset();
946  return proxy;
947  } else {
948  T* proxy = this->m_mgr->getProxyFactory()->create( param );
949  proxy->setEnable( true );
950  this->m_pool.push_back( proxy );
951  this->m_index = this->m_pool.size();
952  return proxy;
953  }
954  }
955 }
956 
957 #endif
agx::Vector< RenderableRef > RenderableRefVector
PrimitiveCache1< BoxProxy, agx::Vec3 > m_boxCache
AGXTERRAIN_EXPORT void clear()
Class that implements a simple graph for plotting scalar values.
Definition: Graph.h:33
Render collision geometries.
Definition: RenderManager.h:59
agx::Vector< agx::ref_ptr< agxRender::RenderProxy > > RenderProxyRefContainer
Batch render bodies.
Definition: RenderManager.h:77
Execute render for all registered Renderables.
Definition: RenderManager.h:74
Vec3T< T > min(const Vec3T< T > &lhs, const Vec3T< T > &rhs)
Definition: Vec3Template.h:861
AGXOSG_EXPORT void setAlpha(osg::Node *node, float alpha)
Set the alpha part of the material for a node.
Class for listening for add/remove geometry events for an associated Space.
Definition: SpaceListener.h:29
Render particle contacts.
Definition: RenderManager.h:62
ParticleSystemProxyContainer m_particleSystems
Smart pointer for observed objects, that automatically set pointers to them to null when they deleted...
Definition: observer_ptr.h:60
Data storage for a collection of entity instances of a specified EntityModel.
Definition: EntityStorage.h:72
Base class for a shape.
Definition: Shape.h:53
Subclass that implements a BoxProxy.
A component is an object containing other objects, enabling hierarchical structuring.
Definition: Component.h:38
Abstract representation of a value.
Definition: Value.h:48
void setRenderManager(RenderManager *mgr)
agx::Vector< CacheBase * > CacheVector
Subclass that implements a TruncatedConeProxy.
agx::Vector< agx::ref_ptr< T > > ProxyVector
PrimitiveCache< TruncatedConeProxy > m_truncatedConeCache
RenderProxyRef m_particleGeometryContactRenderProxy
Subclass that implements a CylinderProxy.
The default rendering mode.
Definition: RenderManager.h:82
#define AGXPHYSICS_EXPORT
Render geometries which are sensors.
Definition: RenderManager.h:70
void flush()
Reduce size of pooled RenderProxy down to the number of used ones.
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
Color for a RigidBody is selected based on which partition it belongs to.
Definition: RenderManager.h:75
Subclass that implements a TrimeshProxy.
RenderProxyRef m_particleContactRenderProxy
Namespace containing classes for handling debug rendering of collision geometries, constraints, contacts and rigid bodies.
Definition: Constraint.h:35
PrimitiveCache< HollowCylinderProxy > m_hollowCylinderCache
Render statistics text/graphs onto screen.
Definition: RenderManager.h:73
agxData::ValueRef m_particleContactBound
Class for storing RenderProxies that are currently in use.
Render contacts as one batch call for all contacts.
Definition: RenderManager.h:76
void setAlpha(float alpha)
Set alpha value for all proxies.
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc...
PrimitiveCache1(RenderManager *mgr)
Constructor.
Subclass that implements a CapsuleProxy.
agx::HashVector< agx::UInt32, agx::ref_ptr< RenderProxy > > RenderProxyHashVector
RenderProxyHashVector m_proxies
PrimitiveCache< CapsuleProxy > m_capsuleCache
AGXOSG_EXPORT agxCollide::Trimesh * createTrimesh(osg::Node *node)
Extracts mesh data from an osg::Node, creates an agxCollide::Trimesh from it and returns the result...
PrimitiveCache1< ContactsProxy, agxCollide::GeometryContactPtrVector > m_contactsCache
A listener that will be responsible for calling RenderManager every time a Shape is added/removed fro...
Abstract class which is responsible for returning a pointer to a specified RenderProxy type...
Render rigid body constraint attachments.
Definition: RenderManager.h:64
PrimitiveCache< CylinderProxy > m_cylinderCache
Base class providing referencing counted objects.
Definition: Referenced.h:119
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
Subclass that implements a SphereProxy.
Wire content batch rendered.
Definition: RenderManager.h:78
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Definition: HashVector.h:40
agxData::BufferRef m_particleContactRadiusBuffer
agxRender::GraphRef m_graph
Buffer is deallocated and replaced by an newly allocated empty buffer.
Definition: Container.h:44
Render rigid body mass centers.
Definition: RenderManager.h:65
A basic particle system that contains all the storages and buffers required for basic operation and a...
Render bounding volumes for geometries.
Definition: RenderManager.h:60
Render AABB trees.
Definition: RenderManager.h:69
Vector containing &#39;raw&#39; data.
Definition: Vector.h:245
PrimitiveCache1< RigidBodyBatchRenderProxy, const agx::RigidBodyPtrSetVector * > m_rbCache
This class contains all Geometries and performs Broad Phase and Narrow Phase collision detection to c...
Definition: Space.h:81
Class holding contacts that makes it possible to batch render these objects.
agx::ref_ptr< RenderProxyFactory > m_factory
Abstract representation of a data buffer.
Definition: Buffer.h:55
RenderProxyRefContainer m_globalProxies
E.g., wires that hold their proxy (i.e., not doing acquire to fetch their render proxy).
ProxyVector::const_iterator const_iterator
PrimitiveCache1< SphereProxy, float > m_sphereCache
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
RenderableRefVector m_renderables
LinearProbingHashSetImplementation< KeyT, HashT >::iterator begin(LinearProbingHashSetImplementation< KeyT, HashT > &set)
std::pair< const agx::ParticleSystem *, agxRender::RenderProxyRef > ConstParticleSystemPtrRenderProxyPtrPair
Subclass that implements a PlaneProxy.
agx::Vector< ConstParticleSystemPtrRenderProxyPtrPair > ParticleSystemProxyContainer
PrimitiveCache< PlaneProxy > m_planeCache
virtual ~PrimitiveCache()
Destructor: calls clear()
Inherit from this class and implement the render() method to make it it self during debug rendering...
Definition: Renderable.h:38
Abstract base class which encapsulated information for rendering a specific shape.
agxData::BufferRef m_particleGeometryContactRadiusBuffer
Render trimesh/height field.
Definition: RenderManager.h:71
Subclass that implements a HollowTruncatedConeProxy.
void clear()
Reduce number of proxies to 0.
Class for storing RenderProxies that are currently in use.
Render particle emitters.
Definition: RenderManager.h:67
agx::ref_ptr< SpaceListener > m_listener
Render Observer frames.
Definition: RenderManager.h:79
Render geometry contacts.
Definition: RenderManager.h:61
PrimitiveCache< ConeProxy > m_coneCache
Render particle-geometry contacts.
Definition: RenderManager.h:63
Subclass that implements a TextProxy.
Abstract base class that acts as an interface and can render the data from a Graph.
Definition: Graph.h:45
PrimitiveCache< LineProxy > m_lineCache
AGXOSG_EXPORT osg::Geode * createLine(const agx::Vec3 &p1, const agx::Vec3 &p2, const agx::Vec4 &color, float width)
Create and return a new Line to render.
Render contacts with high fidelity.
Definition: RenderManager.h:72
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
agxSDK::Simulation * m_simulation
RenderProxy::RenderMode m_defaultRenderMode
LinearProbingHashSetImplementation< KeyT, HashT >::iterator end(LinearProbingHashSetImplementation< KeyT, HashT > &set)
agxData::ValueRef m_particleGeometryContactBound
EventType
Enum for specifying a type of event which might change a RenderProxy.
double Real
Definition: Real.h:42
AGXOSG_EXPORT osg::Geode * createText(const std::string &text, const agx::Vec3 &relPosition=agx::Vec3(0, 0, 0), const agx::Vec4f &color=agxRender::Color::Yellow(), agx::Real size=0.2)
Create a text object.
Render particle systems.
Definition: RenderManager.h:66
Subclass that implements a ConeProxy.
Subclass that implements a WireShapeProxy.
Class holding rigid bodies that makes it possible to batch render these objects.
Subclass that implements a HeightfieldProxy.
Triangle mesh for geometric intersection tests.
Definition: Trimesh.h:42
Subclass that implements a LineProxy.
Render all types of contacts.
Definition: RenderManager.h:80
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
Subclass that implements a CylinderProxy.
PrimitiveCache< HollowTruncatedConeProxy > m_hollowTruncatedConeCache
A HeightField is a collision shape that can be created from a grid structure, like an image...
uint32_t UInt32
Definition: Integer.h:40
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Definition: SetVector.h:37
PrimitiveCache(RenderManager *mgr)
Constructor.
agx::observer_ptr< agxCollide::Space > m_space
With this class you can attach an ObserverFrame object relative to a RigidBody.
Definition: ObserverFrame.h:43
agx::observer_ptr< RenderManager > m_mgr
RenderProxy::RenderMode m_defaultRenderMode
Flags
Flags for specifying what is enabled in the debug rendering system.
Definition: RenderManager.h:58
PrimitiveCache< TextProxy > m_textCache