AGX Dynamics 2.41.3.0
Loading...
Searching...
No Matches
agxRender::RenderManager Class Reference

Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc. More...

#include <RenderManager.h>

+ Inheritance diagram for agxRender::RenderManager:

Classes

struct  CacheBase
 
class  PrimitiveCache
 Class for storing RenderProxies that are currently in use. More...
 
class  PrimitiveCache1
 Class for storing RenderProxies that are currently in use. More...
 

Public Types

typedef std::pair< const agx::ParticleSystem *, agxRender::RenderProxyRefConstParticleSystemPtrRenderProxyPtrPair
 
typedef agx::Vector< ConstParticleSystemPtrRenderProxyPtrPairParticleSystemProxyContainer
 

Public Member Functions

 RenderManager (agxSDK::Simulation *sim)
 Constructor.
 
BoxProxyacquireBox (const agx::Vec3 &halfExtents)
 Create and return a new proxy boxy from the Proxy factory.
 
CapsuleProxyacquireCapsule (const agx::Vec3 &begin, const agx::Vec3 &end, float radius)
 Create and return a new proxy Capsule from the Proxy factory.
 
CapsuleProxyacquireCapsule (float radius, float height)
 Create and return a new proxy Capsule from the Proxy factory.
 
ConeProxyacquireCone (const agx::Vec3 &p1, const agx::Vec3 &p2, float radius)
 Create and return a new proxy Cone from the Proxy factory.
 
agxRender::ContactsProxyacquireContacts (const agxCollide::GeometryContactPtrVector &contacts, float scale)
 Create and return a new proxy Contact from the Proxy factory.
 
CylinderProxyacquireCylinder (const agx::Vec3 &begin, const agx::Vec3 &end, float radius)
 Create and return a new proxy Cylinder from the Proxy factory.
 
CylinderProxyacquireCylinder (float radius, float height)
 Create and return a new proxy Cylinder from the Proxy factory.
 
void acquireGeometry (const agxCollide::Geometry *geometry, const agx::Vec3 &color)
 
HollowConeProxyacquireHollowCone (const agx::Vec3 &p1, const agx::Vec3 &p2, float topRadius, float bottomRadius, float thickness)
 Create and return a new HollowConeProxy from the Proxy factory.
 
HollowCylinderProxyacquireHollowCylinder (float radius, float height, float thickness)
 Create and return a new proxy HollowCylinder from the Proxy factory.
 
LineProxyacquireLine (const agx::Vec3 &p1, const agx::Vec3 &p2)
 Create and return a new proxy Line from the Proxy factory.
 
PlaneProxyacquirePlane (const agx::Vec3 &normal, agx::Real distance)
 
agxRender::RigidBodyBatchRenderProxyacquireRigidBodies (const agx::RigidBodyPtrSetVector *enabledBodies, float scale)
 Create and return a new proxy rigid body batch from the Proxy factory.
 
SphereProxyacquireSphere (float radius)
 Create and return a new proxy sphere from the Proxy factory.
 
TextProxyacquireText (const agx::String &text, const agx::Vec3 &pos, float size=1)
 Create and return a new text sphere from the Proxy factory.
 
TruncatedConeProxyacquireTruncatedCone (const agx::Vec3 &p1, const agx::Vec3 &p2, float topRadius, float bottomRadius)
 Create and return a new proxy TruncatedCone from the Proxy factory.
 
agxRender::WireRenderProxyacquireWire (float radius, const agx::Vec3 &color)
 Create and return a new proxy wire from the proxy factory.
 
void addRenderable (Renderable *renderable)
 Add custom render object.
 
void clear (bool clearText=true, bool clearGlobalProxies=true)
 Clear all acquired RenderProxy.
 
void disableFlags (unsigned int flags)
 Disable all rendering flags specified in flags.
 
void enableFlags (unsigned int flags)
 Enable all rendering flags specified in flags.
 
RenderProxyfindShapeProxy (const agxCollide::Shape *shape)
 Try to locate a RenderProxy which is associated (already added) for the specified shape.
 
float getAlpha () const
 
bool getEnable () const
 
RenderProxyFactorygetProxyFactory ()
 
float getScaleFactor () const
 
agxSDK::SimulationgetSimulation ()
 
