82 virtual void setColor(
const agx::Vec3& color );
92 virtual void setAlpha(
float alpha );
95 virtual float getAlpha()
const;
131 void setEnable(
bool flag );
134 bool getEnable()
const;
143 void setRenderMode( RenderMode mode );
146 RenderMode getRenderMode()
const;
191 bool signalShapeChanged,
192 bool offsetHalfHeight =
true );
318 void set(
float radius,
float height );
350 void set(
float outerRadius,
float height,
float thickness );
387 void set(
float radius,
float height );
420 float bottomRadius );
422 void set(
float topRadius,
float bottomRadius,
float height );
427 float bottomRadius );
518 void set(
float radius,
float height );
559 void set(
float radius,
float height );
727 : startPoint( sp ), endPoint( ep ), radius( r ) {}
874 return m_modifiedCount;
880 m_geometry = geometry;
896 if ( m_enable != flag )
910 if ( mode != m_renderMode ) {
928 return agx::Vec3f( radius, radius, (
float)startPoint.distance( endPoint ) );
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGXPHYSICS_EXPORT
A box shape for geometric intersection tests.
Implements a Capsule shape for geometric intersection tests.
A right circular cone shape for geometric intersection tests.
A cylinder shape for geometric intersection tests.
The geometry representation used by the collision detection engine.
A HeightField is a collision shape that can be created from a grid structure, like an image.
A right circular hollow cone shape for geometric intersection tests.
A hollow cylinder shape for geometric intersection tests.
A line shape for intersection tests, mostly for depth sensing and picking.
A sphere class for geometric intersection tests.
Triangle mesh for geometric intersection tests.
Internal class used by agxWire::Wire.
Subclass that implements a BoxProxy.
BoxProxy(const agx::Vec3 &halfExtents)
void synchronizeParameters()
This method should be implemented so that it extracts size parameters from an associated shape and st...
void set(const agx::Vec3 &halfExtents)
Set the size of the box, will trigger onChange(SHAPE)
agx::Vec3 getHalfExtents() const
const agxCollide::Box * getCastShape() const
Subclass that implements a CapsuleProxy.
CapsuleProxy(float radius, float height)
CapsuleProxy(const agx::Vec3 &begin, const agx::Vec3 &end, float radius)
void set(float radius, float height)
void synchronizeParameters()
This method should be implemented so that it extracts size parameters from an associated shape and st...
virtual ~CapsuleProxy()=default
void set(const agx::Vec3 &begin, const agx::Vec3 &end, float radius)
const agxCollide::Capsule * getCastShape() const
Subclass that implements a ConeProxy.
void synchronizeParameters()
This method should be implemented so that it extracts size parameters from an associated shape and st...
virtual ~ConeProxy()=default
void set(const agx::Vec3 &begin, const agx::Vec3 &end, float radius)
void set(float radius, float height)
ConeProxy(const agx::Vec3 &begin, const agx::Vec3 &end, float radius)
ConeProxy(float radius, float height)
const agxCollide::Cone * getCastShape() const
Subclass that implements a CylinderProxy.
CylinderProxy(const agx::Vec3 &begin, const agx::Vec3 &end, float radius)
void set(const agx::Vec3 &begin, const agx::Vec3 &end, float radius)
void set(float radius, float height)
void synchronizeParameters()
This method should be implemented so that it extracts size parameters from an associated shape and st...
const agxCollide::Cylinder * getCastShape() const
CylinderProxy(float radius, float height)
Subclass that implements a HeightfieldProxy.
void setHeights(const agx::Vec2iVector &modifiedIndices, const agx::RealVector &heights)
Set specified heights of a Heightfield.
HeightFieldProxy & operator=(const HeightFieldProxy &)=delete
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.
HeightFieldProxy(agxCollide::HeightField *hf)
virtual ~HeightFieldProxy()=default
Destructor.
const agxCollide::HeightField * getCastShape() const
Subclass that implements a HollowConeProxy.
HollowConeProxy(const agx::Vec3 &begin, const agx::Vec3 &end, float topRadius, float bottomRadius, float thickness)
const agxCollide::HollowCone * getCastShape() const
virtual ~HollowConeProxy()=default
void set(float topRadius, float bottomRadius, float height, float thickness)
float getTopRadius() const
void set(const agx::Vec3 &top, const agx::Vec3 &bottom, float topRadius, float bottomRadius, float thickness)
float getThickness() const
float getBottomRadius() const
void synchronizeParameters()
This method should be implemented so that it extracts size parameters from an associated shape and st...
HollowConeProxy(float topRadius, float bottomRadius, float height, float thickness)
Subclass that implements a CylinderProxy.
HollowCylinderProxy(const agx::Vec3 &begin, const agx::Vec3 &end, float radius, float thickness)
float getThickness() const
void set(const agx::Vec3 &begin, const agx::Vec3 &end, float outerRadius, float thickness)
virtual ~HollowCylinderProxy()=default
const agxCollide::HollowCylinder * getCastShape() const
HollowCylinderProxy(float outerRadius, float height, float thickness)
void set(float outerRadius, float height, float thickness)
float getOuterRadius() const
void synchronizeParameters()
This method should be implemented so that it extracts size parameters from an associated shape and st...
Subclass that implements a LineProxy.
LineProxy(const agx::Vec3 &p1, const agx::Vec3 &p2)
void synchronizeParameters()
This method should be implemented so that it extracts size parameters from an associated shape and st...
const agxCollide::Line * getCastShape() const
void set(const agx::Vec3 &p1, const agx::Vec3 &p2)
virtual ~LineProxy()=default
Subclass that implements a PlaneProxy.
const agxCollide::Plane * getCastShape() const
agx::Real getDistance() const
void set(const agx::Vec3 &normal, agx::Real distance)
PlaneProxy(const agx::Vec3 &normal, agx::Real distance)
agx::Vec3 getNormal() const
virtual ~PlaneProxy()=default
void synchronizeParameters()
This method should be implemented so that it extracts size parameters from an associated shape and st...
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc.
Abstract base class which encapsulated information for rendering a specific shape.
virtual float getAlpha() const
virtual void setAlpha(float alpha)
Set the alpha value of this proxy.
void setBeginToEndTransform(const agx::Vec3 &begin, const agx::Vec3 &end, float &retHeight, bool signalShapeChanged, bool offsetHalfHeight=true)
Calculates and sets the transform given begin and end points.
const agxCollide::Geometry * getGeometry() const
virtual agx::Vec3 getColor() const
void setModifiedCount(agx::UInt32 c)
agx::UInt32 getModifiedCount() const
This value tells us that if the proxy is synchronized with the associated shape.
virtual ~RenderProxy()
Destructor.
void setEnable(bool flag)
Toggle this proxy for rendering on/off.
virtual void onChange(EventType)
Pure virtual method that should response on the different events.
RenderMode getRenderMode() const
agx::AffineMatrix4x4 m_transform
virtual void synchronizeParameters()
This method should be implemented so that it extracts size parameters from an associated shape and st...
void setShape(agxCollide::Shape *shape, const agxCollide::Geometry *geometry)
Set the shape for this proxy.
void callOnChange(EventType type)
Explicitly fires event of type.
virtual void reset()
Will reset color, alpha and enabled state back to default state (as when initially created).
virtual void setTransform(const agx::AffineMatrix4x4 &transform)
Set the transform of this RenderProxy, if overridden, set the m_transform and call onUpdate(TRANSFORM...
virtual void setColor(const agx::Vec3 &color)
Set the color of this proxy.
const agx::AffineMatrix4x4 & getTransform() const
const agxCollide::Shape * getShape() const
virtual bool updateShape()
Called when a Shape has been changed (for example radius on a sphere is changed).
bool compare() const
Compare the modified count with its associated shape.
static agx::Bool shouldRender(const agx::RigidBody *rb)
EventType
Enum for specifying a type of event which might change a RenderProxy.
@ COLOR
The color value for a proxy is updated.
@ ENABLE
A RenderProxy is enabled/disabled.
@ REMOVE
The Shape has been removed from space, need to be removed from rendering.
@ RENDERMODE
The RenderMode has been changed.
@ ALPHA
The alpha value for a proxy is updated.
@ TRANSFORM
The transformation for a proxy is updated.
@ SHAPE
The Shape has been modified a rebuild is needed.
agx::observer_ptr< agxCollide::Shape > m_shape
RenderProxy(agxCollide::Shape *shape=nullptr)
Constructor.
void setRenderMode(RenderMode mode)
Set the render mode for this Proxy.
Class holding rigid bodies that makes it possible to batch render these objects.
agx::Vector< const agx::RigidBody * > Container
virtual ~RigidBodyBatchRenderProxy()=default
void set(const agx::RigidBodyPtrSetVector *enabledBodies, float scale)
agxRender::RigidBodyBatchRenderProxy::Container m_bodies
RigidBodyBatchRenderProxy()
Subclass that implements a SphereProxy.
virtual ~SphereProxy()=default
void synchronizeParameters()
This method should be implemented so that it extracts size parameters from an associated shape and st...
const agxCollide::Sphere * getCastShape() const
SphereProxy(float radius)
Subclass that implements a TextProxy.
agx::Vec3 getPosition() const
virtual ~TextProxy()=default
void set(const agx::String &text, const agx::Vec3 &pos, float size=1)
agx::String getText() const
TextProxy(const agx::String &text, const agx::Vec3 &pos, float size=1)
Subclass that implements a TrimeshProxy.
TrimeshProxy & operator=(const TrimeshProxy &)=delete
TrimeshProxy(agxCollide::Trimesh *mesh)
const agxCollide::Trimesh * getCastShape() const
Subclass that implements a TruncatedConeProxy.
TruncatedConeProxy(const agx::Vec3 &begin, const agx::Vec3 &end, float topRadius, float bottomRadius)
TruncatedConeProxy(float topRadius, float bottomRadius, float height)
virtual ~TruncatedConeProxy()
float getBottomRadius() const
void set(const agx::Vec3 &top, const agx::Vec3 &bottom, float topRadius, float bottomRadius)
float getTopRadius() const
void set(float topRadius, float bottomRadius, float height)
void synchronizeParameters()
This method should be implemented so that it extracts size parameters from an associated shape and st...
const agxCollide::Cone * getCastShape() const
void addNode(const agx::Vec3 &point)
Node with default color (lumped node).
SegmentDefContainer m_segments
virtual void onAddNotification()
Called when the wire is added to the simulation.
void commit()
Commit the current state to the renderer.
agx::VectorPOD< SphereDef > SphereDefContainer
agx::VectorPOD< SegmentDef > SegmentDefContainer
void addSegment(const agx::Vec3 &startPoint, const agx::Vec3 &endPoint, const agx::Vec3 &prevStartPoint, const agx::Vec3 &prevEndPoint)
Add segment with global radius and color.
virtual ~WireRenderProxy()
void addSegment(const agx::Vec3 &startPoint, const agx::Vec3 &endPoint, float radius, const agx::Vec3 &color, agxRender::RenderManager *manager) const
Slow, non-batch-rendered, segment.
void addNode(const agx::Vec3 &point, float radius, const agx::Vec3 &color, agxRender::RenderManager *manager) const
Node with different color and/or size.
void prepare(agx::UInt numSegmentEstimate, agx::UInt numEdgesEstimate, agx::UInt numNodesEstimate)
Prepare buffers.
void addEdge(const agx::Vec3 &startPoint, const agx::Vec3 &endPoint)
Edges are always red and same radius as others.
virtual void onRemoveNotification()
Called when the wire is removed from the simulation.
SphereDefContainer m_nodes
WireRenderProxy(float radius, const agx::Vec3 &color)
SegmentDefContainer m_edges
Subclass that implements a WireShapeProxy.
void set(float radius, float height, const agx::Vec3 &previousEndPoint0, const agx::Vec3 &previousEndPoint1)
void set(float radius, float height)
virtual ~WireShapeProxy()=default
void set(const agx::Vec3 &begin, const agx::Vec3 &end, const agx::Vec3 &previousEndPoint0, const agx::Vec3 &previousEndPoint1, float radius)
agx::Vec3 getPreviousEndPoint1() const
agx::Vec3 getPreviousEndPoint0() const
const agxCollide::WireShape * getCastShape() const
agx::Vec3 m_previousEndPoint1
void synchronizeParameters()
This method should be implemented so that it extracts size parameters from an associated shape and st...
WireShapeProxy(const agx::Vec3 &begin, const agx::Vec3 &end, const agx::Vec3 &previousEndPoint0, const agx::Vec3 &previousEndPoint1, float radius)
agx::Vec3 m_previousEndPoint0
WireShapeProxy(float radius, float height, const agx::Vec3 &previousEndPoint0, const agx::Vec3 &previousEndPoint1)
static AffineMatrix4x4T< Real > rotate(const Vec3T< Real > &from, const Vec3T< Real > &to)
Return a matrix which rotate a vector from from to to.
static AffineMatrix4x4T< Real > translate(const Vec3T< Real > &dv)
Return a matrix which translates according to dv.
Base class providing referencing counted objects.
The rigid body class, combining a geometric model and a frame of reference.
Vector containing 'raw' data.
Smart pointer for observed objects, that automatically set pointers to them to null when they deleted...
Smart pointer for handling referenced counted objects.
This namespace consists of a set of classes for handling geometric intersection tests including boole...
Namespace containing classes for handling debug rendering of collision geometries,...
agx::ref_ptr< WireRenderProxy > WireRenderProxyRef
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
PlaneT< agx::Real > Plane
AGXPHYSICS_EXPORT agx::Bool equivalent(const agx::AddedMassInteraction::Matrix6x6 &lhs, const agx::AddedMassInteraction::Matrix6x6 &rhs, agx::Real eps=agx::RealEpsilon)
agx::Vec3f getScale() const
agx::AffineMatrix4x4 getTransform() const
const SegmentDef * operator->() const
SegmentDef(const agx::Vec3 &sp, const agx::Vec3 &ep, float r)
const SphereDef * operator->() const
SphereDef(const agx::Vec3 &p)
agx::AffineMatrix4x4 getTransform() const