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;
171 void setRenderMode( RenderMode mode );
174 RenderMode getRenderMode( )
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() );
863 m_bodies.push_back( rb );
867 callOnChange( SHAPE );
884 : startPoint( sp ), endPoint( ep ), radius( r ) {}
1006 m_modifiedCount = c;
1010 return m_modifiedCount;
1015 m_geometry = geometry;
1029 if (m_enable != flag)
1041 if ( mode != m_renderMode ) {
1055 set( modifiedIndices, heights );
1068 return agx::Vec3f( radius, radius, (
float)startPoint.distance( endPoint ) );
void setShape(agxCollide::Shape *shape, const agxCollide::Geometry *geometry)
Set the shape for this proxy.
agx::Vec3 getPreviousEndPoint1() const
float getThickness() const
virtual void set(const agx::Vec2iVector &modifiedIndices, const agx::RealVector &heights)=0
Override this method to support changing a selection of indices in the heightfield.
agx::String getText() const
AGXCORE_EXPORT Type * getType(const agx::String &name)
A right circular hollow cone shape for geometric intersection tests.
agx::UInt32 getModifiedCount() const
This value tells us that if the proxy is synchronized with the associated shape.
virtual void setColor(const agx::Vec3 &color)
Set the color of this proxy.
virtual void setTransform(const agx::AffineMatrix4x4 &transform)
Set the transform of this RenderProxy, if overridden, set the m_transform and call onUpdate(TRANSFORM...
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.
const SphereDef * operator->() const
virtual void setAlpha(float alpha)
Set the alpha value of this proxy.
SegmentDefContainer m_edges
Subclass that implements a BoxProxy.
Abstract representation of a value.
float getBottomRadius() 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.
void set(const agx::Vec3 &normal, agx::Real distance)
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
void set(float radius, float height, float thickness)
agx::Vec3 getHalfExtents() const
virtual void onChange(EventType)
Pure virtual method that should response on the different events.
RenderMode getRenderMode() const
void setRenderMode(RenderMode mode)
Set the render mode for this Proxy.
agx::Vec3 m_previousEndPoint0
void callOnChange(EventType type)
Explicitly fires event of type.
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.
const DataT & at(size_t index) const
Access an element in the vector using an index.
#define AGXPHYSICS_EXPORT
The Shape has been modified a rebuild is needed.
virtual ~RigidBodyBatchRenderProxy()
A RenderProxy is enabled/disabled.
virtual ~HeightFieldProxy()
Destructor.
agx::Vec3 getPosition() const
#define AGX_DECLARE_POINTER_TYPES(type)
Subclass that implements a TrimeshProxy.
void set(const agx::Vec3 &p1, const agx::Vec3 &p2)
agxRender::RigidBodyBatchRenderProxy::Container m_bodies
const SegmentDef * operator->() const
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.
static agx::Bool shouldRender(const agx::RigidBody *rb)
void set(float radius, float height, const agx::Vec3 &previousEndPoint0, const agx::Vec3 &previousEndPoint1)
TrimeshProxy & operator=(const TrimeshProxy &)
Type-specific Array used for fast access into the data held by a Buffer.
void setModifiedCount(agx::UInt32 c)
SegmentDef(const agx::Vec3 &sp, const agx::Vec3 &ep, float r)
void set(float topRadius, float bottomRadius, float height)
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.
void set(const agx::String &text, const agx::Vec3 &pos)
virtual agx::Vec3 getColor() const
SphereDefContainer m_nodes
agx::Vec3 getNormal() const
The RenderMode has been changed.
float getThickness() const
float getTopRadius() const
agx::Vec3f getScale() const
Vector containing 'raw' data.
void set(float radius, float height)
The alpha value for a proxy is updated.
agx::AffineMatrix4x4 getTransform() const
virtual void onRemoveNotification()
Called when the wire is removed from the simulation.
void set(const agx::RigidBodyPtrSetVector *enabledBodies, float scale)
Abstract representation of a data buffer.
agx::ref_ptr< WireRenderProxy > WireRenderProxyRef
A hollow cylinder shape for geometric intersection tests.
PrimitiveType getType() const
void set(const agx::Vec3 &halfExtents)
Set the size of the box, will trigger onChange(SHAPE)
HollowTruncatedConeProxy()
agx::Vec3 getPreviousEndPoint0() const
agx::Real getDistance() const
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.
float getBottomRadius() const
const agx::AffineMatrix4x4 & getTransform() const
virtual ~WireRenderProxy()
void setHeights(const agx::Vec2iVector &modifiedIndices, const agx::RealVector &heights)
Set specified heights of a Heightfield.
agx::AffineMatrix4x4 getTransform() const
virtual float getAlpha() const
Subclass that implements a TextProxy.
void set(float radius, float height)
void set(float topRadius, float bottomRadius, float height, float thickness)
agx::Vector< const agx::RigidBody * > Container
float getTopRadius() const
LinearProbingHashSetImplementation< KeyT, HashT >::iterator end(LinearProbingHashSetImplementation< KeyT, HashT > &set)
EventType
Enum for specifying a type of event which might change a RenderProxy.
RigidBodyBatchRenderProxy()
void set(float radius, float height)
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.
void setEnable(bool flag)
Toggle this proxy for rendering on/off.
Subclass that implements a HeightfieldProxy.
Triangle mesh for geometric intersection tests.
Subclass that implements a LineProxy.
Subclass that implements a CylinderProxy.
A cylinder shape for geometric intersection tests.
virtual void onAddNotification()
Called when the wire is added to the simulation.
void set(float radius, float height)
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
const agxCollide::Geometry * getGeometry() const
size_t size() const
Return the number of inserted elements.
const agxCollide::Shape * getShape() const