bool hasRenderable (Renderable *renderable) const
 
bool isEnabled () const
 
bool isEnabledFlags (unsigned int flags) const
 
bool removeRenderable (Renderable *renderable)
 Remove custom render object renderable.
 
void setAlpha (float alpha)
 Loop over all proxies and set alpha value to the specified value, also sets the new default alpha value.
 
void setDefaultRenderMode (RenderProxy::RenderMode mode)
 Set the new default render mode for all RenderProxies activated after this call.
 
void setEnable (bool flag)
 Enable/disable the whole rendering system.
 
void setFlags (unsigned int flags)
 Set the render flags.
 
void setProxyFactory (RenderProxyFactory *factory)
 Associate a new factory for creating RenderProxy's on request from the RenderManager.
 
void setScaleFactor (float scaleFactor=1.0f)
 Set the scale of the debug rendering of contacts and center of mass, it will not affect already created/rendered objects, only new, if you want the scale to affect all objects, call setEnable(false), setEnable(true) Default is 1.0 which corresponds to a rendering which suits objects of size 1m or larger...
 
void update ()
 Updates a new state for the rendering, acquires renderable objects for shapes, text etc.
 
void updateAllProxies (agxRender::RenderProxy::EventType eventType)
 Fires event given eventType for all proxies.
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referencedoperator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 

Protected Types

typedef agx::Vector< CacheBase * > CacheVector
 
typedef agx::Vector< RenderableRefRenderableRefVector
 
typedef agx::HashVector< agx::UInt32, agx::ref_ptr< RenderProxy > > RenderProxyHashVector
 
typedef agx::Vector< agx::ref_ptr< agxRender::RenderProxy > > RenderProxyRefContainer
 

Protected Member Functions

virtual ~RenderManager ()
 Destructor.
 
RenderProxyadd (agxCollide::Shape *shape, const agxCollide::Geometry *geometry, const agx::Vec3 &color=agx::Vec3(-1, 0, 0), bool addToProxies=true)
 Add a shape to the set of active shape proxies.
 
void add (const agx::ParticleSystem *particleSystem)
 
void add (const agxCollide::Geometry *geometry, const agx::Vec3 &color=agx::Vec3(-1, 0, 0), bool addToProxies=true)
 Add a geometry (and its shapes) to the set of active shape proxies.
 
void addAllGeometries ()
 Go through space and add all geometries to the set of shapes that should be rendered.
 
void clearShapeProxies ()
 Remove all shape proxies.
 
void flush ()
 Based on the number of used RenderProxy (for each type), reduce the cache down to that size.
 
GraphgetGraph ()
 
void remove (const agx::ParticleSystem *particleSystem)
 
void remove (const agxCollide::Geometry *geometry)
 Remove a Geometry (and its shapes) from the set of shapes that should be rendered.
 
void remove (const agxCollide::Shape *shape)
 Remove a Shape from the set of shapes that should be rendered.
 
void renderAABBTrees (RenderProxy *proxy)
 Render AABB tree for the specified proxy.
 
void renderBoundingVolume (const agxCollide::Geometry *geometry)
 Render bounding volume for the geom.
 
void renderObserverFrame (const agx::ObserverFrame *observerFrame)
 Render an ObserverFrame.
 
void setSpace (agxCollide::Space *space)
 Associate a new space with this RenderManager, used by agxSDK::Simulation.
 
void updateAABBProxies ()
 Update all AABB (for geometries) proxies (boxes)
 
void updateBodyProxies (agxData::EntityStorage *islandStorage=nullptr)
 Go through all bodies and acquire proxies for them.
 
void updateConstraintProxies ()
 Update all constraints (call render)
 
void updateContactProxies ()
 acquire proxies for contacts
 
void updateGraphs ()
 Update the graphs.
 
void updateObserverFrames ()
 Update all observer frames.
 
void updateParticleContactProxies ()
 
void updateParticleGeometryContactProxies ()
 
void updateParticleSystemProxies ()
 Update particleSystems.
 
void updateProxy (RenderProxy *proxy, agxData::EntityStorage *islandStorage=nullptr)
 Update size, color and transform.
 
void updateRenderables ()
 Call render for all Renderables.
 
