AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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::RenderProxyRef > 
ConstParticleSystemPtrRenderProxyPtrPair
 
typedef agx::Vector
< ConstParticleSystemPtrRenderProxyPtrPair > 
ParticleSystemProxyContainer
 

Public Member Functions

 RenderManager (agxSDK::Simulation *sim)
 Constructor. More...
 
BoxProxy * acquireBox (const agx::Vec3 &halfExtents)
 Create and return a new proxy boxy from the Proxy factory. More...
 
CapsuleProxy * acquireCapsule (float radius, float height)
 Create and return a new proxy Capsule from the Proxy factory. More...
 
CapsuleProxy * acquireCapsule (const agx::Vec3 &begin, const agx::Vec3 &end, float radius)
 Create and return a new proxy Capsule from the Proxy factory. More...
 
ConeProxy * acquireCone (const agx::Vec3 &p1, const agx::Vec3 &p2, float radius)
 Create and return a new proxy Cone from the Proxy factory. More...
 
ContactsProxy * acquireContacts (const agxCollide::GeometryContactPtrVector &contacts, float scale)
 Create and return a new proxy Contact from the Proxy factory. More...
 
CylinderProxy * acquireCylinder (float radius, float height)
 Create and return a new proxy Cylinder from the Proxy factory. More...
 
CylinderProxy * acquireCylinder (const agx::Vec3 &begin, const agx::Vec3 &end, float radius)
 Create and return a new proxy Cylinder from the Proxy factory. More...
 
void acquireGeometry (const agxCollide::Geometry *geometry, const agx::Vec3 &color)
 
HollowCylinderProxy * acquireHollowCylinder (float radius, float height, float thickness)
 Create and return a new proxy HollowCylinder from the Proxy factory. More...
 
HollowTruncatedConeProxy * acquireHollowTruncatedCone (const agx::Vec3 &p1, const agx::Vec3 &p2, float topRadius, float bottomRadius, float thickness)
 Create and return a new proxy TruncatedCone from the Proxy factory. More...
 
LineProxy * acquireLine (const agx::Vec3 &p1, const agx::Vec3 &p2)
 Create and return a new proxy Line from the Proxy factory. More...
 
PlaneProxy * acquirePlane (const agx::Vec3 &normal, agx::Real distance)
 
RigidBodyBatchRenderProxy * acquireRigidBodies (const agx::RigidBodyPtrSetVector *enabledBodies, float scale)
 Create and return a new proxy rigid body batch from the Proxy factory. More...
 
SphereProxy * acquireSphere (float radius)
 Create and return a new proxy sphere from the Proxy factory. More...
 
TextProxy * acquireText (const agx::String &text, const agx::Vec3 &pos)
 Create and return a new text sphere from the Proxy factory. More...
 
TruncatedConeProxy * acquireTruncatedCone (const agx::Vec3 &p1, const agx::Vec3 &p2, float topRadius, float bottomRadius)
 Create and return a new proxy TruncatedCone from the Proxy factory. More...
 
WireRenderProxy * acquireWire (float radius, const agx::Vec3 &color)
 Create and return a new proxy wire from the proxy factory. More...
 
void addRenderable (Renderable *renderable)
 Add custom render object. More...
 
template<typename T >
T * as ()
 Subclass casting. More...
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match. More...
 
template<typename T >
const T * asSafe () const
 
void clear (bool clearText=true, bool clearGlobalProxies=true)
 Clear all acquired RenderProxy. More...
 
void disableFlags (unsigned int flags)
 Disable all rendering flags specified in flags. More...
 
void enableFlags (unsigned int flags)
 Enable all rendering flags specified in flags. More...
 
RenderProxy * findShapeProxy (const agxCollide::Shape *shape)
 Try to locate a RenderProxy which is associated (already added) for the specified shape. More...
 
float getAlpha () const
 
bool getEnable () const
 
RenderProxyFactory * getProxyFactory ()
 
int getReferenceCount () const
 
float getScaleFactor () const
 
bool hasRenderable (Renderable *renderable) const
 
template<typename T >
bool is () const
 Subclass test. More...
 
bool isEnabled () const
 
bool isEnabledFlags (unsigned int flags) const
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
bool removeRenderable (Renderable *renderable)
 Remove custom render object renderable. More...
 
void setAlpha (float alpha)
 Loop over all proxies and set alpha value to the specified value, also sets the new default alpha value. More...
 
