AGX Dynamics  2.37.2.0
agxRender/RenderProxy.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGXRENDER_RENDERPROXY_H
18 #define AGXRENDER_RENDERPROXY_H
19 
20 
21 #include <agx/agxPhysics_export.h>
22 #include <agx/DynamicsSystem.h>
23 
24 namespace agxCollide
25 {
26  class Shape;
27  class Geometry;
28  class Sphere;
29  class Box;
30  class HeightField;
31  class Line;
32  class Cylinder;
33  class HollowCylinder;
34  class Capsule;
35  class Cone;
36  class HollowCone;
37  class Trimesh;
38  class Plane;
39  class WireShape;
40 }
41 
42 namespace agxSDK
43 {
44  class Simulation;
45 }
46 
47 namespace agxRender
48 {
49 
50 
69  };
70 
72 
77  {
78  public:
79 
81  enum EventType {
88  RENDERMODE
89  };
90 
91  enum RenderMode {
92  NOT_SET = 0x0,
93  SOLID = 0x1,
94  WIREFRAME = 0x2
95  };
96 
98  RenderProxy( PrimitiveType type, agxCollide::Shape *shape = nullptr );
99 
101  PrimitiveType getType() const;
102 
104  virtual void setTransform( const agx::AffineMatrix4x4& transform );
105 
109  virtual void setColor( const agx::Vec3& color );
110 
114  virtual agx::Vec3 getColor() const;
115 
116 
120  virtual void setAlpha( float alpha );
121 
123  virtual float getAlpha() const;
124 
128  virtual void updateShape() {}
129 
130 
132  const agx::AffineMatrix4x4& getTransform() const;
133 
140  agx::UInt32 getModifiedCount() const;
141 
142 
143  const agxCollide::Shape *getShape() const;
144  const agxCollide::Geometry *getGeometry() const;
145 
147  bool compare() const;
148 
153  void callOnChange( EventType type );
154 
159  void setEnable( bool flag );
160 
162  bool getEnable() const;
163 
165  inline bool isEnabled() const { return getEnable(); }
166 
171  void setRenderMode( RenderMode mode );
172 
174  RenderMode getRenderMode( ) const;
175 
177  virtual void reset();
178 
182  static agx::Bool shouldRender( const agx::RigidBody* rb );
183 
184  protected:
188  virtual void synchronizeParameters() {}
189 
195  virtual void onChange( EventType /*type*/ ) {}
196 
197  friend class RenderManager;
198  void setModifiedCount( agx::UInt32 c );
200  void setShape( agxCollide::Shape* shape, const agxCollide::Geometry *geometry );
201 
203  virtual ~RenderProxy();
204 
207 
208  private:
209  PrimitiveType m_type;
210  const agxCollide::Geometry* m_geometry;
211  agx::UInt32 m_modifiedCount;
212  float m_alpha;
213  agx::Vec3 m_color;
214  bool m_enable;
215  agx::Int32 m_renderMode;
216  };
217 
220  {
221  public:
222 
224  TextProxy( const agx::String& text, const agx::Vec3& pos );
225 
226  void set( const agx::String& text, const agx::Vec3& pos ) {
227  m_text = text;
228  m_transform.setTranslate( pos[0], pos[1], pos[2] );
229  callOnChange( SHAPE );
230  }
232  return m_text;
233  }
235  return m_transform.getTranslate();
236  }
237 
238  protected:
239  virtual ~TextProxy() {}
241  };
242 
245  {
246  public:
247 
249  PlaneProxy( const agx::Vec3& normal, agx::Real distance );
250 
251  void set( const agx::Vec3& normal, agx::Real distance ) {
252  m_normal = normal;
253  m_distance = distance;
254  callOnChange( SHAPE );
255  }
256 
258  const agxCollide::Plane *getCastShape() const;
259 
261  return m_normal;
262  }
264  return m_distance;
265  }
266 
267  protected:
268 
269  void synchronizeParameters();
270 
271  virtual ~PlaneProxy() {}
274  };
275 
278  {
279  public:
280 
281  SphereProxy() : RenderProxy( PRIMITIVE_SPHERE ), m_radius( 0 ) {}
282  SphereProxy( float radius );
283 
284  void set( float radius ) {
285  m_radius = radius;
286  callOnChange( SHAPE );
287  }
288 
289  float getRadius() const {
290  return m_radius;
291  }
292 
294  const agxCollide::Sphere *getCastShape() const;
295 
296  protected:
297 
298  void synchronizeParameters();
299 
300  virtual ~SphereProxy() {}
301  float m_radius;
302  };
303 
306  {
307  public:
308 
310  LineProxy( const agx::Vec3& p1, const agx::Vec3& p2 );
311 
312  void set( const agx::Vec3& p1, const agx::Vec3& p2 ) {
313  m_p1 = p1;
314  m_p2 = p2;
315  callOnChange( SHAPE );
316  }
317  agx::Vec3 getP1() const {
318  return m_p1;
319  }
320  agx::Vec3 getP2() const {
321  return m_p2;
322  }
323 
325  const agxCollide::Line *getCastShape() const;
326 
327  protected:
328 
329  void synchronizeParameters();
330 
331  virtual ~LineProxy() {}
334  };
335 
338  {
339  public:
340 
342  CylinderProxy( float radius, float height );
343  CylinderProxy( const agx::Vec3& begin, const agx::Vec3& end, float radius );
344 
345  void set( float radius, float height ) {
346  m_radius = radius;
347  m_height = height;
348  callOnChange( SHAPE );
349  }
350  void set( const agx::Vec3& begin, const agx::Vec3& end, float radius );
351 
353  float getRadius() const {
354  return m_radius;
355  }
356 
358  float getHeight() const {
359  return m_height;
360  }
361 
363  const agxCollide::Cylinder *getCastShape() const;
364 
365  protected:
366 
367  void synchronizeParameters();
368 
369  virtual ~CylinderProxy() {}
370  float m_height;
371  float m_radius;
372  };
373 
374 
377  {
378  public:
379 
381  HollowCylinderProxy( float radius, float height, float thickness );
382  HollowCylinderProxy( const agx::Vec3& begin, const agx::Vec3& end, float radius, float thickness );
383 
384  void set( float radius, float height, float thickness ) {
385  m_radius = radius;
386  m_height = height;
387  m_thickness = thickness;
388  callOnChange( SHAPE );
389  }
390 
391  void set( const agx::Vec3& begin, const agx::Vec3& end, float radius, float thickness );
392 
394  float getRadius() const {
395  return m_radius;
396  }
397 
399  float getHeight() const {
400  return m_height;
401  }
402 
404  float getThickness() const {
405  return m_thickness;
406  }
407 
409  const agxCollide::HollowCylinder *getCastShape() const;
410 
411  protected:
412  void synchronizeParameters();
413 
414  virtual ~HollowCylinderProxy() {}
415  float m_height;
416  float m_radius;
417  float m_thickness;
418  };
419 
420 
421 
424  {
425  public:
426 
428  ConeProxy( float radius, float height );
429  ConeProxy( const agx::Vec3& begin, const agx::Vec3& end, float radius );
430 
431  void set( float radius, float height ) {
432  m_radius = radius;
433  m_height = height;
434  callOnChange( SHAPE );
435  }
436 
437  void set( const agx::Vec3& begin, const agx::Vec3& end, float radius );
438 
440  float getRadius() const {
441  return m_radius;
442  }
443 
445  float getHeight() const {
446  return m_height;
447  }
448 
449 
451  const agxCollide::Cone *getCastShape() const;
452  protected:
453 
454  void synchronizeParameters();
455 
456  virtual ~ConeProxy() {}
457  float m_radius;
458  float m_height;
459  };
460 
463  {
464  public:
465 
467  TruncatedConeProxy( float topRadius, float bottomRadius, float height );
468  TruncatedConeProxy( const agx::Vec3& begin, const agx::Vec3& end, float topRadius, float bottomRadius );
469 
470  void set( float topRadius, float bottomRadius, float height ) {
471  m_topRadius = topRadius;
472  m_bottomRadius = bottomRadius;
473  m_height = height;
474  callOnChange( SHAPE );
475  }
476 
477  void set( const agx::Vec3& top, const agx::Vec3& bottom, float topRadius, float bottomRadius );
478 
480  float getTopRadius() const {
481  return m_topRadius;
482  }
483 
485  float getBottomRadius() const {
486  return m_bottomRadius;
487  }
488 
490  float getHeight() const {
491  return m_height;
492  }
493 
494 
496  const agxCollide::Cone *getCastShape() const;
497  protected:
498 
499  void synchronizeParameters();
500 
501  virtual ~TruncatedConeProxy() {}
502  float m_topRadius;
504  float m_height;
505  };
506 
509  {
510  public:
511 
513  HollowTruncatedConeProxy( float topRadius, float bottomRadius, float height, float thickness );
514  HollowTruncatedConeProxy( const agx::Vec3& begin, const agx::Vec3& end, float topRadius, float bottomRadius, float thickness );
515 
516  void set( float topRadius, float bottomRadius, float height, float thickness ) {
517  m_topRadius = topRadius;
518  m_bottomRadius = bottomRadius;
519  m_height = height;
520  m_thickness = thickness;
521  callOnChange( SHAPE );
522  }
523 
524  void set( const agx::Vec3& top, const agx::Vec3& bottom, float topRadius, float bottomRadius, float thickness );
525 
527  float getTopRadius() const {
528  return m_topRadius;
529  }
530 
532  float getBottomRadius() const {
533  return m_bottomRadius;
534  }
535 
537  float getHeight() const {
538  return m_height;
539  }
540 
542  float getThickness() const {
543  return m_thickness;
544  }
545 
546 
548  const agxCollide::HollowCone *getCastShape() const;
549  protected:
550 
551  void synchronizeParameters();
552 
554  float m_topRadius;
556  float m_height;
557  float m_thickness;
558  };
559 
560 
563  {
564  public:
565 
567  CapsuleProxy( float radius, float height );
568  CapsuleProxy( const agx::Vec3& begin, const agx::Vec3& end, float radius );
569 
570  void set( float radius, float height ) {
571  m_radius = radius;
572  m_height = height;
573  callOnChange( SHAPE );
574  }
575 
576  void set( const agx::Vec3& begin, const agx::Vec3& end, float radius );
577 
578 
580  float getRadius() const {
581  return m_radius;
582  }
583 
585  float getHeight() const {
586  return m_height;
587  }
588 
590  const agxCollide::Capsule *getCastShape() const;
591 
592  protected:
593 
594  void synchronizeParameters();
595 
596  virtual ~CapsuleProxy() {}
597  float m_height;
598  float m_radius;
599  };
600 
601 
604  {
605  public:
606 
608  WireShapeProxy( float radius, float height,
609  const agx::Vec3& previousEndPoint0, const agx::Vec3& previousEndPoint1 );
610  WireShapeProxy( const agx::Vec3& begin, const agx::Vec3& end,
611  const agx::Vec3& previousEndPoint0, const agx::Vec3& previousEndPoint1, float radius );
612 
613  void set( float radius, float height) {
614  m_radius = radius;
615  m_height = height;
616  callOnChange( SHAPE );
617  }
618 
619  void set( float radius, float height,
620  const agx::Vec3& previousEndPoint0, const agx::Vec3& previousEndPoint1)
621  {
622  m_radius = radius;
623  m_height = height;
624  m_previousEndPoint0 = previousEndPoint0;
625  m_previousEndPoint1 = previousEndPoint1;
626  callOnChange( SHAPE );
627  }
628 
629  void set( const agx::Vec3& begin, const agx::Vec3& end,
630  const agx::Vec3& previousEndPoint0, const agx::Vec3& previousEndPoint1, float radius );
631 
632 
634  float getRadius() const {
635  return m_radius;
636  }
637 
639  float getHeight() const {
640  return m_height;
641  }
642 
645  {
646  return m_previousEndPoint0;
647  }
648 
649 
652  {
653  return m_previousEndPoint1;
654  }
655 
656 
658  const agxCollide::WireShape *getCastShape() const;
659 
660  protected:
661  void synchronizeParameters();
662 
663  virtual ~WireShapeProxy() {}
664 
667  float m_height;
668  float m_radius;
669  };
670 
671 
674  {
675  public:
676 
678  BoxProxy( const agx::Vec3& halfExtents );
679 
681  void set( const agx::Vec3& halfExtents ) {
682  m_halfExtents = halfExtents;
683  callOnChange( SHAPE );
684  }
685 
687  return m_halfExtents;
688  }
689 
691  const agxCollide::Box *getCastShape() const;
692 
693  protected:
694 
695  void synchronizeParameters();
696 
697 
698  virtual ~BoxProxy() {}
699 
701  };
702 
705  {
706  public:
707 
709 
711 
717  void setHeights(const agx::Vec2iVector& modifiedIndices, const agx::RealVector& heights);
718 
720  const agxCollide::HeightField *getCastShape() const;
721 
722  protected:
723 
728  virtual void set( const agx::Vec2iVector& modifiedIndices, const agx::RealVector& heights )=0;
729 
731  virtual ~HeightFieldProxy() {}
732 
734  return *this;
735  }
736  };
737 
740  {
741  public:
742 
744 
746 
747  void set( agxCollide::Trimesh *mesh );
748 
749  const agxCollide::Trimesh *getCastShape() const;
750 
751  protected:
752  virtual ~TrimeshProxy() {}
754  return *this;
755  }
756  };
757 
758 #if 0
759  class AGXPHYSICS_EXPORT SphereSpriteBatchRenderProxy : public RenderProxy
760  {
761  public:
762  SphereSpriteBatchRenderProxy() : RenderProxy( PRIMITIVE_SPHERE_BATCH )
763  {
764  this->setColor(agx::Vec3(agx::Real(0.9)));
765  }
766 
767  // SphereSpriteBatchRenderProxy( agxData::Buffer *positions, agxData::Buffer *radii, agxData::Value *bound )
768  // : RenderProxy( PRIMITIVE_SPHERE_BATCH ), m_positions(positions), m_radii(radii), m_bound(bound) {}
769 
770  #if 0
771  // void set( agxData::Array<agx::Vec3> positions, agxData::Array<agx::Real> radii, agx::Bound3 bound )
772  void set( agxData::Buffer *positions, agxData::Buffer *radii, agxData::Value *bound )
773  {
774  m_positions = positions;
775  m_radii = radii;
776  m_bound = bound;
777  callOnChange( SHAPE );
778  }
779  #endif
780 
781  protected:
782  virtual ~SphereSpriteBatchRenderProxy() {}
783 
784  protected:
785  // agxData::Array< agx::Vec3 > m_positions;
786  // agxData::Array< agx::Real > m_radii;
787  // agx::Bound3 m_bound;
788  // agxData::BufferRef m_positions;
789  // agxData::BufferRef m_radii;
790  // agxData::ValueRef m_bound;
791  };
792 
793  typedef agx::ref_ptr< SphereSpriteBatchRenderProxy > SphereSpriteBatchRenderProxyRef;
794 
795 
796  class AGXPHYSICS_EXPORT SphereMeshBatchRenderProxy : public RenderProxy
797  {
798  public:
799  SphereMeshBatchRenderProxy( const agxData::Array< agx::Vec3 >* buffer )
800  : RenderProxy( PRIMITIVE_SPHERE ), m_buffer( buffer ) {}
801 
802  void set( const agxData::Array< agx::Vec3 >* buffer, float /*radius*/ )
803  {
804  m_buffer = buffer;
805  callOnChange( SHAPE );
806  }
807 
808  protected:
809  virtual ~SphereMeshBatchRenderProxy() {}
810 
811  protected:
812  const agxData::Array< agx::Vec3 >* m_buffer;
813  };
814 
815  typedef agx::ref_ptr< SphereMeshBatchRenderProxy > SphereMeshBatchRenderProxyRef;
816 #endif
817 
822  {
823  public:
825 
826  void set( const agxCollide::GeometryContactPtrVector& contacts, float scale )
827  {
828  m_contacts = &contacts;
829  m_scale = scale;
830  callOnChange( SHAPE );
831  }
832 
833  const agxCollide::GeometryContactPtrVector& getContacts() const { return *m_contacts; }
834 
835  protected:
836  ContactsProxy() : RenderProxy( PRIMITIVE_CONTACTS ), m_contacts(nullptr), m_scale(1) {}
837 
838  virtual ~ContactsProxy() {}
840  float m_scale;
841  };
842 
847  {
848  public:
850 
851  public:
853  : RenderProxy( PRIMITIVE_SPHERE ), m_bodies(), m_scale( 1.f ) {}
854 
855  void set( const agx::RigidBodyPtrSetVector* enabledBodies, float scale )
856  {
857  m_bodies.clear();
858  if ( enabledBodies != nullptr ) {
859  m_bodies.reserve( enabledBodies->size() );
860  for ( agx::UInt i = 0; i < enabledBodies->size(); ++i ) {
861  const agx::RigidBody* rb = enabledBodies->at( i );
862  if ( RenderProxy::shouldRender( rb ) )
863  m_bodies.push_back( rb );
864  }
865  }
866  m_scale = scale;
867  callOnChange( SHAPE );
868  }
869 
870  protected:
872 
873  protected:
875  float m_scale;
876  };
877 
879  {
880  public:
881  struct SegmentDef
882  {
883  SegmentDef( const agx::Vec3& sp, const agx::Vec3& ep, float r )
884  : startPoint( sp ), endPoint( ep ), radius( r ) {}
885 
886  const SegmentDef* operator->() const { return this; }
887 
888  agx::AffineMatrix4x4 getTransform() const;
889  agx::Vec3f getScale() const;
890 
893  float radius;
894  };
895 
896  struct SphereDef
897  {
898  SphereDef( const agx::Vec3& p )
899  : point( p ) {}
900 
901  const SphereDef* operator->() const { return this; }
902  agx::AffineMatrix4x4 getTransform() const;
903 
905  };
906 
909 
910  public:
911  WireRenderProxy( float radius, const agx::Vec3& color );
912 
916  virtual void onAddNotification() {}
917 
921  virtual void onRemoveNotification() {}
922 
926  void prepare( agx::UInt numSegmentEstimate, agx::UInt numEdgesEstimate, agx::UInt numNodesEstimate );
927 
931  void commit();
932 
936  void addSegment( const agx::Vec3& startPoint, const agx::Vec3& endPoint, const agx::Vec3& prevStartPoint, const agx::Vec3& prevEndPoint );
937 
941  void addSegment( const agx::Vec3& startPoint, const agx::Vec3& endPoint, float radius, const agx::Vec3& color, agxRender::RenderManager* manager ) const;
942 
946  void addEdge( const agx::Vec3& startPoint, const agx::Vec3& endPoint );
947 
951  void addNode( const agx::Vec3& point );
952 
956  void addNode( const agx::Vec3& point, float radius, const agx::Vec3& color, agxRender::RenderManager* manager ) const;
957 
958  protected:
959  virtual ~WireRenderProxy() {}
960 
961  protected:
962  float m_radius;
963  SegmentDefContainer m_segments;
964  SegmentDefContainer m_edges;
965  SphereDefContainer m_nodes;
966  };
967 
969 
970  // -------- Implementation ----------------
971 
972  inline PrimitiveType RenderProxy::getType() const { return m_type; }
973 
974  inline void RenderProxy::setTransform( const agx::AffineMatrix4x4& transform ) {
975  m_transform = transform;
976  callOnChange( TRANSFORM );
977  }
978  inline const agx::AffineMatrix4x4& RenderProxy::getTransform() const {
979  return m_transform;
980  }
981 
982  inline void RenderProxy::setColor( const agx::Vec3& color ) {
983  if (!agx::equivalent(m_color, color)) {
984  m_color = color;
985  callOnChange( COLOR );
986  }
987  }
988 
989  inline agx::Vec3 RenderProxy::getColor() const {
990  return m_color;
991  }
992 
993  inline void RenderProxy::setAlpha( float alpha ) {
994 
995  if (!agx::equivalent(m_alpha, alpha)) {
996  m_alpha = alpha;
997  callOnChange( ALPHA );
998  }
999  }
1000 
1001  inline float RenderProxy::getAlpha() const {
1002  return m_alpha;
1003  }
1004 
1005  inline void RenderProxy::setModifiedCount( agx::UInt32 c ) {
1006  m_modifiedCount = c;
1007  }
1008 
1009  inline agx::UInt32 RenderProxy::getModifiedCount() const {
1010  return m_modifiedCount;
1011  }
1012 
1013  inline void RenderProxy::setShape( agxCollide::Shape* shape, const agxCollide::Geometry *geometry ) {
1014  m_shape = shape;
1015  m_geometry = geometry;
1016  setModifiedCount(agx::UInt32(-1));
1017  //callOnChange( SHAPE );
1018  }
1019 
1020  inline const agxCollide::Shape* RenderProxy::getShape() const {
1021  return m_shape;
1022  }
1023 
1024  inline const agxCollide::Geometry* RenderProxy::getGeometry() const {
1025  return m_geometry;
1026  }
1027 
1028  inline void RenderProxy::setEnable( bool flag ) {
1029  if (m_enable != flag)
1030  {
1031  m_enable = flag;
1032  callOnChange( ENABLE );
1033  }
1034  }
1035 
1036  inline bool RenderProxy::getEnable() const {
1037  return m_enable;
1038  }
1039 
1040  inline void RenderProxy::setRenderMode( RenderProxy::RenderMode mode ) {
1041  if ( mode != m_renderMode ) {
1042  m_renderMode = ( RenderMode )mode;
1043  callOnChange( RENDERMODE );
1044  }
1045  }
1046 
1047  inline RenderProxy::RenderMode RenderProxy::getRenderMode( ) const {
1048  return ( RenderMode )m_renderMode;
1049  }
1050 
1051  inline void HeightFieldProxy::setHeights(const agx::Vec2iVector& modifiedIndices, const agx::RealVector& heights)
1052  {
1053  agxAssert(modifiedIndices.size() == heights.size() );
1054 
1055  set( modifiedIndices, heights );
1056 
1057  // Sync modified count
1058  setModifiedCount( getShape()->getModifiedCount() );
1059  }
1060 
1061  inline agx::AffineMatrix4x4 WireRenderProxy::SegmentDef::getTransform() const
1062  {
1063  return agx::AffineMatrix4x4::rotate( agx::Vec3::Z_AXIS(), (endPoint - startPoint).normal() ) * agx::AffineMatrix4x4::translate( (startPoint + endPoint) * agx::Real( 0.5 ) );
1064  }
1065 
1066  inline agx::Vec3f WireRenderProxy::SegmentDef::getScale() const
1067  {
1068  return agx::Vec3f( radius, radius, (float)startPoint.distance( endPoint ) );
1069  }
1070 
1071  inline agx::AffineMatrix4x4 WireRenderProxy::SphereDef::getTransform() const
1072  {
1073  return agx::AffineMatrix4x4::translate( point );
1074  }
1075 }
1076 
1077 #endif
AGXCORE_EXPORT Type * getType(const agx::String &name)
A right circular hollow cone shape for geometric intersection tests.
Definition: HollowCone.h:45
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.
Definition: Capsule.h:34
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.
int32_t Int32
Definition: Integer.h:45
agx::Vec3 getPreviousEndPoint0() const
bool Bool
Definition: Integer.h:48
Base class for a shape.
Definition: Shape.h:53
Subclass that implements a BoxProxy.
Abstract representation of a value.
Definition: Value.h:48
This namespace consists of a set of classes for handling geometric intersection tests including boole...
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
Definition: Plane.h:121
agx::Vec3 getHalfExtents() const
virtual void onChange(EventType)
Pure virtual method that should response on the different events.
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
The Shape has been modified a rebuild is needed.
agx::Vec3 getPosition() const
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.
Definition: Constraint.h:35
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.
Definition: agxData.h:30
SegmentDef(const agx::Vec3 &sp, const agx::Vec3 &ep, float r)
A line shape for intersection tests, mostly for depth sensing and picking.
Definition: ollide/Line.h:55
Base class providing referencing counted objects.
Definition: Referenced.h:119
static Vec3T Z_AXIS()
Definition: Vec3Template.h:783
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
Subclass that implements a SphereProxy.
uint32_t UInt
Definition: Integer.h:34
Vector containing &#39;raw&#39; data.
Definition: Vector.h:245
The alpha value for a proxy is updated.
Class holding contacts that makes it possible to batch render these objects.
virtual void onRemoveNotification()
Called when the wire is removed from the simulation.
Abstract representation of a data buffer.
Definition: Buffer.h:55
const agxCollide::GeometryContactPtrVector & getContacts() const
agx::Real getDistance() const
agx::ref_ptr< WireRenderProxy > WireRenderProxyRef
A hollow cylinder shape for geometric intersection tests.
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
LinearProbingHashSetImplementation< KeyT, HashT >::iterator begin(LinearProbingHashSetImplementation< KeyT, HashT > &set)
A right circular cone shape for geometric intersection tests.
Definition: Cone.h:48
Subclass that implements a PlaneProxy.
const agxCollide::GeometryContactPtrVector * m_contacts
virtual void synchronizeParameters()
This method should be implemented so that it extracts size parameters from an associated shape and st...
Vec3T< Real32 > Vec3f
Definition: Vec3.h:39
#define agxAssert(expr)
Definition: debug.h:143
A sphere class for geometric intersection tests.
Definition: Sphere.h:31
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.
Definition: WireShape.h:43
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:54
A box shape for geometric intersection tests.
Definition: Box.h:32
Subclass that implements a HollowTruncatedConeProxy.
agx::String getText() const
Subclass that implements a TextProxy.
size_t size() const
Definition: Container.h:134
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.
double Real
Definition: Real.h:42
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.
Definition: Trimesh.h:42
Subclass that implements a LineProxy.
LineT< Vec3 > Line
Definition: Line.h:39
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
Subclass that implements a CylinderProxy.
A cylinder shape for geometric intersection tests.
Definition: Cylinder.h:36
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...
uint32_t UInt32
Definition: Integer.h:40
The color value for a proxy is updated.
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Definition: SetVector.h:37
AGX_DECLARE_POINTER_TYPES(SpaceListener)