17 #ifndef AGXRENDER_RENDERPROXY_H 18 #define AGXRENDER_RENDERPROXY_H 109 virtual void setColor(
const agx::Vec3& color );
120 virtual void setAlpha(
float alpha );
123 virtual float getAlpha()
const;
147 bool compare()
const;
159 void setEnable(
bool flag );
162 bool getEnable()
const;
177 virtual void reset();
228 m_transform.setTranslate( pos[0], pos[1], pos[2] );
229 callOnChange( SHAPE );
235 return m_transform.getTranslate();
253 m_distance = distance;
254 callOnChange( SHAPE );
269 void synchronizeParameters();
284 void set(
float radius ) {
286 callOnChange( SHAPE );
298 void synchronizeParameters();
315 callOnChange( SHAPE );
329 void synchronizeParameters();
345 void set(
float radius,
float height ) {
348 callOnChange( SHAPE );
367 void synchronizeParameters();
384 void set(
float radius,
float height,
float thickness ) {
387 m_thickness = thickness;
388 callOnChange( SHAPE );
412 void synchronizeParameters();
431 void set(
float radius,
float height ) {
434 callOnChange( SHAPE );
454 void synchronizeParameters();
470 void set(
float topRadius,
float bottomRadius,
float height ) {
471 m_topRadius = topRadius;
472 m_bottomRadius = bottomRadius;
474 callOnChange( SHAPE );
477 void set(
const agx::Vec3& top,
const agx::Vec3& bottom,
float topRadius,
float bottomRadius );
486 return m_bottomRadius;
499 void synchronizeParameters();
516 void set(
float topRadius,
float bottomRadius,
float height,
float thickness ) {
517 m_topRadius = topRadius;
518 m_bottomRadius = bottomRadius;
520 m_thickness = thickness;
521 callOnChange( SHAPE );
524 void set(
const agx::Vec3& top,
const agx::Vec3& bottom,
float topRadius,
float bottomRadius,
float thickness );
533 return m_bottomRadius;
551 void synchronizeParameters();
570 void set(
float radius,
float height ) {
573 callOnChange( SHAPE );
594 void synchronizeParameters();
611 const agx::Vec3& previousEndPoint0,
const agx::Vec3& previousEndPoint1,
float radius );
613 void set(
float radius,
float height) {
616 callOnChange( SHAPE );
619 void set(
float radius,
float height,
624 m_previousEndPoint0 = previousEndPoint0;
625 m_previousEndPoint1 = previousEndPoint1;
626 callOnChange( SHAPE );
630 const agx::Vec3& previousEndPoint0,
const agx::Vec3& previousEndPoint1,
float radius );
646 return m_previousEndPoint0;
653 return m_previousEndPoint1;
661 void synchronizeParameters();
682 m_halfExtents = halfExtents;
683 callOnChange( SHAPE );
687 return m_halfExtents;
695 void synchronizeParameters();
774 m_positions = positions;
777 callOnChange( SHAPE );
782 virtual ~SphereSpriteBatchRenderProxy() {}
805 callOnChange( SHAPE );
809 virtual ~SphereMeshBatchRenderProxy() {}
828 m_contacts = &contacts;
830 callOnChange( SHAPE );
858 if ( enabledBodies !=
nullptr ) {
859 m_bodies.reserve( enabledBodies->size() );
860 for (
agx::UInt i = 0; i < enabledBodies->size(); ++i ) {
862 if ( RenderProxy::shouldRender( rb ) )
863 m_bodies.push_back( rb );
867 callOnChange( SHAPE );
884 : startPoint( sp ), endPoint( ep ), radius( r ) {}
976 callOnChange( TRANSFORM );
982 inline void RenderProxy::setColor(
const agx::Vec3& color ) {
985 callOnChange( COLOR );
997 callOnChange( ALPHA );
1001 inline float RenderProxy::getAlpha()
const {
1006 m_modifiedCount = c;
1010 return m_modifiedCount;
1015 m_geometry = geometry;
1028 inline void RenderProxy::setEnable(
bool flag ) {
1029 if (m_enable != flag)
1032 callOnChange( ENABLE );
1036 inline bool RenderProxy::getEnable()
const {
1041 if ( mode != m_renderMode ) {
1043 callOnChange( RENDERMODE );
1055 set( modifiedIndices, heights );
1058 setModifiedCount( getShape()->getModifiedCount() );
1068 return agx::Vec3f( radius, radius, (
float)startPoint.distance( endPoint ) );
AGXCORE_EXPORT Type * getType(const agx::String &name)
A right circular hollow cone shape for geometric intersection tests.
AGXOSG_EXPORT void setAlpha(osg::Node *node, float alpha)
Set the alpha part of the material for a node.
Implements a Capsule shape for geometric intersection tests.
static AffineMatrix4x4T< Real > translate(const Vec3T< Real > &dv)
Return a matrix which translates according to dv.
The Shape has been removed from space, need to be removed from rendering.
SegmentDefContainer m_edges
agx::Vec3 getPreviousEndPoint0() const
Subclass that implements a BoxProxy.
Abstract representation of a value.
This namespace consists of a set of classes for handling geometric intersection tests including boole...
const SegmentDef * operator->() const
SegmentDefContainer m_segments
virtual void updateShape()
Called when a Shape has been changed (for example radius on a sphere is changed). ...
Subclass that implements a TruncatedConeProxy.
static AffineMatrix4x4T< Real > rotate(const Vec3T< Real > &from, const Vec3T< Real > &to)
Return a matrix which rotate a vector from from to to.
PlaneT< agx::Real > Plane
float getTopRadius() const
agx::Vec3 getHalfExtents() const
virtual void onChange(EventType)
Pure virtual method that should response on the different events.
agx::Vec3 getNormal() const
agx::Vec3 m_previousEndPoint0
agx::VectorPOD< SphereDef > SphereDefContainer
HeightFieldProxy & operator=(const HeightFieldProxy &)
void AGXCORE_EXPORT transform(void *target, const Format *targetFormat, const void *source, const Format *sourceFormat, size_t numElements)
Transform data between two buffers.
Subclass that implements a CylinderProxy.
#define AGXPHYSICS_EXPORT
float getTopRadius() const
The Shape has been modified a rebuild is needed.
agx::Vec3 getPosition() const
virtual ~RigidBodyBatchRenderProxy()
A RenderProxy is enabled/disabled.
virtual ~HeightFieldProxy()
Destructor.
agx::Vec3 getPreviousEndPoint1() const
Subclass that implements a TrimeshProxy.
Namespace containing classes for handling debug rendering of collision geometries, constraints, contacts and rigid bodies.
agxRender::RigidBodyBatchRenderProxy::Container m_bodies
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc...
agx::AffineMatrix4x4 m_transform
Subclass that implements a CapsuleProxy.
The transformation for a proxy is updated.
TrimeshProxy & operator=(const TrimeshProxy &)
Type-specific Array used for fast access into the data held by a Buffer.
const SphereDef * operator->() const
SegmentDef(const agx::Vec3 &sp, const agx::Vec3 &ep, float r)
A line shape for intersection tests, mostly for depth sensing and picking.
Base class providing referencing counted objects.
virtual ~HollowTruncatedConeProxy()
The geometry representation used by the collision detection engine.
Subclass that implements a SphereProxy.
float getThickness() const
SphereDefContainer m_nodes
Vector containing 'raw' data.
float getBottomRadius() const
The alpha value for a proxy is updated.
virtual void onRemoveNotification()
Called when the wire is removed from the simulation.
Abstract representation of a data buffer.
agx::Real getDistance() const
agx::ref_ptr< WireRenderProxy > WireRenderProxyRef
A hollow cylinder shape for geometric intersection tests.
HollowTruncatedConeProxy()
virtual ~HollowCylinderProxy()
Smart pointer for handling referenced counted objects.
LinearProbingHashSetImplementation< KeyT, HashT >::iterator begin(LinearProbingHashSetImplementation< KeyT, HashT > &set)
A right circular cone shape for geometric intersection tests.
Subclass that implements a PlaneProxy.
virtual void synchronizeParameters()
This method should be implemented so that it extracts size parameters from an associated shape and st...
virtual ~TruncatedConeProxy()
A sphere class for geometric intersection tests.
Abstract base class which encapsulated information for rendering a specific shape.
AGXPHYSICS_EXPORT agx::Bool equivalent(const agx::AddedMassInteraction::Matrix6x6 &lhs, const agx::AddedMassInteraction::Matrix6x6 &rhs, agx::Real eps=agx::RealEpsilon)
Internal class used by agxWire::Wire.
The rigid body class, combining a geometric model and a frame of reference.
A box shape for geometric intersection tests.
SphereDef(const agx::Vec3 &p)
virtual ~WireShapeProxy()
Subclass that implements a HollowTruncatedConeProxy.
virtual ~WireRenderProxy()
agx::String getText() const
Subclass that implements a TextProxy.
float getThickness() const
agx::Vector< const agx::RigidBody *> Container
LinearProbingHashSetImplementation< KeyT, HashT >::iterator end(LinearProbingHashSetImplementation< KeyT, HashT > &set)
EventType
Enum for specifying a type of event which might change a RenderProxy.
RigidBodyBatchRenderProxy()
agx::observer_ptr< agxCollide::Shape > m_shape
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.
Subclass that implements a LineProxy.
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Subclass that implements a CylinderProxy.
float getBottomRadius() const
A cylinder shape for geometric intersection tests.
virtual void onAddNotification()
Called when the wire is added to the simulation.
agx::VectorPOD< SegmentDef > SegmentDefContainer
A HeightField is a collision shape that can be created from a grid structure, like an image...
The color value for a proxy is updated.
agx::Vec3 m_previousEndPoint1
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
AGX_DECLARE_POINTER_TYPES(SpaceListener)