void setDefaultRenderMode (RenderProxy::RenderMode mode)
 Set the new default render mode for all RenderProxies activated after this call. More...
 
void setEnable (bool flag)
 Enable/disable the whole rendering system. More...
 
void setFlags (unsigned int flags)
 Set the render flags. More...
 
void setProxyFactory (RenderProxyFactory *factory)
 Associate a new factory for creating RenderProxy's on request from the RenderManager. More...
 
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... More...
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void update ()
 Updates a new state for the rendering, acquires renderable objects for shapes, text etc. More...
 
void updateAllProxies (agxRender::RenderProxy::EventType eventType)
 Fires event given eventType for all proxies. More...
 

Static Public Member Functions

template<typename T >
static bool ValidateCast (const Referenced *object)
 

Protected Types

typedef agx::Vector< CacheBase * > CacheVector
 
typedef agx::Vector
< RenderableRef > 
RenderableRefVector
 
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. More...
 
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. More...
 
RenderProxy * add (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. More...
 
void addAllGeometries ()
 Go through space and add all geometries to the set of shapes that should be rendered. More...
 
void allocateObserverVector () const
 
void clearShapeProxies ()
 Remove all shape proxies. More...
 
void deleteUsingDeleteHandler () const
 
void flush ()
 Based on the number of used RenderProxy (for each type), reduce the cache down to that size. More...
 
Graph * getGraph ()
 
void remove (const agx::ParticleSystem *particleSystem)
 
void remove (const agxCollide::Shape *shape)
 Remove a Shape from the set of shapes that should be rendered. More...
 
void remove (const agxCollide::Geometry *geometry)
 Remove a Geometry (and its shapes) from the set of shapes that should be rendered. More...
 
void renderAABBTrees (RenderProxy *proxy)
 Render AABB tree for the specified proxy. More...
 
void renderBoundingVolume (const agxCollide::Geometry *geometry)
 Render bounding volume for the geom. More...
 
void setSpace (agxCollide::Space *space)
 Associate a new space with this RenderManager, used by agxSDK::Simulation. More...
 
void updateAABBProxies ()
 Update all AABB (for geometries) proxies (boxes) More...
 
void updateBodyProxies (agxData::EntityStorage *islandStorage=nullptr)
 Go through all bodies and acquire proxies for them. More...
 
void updateConstraintProxies ()
 Update all constraints (call render) More...
 
void updateContactProxies ()
 acquire proxies for contacts More...
 
void updateGraphs ()
 Update the graphs. More...
 
void updateParticleContactProxies ()
 
void updateParticleGeometryContactProxies ()
 
void updateParticleSystemProxies ()
 Update particleSystems. More...
 
void updateProxy (RenderProxy *proxy, agxData::EntityStorage *islandStorage=nullptr)
 Update size, color and transform. More...
 
void updateRenderables ()
 Call render for all Renderables. More...
 
void updateShapeProxies (agxData::EntityStorage *islandStorage=nullptr)
 Update (transform and color) for all shapes. More...
 
void updateText ()
 Update only text proxies. More...
 

Static Protected Member Functions

static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More...
 

Protected Attributes

float m_alpha
 
PrimitiveCache1< BoxProxy,
agx::Vec3 > 
m_boxCache
 
CacheVector m_cacheVector
 
PrimitiveCache< CapsuleProxy > m_capsuleCache
 
PrimitiveCache< ConeProxy > m_coneCache
 
PrimitiveCache1< ContactsProxy,
agxCollide::GeometryContactPtrVector > 
m_contactsCache
 
float m_ContactsProxySize
 
PrimitiveCache< CylinderProxy > m_cylinderCache
 
RenderProxy::RenderMode m_defaultRenderMode
 
bool m_enable
 
agx::ref_ptr< RenderProxyFactory > m_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). More...
 
agxRender::GraphRef m_graph
 
PrimitiveCache
< HollowCylinderProxy > 
m_hollowCylinderCache
 
PrimitiveCache
< HollowTruncatedConeProxy > 
m_hollowTruncatedConeCache
 
PrimitiveCache< LineProxy > m_lineCache
 
agx::ref_ptr< SpaceListener > m_listener
 
Mutex m_mutex
 
ObserverContainer m_observers
 
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< PlaneProxy > m_planeCache
 
RenderProxyHashVector m_proxies
 
PrimitiveCache1
< RigidBodyBatchRenderProxy,
const
agx::RigidBodyPtrSetVector * > 
m_rbCache
 