void updateShapeProxies (agxData::EntityStorage *islandStorage=nullptr)
 Update (transform and color) for all shapes.
 
void updateText ()
 Update only text proxies.
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Protected Attributes

float m_alpha
 
PrimitiveCache1< BoxProxy, agx::Vec3m_boxCache
 
CacheVector m_cacheVector
 
PrimitiveCache< CapsuleProxym_capsuleCache
 
PrimitiveCache< ConeProxym_coneCache
 
PrimitiveCache1< ContactsProxy, agxCollide::GeometryContactPtrVectorm_contactsCache
 
float m_ContactsProxySize
 
PrimitiveCache< CylinderProxym_cylinderCache
 
RenderProxy::RenderMode m_defaultRenderMode
 
bool m_enable
 
agx::ref_ptr< RenderProxyFactorym_factory
 
agx::UInt32 m_flags
 
RenderProxyRefContainer m_globalProxies
 E.g., wires that hold their proxy (i.e., not doing acquire to fetch their render proxy).
 
agxRender::GraphRef m_graph
 
PrimitiveCache< HollowConeProxym_hollowConeCache
 
PrimitiveCache< HollowCylinderProxym_hollowCylinderCache
 
PrimitiveCache< LineProxym_lineCache
 
agx::ref_ptr< SpaceListenerm_listener
 
agxData::ValueRef m_particleContactBound
 
agxData::BufferRef m_particleContactRadiusBuffer
 
RenderProxyRef m_particleContactRenderProxy
 
agxData::ValueRef m_particleGeometryContactBound
 
agxData::BufferRef m_particleGeometryContactRadiusBuffer
 
RenderProxyRef m_particleGeometryContactRenderProxy
 
ParticleSystemProxyContainer m_particleSystems
 
PrimitiveCache< PlaneProxym_planeCache
 
RenderProxyHashVector m_proxies
 
PrimitiveCache1< RigidBodyBatchRenderProxy, const agx::RigidBodyPtrSetVector * > m_rbCache
 
RenderableRefVector m_renderables
 
float m_scaleFactor
 
agxSDK::Simulationm_simulation
 
PrimitiveCache1< SphereProxy, float > m_sphereCache
 
PrimitiveCache< TextProxym_textCache
 
PrimitiveCache< TruncatedConeProxym_truncatedConeCache
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandlergetDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 

Detailed Description

Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc.

