 |
AGXDynamics
2.35.0.2
|
Go to the documentation of this file.
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 ) );
A box shape for geometric intersection tests.
virtual void updateShape()
Called when a Shape has been changed (for example radius on a sphere is changed).
void set(const agx::Vec3 &normal, agx::Real distance)
@ PRIMITIVE_HOLLOW_CYLINDER
void setRenderMode(RenderMode mode)
Set the render mode for this Proxy.
void callOnChange(EventType type)
Explicitly fires event of type.
LinearProbingHashSetImplementation< KeyT, HashT >::iterator end(LinearProbingHashSetImplementation< KeyT, HashT > &set)
Abstract representation of a value.
virtual ~HollowCylinderProxy()
@ COLOR
The color value for a proxy is updated.
EventType
Enum for specifying a type of event which might change a RenderProxy.
Implements a Capsule shape for geometric intersection tests.
A cylinder shape for geometric intersection tests.
AGXPHYSICS_EXPORT agx::Bool equivalent(const agx::AddedMassInteraction::Matrix6x6 &lhs, const agx::AddedMassInteraction::Matrix6x6 &rhs, agx::Real eps=agx::RealEpsilon)
virtual void onAddNotification()
Called when the wire is added to the simulation.
void AGXCORE_EXPORT transform(void *target, const Format *targetFormat, const void *source, const Format *sourceFormat, size_t numElements)
Transform data between two buffers.
void set(float radius, float height)
void setEnable(bool flag)
Toggle this proxy for rendering on/off.
Namespace containing classes for handling debug rendering of collision geometries,...
A sphere class for geometric intersection tests.
float getTopRadius() const
static AffineMatrix4x4T< Real > rotate(const Vec3T< Real > &from, const Vec3T< Real > &to)
Return a matrix which rotate a vector from from to to.
void set(float radius, float height, float thickness)
agx::Vec3f getScale() const
agx::AffineMatrix4x4 m_transform
Subclass that implements a ConeProxy.
The rigid body class, combining a geometric model and a frame of reference.
@ ENABLE
A RenderProxy is enabled/disabled.
@ RENDERMODE
The RenderMode has been changed.
static AffineMatrix4x4T< Real > translate(const Vec3T< Real > &dv)
Return a matrix which translates according to dv.
void set(const agx::String &text, const agx::Vec3 &pos)
const SphereDef * operator->() const
size_t size() const
Return the number of inserted elements.
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc.
agx::AffineMatrix4x4 getTransform() const
SegmentDef(const agx::Vec3 &sp, const agx::Vec3 &ep, float r)
AGXCORE_EXPORT Type * getType(const agx::String &name)
Subclass that implements a HeightfieldProxy.
agx::UInt32 getModifiedCount() const
This value tells us that if the proxy is synchronized with the associated shape.
@ PRIMITIVE_HOLLOW_TRUNCATED_CONE
@ ALPHA
The alpha value for a proxy is updated.
Subclass that implements a CapsuleProxy.
TrimeshProxy & operator=(const TrimeshProxy &)
A HeightField is a collision shape that can be created from a grid structure, like an image.
virtual ~TruncatedConeProxy()
virtual ~WireRenderProxy()
virtual void onRemoveNotification()
Called when the wire is removed from the simulation.
SphereDefContainer m_nodes
PrimitiveType getType() const
HeightFieldProxy & operator=(const HeightFieldProxy &)
Subclass that implements a TruncatedConeProxy.
Subclass that implements a BoxProxy.
void set(float topRadius, float bottomRadius, float height, float thickness)
A right circular hollow cone shape for geometric intersection tests.
virtual void setTransform(const agx::AffineMatrix4x4 &transform)
Set the transform of this RenderProxy, if overridden, set the m_transform and call onUpdate(TRANSFORM...
virtual ~HeightFieldProxy()
Destructor.
Vector containing 'raw' data.
void set(float radius, float height)
A hollow cylinder shape for geometric intersection tests.
#define AGXPHYSICS_EXPORT
Internal class used by agxWire::Wire.
virtual void onChange(EventType)
Pure virtual method that should response on the different events.
const agxCollide::Shape * getShape() const
LinearProbingHashSetImplementation< KeyT, HashT >::iterator begin(LinearProbingHashSetImplementation< KeyT, HashT > &set)
agx::Vec3 getNormal() const
@ SHAPE
The Shape has been modified a rebuild is needed.
Type-specific Array used for fast access into the data held by a Buffer.
Subclass that implements a TextProxy.
agx::Vec3 getPreviousEndPoint0() const
float getBottomRadius() const
virtual ~WireShapeProxy()
@ REMOVE
The Shape has been removed from space, need to be removed from rendering.
SegmentDefContainer m_segments
virtual void synchronizeParameters()
This method should be implemented so that it extracts size parameters from an associated shape and st...
Class holding rigid bodies that makes it possible to batch render these objects.
Smart pointer for handling referenced counted objects.
SphereDef(const agx::Vec3 &p)
void set(float radius, float height)
const DataT & at(size_t index) const
Access an element in the vector using an index.
Subclass that implements a CylinderProxy.
SegmentDefContainer m_edges
void set(const agx::RigidBodyPtrSetVector *enabledBodies, float scale)
agx::ref_ptr< WireRenderProxy > WireRenderProxyRef
void set(const agx::Vec3 &halfExtents)
Set the size of the box, will trigger onChange(SHAPE)
agx::Real getDistance() const
Subclass that implements a PlaneProxy.
A line shape for intersection tests, mostly for depth sensing and picking.
static agx::Bool shouldRender(const agx::RigidBody *rb)
@ PRIMITIVE_TRUNCATED_CONE
RenderMode getRenderMode() const
AGXOSG_EXPORT void setAlpha(osg::Node *node, float alpha)
Set the alpha part of the material for a node.
Abstract base class which encapsulated information for rendering a specific shape.
Abstract representation of a data buffer.
virtual float getAlpha() const
The geometry representation used by the collision detection engine.
float getTopRadius() const
agx::VectorPOD< SegmentDef > SegmentDefContainer
void setModifiedCount(agx::UInt32 c)
Subclass that implements a HollowTruncatedConeProxy.
float getThickness() const
agx::Vector< const agx::RigidBody * > Container
const agx::AffineMatrix4x4 & getTransform() const
agx::Vec3 getPosition() const
agx::Vec3 m_previousEndPoint0
agx::String getText() const
void set(float radius, float height, const agx::Vec3 &previousEndPoint0, const agx::Vec3 &previousEndPoint1)
@ TRANSFORM
The transformation for a proxy is updated.
Subclass that implements a SphereProxy.
Subclass that implements a CylinderProxy.
RigidBodyBatchRenderProxy()
Base class providing referencing counted objects.
HollowTruncatedConeProxy()
#define AGX_DECLARE_POINTER_TYPES(type)
void setHeights(const agx::Vec2iVector &modifiedIndices, const agx::RealVector &heights)
Set specified heights of a Heightfield.
agx::observer_ptr< agxCollide::Shape > m_shape
virtual ~RigidBodyBatchRenderProxy()
agx::Vec3 getHalfExtents() const
This namespace consists of a set of classes for handling geometric intersection tests including boole...
float getBottomRadius() const
virtual ~HollowTruncatedConeProxy()
agx::Vec3 getPreviousEndPoint1() const
A right circular cone shape for geometric intersection tests.
virtual agx::Vec3 getColor() const
void set(const agx::Vec3 &p1, const agx::Vec3 &p2)
agxRender::RigidBodyBatchRenderProxy::Container m_bodies
void set(float radius, float height)
const agxCollide::Geometry * getGeometry() const
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
agx::Vec3 m_previousEndPoint1
agx::AffineMatrix4x4 getTransform() const
Subclass that implements a WireShapeProxy.
Triangle mesh for geometric intersection tests.
void setShape(agxCollide::Shape *shape, const agxCollide::Geometry *geometry)
Set the shape for this proxy.
virtual void setColor(const agx::Vec3 &color)
Set the color of this proxy.
Subclass that implements a LineProxy.
virtual void setAlpha(float alpha)
Set the alpha value of this proxy.
float getThickness() const
const SegmentDef * operator->() const
PlaneT< agx::Real > Plane
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.
Subclass that implements a TrimeshProxy.
agx::VectorPOD< SphereDef > SphereDefContainer
void set(float topRadius, float bottomRadius, float height)