AtomicValue m_refCount
 
RenderableRefVector m_renderables
 
float m_scaleFactor
 
agxSDK::Simulation * m_simulation
 
PrimitiveCache1< SphereProxy,
float > 
m_sphereCache
 
PrimitiveCache< TextProxy > m_textCache
 
PrimitiveCache
< TruncatedConeProxy > 
m_truncatedConeCache
 

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 110 of file RenderManager.h.

Member Typedef Documentation

Definition at line 601 of file RenderManager.h.

Constructor & Destructor Documentation

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

Constructor.

Parameters
sim- The associated simulation for which this RenderManager exists.
virtual agxRender::RenderManager::~RenderManager ( )
protectedvirtual

Destructor.

Member Function Documentation

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
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
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
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
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
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
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
void agxRender::RenderManager::acquireGeometry ( const agxCollide::Geometry *  geometry,
const agx::Vec3 &  color 
)
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
HollowTruncatedConeProxy* agxRender::RenderManager::acquireHollowTruncatedCone ( const agx::Vec3 &  p1,
const agx::Vec3 &  p2,
float  topRadius,
float  bottomRadius,
float  thickness 
)

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)
thickness- The wall thickness
Returns
a pointer to a new ConeProxy
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
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
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
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
TextProxy* agxRender::RenderManager::acquireText ( const agx::String &  text,
const agx::Vec3 &  pos 
)

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.
Returns
a pointer to a new TextProxy
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
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
void agxRender::RenderManager::add ( const agx::ParticleSystem *  particleSystem)
protected
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.
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.
void agxRender::RenderManager::addAllGeometries ( )
protected

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

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

Add custom render object.

Parameters
renderable- custom render object derived from the base class Renderable.
void agx::Referenced::allocateObserverVector ( ) const
protectedinherited
template<typename T >
T* agx::Referenced::as ( )
inherited

Subclass casting.

Template type must match actual type, dynamic_cast assertion will fail otherwise.

Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), and agx::InternalData::getOrCreate().

template<typename T >
const T* agx::Referenced::as ( ) const
inherited
template<typename T >
T* agx::Referenced::asSafe ( )
inherited

Safe subclass casting, return nullptr if template type does not match.

Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited
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)
void agxRender::RenderManager::clearShapeProxies ( )
protected

Remove all shape proxies.

void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited
void agxRender::RenderManager::disableFlags ( unsigned int  flags)

Disable all rendering flags specified in flags.

Parameters
flags- The rendering flags to be disabled
void agxRender::RenderManager::enableFlags ( unsigned int  flags)

Enable all rendering flags specified in flags.

Parameters
flags- The rendering flags to be enabled
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.
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.

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

Definition at line 831 of file RenderManager.h.

References m_alpha.

static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.
bool agxRender::RenderManager::getEnable ( ) const
inline
Returns
true if rendering is enabled.

Definition at line 825 of file RenderManager.h.

References m_enable.

Referenced by isEnabled().

Graph* agxRender::RenderManager::getGraph ( )
protected
Returns
a pointer to the Graph, used by agxSDK::Simulation
RenderProxyFactory* agxRender::RenderManager::getProxyFactory ( )
Returns
a pointer to the associated RenderProxyFactory
int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.
float agxRender::RenderManager::getScaleFactor ( ) const
Returns
the scale factor used for rendering contacts and center of mass.
bool agxRender::RenderManager::hasRenderable ( Renderable *  renderable) const
Returns
true if renderable is added
template<typename T >
bool agx::Referenced::is ( ) const
inherited
bool agxRender::RenderManager::isEnabled ( ) const
inline
Returns
true if rendering is enabled.

Definition at line 837 of file RenderManager.h.

References getEnable().

bool agxRender::RenderManager::isEnabledFlags ( unsigned int  flags) const
Returns
true if all rendering flags specified in flags are enabled.
void agx::Referenced::reference ( void *  ptr = nullptr) const
inherited

Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.

This method should be used with care, always balanced with the same number of calls to unreference.

Referenced by agxData::Val< UInt >::Val().

void agxRender::RenderManager::remove ( const agx::ParticleSystem *  particleSystem)
protected
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
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
bool agxRender::RenderManager::removeRenderable ( Renderable *  renderable)

Remove custom render object renderable.

Returns
true if remove of the object were successful
void agxRender::RenderManager::renderAABBTrees ( RenderProxy *  proxy)
protected