The state (what to be rendered can be set using methods enableFlags/disableFlags/setFlags. The RenderManager needs a RenderProxyFactory, implemented according to the design pattern 'Factory'. It will be responsible for creating the renderable objects which the RenderManager requests. The implementation of the RenderProxyFactory is up to the user, depending on rendering system.

The RenderManager has a cache of previously created RenderProxy, so it will try to reuse these between frames.

Definition at line 105 of file RenderManager.h.

Member Typedef Documentation

◆ CacheVector

Definition at line 606 of file RenderManager.h.

◆ ConstParticleSystemPtrRenderProxyPtrPair

◆ ParticleSystemProxyContainer

◆ RenderableRefVector

◆ RenderProxyHashVector

◆ RenderProxyRefContainer

Constructor & Destructor Documentation

◆ RenderManager()

agxRender::RenderManager::RenderManager ( agxSDK::Simulation sim)

Constructor.

Parameters
sim- The associated simulation for which this RenderManager exists.

◆ ~RenderManager()

virtual agxRender::RenderManager::~RenderManager ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ acquireBox()

BoxProxy * agxRender::RenderManager::acquireBox ( const agx::Vec3 halfExtents)

Create and return a new proxy boxy from the Proxy factory.

Parameters
halfExtents- The size of the box
Returns
a pointer to a new BoxProxy with specified size

◆ acquireCapsule() [1/2]

CapsuleProxy * agxRender::RenderManager::acquireCapsule ( const agx::Vec3 begin,
const agx::Vec3 end,
float  radius 
)

Create and return a new proxy Capsule from the Proxy factory.

Parameters
begin- The start point in WORLD coordinate system for a capsule
end- The end point in WORLD coordinate system for a capsule
radius- The radius of a capsule
Returns
a pointer to a new CapsuleProxy

◆ acquireCapsule() [2/2]

CapsuleProxy * agxRender::RenderManager::acquireCapsule ( float  radius,
float  height 
)

Create and return a new proxy Capsule from the Proxy factory.

Parameters
radius- The radius of a capsule
height- The height of a capsule
Returns
a pointer to a new CapsuleProxy

◆ acquireCone()

ConeProxy * agxRender::RenderManager::acquireCone ( const agx::Vec3 p1,
const agx::Vec3 p2,
float  radius 
)

Create and return a new proxy Cone from the Proxy factory.

Parameters
p1- The start point in WORLD coordinate system for a cone
p2- The end point in WORLD coordinate system for a cone
radius- The top radius of a cone
Returns
a pointer to a new ConeProxy

◆ acquireContacts()

agxRender::ContactsProxy * agxRender::RenderManager::acquireContacts ( const agxCollide::GeometryContactPtrVector contacts,
float  scale 
)

Create and return a new proxy Contact from the Proxy factory.

Parameters
contacts- Vector with all contacts that should be rendered
scale- Scale that can be used for scaling the size of the rendered contacts
Returns
a pointer to a new ContactsProxy

◆ acquireCylinder() [1/2]

CylinderProxy * agxRender::RenderManager::acquireCylinder ( const agx::Vec3 begin,
const agx::Vec3 end,
float  radius 
)

Create and return a new proxy Cylinder from the Proxy factory.

Parameters
begin- The start point in WORLD coordinate system for a cylinder
end- The end point in WORLD coordinate system for a cylinder
radius- The radius of a cylinder
Returns
a pointer to a new CylinderProxy

◆ acquireCylinder() [2/2]

CylinderProxy * agxRender::RenderManager::acquireCylinder ( float  radius,
float  height 
)

Create and return a new proxy Cylinder from the Proxy factory.

Parameters
radius- The radius of a cylinder
height- The height of a cylinder
Returns
a pointer to a new CylinderProxy

◆ acquireGeometry()

void agxRender::RenderManager::acquireGeometry ( const agxCollide::Geometry geometry,
const agx::Vec3 color 
)

◆ acquireHollowCone()

HollowConeProxy * agxRender::RenderManager::acquireHollowCone ( const agx::Vec3 p1,
const agx::Vec3 p2,
float  topRadius,
float  bottomRadius,
float  thickness 
)

Create and return a new HollowConeProxy from the Proxy factory.

Parameters
p1- The start point in WORLD coordinate system for a cone
p2- The end point in WORLD coordinate system for a cone
topRadius- The top radius of a cone (at p1)
bottomRadius- The bottom radius for the cone (at p2)
thickness- The wall thickness
Returns
a pointer to a new ConeProxy

◆ acquireHollowCylinder()

HollowCylinderProxy * agxRender::RenderManager::acquireHollowCylinder ( float  radius,
float  height,
float  thickness 
)

Create and return a new proxy HollowCylinder from the Proxy factory.

Parameters
radius- The radius of a cylinder
height- The height of a cylinder
Returns
a pointer to a new HollowCylinderProxy

◆ acquireLine()

LineProxy * agxRender::RenderManager::acquireLine ( const agx::Vec3 p1,
const agx::Vec3 p2 
)

Create and return a new proxy Line from the Proxy factory.

Parameters
p1,p2- Start, end points in WORLD coordinate system
Returns
a pointer to a new LineProxy

◆ acquirePlane()

PlaneProxy * agxRender::RenderManager::acquirePlane ( const agx::Vec3 normal,
agx::Real  distance 
)
Parameters
normal- The normal of a plane
distance- The scalar part of the plane
Returns
a pointer to a new PlaneProxy

◆ acquireRigidBodies()

agxRender::RigidBodyBatchRenderProxy * agxRender::RenderManager::acquireRigidBodies ( const agx::RigidBodyPtrSetVector enabledBodies,
float  scale 
)

Create and return a new proxy rigid body batch from the Proxy factory.

Parameters
enabledBodies- container with enabled bodies
scale- scale that can be used for scaling the size of the rendered bodies
Returns
a pointer to a new rigid body batch render proxy

◆ acquireSphere()

SphereProxy * agxRender::RenderManager::acquireSphere ( float  radius)

Create and return a new proxy sphere from the Proxy factory.

Parameters
radius- The radius of the new sphere
Returns
a pointer to a new SphereProxy with specified radius

◆ acquireText()

TextProxy * agxRender::RenderManager::acquireText ( const agx::String text,
const agx::Vec3 pos,
float  size = 1 
)

Create and return a new text sphere from the Proxy factory.

Parameters
text- The text
pos- Position of the text. Currently only x,y is used.
size- Size of the text. Used to scale the text.
Returns
a pointer to a new TextProxy

◆ acquireTruncatedCone()

TruncatedConeProxy * agxRender::RenderManager::acquireTruncatedCone ( const agx::Vec3 p1,
const agx::Vec3 p2,
float  topRadius,
float  bottomRadius 
)

Create and return a new proxy TruncatedCone from the Proxy factory.

Parameters
p1- The start point in WORLD coordinate system for a cone
p2- The end point in WORLD coordinate system for a cone
topRadius- The top radius of a cone (at p1)
bottomRadius- The bottom radius for the cone (at p2)
Returns
a pointer to a new ConeProxy

◆ acquireWire()

agxRender::WireRenderProxy * agxRender::RenderManager::acquireWire ( float  radius,
const agx::Vec3 color 
)

Create and return a new proxy wire from the proxy factory.

Parameters
radius- global radius of this wire
color- color of this wire

◆ add() [1/3]

RenderProxy * agxRender::RenderManager::add ( agxCollide::Shape shape,
const agxCollide::Geometry geometry,
const agx::Vec3 color = agx::Vec3(-1, 0, 0),
bool  addToProxies = true 
)
protected

Add a shape to the set of active shape proxies.

Parameters
shape- The shape which should be rendered
geometry- The Geometry for the shape
color- the color which will be used for the geometry. The default value x=-1, is to indicate that its the RenderManager which should set the color
addToProxies- If true (default), it will be added to the Shape proxies and will be updated when shape transforms. If not, it will be rendered only once.

◆ add() [2/3]

void agxRender::RenderManager::add ( const agx::ParticleSystem particleSystem)
protected

◆ add() [3/3]

void agxRender::RenderManager::add ( const agxCollide::Geometry geometry,
const agx::Vec3 color = agx::Vec3(-1, 0, 0),
bool  addToProxies = true 
)
protected

Add a geometry (and its shapes) to the set of active shape proxies.

Parameters
geometry- The geometry which should be rendered
color- the color which will be used for the geometry. The default value x=-1, is to indicate that its the RenderManager which should set the color
addToProxies- If true (default), it will be added to the Shape proxies and will be updated when shape transforms. If not, it will be rendered only once.

◆ addAllGeometries()

void agxRender::RenderManager::addAllGeometries ( )
protected

Go through space and add all geometries to the set of shapes that should be rendered.

◆ addRenderable()

void agxRender::RenderManager::addRenderable ( Renderable renderable)

Add custom render object.

Parameters
renderable- custom render object derived from the base class Renderable.

◆ clear()

void agxRender::RenderManager::clear ( bool  clearText = true,
bool  clearGlobalProxies = true 
)

Clear all acquired RenderProxy.

Will call atRemove for each Proxy that is removed.

Parameters
clearText- true to clear text proxies (Default: true)
clearGlobalProxies- true to clear global proxies that are not part of a cache (Default: true)

◆ clearShapeProxies()

void agxRender::RenderManager::clearShapeProxies ( )
protected

Remove all shape proxies.

◆ disableFlags()

void agxRender::RenderManager::disableFlags ( unsigned int  flags)

Disable all rendering flags specified in flags.

Parameters
flags- The rendering flags to be disabled

◆ enableFlags()

void agxRender::RenderManager::enableFlags ( unsigned int  flags)

Enable all rendering flags specified in flags.

Parameters
flags- The rendering flags to be enabled

◆ findShapeProxy()

RenderProxy * agxRender::RenderManager::findShapeProxy ( const agxCollide::Shape shape)

Try to locate a RenderProxy which is associated (already added) for the specified shape.

Parameters
shape- A pointer to a shape, for which a RenderProxy should be found.
Returns
a pointer to a RenderProxy associated to the specified shape. nullptr if no matching proxy is found.

◆ flush()

void agxRender::RenderManager::flush ( )
protected

Based on the number of used RenderProxy (for each type), reduce the cache down to that size.

Remove any outstanding ones.

◆ getAlpha()

float agxRender::RenderManager::getAlpha ( ) const
inline
Returns
the overall, default alpha value

Definition at line 685 of file RenderManager.h.

References m_alpha.

◆ getEnable()

bool agxRender::RenderManager::getEnable ( ) const
inline
Returns
true if rendering is enabled.

Definition at line 679 of file RenderManager.h.

References m_enable.

Referenced by isEnabled().

◆ getGraph()

Graph * agxRender::RenderManager::getGraph ( )
protected
Returns
a pointer to the Graph, used by agxSDK::Simulation

◆ getProxyFactory()

RenderProxyFactory * agxRender::RenderManager::getProxyFactory ( )
Returns
a pointer to the associated RenderProxyFactory

◆ getScaleFactor()

float agxRender::RenderManager::getScaleFactor ( ) const
Returns
the scale factor used for rendering contacts and center of mass.

◆ getSimulation()

agxSDK::Simulation * agxRender::RenderManager::getSimulation ( )
inline

Definition at line 376 of file RenderManager.h.

◆ hasRenderable()

bool agxRender::RenderManager::hasRenderable ( Renderable renderable) const
Returns
true if renderable is added

◆ isEnabled()

bool agxRender::RenderManager::isEnabled ( ) const
inline
Returns
true if rendering is enabled.

Definition at line 691 of file RenderManager.h.

References getEnable().

◆ isEnabledFlags()

bool agxRender::RenderManager::isEnabledFlags ( unsigned int  flags) const
Returns
true if all rendering flags specified in flags are enabled.

◆ remove() [1/3]

void agxRender::RenderManager::remove ( const agx::ParticleSystem particleSystem)
protected

◆ remove() [2/3]

void agxRender::RenderManager::remove ( const agxCollide::Geometry geometry)
protected

Remove a Geometry (and its shapes) from the set of shapes that should be rendered.

Parameters
geometry- The Geometry that should be removed

◆ remove() [3/3]

void agxRender::RenderManager::remove ( const agxCollide::Shape shape)
protected

Remove a Shape from the set of shapes that should be rendered.

Parameters
shape- The shape that should be removed

◆ removeRenderable()

bool agxRender::RenderManager::removeRenderable ( Renderable renderable)

Remove custom render object renderable.

Returns
true if remove of the object were successful

◆ renderAABBTrees()

void agxRender::RenderManager::renderAABBTrees ( RenderProxy proxy)
protected

Render AABB tree for the specified proxy.

◆ renderBoundingVolume()

void agxRender::RenderManager::renderBoundingVolume ( const agxCollide::Geometry geometry)
protected

Render bounding volume for the geom.

◆ renderObserverFrame()

void agxRender::RenderManager::renderObserverFrame ( const agx::ObserverFrame observerFrame)
protected

Render an ObserverFrame.

◆ setAlpha()

void agxRender::RenderManager::setAlpha ( float  alpha)

Loop over all proxies and set alpha value to the specified value, also sets the new default alpha value.

Parameters
alpha- the new alpha value

◆ setDefaultRenderMode()

void agxRender::RenderManager::setDefaultRenderMode ( RenderProxy::RenderMode  mode)

Set the new default render mode for all RenderProxies activated after this call.

◆ setEnable()

void agxRender::RenderManager::setEnable ( bool  flag)

Enable/disable the whole rendering system.

Rendering of shapes, constraints and Renderables is disabled.

Parameters
flag- if true, the rendering is enabled, otherwise disabled

◆ setFlags()

void agxRender::RenderManager::setFlags ( unsigned int  flags)

Set the render flags.

◆ setProxyFactory()

void agxRender::RenderManager::setProxyFactory ( RenderProxyFactory factory)

Associate a new factory for creating RenderProxy's on request from the RenderManager.

Parameters
factory- The new render proxy factory

◆ setScaleFactor()

void agxRender::RenderManager::setScaleFactor ( float  scaleFactor = 1.0f)

Set the scale of the debug rendering of contacts and center of mass, it will not affect already created/rendered objects, only new, if you want the scale to affect all objects, call setEnable(false), setEnable(true) Default is 1.0 which corresponds to a rendering which suits objects of size 1m or larger...

◆ setSpace()

void agxRender::RenderManager::setSpace ( agxCollide::Space space)
protected

Associate a new space with this RenderManager, used by agxSDK::Simulation.

◆ update()

void agxRender::RenderManager::update ( )

Updates a new state for the rendering, acquires renderable objects for shapes, text etc.

Will dispatch create calls to the associated RenderProxyFactory.

◆ updateAABBProxies()

void agxRender::RenderManager::updateAABBProxies ( )
protected

Update all AABB (for geometries) proxies (boxes)

◆ updateAllProxies()

void agxRender::RenderManager::updateAllProxies ( agxRender::RenderProxy::EventType  eventType)

Fires event given eventType for all proxies.

Parameters
eventType- event type to fire

◆ updateBodyProxies()

void agxRender::RenderManager::updateBodyProxies ( agxData::EntityStorage islandStorage = nullptr)
protected

Go through all bodies and acquire proxies for them.

◆ updateConstraintProxies()

void agxRender::RenderManager::updateConstraintProxies ( )
protected

Update all constraints (call render)

◆ updateContactProxies()

void agxRender::RenderManager::updateContactProxies ( )
protected

acquire proxies for contacts

◆ updateGraphs()

void agxRender::RenderManager::updateGraphs ( )
protected

Update the graphs.

◆ updateObserverFrames()

void agxRender::RenderManager::updateObserverFrames ( )
protected

Update all observer frames.

◆ updateParticleContactProxies()

void agxRender::RenderManager::updateParticleContactProxies ( )
protected

◆ updateParticleGeometryContactProxies()

void agxRender::RenderManager::updateParticleGeometryContactProxies ( )
protected

◆ updateParticleSystemProxies()

void agxRender::RenderManager::updateParticleSystemProxies ( )
protected

Update particleSystems.

◆ updateProxy()

void agxRender::RenderManager::updateProxy ( RenderProxy proxy,
agxData::EntityStorage islandStorage = nullptr 
)
protected

Update size, color and transform.

◆ updateRenderables()

void agxRender::RenderManager::updateRenderables ( )
protected

Call render for all Renderables.

◆ updateShapeProxies()

void agxRender::RenderManager::updateShapeProxies ( agxData::EntityStorage islandStorage = nullptr)
protected

Update (transform and color) for all shapes.

◆ updateText()

void agxRender::RenderManager::updateText ( )
protected

Update only text proxies.

Member Data Documentation

◆ m_alpha

float agxRender::RenderManager::m_alpha
protected

Definition at line 494 of file RenderManager.h.

Referenced by getAlpha().

◆ m_boxCache

PrimitiveCache1<BoxProxy, agx::Vec3> agxRender::RenderManager::m_boxCache
protected

Definition at line 618 of file RenderManager.h.

◆ m_cacheVector

CacheVector agxRender::RenderManager::m_cacheVector
protected

Definition at line 607 of file RenderManager.h.

◆ m_capsuleCache

PrimitiveCache<CapsuleProxy> agxRender::RenderManager::m_capsuleCache
protected

Definition at line 611 of file RenderManager.h.

◆ m_coneCache

PrimitiveCache<ConeProxy> agxRender::RenderManager::m_coneCache
protected

Definition at line 614 of file RenderManager.h.

◆ m_contactsCache

PrimitiveCache1<ContactsProxy, agxCollide::GeometryContactPtrVector> agxRender::RenderManager::m_contactsCache
protected

Definition at line 620 of file RenderManager.h.

◆ m_ContactsProxySize

float agxRender::RenderManager::m_ContactsProxySize
protected

Definition at line 498 of file RenderManager.h.

◆ m_cylinderCache

PrimitiveCache<CylinderProxy> agxRender::RenderManager::m_cylinderCache
protected

Definition at line 612 of file RenderManager.h.

◆ m_defaultRenderMode

RenderProxy::RenderMode agxRender::RenderManager::m_defaultRenderMode
protected

Definition at line 630 of file RenderManager.h.

◆ m_enable

bool agxRender::RenderManager::m_enable
protected

Definition at line 493 of file RenderManager.h.

Referenced by getEnable().

◆ m_factory

agx::ref_ptr<RenderProxyFactory> agxRender::RenderManager::m_factory
protected

Definition at line 492 of file RenderManager.h.

◆ m_flags

agx::UInt32 agxRender::RenderManager::m_flags
protected

Definition at line 625 of file RenderManager.h.

◆ m_globalProxies

RenderProxyRefContainer agxRender::RenderManager::m_globalProxies
protected

E.g., wires that hold their proxy (i.e., not doing acquire to fetch their render proxy).

Definition at line 629 of file RenderManager.h.

◆ m_graph

agxRender::GraphRef agxRender::RenderManager::m_graph
protected

Definition at line 496 of file RenderManager.h.

◆ m_hollowConeCache

PrimitiveCache<HollowConeProxy> agxRender::RenderManager::m_hollowConeCache
protected

Definition at line 616 of file RenderManager.h.

◆ m_hollowCylinderCache

PrimitiveCache<HollowCylinderProxy> agxRender::RenderManager::m_hollowCylinderCache
protected

Definition at line 613 of file RenderManager.h.

◆ m_lineCache

PrimitiveCache<LineProxy> agxRender::RenderManager::m_lineCache
protected

Definition at line 619 of file RenderManager.h.

◆ m_listener

agx::ref_ptr<SpaceListener> agxRender::RenderManager::m_listener
protected

Definition at line 623 of file RenderManager.h.

◆ m_particleContactBound

agxData::ValueRef agxRender::RenderManager::m_particleContactBound
protected

Definition at line 634 of file RenderManager.h.

◆ m_particleContactRadiusBuffer

agxData::BufferRef agxRender::RenderManager::m_particleContactRadiusBuffer
protected

Definition at line 632 of file RenderManager.h.

◆ m_particleContactRenderProxy

RenderProxyRef agxRender::RenderManager::m_particleContactRenderProxy
protected

Definition at line 636 of file RenderManager.h.

◆ m_particleGeometryContactBound

agxData::ValueRef agxRender::RenderManager::m_particleGeometryContactBound
protected

Definition at line 635 of file RenderManager.h.

◆ m_particleGeometryContactRadiusBuffer

agxData::BufferRef agxRender::RenderManager::m_particleGeometryContactRadiusBuffer
protected

Definition at line 633 of file RenderManager.h.

◆ m_particleGeometryContactRenderProxy

RenderProxyRef agxRender::RenderManager::m_particleGeometryContactRenderProxy
protected

Definition at line 637 of file RenderManager.h.

◆ m_particleSystems

ParticleSystemProxyContainer agxRender::RenderManager::m_particleSystems
protected

Definition at line 501 of file RenderManager.h.

◆ m_planeCache

PrimitiveCache<PlaneProxy> agxRender::RenderManager::m_planeCache
protected

Definition at line 610 of file RenderManager.h.

◆ m_proxies

RenderProxyHashVector agxRender::RenderManager::m_proxies
protected

Definition at line 491 of file RenderManager.h.

◆ m_rbCache

PrimitiveCache1<RigidBodyBatchRenderProxy, const agx::RigidBodyPtrSetVector*> agxRender::RenderManager::m_rbCache
protected

Definition at line 621 of file RenderManager.h.

◆ m_renderables

RenderableRefVector agxRender::RenderManager::m_renderables
protected

Definition at line 627 of file RenderManager.h.

◆ m_scaleFactor

float agxRender::RenderManager::m_scaleFactor
protected

Definition at line 499 of file RenderManager.h.

◆ m_simulation

agxSDK::Simulation* agxRender::RenderManager::m_simulation
protected

Definition at line 495 of file RenderManager.h.

◆ m_sphereCache

PrimitiveCache1<SphereProxy, float> agxRender::RenderManager::m_sphereCache
protected

Definition at line 617 of file RenderManager.h.

◆ m_textCache

PrimitiveCache<TextProxy> agxRender::RenderManager::m_textCache
protected

Definition at line 609 of file RenderManager.h.

◆ m_truncatedConeCache

PrimitiveCache<TruncatedConeProxy> agxRender::RenderManager::m_truncatedConeCache
protected

Definition at line 615 of file RenderManager.h.


The documentation for this class was generated from the following file: