AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
agxRender/RenderProxy.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
20#include <agx/DynamicsSystem.h>
21
22namespace agxCollide
23{
24 class Shape;
25 class Geometry;
26 class Sphere;
27 class Box;
28 class HeightField;
29 class Line;
30 class Cylinder;
31 class HollowCylinder;
32 class Capsule;
33 class Cone;
34 class HollowCone;
35 class Trimesh;
36 class Plane;
37 class WireShape;
38}
39
40namespace agxSDK
41{
42 class Simulation;
43}
44
45namespace agxRender
46{
48
53 {
54 public:
55
57 enum EventType {
64 RENDERMODE
65 };
66
68 NOT_SET = 0x0,
69 SOLID = 0x1,
70 WIREFRAME = 0x2
71 };
72
74 RenderProxy( agxCollide::Shape* shape = nullptr );
75
77 virtual void setTransform( const agx::AffineMatrix4x4& transform );
78
82 virtual void setColor( const agx::Vec3& color );
83
87 virtual agx::Vec3 getColor() const;
88
92 virtual void setAlpha( float alpha );
93
95 virtual float getAlpha() const;
96
101 virtual bool updateShape() { return false; }
102
103
105 const agx::AffineMatrix4x4& getTransform() const;
106
113 agx::UInt32 getModifiedCount() const;
114
115 const agxCollide::Shape* getShape() const;
116 const agxCollide::Geometry* getGeometry() const;
117
119 bool compare() const;
120
126
131 void setEnable( bool flag );
132
134 bool getEnable() const;
135
137 inline bool isEnabled() const { return getEnable(); }
138
143 void setRenderMode( RenderMode mode );
144
146 RenderMode getRenderMode() const;
147
149 virtual void reset();
150
155
157 void setShape(agxCollide::Shape* shape, const agxCollide::Geometry* geometry);
158
159 protected:
163 virtual void synchronizeParameters() {}
164
170 virtual void onChange( EventType /*type*/ ) {}
171
172 friend class RenderManager;
173 void setModifiedCount( agx::UInt32 c );
174
176 virtual ~RenderProxy();
177
189 const agx::Vec3& end,
190 float& retHeight,
191 bool signalShapeChanged,
192 bool offsetHalfHeight = true );
193
196
197 private:
198 const agxCollide::Geometry* m_geometry;
199 agx::UInt32 m_modifiedCount;
200 float m_alpha;
201 agx::Vec3 m_color;
202 bool m_enable;
203 agx::Int32 m_renderMode;
204 };
205
206
209 {
210 public:
212 TextProxy( const agx::String& text, const agx::Vec3& pos, float size=1 );
213
214 void set( const agx::String& text, const agx::Vec3& pos, float size=1 );
215
217
219
220 protected:
221 virtual ~TextProxy() = default;
222
223 protected:
225 float m_size;
226 };
227
228
231 {
232 public:
234 SphereProxy( float radius );
235
236 void set( float radius );
237
238 float getRadius() const;
239
242
243 protected:
244 virtual ~SphereProxy() = default;
245
246 protected:
248
249 protected:
250 float m_radius;
251 };
252
253
256 {
257 public:
259 PlaneProxy( const agx::Vec3& normal, agx::Real distance );
260
261 void set( const agx::Vec3& normal, agx::Real distance );
262
265
267
269
270 protected:
271 virtual ~PlaneProxy() = default;
272
273 protected:
275
276 protected:
279 };
280
281
284 {
285 public:
287 LineProxy( const agx::Vec3& p1, const agx::Vec3& p2 );
288
289 void set( const agx::Vec3& p1, const agx::Vec3& p2 );
290
292
294
297
298 protected:
299 virtual ~LineProxy() = default;
300
301 protected:
303
304 protected:
307 };
308
309
312 {
313 public:
315 CylinderProxy( float radius, float height );
316 CylinderProxy( const agx::Vec3& begin, const agx::Vec3& end, float radius );
317
318 void set( float radius, float height );
319 void set( const agx::Vec3& begin, const agx::Vec3& end, float radius );
320
322 float getRadius() const;
323
325 float getHeight() const;
326
329
330 protected:
331 virtual ~CylinderProxy() {}
332
333 protected:
335
336 protected:
337 float m_height;
338 float m_radius;
339 };
340
341
344 {
345 public:
347 HollowCylinderProxy( float outerRadius, float height, float thickness );
348 HollowCylinderProxy( const agx::Vec3& begin, const agx::Vec3& end, float radius, float thickness );
349
350 void set( float outerRadius, float height, float thickness );
351
352 void set( const agx::Vec3& begin, const agx::Vec3& end, float outerRadius, float thickness );
353
355 float getOuterRadius() const;
356
358 float getHeight() const;
359
361 float getThickness() const;
362
365
366 protected:
367 virtual ~HollowCylinderProxy() = default;
368
369 protected:
371
372 protected:
373 float m_height;
376 };
377
378
381 {
382 public:
384 ConeProxy( float radius, float height );
385 ConeProxy( const agx::Vec3& begin, const agx::Vec3& end, float radius );
386
387 void set( float radius, float height );
388 void set( const agx::Vec3& begin, const agx::Vec3& end, float radius );
389
391 float getRadius() const;
392
394 float getHeight() const;
395
398
399 protected:
400 virtual ~ConeProxy() = default;
401
402 protected:
404
405 protected:
406 float m_radius;
407 float m_height;
408 };
409
410
413 {
414 public:
416 TruncatedConeProxy( float topRadius, float bottomRadius, float height );
418 const agx::Vec3& end,
419 float topRadius,
420 float bottomRadius );
421
422 void set( float topRadius, float bottomRadius, float height );
423
424 void set( const agx::Vec3& top,
425 const agx::Vec3& bottom,
426 float topRadius,
427 float bottomRadius );
428
430 float getTopRadius() const;
431
433 float getBottomRadius() const;
434
436 float getHeight() const;
437
440
441 protected:
443
444 protected:
446
447 protected:
450 float m_height;
451 };
452
455 {
456 public:
457
459 HollowConeProxy(float topRadius,
460 float bottomRadius,
461 float height,
462 float thickness );
463
465 const agx::Vec3& end,
466 float topRadius,
467 float bottomRadius,
468 float thickness);
469
470 void set(float topRadius,
471 float bottomRadius,
472 float height,
473 float thickness );
474
475 void set(const agx::Vec3& top,
476 const agx::Vec3& bottom,
477 float topRadius,
478 float bottomRadius,
479 float thickness);
480
482 float getTopRadius() const;
483
485 float getBottomRadius() const;
486
488 float getHeight() const;
489
491 float getThickness() const;
492
495
496 protected:
497 virtual ~HollowConeProxy() = default;
498
499 protected:
501
502 protected:
505 float m_height;
507 };
508
509
512 {
513 public:
515 CapsuleProxy( float radius, float height );
516 CapsuleProxy( const agx::Vec3& begin, const agx::Vec3& end, float radius );
517
518 void set( float radius, float height );
519
520 void set( const agx::Vec3& begin, const agx::Vec3& end, float radius );
521
522
524 float getRadius() const;
525
527 float getHeight() const;
528
531
532 protected:
533 virtual ~CapsuleProxy() = default;
534
535 protected:
537
538 protected:
539 float m_height;
540 float m_radius;
541 };
542
543
546 {
547 public:
549 WireShapeProxy( float radius,
550 float height,
551 const agx::Vec3& previousEndPoint0,
552 const agx::Vec3& previousEndPoint1 );
554 const agx::Vec3& end,
555 const agx::Vec3& previousEndPoint0,
556 const agx::Vec3& previousEndPoint1,
557 float radius );
558
559 void set( float radius, float height );
560
561 void set( float radius,
562 float height,
563 const agx::Vec3& previousEndPoint0,
564 const agx::Vec3& previousEndPoint1 );
565
566 void set( const agx::Vec3& begin,
567 const agx::Vec3& end,
568 const agx::Vec3& previousEndPoint0,
569 const agx::Vec3& previousEndPoint1,
570 float radius );
571
572
574 float getRadius() const;
575
577 float getHeight() const;
578
581
582
585
588
589 protected:
590 virtual ~WireShapeProxy() = default;
591
592 protected:
594
595 protected:
598 float m_height;
599 float m_radius;
600 };
601
602
605 {
606 public:
608 BoxProxy( const agx::Vec3& halfExtents );
609
611 void set( const agx::Vec3& halfExtents );
612
614
617
618 protected:
619 virtual ~BoxProxy() {}
620
621 protected:
623
624 protected:
626 };
627
628
631 {
632 public:
635
637
643 void setHeights(const agx::Vec2iVector& modifiedIndices, const agx::RealVector& heights);
644
647
648 protected:
650 virtual ~HeightFieldProxy() = default;
651
656 virtual void set( const agx::Vec2iVector& modifiedIndices, const agx::RealVector& heights ) = 0;
657 };
658
659
662 {
663 public:
666
668
670
671 protected:
672 virtual ~TrimeshProxy() {}
673 };
674
675
680 {
681 public:
683
684 void set( const agxCollide::GeometryContactPtrVector& contacts, float scale );
685
687
688 protected:
689 virtual ~ContactsProxy() {}
690
691 protected:
693
694 protected:
696 float m_scale;
697 };
698
699
704 {
705 public:
707
708 public:
710
711 void set( const agx::RigidBodyPtrSetVector* enabledBodies, float scale );
712
713 protected:
714 virtual ~RigidBodyBatchRenderProxy() = default;
715
716 protected:
718 float m_scale;
719 };
720
722 {
723 public:
725 {
726 SegmentDef( const agx::Vec3& sp, const agx::Vec3& ep, float r )
727 : startPoint( sp ), endPoint( ep ), radius( r ) {}
728
729 const SegmentDef* operator->() const { return this; }
730
731 agx::AffineMatrix4x4 getTransform() const;
732 agx::Vec3f getScale() const;
733
736 float radius;
737 };
738
740 {
742 : point( p ) {}
743
744 const SphereDef* operator->() const { return this; }
745 agx::AffineMatrix4x4 getTransform() const;
746
748 };
749
752
753 public:
754 WireRenderProxy( float radius, const agx::Vec3& color );
755
759 virtual void onAddNotification() {}
760
764 virtual void onRemoveNotification() {}
765
769 void prepare( agx::UInt numSegmentEstimate,
770 agx::UInt numEdgesEstimate,
771 agx::UInt numNodesEstimate );
772
776 void commit();
777
781 void addSegment( const agx::Vec3& startPoint,
782 const agx::Vec3& endPoint,
783 const agx::Vec3& prevStartPoint,
784 const agx::Vec3& prevEndPoint );
785
789 void addSegment( const agx::Vec3& startPoint,
790 const agx::Vec3& endPoint,
791 float radius,
792 const agx::Vec3& color,
793 agxRender::RenderManager* manager ) const;
794
798 void addEdge( const agx::Vec3& startPoint, const agx::Vec3& endPoint );
799
803 void addNode( const agx::Vec3& point );
804
808 void addNode( const agx::Vec3& point,
809 float radius,
810 const agx::Vec3& color,
811 agxRender::RenderManager* manager ) const;
812
813 protected:
814 virtual ~WireRenderProxy() {}
815
816 protected:
817 float m_radius;
821 };
822
824
825 // -------- Implementation ----------------
826
827 //inline PrimitiveType RenderProxy::getType() const { return m_type; }
828
829 inline void RenderProxy::setTransform( const agx::AffineMatrix4x4& transform )
830 {
831 m_transform = transform;
833 }
834
836 {
837 return m_transform;
838 }
839
840 inline void RenderProxy::setColor( const agx::Vec3& color )
841 {
842 if ( !agx::equivalent( m_color, color ) ) {
843 m_color = color;
845 }
846 }
847
849 {
850 return m_color;
851 }
852
853 inline void RenderProxy::setAlpha( float alpha )
854 {
855
856 if ( !agx::equivalent( m_alpha, alpha ) ) {
857 m_alpha = alpha;
859 }
860 }
861
862 inline float RenderProxy::getAlpha() const
863 {
864 return m_alpha;
865 }
866
868 {
869 m_modifiedCount = c;
870 }
871
873 {
874 return m_modifiedCount;
875 }
876
877 inline void RenderProxy::setShape( agxCollide::Shape* shape, const agxCollide::Geometry* geometry )
878 {
879 m_shape = shape;
880 m_geometry = geometry;
882 }
883
885 {
886 return m_shape;
887 }
888
890 {
891 return m_geometry;
892 }
893
894 inline void RenderProxy::setEnable( bool flag )
895 {
896 if ( m_enable != flag )
897 {
898 m_enable = flag;
900 }
901 }
902
903 inline bool RenderProxy::getEnable() const
904 {
905 return m_enable;
906 }
907
909 {
910 if ( mode != m_renderMode ) {
911 m_renderMode = (RenderMode)mode;
913 }
914 }
915
917 {
918 return (RenderMode)m_renderMode;
919 }
920
922 {
924 }
925
927 {
928 return agx::Vec3f( radius, radius, (float)startPoint.distance( endPoint ) );
929 }
930
932 {
933 return agx::AffineMatrix4x4::translate( point );
934 }
935}
936
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGXPHYSICS_EXPORT
A box shape for geometric intersection tests.
Definition: Box.h:33
Implements a Capsule shape for geometric intersection tests.
Definition: Capsule.h:35
A right circular cone shape for geometric intersection tests.
Definition: Cone.h:49
A cylinder shape for geometric intersection tests.
Definition: Cylinder.h:35
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
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.
Definition: HollowCone.h:46
A hollow cylinder shape for geometric intersection tests.
A line shape for intersection tests, mostly for depth sensing and picking.
Base class for a shape.
Definition: Shape.h:58
A sphere class for geometric intersection tests.
Definition: Sphere.h:32
Triangle mesh for geometric intersection tests.
Definition: Trimesh.h:40
Internal class used by agxWire::Wire.
Definition: WireShape.h:44
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)
float getRadius() const
void set(float radius, float height)
float getHeight() const
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
float getHeight() const
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)
float getRadius() const
const agxCollide::Cone * getCastShape() const
Class holding contacts that makes it possible to batch render these objects.
const agxCollide::GeometryContactPtrVector * m_contacts
void set(const agxCollide::GeometryContactPtrVector &contacts, float scale)
const agxCollide::GeometryContactPtrVector & getContacts() const
ContactsProxy(const agxCollide::GeometryContactPtrVector &contacts)
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)
void set(const agx::Vec3 &top, const agx::Vec3 &bottom, float topRadius, float bottomRadius, float thickness)
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)
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)
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)
agx::Vec3 getP2() const
agx::Vec3 getP1() const
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
Subclass that implements a SphereProxy.
virtual ~SphereProxy()=default
float getRadius() const
void synchronizeParameters()
This method should be implemented so that it extracts size parameters from an associated shape and st...
const agxCollide::Sphere * getCastShape() const
void set(float radius)
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)
void set(const agx::Vec3 &top, const agx::Vec3 &bottom, float topRadius, float bottomRadius)
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).
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.
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.
WireRenderProxy(float radius, const agx::Vec3 &color)
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
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)
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.
Definition: Referenced.h:120
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:49
static Vec3T Z_AXIS()
Definition: Vec3Template.h:783
Vector containing 'raw' data.
Definition: agx/Vector.h:246
Templated vector class.
Definition: agx/Vector.h:53
Smart pointer for observed objects, that automatically set pointers to them to null when they deleted...
Definition: observer_ptr.h:61
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:30
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,...
Definition: Constraint.h:36
agx::ref_ptr< WireRenderProxy > WireRenderProxyRef
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:31
int32_t Int32
Definition: Integer.h:37
uint32_t UInt32
Definition: Integer.h:32
PlaneT< agx::Real > Plane
Definition: agx/Plane.h:121
bool Bool
Definition: Integer.h:40
uint64_t UInt
Definition: Integer.h:27
double Real
Definition: Real.h:41
LineT< Vec3 > Line
Definition: agx/Line.h:39
Vec3T< Real32 > Vec3f
Definition: agx/Vec3.h:39
AGXPHYSICS_EXPORT agx::Bool equivalent(const agx::AddedMassInteraction::Matrix6x6 &lhs, const agx::AddedMassInteraction::Matrix6x6 &rhs, agx::Real eps=agx::RealEpsilon)
agx::AffineMatrix4x4 getTransform() const
SegmentDef(const agx::Vec3 &sp, const agx::Vec3 &ep, float r)
agx::AffineMatrix4x4 getTransform() const