Render AABB tree for the specified proxy.

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

Render bounding volume for the geom.

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
void agxRender::RenderManager::setDefaultRenderMode ( RenderProxy::RenderMode  mode)

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

static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.

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
void agxRender::RenderManager::setFlags ( unsigned int  flags)

Set the render flags.

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
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...

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

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

void agx::Referenced::unreference ( void *  ptr = nullptr) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.

This method should be used with care, always balanced with the same number of calls to reference.

void agx::Referenced::unreference_nodelete ( ) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.

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.

void agxRender::RenderManager::updateAABBProxies ( )
protected

Update all AABB (for geometries) proxies (boxes)

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

Fires event given eventType for all proxies.

Parameters
eventType- event type to fire
void agxRender::RenderManager::updateBodyProxies ( agxData::EntityStorage *  islandStorage = nullptr)
protected

Go through all bodies and acquire proxies for them.

void agxRender::RenderManager::updateConstraintProxies ( )
protected

Update all constraints (call render)

void agxRender::RenderManager::updateContactProxies ( )
protected

acquire proxies for contacts

void agxRender::RenderManager::updateGraphs ( )
protected

Update the graphs.

void agxRender::RenderManager::updateParticleContactProxies ( )
protected
void agxRender::RenderManager::updateParticleGeometryContactProxies ( )
protected
void agxRender::RenderManager::updateParticleSystemProxies ( )
protected

Update particleSystems.

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

Update size, color and transform.

void agxRender::RenderManager::updateRenderables ( )
protected

Call render for all Renderables.

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

Update (transform and color) for all shapes.

void agxRender::RenderManager::updateText ( )
protected

Update only text proxies.

template<typename T >
static bool agx::Referenced::ValidateCast ( const Referenced *  object)
staticinherited

Member Data Documentation

float agxRender::RenderManager::m_alpha
protected

Definition at line 489 of file RenderManager.h.

Referenced by getAlpha().

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

Definition at line 613 of file RenderManager.h.

CacheVector agxRender::RenderManager::m_cacheVector
protected

Definition at line 602 of file RenderManager.h.

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

Definition at line 606 of file RenderManager.h.

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

Definition at line 609 of file RenderManager.h.

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

Definition at line 615 of file RenderManager.h.

float agxRender::RenderManager::m_ContactsProxySize
protected

Definition at line 493 of file RenderManager.h.

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

Definition at line 607 of file RenderManager.h.

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

Definition at line 625 of file RenderManager.h.

bool agxRender::RenderManager::m_enable
protected

Definition at line 488 of file RenderManager.h.

Referenced by getEnable().

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

Definition at line 487 of file RenderManager.h.

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

Definition at line 620 of file RenderManager.h.

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 624 of file RenderManager.h.

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

Definition at line 491 of file RenderManager.h.

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

Definition at line 608 of file RenderManager.h.

PrimitiveCache<HollowTruncatedConeProxy> agxRender::RenderManager::m_hollowTruncatedConeCache
protected

Definition at line 611 of file RenderManager.h.

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

Definition at line 614 of file RenderManager.h.

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

Definition at line 618 of file RenderManager.h.

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

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

Definition at line 629 of file RenderManager.h.

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

Definition at line 627 of file RenderManager.h.

RenderProxyRef agxRender::RenderManager::m_particleContactRenderProxy
protected

Definition at line 631 of file RenderManager.h.

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

Definition at line 630 of file RenderManager.h.

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

Definition at line 628 of file RenderManager.h.

RenderProxyRef agxRender::RenderManager::m_particleGeometryContactRenderProxy
protected

Definition at line 632 of file RenderManager.h.

ParticleSystemProxyContainer agxRender::RenderManager::m_particleSystems
protected

Definition at line 496 of file RenderManager.h.

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

Definition at line 605 of file RenderManager.h.

RenderProxyHashVector agxRender::RenderManager::m_proxies
protected

Definition at line 486 of file RenderManager.h.

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

Definition at line 616 of file RenderManager.h.

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.

RenderableRefVector agxRender::RenderManager::m_renderables
protected

Definition at line 622 of file RenderManager.h.

float agxRender::RenderManager::m_scaleFactor
protected

Definition at line 494 of file RenderManager.h.

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

Definition at line 490 of file RenderManager.h.

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

Definition at line 612 of file RenderManager.h.

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

Definition at line 604 of file RenderManager.h.

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

Definition at line 610 of file RenderManager.h.


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