AGX Dynamics  2.38.0.2
WindAndWaterController.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 AGXMODEL_WINDANDWATERCONTROLLER_H
18 #define AGXMODEL_WINDANDWATERCONTROLLER_H
19 
20 #include <agxModel/export.h>
21 #include <agxModel/AddedMassDb.h>
24 
25 #include <agx/Vec6.h>
26 
27 #include <agxCollide/Geometry.h>
28 
29 #include <agxSDK/LinkedStructure.h>
30 
31 #include <agxWire/Wire.h>
32 
33 #include <mutex>
34 
35 
36 namespace agxModel {
37  class WaterWrapper;
41 
46  {
47  public:
49 
50  enum ForceType {
51  OTHER = 0,
56  Count
57  };
58 
63  {
64  public:
70 
76  virtual agx::Vec3 getVelocity( const agx::Vec3& worldPoint ) const;
77 
79 
80  protected:
81  virtual ~WindAndWaterFlowGenerator();
82  };
83 
85 
90  {
91  public:
97 
98 #ifndef SWIG
100 #endif
101  protected:
102  virtual ~WaterFlowGenerator();
103  };
104 
106 
111  {
112  public:
117  WindGenerator();
118 
123  virtual void prepare( const agxCollide::Geometry* geometry );
124 
125 #ifndef SWIG
127 #endif
128  protected:
129  virtual ~WindGenerator();
130  };
131 
132 
137  {
138  public:
142  WindWrapper( agx::Bool enable, const agxModel::WindAndWaterController::WindGenerator* windGenerator, agx::Real airDensity );
143 
147  agx::Real getDensity() const;
148 
152  agx::Vec3 getVelocity( const agx::Vec3& worldPoint ) const;
153 
157  agx::Bool getEnable() const;
158 
159  protected:
163  };
164 
169  {
170  public:
171 
176  const agxModel::HydrodynamicsParameters* hydroParams );
177 
181  const agxModel::AerodynamicsParameters* getAerodynamicsParameters() const;
182 
186  const agxModel::HydrodynamicsParameters* getHydrodynamicsParameters() const;
187 
188  protected:
189  virtual ~WindAndWaterData();
190 
193  };
194 
199  {
200  public:
204  ObjectData( const agxCollide::Shape* shape,
205  const agxModel::AerodynamicsParameters* aeroParams,
206  const agxModel::HydrodynamicsParameters* hydroParams,
207  const agxModel::WaterWrapper* water,
209  const agx::Vec3& gravity,
210  agxModel::PressureFieldRenderer* pressureFieldRenderer,
211  const agx::UInt numTriangles,
212  const agx::UInt startIndexT,
213  const agx::UInt startIndexV,
214  bool enableCenterOfBuoyancy);
215 
219  agx::UInt getStartIndexT() const;
220 
224  agx::UInt getNumTriangles() const;
225 
229  agx::Real getDensity( agx::Bool belowSurface ) const;
230 
234  agx::Real getDensity( const agxModel::TriangleData& tData ) const;
235 
239  agx::Real getDensity( const agxModel::VertexData& vData ) const;
240 
244  agx::Real getDensityWater() const;
245 
249  agx::Real getDensityAir() const;
250 
254  const agx::Vec3& getGravity() const;
255 
259  const agx::Vec3& getForce() const;
260 
264  agx::Vec3& force();
265 
269  const agx::Vec3& getForceComponent(ForceType type) const;
270 
274  const agx::Vec3Vector& getForceComponents() const;
275 
279  agx::Vec3& forceComponent(ForceType type);
280 
284  const agx::Vec3& getTorque() const;
285 
289  agx::Vec3& torque();
290 
294  const agx::Vec3& getTorqueComponent(ForceType type) const;
295 
299  const agx::Vec3Vector& getTorqueComponents() const;
300 
304  agx::Vec3& torqueComponent(ForceType type);
305 
309  const agx::Matrix3x3& getAddedMass() const;
310 
314  agx::Matrix3x3& addedMass();
315 
319  const agx::Matrix3x3& getAddedInertia() const;
320 
324  agx::Matrix3x3& addedInertia();
325 
329  agx::Bool& containsAddedMass();
330 
334  const agx::Bool& containsAddedMass() const;
335 
339  const agxCollide::Shape* getShape() const;
340 
344  const agxCollide::Geometry* getGeometry() const;
345 
349  const WaterWrapper* getWater() const;
350 
354  const agx::RigidBody* getRigidBody() const;
355 
360  agx::RigidBody* getRigidBodySerial();
361 
365  agxModel::PressureFieldRenderer* getPressureFieldRenderer() const;
366 
370  const agx::Vec3& getCenterOfBuoyancy() const;
371 
375  agx::Vec3& centerOfBuoyancy();
376 
380  const agx::Real& getVolumeInWater() const;
381 
385  agx::Real& volumeInWater();
386 
390  bool getEnableCenterOfBuoyancy();
391 
395  void lock() const { m_mutex.lock(); };
396 
400  void unLock() const { m_mutex.unlock(); };
401 
402  protected:
403  virtual ~ObjectData();
404 
405  private:
406  agx::Vec3 m_gravity;
407  agx::Real m_densityWater;
408  agx::Real m_densityAir;
409  mutable agx::Vec3 m_force;
410  agx::Vec3Vector m_forceComponents;
411  mutable agx::Vec3 m_torque;
412  agx::Vec3Vector m_torqueComponents;
413  agx::Matrix3x3 m_addedMass;
414  agx::Matrix3x3 m_addedInertia;
415  agx::Bool m_containsAddedMass;
416  const agxCollide::Shape* m_shape;
417  PressureFieldRenderer* m_pressureFieldRenderer;
418  WaterWrapperConstRef m_water;
419  const agx::UInt m_numTriangles;
420  const agx::UInt m_startIndexT;
421  mutable std::mutex m_mutex;
422  agx::Vec3 m_centerOfBuoyancy;
423  agx::Real m_volumeInWater;
424  bool m_enableCenterOfBuoyancy;
425  };
426 
429 
430  struct WirePair
431  {
433  : node1( nullptr ), node2( nullptr ), water( nullptr ), gravity( agx::Vec3() )
434  {
435  }
436  WirePair( agxWire::Node* node1, agxWire::Node* node2, const agxCollide::Geometry* water, agx::Vec3 gravity )
437  : node1( node1 ), node2( node2 ), water( water ), gravity( gravity )
438  {
439  }
444 
445  private:
447  WirePair& operator=( const WirePair& )
448  {
449  return *this;
450  }
451  };
452 
454 
455  struct Segment
456  {
457  Segment( agx::RigidBody* rb, agx::Vec3 point1, agx::Vec3 point2, agx::Vec3 velocity, agx::Vec3 velocityOfFluid,
458  agx::Real fluidDensity, agx::Vec3 gravity, agx::Real volume )
459  : rb( rb ), point1( point1 ), point2( point2 ), velocity( velocity ), velocityOfFluid( velocityOfFluid ),
460  fluidDensity( fluidDensity ), gravity( gravity ), volume(volume)
461  {
462  }
471  };
472 
474 
479  {
480  public:
487  WireLinkedStructureData( agx::Real radius, const AerodynamicsParameters* aeroParams, const HydrodynamicsParameters* hydroParams );
488 
492  agx::Real getRadius();
493 
497  void addWaterSegment( const Segment& segment );
498 
502  void addAirSegment( const Segment& segment );
503 
507  SegmentContainer& getAirSegments();
508 
512  SegmentContainer& getWaterSegments();
513 
514  protected:
515  virtual ~WireLinkedStructureData();
516 
517 
518  private:
519  SegmentContainer m_airSegments;
520  SegmentContainer m_waterSegments;
521  agx::Real m_radius;
522  };
523 
526 
527 
533  {
534  DynamicsData() : worldForce(), worldTorque(), bodyFrameAddedMass( agx::Vec3() ), bodyFrameAddedInertia( agx::Vec3() ) {}
535 
543  void getAddedMassAndInertiaDiagonalCoefficients( const agx::RigidBody* rb, agx::Vec3& addedMassDiagonalCoefficients, agx::Vec3& addedInertiaDiagonalCoefficients ) const;
544 
549  };
550 
555  {
558  size_t numWaterSegments{0};
559  size_t numAirSegments{0};
560  agx::Real lengthWater{0.0};
561  agx::Real lengthAir{0.0};
562  };
563 
568  {
570  };
571 
572  public:
577 
583  virtual agx::Bool addWater( agxCollide::Geometry* geometry );
584 
591  virtual agx::Bool setEnableAerodynamics( agxCollide::Geometry* geometry, agx::Bool enable );
592 
598  virtual void setEnableAerodynamics( agx::Bool enable );
599 
606  virtual agx::Bool setEnableAerodynamics( agx::RigidBody* rb, agx::Bool enable );
607 
614  virtual agx::Bool setEnableAerodynamics( agxWire::Wire* wire, agx::Bool enable );
615 
623  agx::Bool setEnableAerodynamics( agxSDK::LinkedStructure* linkedStructure, agx::Bool enable );
624 
629  void setAirDensity( agx::Real airDensity );
630 
635  virtual agxModel::AerodynamicsParameters* getOrCreateAerodynamicsParameters( const agxCollide::Shape* shape ) const;
636 
641  virtual agxModel::HydrodynamicsParameters* getOrCreateHydrodynamicsParameters( const agxCollide::Shape* shape ) const;
642 
647  agxModel::AerodynamicsParameters* getOrCreateAerodynamicsParameters( const agxWire::Wire* wire ) const;
648 
653  agxModel::HydrodynamicsParameters* getOrCreateHydrodynamicsParameters( const agxWire::Wire* wire ) const;
654 
662  agxModel::AerodynamicsParameters* getOrCreateAerodynamicsParameters( const agxSDK::LinkedStructure* linkedStructure ) const;
663 
671  agxModel::HydrodynamicsParameters* getOrCreateHydrodynamicsParameters( const agxSDK::LinkedStructure* linkedStructure ) const;
672 
676  virtual agx::Bool registerPressureFieldRenderer( agxModel::PressureFieldRenderer* pressureFieldRenderer, const agxCollide::Shape* shape );
677 
682  virtual void setWindGenerator( agxModel::WindAndWaterController::WindGenerator* windGenerator );
683 
687  virtual agxModel::WindAndWaterController::WindGenerator* getWindGenerator() const;
688 
696  virtual agx::Bool setWaterFlowGenerator( const agxCollide::Geometry* waterGeometry,
698 
703  agxModel::WindAndWaterController::WaterFlowGenerator* getWaterFlowGenerator( const agxCollide::Geometry* waterGeometry ) const;
704 
710  virtual agx::Bool setWaterWrapper( agxCollide::Geometry* geometry,
711  agxModel::WaterWrapper* waterWrapper );
716  agxModel::WaterWrapper* getWaterWrapper( const agxCollide::Geometry* waterGeometry );
717 
724  static agxCollide::TrimeshRef createPrimitiveMesh( const agxCollide::Shape* shape,
726 
736  virtual agxModel::WindAndWaterController::DynamicsData calculateDynamicsData( const agxCollide::Geometry* waterGeometry,
737  const agx::RigidBody* rb,
738  const agx::Vec3& gravity,
739  const agxCollide::Space* space = nullptr,
740  agx::Bool updateRenderers = false );
741 
747  agxModel::WindAndWaterController::DynamicsWireData calculateWireDynamicsData( const agxCollide::Geometry* waterGeometry,
748  agxWire::Wire* wire );
749 
755  agxModel::WindAndWaterController::DynamicsLinkedStructureData calculateLinkedStructureDynamicsData( const agxCollide::Geometry* waterGeometry,
756  agxSDK::LinkedStructure* linkedStructure,
757  const agxCollide::Space* space );
758 
765  static agxModel::WindAndWaterController* find( agxSDK::Simulation* simulation, const agx::Uuid& uuid );
766 
773  static agxModel::WindAndWaterControllerPtrVector findAll( const agxSDK::Simulation* simulation, const agx::Name& name );
774 
780  static agxModel::WindAndWaterControllerPtrVector findAll( const agxSDK::Simulation* simulation );
781 
788  agx::Vec3 getForceComponent(agxCollide::Geometry* geometry, WindAndWaterController::ForceType type) const;
789 
796  agx::Vec3 getForceComponent(agx::RigidBody* body, WindAndWaterController::ForceType type) const;
797 
803  agx::Vec3 getForce(agxCollide::Geometry* geometry) const;
804 
810  agx::Vec3 getForce(agx::RigidBody* body) const;
811 
818  agx::Vec3 getTorqueComponent(agxCollide::Geometry* geometry, WindAndWaterController::ForceType type) const;
819 
826  agx::Vec3 getTorqueComponent(agx::RigidBody* body, WindAndWaterController::ForceType type) const;
827 
833  agx::Vec3 getTorque(agxCollide::Geometry* geometry) const;
834 
840  agx::Vec3 getTorque(agx::RigidBody* body) const;
841 
849  bool getCenterOfBuoyancy(agxCollide::Geometry* geometry, agx::Vec3& centerOfBuoyancy) const;
850 
859  bool getCenterOfBuoyancy(agx::RigidBody* body, agx::Vec3& centerOfBuoyancy) const;
860 
865  bool getEnableCenterOfBuoyancy(const agxCollide::Geometry* geometry) const;
866 
873  void setEnableCenterOfBuoyancy(agxCollide::Geometry* geometry, bool enable);
874 
881  void setEnableCenterOfBuoyancy(agx::RigidBody* body, bool enable);
882 
886  virtual void preCollide( const agx::TimeStamp& ) override;
887 
891  virtual void pre( const agx::TimeStamp& ) override;
892 
896  virtual void post( const agx::TimeStamp& ) override;
897 
899 
900  protected:
902  {
905 
906  protected:
908  };
910 
912  {
913  AerodynamicsData( const agxCollide::Geometry* geometryIn ) : geometry( geometryIn ) {}
915 
916  protected:
917  virtual ~AerodynamicsData() {}
918  };
920 
922  {
923  public:
926 
927  const agxCollide::Mesh* getOrCreateMesh( const agxCollide::Shape* shape, agx::Vec3& scale,
928  agxModel::WindAndWaterParameters::ShapeTessellation tessellationLevel ) const;
929 
930  static agx::Vec3 findScale( const agxCollide::Shape* shape );
931 
932  void garbageCollect();
933 
934  private:
935  struct PrimitiveData : public agx::Referenced
936  {
937  PrimitiveData( const agxCollide::Shape* shapeIn, agxCollide::Mesh* meshIn )
938  : shape( shapeIn ), mesh( meshIn )
939  {
940  }
941 
942  virtual void checkSize( agx::Real resolution ) = 0;
943 
945  agxCollide::MeshRef mesh;
946 
947  protected:
948  virtual ~PrimitiveData() {}
949  };
950 
951  struct CapsuleData : PrimitiveData
952  {
953  CapsuleData( const agxCollide::Shape* shapeIn, agxCollide::Mesh* meshIn, agx::Real radiusIn, agx::Real heightIn )
954  : PrimitiveData( shapeIn, meshIn ), radius( radiusIn ), height( heightIn )
955  {
956  }
957 
958  virtual void checkSize( agx::Real resolution ) override;
959 
960  agx::Real radius;
961  agx::Real height;
962 
963  protected:
964  virtual ~CapsuleData() {}
965  };
966 
967  struct ConeData : PrimitiveData
968  {
969  ConeData( const agxCollide::Shape* shapeIn, agxCollide::Mesh* meshIn , agx::Real topRadiusIn, agx::Real bottomRadiusIn, agx::Real heightIn )
970  : PrimitiveData( shapeIn, meshIn ), topRadius( topRadiusIn ), bottomRadius( bottomRadiusIn ),
971  height( heightIn )
972  {
973  }
974 
975  virtual void checkSize( agx::Real resolution ) override;
976 
977  agx::Real topRadius;
978  agx::Real bottomRadius;
979  agx::Real height;
980 
981  protected:
982  virtual ~ConeData() {}
983  };
984 
985  struct HollowConeData : PrimitiveData
986  {
987  HollowConeData( const agxCollide::Shape* shapeIn, agxCollide::Mesh* meshIn, agx::Real topOuterRadiusIn,
988  agx::Real bottomInnerRadiusIn, agx::Real heightIn,
989  agx::Real thicknessIn )
990  : PrimitiveData( shapeIn, meshIn ), topOuterRadius( topOuterRadiusIn ),
991  bottomInnerRadius( bottomInnerRadiusIn ), height( heightIn ), thickness( thicknessIn )
992  {
993  }
994 
995  virtual void checkSize( agx::Real resolution ) override;
996 
997  agx::Real topOuterRadius;
998  agx::Real bottomInnerRadius;
999  agx::Real height;
1000  agx::Real thickness;
1001 
1002  protected:
1003  virtual ~HollowConeData() {}
1004  };
1005 
1006  struct HollowCylinderData : PrimitiveData
1007  {
1008  HollowCylinderData( const agxCollide::Shape* shapeIn, agxCollide::Mesh* meshIn, agx::Real innerRadiusIn, agx::Real heightIn, agx::Real thicknessIn )
1009  : PrimitiveData( shapeIn, meshIn ), innerRadius( innerRadiusIn ), height( heightIn ),
1010  thickness( thicknessIn )
1011  {
1012  }
1013 
1014  virtual void checkSize( agx::Real resolution ) override;
1015 
1016  agx::Real innerRadius;
1017  agx::Real height;
1018  agx::Real thickness;
1019 
1020  protected:
1021  virtual ~HollowCylinderData() {}
1022  };
1023 
1025 
1028 
1029  private:
1030  agxCollide::MeshRef createUnitShape( agxCollide::Shape::Type shapeType, agx::Real resolution = agx::Real( 1 ) ) const;
1031  const agxCollide::Mesh* getOrCreatePrimitive( const agxCollide::Shape* shape, agx::Real resolution = agx::Real( 1 ) ) const;
1032 
1033  private:
1034  mutable MeshContainer m_cache;
1035  mutable PrimitiveContainer m_primitives;
1036 
1037  mutable std::mutex meshCreationMutex;
1038  };
1039 
1056 
1057  protected:
1061  virtual ~WindAndWaterController();
1062 
1066  virtual void updateAlgorithms( const ObjectDataContainer& data, bool updateRenderers );
1067 
1068  protected:
1072  void configureDefaultAlgorithms();
1073 
1077  void garbageCollect();
1078 
1082  agxModel::WindAndWaterController::PressureFieldRendererData* getPressureFieldRenderData( const agxCollide::Shape* shape ) const;
1083 
1087  agxModel::PressureFieldRenderer* getPressureFieldRender( const agxCollide::Shape* shape ) const;
1088 
1092  virtual agxModel::WindAndWaterController::ObjectDataContainer calculateObjectData( const agxCollide::Geometry* waterGeometry,
1093  const agxCollide::Geometry* geometry,
1094  const agx::Vec3& gravity,
1095  agx::Bool aeroEnabled,
1096  agx::Bool hydroEnabled,
1097  agx::Bool updateRenderers,
1098  const agx::UIntVector startIndexT,
1099  const agx::UIntVector startIndexV,
1100  const agx::TimeStamp& t = 0 );
1101 
1106  WirePairContainer wirePairs,
1108  agx::Bool aeroEnable,
1109  const agx::TimeStamp& t = 0 );
1110 
1114  agxModel::WindAndWaterController::WireLinkedStructureData* calculateLinkedStructureData( const agxCollide::Geometry* waterGeometry,
1115  const agxCollide::Geometry* geometry,
1116  const agx::Vec3& gravity,
1117  const AerodynamicsParameters* aeroParams,
1118  const HydrodynamicsParameters* hydroParams,
1119  agx::Bool aeroEnabled,
1120  agx::Bool hydroEnabled,
1121  const agx::TimeStamp& t = 0 );
1122 
1123  void getSizeOfGeometry( const agxCollide::Geometry* geometry,
1124  agx::UIntVector& numTriangles,
1125  agx::UIntVector& numVertices );
1126 
1127  protected:
1153  };
1154 
1160  class AGXMODEL_EXPORT WindAndWaterController::Algorithm : public agx::Referenced
1161  {
1162  public:
1164 
1165  public:
1169  virtual void preCollide( agxModel::WindAndWaterController* /*controller*/ ) {}
1170 
1174  virtual void pre( agxModel::WindAndWaterController* /*controller*/ ) {}
1175 
1179  virtual void post( agxModel::WindAndWaterController* /*controller*/ ) {}
1180 
1185 
1187  };
1188 
1190 
1195  {
1196  public:
1201  ConstantWaterFlowGenerator( const agx::Vec3& velocity );
1202 
1207  void setVelocity( const agx::Vec3& velocity );
1208 
1212  const agx::Vec3& getVelocity() const;
1213 
1214  public:
1215  virtual agx::Vec3 getVelocity( const agx::Vec3& /*worldPosition*/ ) const override;
1216 
1218 
1219  protected:
1221  virtual ~ConstantWaterFlowGenerator();
1222 
1223  private:
1224  agx::Vec3 m_velocity;
1225  };
1226 
1227 
1229 
1234  {
1235  public:
1240  ConstantWindGenerator( const agx::Vec3& velocity );
1241 
1246  void setVelocity( const agx::Vec3& velocity );
1247 
1251  const agx::Vec3& getVelocity() const;
1252 
1253  public:
1254  virtual agx::Vec3 getVelocity( const agx::Vec3& /*worldPosition*/ ) const override;
1255 
1257 
1258  protected:
1260  virtual ~ConstantWindGenerator();
1261 
1262  private:
1263  agx::Vec3 m_velocity;
1264  };
1265 
1271  {
1273 
1274  public:
1278  WaterWrapper();
1279 
1287  virtual agx::Real findHeightFromSurface( const agx::Vec3& worldPoint, const agx::Vec3& upVector, const agx::TimeStamp& t ) const;
1288 
1292  virtual agx::Bool isValid() const;
1293 
1297  virtual agx::Real getDensity() const;
1298 
1302  virtual agx::Vec3 getVelocity( const agx::Vec3& worldPoint ) const;
1303 
1307  const agxCollide::Geometry* getGeometry() const;
1308 
1312  const agxModel::WindAndWaterController::WaterFlowGenerator* getWaterFlowGenerator() const;
1313 
1314 #ifndef SWIG
1316 #endif
1317 
1318  protected:
1319  virtual ~WaterWrapper() {}
1320 
1326  agx::Vec3 project( const agx::Vec3& localPoint, const agx::Vec3& localUpVector ) const;
1327 
1328  protected:
1333 
1335  private:
1336  // Only used by WindAndWaterController
1337  WaterWrapper( const agxCollide::Geometry* geometry );
1338  void setFlowGenerator( WindAndWaterController::WaterFlowGenerator* flowGenerator );
1339  void setWaterGeometry( agxCollide::Geometry* waterGeometry );
1340  void update();
1342  };
1343 
1345  {
1346  return m_aeroParams;
1347  }
1348 
1350  {
1351  return m_hydroParams;
1352  }
1353 
1355  {
1356  return m_velocity;
1357  }
1358 
1360  {
1361  return m_velocity;
1362  }
1363 }
1364 
1365 #endif // AGXMODEL_WINDANDWATERCONTROLLER_H
agxModel::WindAndWaterController::ObjectData
Static data for a shape.
Definition: WindAndWaterController.h:198
agxModel::WindAndWaterController::preCollide
virtual void preCollide(agxModel::WindAndWaterController *)
Called during normal preCollide events.
Definition: WindAndWaterController.h:1169
agxModel::WindAndWaterController::m_addedMassDb
AddedMassDbRef m_addedMassDb
Definition: WindAndWaterController.h:1132
agxModel::WindAndWaterController::VISCOUS_DRAG
@ VISCOUS_DRAG
Definition: WindAndWaterController.h:53
agxModel::WindAndWaterController::WindAndWaterData
Data for different objects.
Definition: WindAndWaterController.h:168
agxModel::WindAndWaterController::PressureFieldRendererData::shape
agxCollide::ShapeConstObserver shape
Definition: WindAndWaterController.h:904
agx::UInt
uint64_t UInt
Definition: Integer.h:27
agxModel::WindAndWaterController::WindAndWaterData::getHydrodynamicsParameters
const agxModel::HydrodynamicsParameters * getHydrodynamicsParameters() const
Definition: WindAndWaterController.h:1349
agxModel::WindAndWaterController::m_hydrodynamicsParameters
HydrodynamicsParametersContainer m_hydrodynamicsParameters
Definition: WindAndWaterController.h:1138
agxModel::ConstantWindGenerator
Class to generate constant wind in a scene.
Definition: WindAndWaterController.h:1233
agxCollide::Mesh
Mesh is a common base class for triangle meshes, such as Mesh or HeightField.
Definition: Mesh.h:69
agxModel::WindAndWaterController::SegmentContainer
agx::Vector< Segment > SegmentContainer
Definition: WindAndWaterController.h:473
LinkedStructure.h
agxModel::WindAndWaterController::m_geomForcesAndTorques
GeometryForceTorqueContainer m_geomForcesAndTorques
Definition: WindAndWaterController.h:1150
agx::Real
double Real
Definition: Real.h:42
agxModel::WaterWrapper::~WaterWrapper
virtual ~WaterWrapper()
Definition: WindAndWaterController.h:1319
agxModel::WindAndWaterController::m_waterGeometries
GeometryConstObserverVector m_waterGeometries
Definition: WindAndWaterController.h:1129
agxModel::WindAndWaterController::WindWrapper::m_density
agx::Real m_density
Definition: WindAndWaterController.h:160
agxModel
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition: FlowUnit.h:36
agxSDK::StepEventListener
Derive from this class to implement a listener for simulation step events.
Definition: StepEventListener.h:37
agx::Vector
Templated vector class.
Definition: Vector.h:52
agxModel::WindAndWaterController::WaterFlowGenerator
Interface for generating water flow.
Definition: WindAndWaterController.h:89
agxModel::WindAndWaterController::PRESSURE_DRAG
@ PRESSURE_DRAG
Definition: WindAndWaterController.h:52
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:51
agxModel::WindAndWaterController::Segment::velocityOfFluid
agx::Vec3 velocityOfFluid
Definition: WindAndWaterController.h:467
agxModel::WindAndWaterController::AerodynamicsParametersWireContainer
agx::HashVector< const agxWire::Wire *, AerodynamicsParametersRef > AerodynamicsParametersWireContainer
Definition: WindAndWaterController.h:1043
agxModel::WindAndWaterController::WirePair::gravity
const agx::Vec3 gravity
Definition: WindAndWaterController.h:443
agxStream::Serializable
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
agxModel::WindAndWaterController::m_unitPrimitiveCache
UnitPrimitiveCache m_unitPrimitiveCache
Definition: WindAndWaterController.h:1142
agxModel::WindAndWaterController::ObjectDataContainer
agx::Vector< ObjectDataRef > ObjectDataContainer
Definition: WindAndWaterController.h:428
agxModel::WindAndWaterController::WireLinkedStructureDataRef
agx::ref_ptr< WireLinkedStructureData > WireLinkedStructureDataRef
Definition: WindAndWaterController.h:524
agxModel::WindAndWaterController::m_flowGenerators
WaterFlowGeneratorContainer m_flowGenerators
Definition: WindAndWaterController.h:1144
agxModel::WaterWrapper::m_flowGenerator
const WindAndWaterController::WaterFlowGenerator * m_flowGenerator
Definition: WindAndWaterController.h:1330
agxModel::WindAndWaterController::m_pressureFieldRenderers
PressureFieldRendererDataContainer m_pressureFieldRenderers
Definition: WindAndWaterController.h:1141
export.h
agxModel::WindAndWaterController::WirePairContainer
agx::Vector< WirePair > WirePairContainer
Definition: WindAndWaterController.h:453
DOXYGEN_END_INTERNAL_BLOCK
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:97
agxModel::WindAndWaterController::DynamicsData::worldForce
agx::Vec3 worldForce
Definition: WindAndWaterController.h:545
Wire.h
Geometry.h
agxModel::VertexData
Vertex data for all global vertices in a mesh.
Definition: WindAndWaterUtils.h:30
agx::AffineMatrix4x4T< Real >
DOXYGEN_START_INTERNAL_BLOCK
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
agxModel::WindAndWaterController::post
virtual void post(agxModel::WindAndWaterController *)
Called during normal post.
Definition: WindAndWaterController.h:1179
agxModel::WindAndWaterController::Segment::velocity
agx::Vec3 velocity
Definition: WindAndWaterController.h:466
agxModel::PressureFieldRenderer
Definition: agxModel/PressureFieldRenderer.h:27
agxModel::WindAndWaterController::Segment::point1
agx::Vec3 point1
Definition: WindAndWaterController.h:464
agxModel::WindAndWaterController::ForceType
ForceType
Definition: WindAndWaterController.h:50
agxStream::ElementTypes::OTHER
@ OTHER
Definition: Types.h:38
agxModel::WindAndWaterController::m_hydrodynamicsParametersWires
HydrodynamicsParametersWireContainer m_hydrodynamicsParametersWires
Definition: WindAndWaterController.h:1139
agxModel::WindAndWaterControllerPtrVector
agx::Vector< WindAndWaterController * > WindAndWaterControllerPtrVector
Definition: WindAndWaterController.h:40
AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE
#define AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(T)
Use this in a pure abstract Serializable class to add the required methods Important: Use full namesp...
Definition: Serializable.h:221
agxModel::WindAndWaterController::DynamicsWireData::airForce
agx::Vec3 airForce
Definition: WindAndWaterController.h:557
agxModel::WindAndWaterController::WindAndWaterData::m_aeroParams
const AerodynamicsParameters * m_aeroParams
Definition: WindAndWaterController.h:191
agxWire::Wire
Interface and placeholder of controllers/helpers for wires.
Definition: Wire.h:61
agxModel::WindAndWaterController::AerodynamicsParametersContainer
agx::HashVector< const agxCollide::Shape *, AerodynamicsParametersRef > AerodynamicsParametersContainer
Definition: WindAndWaterController.h:1041
agxModel::WindAndWaterController::m_aeroGeometries
AerodynamicsDataContainer m_aeroGeometries
Definition: WindAndWaterController.h:1130
agxModel::WindAndWaterController::DynamicsLinkedStructureData
Hydro- and aerodynamic results for a linked structure.
Definition: WindAndWaterController.h:567
AGXSTREAM_DECLARE_SERIALIZABLE
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
agxModel::WindAndWaterController::WindAndWaterData::m_hydroParams
const HydrodynamicsParameters * m_hydroParams
Definition: WindAndWaterController.h:192
agxModel::WindAndWaterController::m_globalAerodynamicsParameters
AerodynamicsParametersRef m_globalAerodynamicsParameters
Definition: WindAndWaterController.h:1133
agx::VectorPOD< Vec3 >
agxModel::WindAndWaterController::m_centerOfBuoyancy
CenterOfBuoyancyContainer m_centerOfBuoyancy
Definition: WindAndWaterController.h:1151
agxModel::WindAndWaterController::WirePair::WirePair
WirePair()
Definition: WindAndWaterController.h:432
agx::observer_ptr< const Shape >
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
agxModel::WindAndWaterController::PressureFieldRendererData
Definition: WindAndWaterController.h:901
agxModel::WindAndWaterController::UnitPrimitiveCache
Definition: WindAndWaterController.h:921
agxModel::WindAndWaterController::DynamicsData
Data for rigid body with aero/hydro static/dynamic forces and added mass and inertia matrices.
Definition: WindAndWaterController.h:532
agxModel::WindAndWaterController::Segment::fluidDensity
agx::Real fluidDensity
Definition: WindAndWaterController.h:468
agxModel::WindAndWaterController::DynamicsWireData::waterForce
agx::Vec3 waterForce
Definition: WindAndWaterController.h:556
agxModel::WindAndWaterController::ObjectData::unLock
void unLock() const
Perform a mutex unlock for this ObjectData.
Definition: WindAndWaterController.h:400
agxModel::WindAndWaterController::DynamicsData::DynamicsData
DynamicsData()
Definition: WindAndWaterController.h:534
agxModel::WindAndWaterController::Segment::rb
agx::RigidBodyRef rb
Definition: WindAndWaterController.h:463
agxModel::WindAndWaterController::WirePair::water
const agxCollide::Geometry * water
Definition: WindAndWaterController.h:442
agxModel::WindAndWaterController::WireLinkedStructureData
Data for a wire or a linked structure.
Definition: WindAndWaterController.h:478
agxModel::WindAndWaterController::WindGenerator
Interface for generating wind effects.
Definition: WindAndWaterController.h:110
agxModel::WindAndWaterController::WaterFlowGeneratorContainer
agx::HashVector< const agxCollide::Geometry *, WaterFlowGeneratorRef > WaterFlowGeneratorContainer
Definition: WindAndWaterController.h:1049
agxModel::WindAndWaterController::m_vertexPool
VertexData::Container m_vertexPool
Definition: WindAndWaterController.h:1149
agxModel::WindAndWaterController::m_enableCenterOfBuoyancy
EnableCbContainer m_enableCenterOfBuoyancy
Definition: WindAndWaterController.h:1152
agxModel::WindAndWaterController::AerodynamicsParametersLinkedStructureContainer
agx::HashVector< const agxSDK::LinkedStructure *, AerodynamicsParametersRef > AerodynamicsParametersLinkedStructureContainer
Definition: WindAndWaterController.h:1045
agxModel::WindAndWaterController::Segment::point2
agx::Vec3 point2
Definition: WindAndWaterController.h:465
agxModel::WindAndWaterController::WindAndWaterFlowGenerator
Interface for generating water flow and wind.
Definition: WindAndWaterController.h:62
agx::ref_ptr
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
agxModel::WindAndWaterController::m_aeroWires
WireObserverVector m_aeroWires
Definition: WindAndWaterController.h:1131
agxModel::WindAndWaterController::AerodynamicsData::AerodynamicsData
AerodynamicsData(const agxCollide::Geometry *geometryIn)
Definition: WindAndWaterController.h:913
agxModel::WindAndWaterController::WireObserverVector
agx::Vector< agxWire::WireObserver > WireObserverVector
Definition: WindAndWaterController.h:1055
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:125
agxModel::WindAndWaterController
Controller that collects relevant data and executes algorithms (probably mostly aero- and hydrodynami...
Definition: WindAndWaterController.h:45
agxCollide::Shape
Base class for a shape.
Definition: Shape.h:53
agxModel::WindAndWaterController::WindWrapper::m_enable
agx::Bool m_enable
Definition: WindAndWaterController.h:161
agxModel::ConstantWaterFlowGenerator
Class to generate constant water flow in a scene.
Definition: WindAndWaterController.h:1194
agxModel::WaterWrapper
Water wrapper that can be inherited to create custom made wrappers.
Definition: WindAndWaterController.h:1270
agxModel::WindAndWaterController::m_aeroForAll
agx::Bool m_aeroForAll
Definition: WindAndWaterController.h:1147
agx::Vec3
Vec3T< Real > Vec3
The object holding 3 dimensional vectors and providing basic arithmetic.
Definition: Vec3.h:36
agxModel::WindAndWaterController::DynamicsData::worldTorque
agx::Vec3 worldTorque
Definition: WindAndWaterController.h:546
agxModel::WindAndWaterController::DynamicsData::bodyFrameAddedMass
agx::Matrix3x3 bodyFrameAddedMass
Definition: WindAndWaterController.h:547
agxModel::WindAndWaterController::HydrodynamicsParametersLinkedStructureContainer
agx::HashVector< const agxSDK::LinkedStructure *, HydrodynamicsParametersRef > HydrodynamicsParametersLinkedStructureContainer
Definition: WindAndWaterController.h:1046
agxSDK::LinkedStructure
Basic implementation of any structure where bodies are linked/constrained together in a well defined ...
Definition: LinkedStructure.h:35
agxModel::WindAndWaterController::updateInteraction
virtual void updateInteraction(agxModel::WindAndWaterController::ObjectData &, const GlobalTriangleData::Container &)
Called when it's time to update interaction.
Definition: WindAndWaterController.h:1184
Vec6.h
agxModel::WindAndWaterController::WireLinkedStructureDataContainer
agx::Vector< WireLinkedStructureDataRef > WireLinkedStructureDataContainer
Definition: WindAndWaterController.h:525
agxModel::WindAndWaterController::GeometryConstObserverVector
agx::Vector< agxCollide::GeometryConstObserver > GeometryConstObserverVector
Definition: WindAndWaterController.h:1054
agxModel::WindAndWaterController::AerodynamicsDataContainer
agx::HashVector< const agxCollide::Geometry *, AerodynamicsDataRef > AerodynamicsDataContainer
Definition: WindAndWaterController.h:1048
agxModel::WindAndWaterController::PressureFieldRendererDataContainer
agx::HashVector< const agxCollide::Shape *, PressureFieldRendererDataRef > PressureFieldRendererDataContainer
Definition: WindAndWaterController.h:1047
agxCollide::Shape::Type
Type
Define the type of a Shape.
Definition: Shape.h:58
agxModel::WindAndWaterController::m_airDensity
agx::Real m_airDensity
Definition: WindAndWaterController.h:1146
agxModel::WindAndWaterController::HydrodynamicsParametersWireContainer
agx::HashVector< const agxWire::Wire *, HydrodynamicsParametersRef > HydrodynamicsParametersWireContainer
Definition: WindAndWaterController.h:1044
agxModel::AerodynamicsParameters
Definition: WindAndWaterParameters.h:137
agx::LinearProbingHashTable
Inheritance with partial specialization due to bug with ref_ptr containers.
Definition: LinearProbingHashTable.h:926
agxCollide::Geometry
The geometry representation used by the collision detection engine.
Definition: Geometry.h:91
agxModel::WindAndWaterController::WindWrapper::m_windGenerator
const WindGenerator * m_windGenerator
Definition: WindAndWaterController.h:162
agxModel::WindAndWaterController::m_aerodynamicsParameters
AerodynamicsParametersContainer m_aerodynamicsParameters
Definition: WindAndWaterController.h:1134
agxModel::WindAndWaterController::m_aerodynamicsParametersLinkedStructures
AerodynamicsParametersLinkedStructureContainer m_aerodynamicsParametersLinkedStructures
Definition: WindAndWaterController.h:1136
agx::Name
Representation of a name string.
Definition: Name.h:32
agxModel::WindAndWaterController::Segment::volume
agx::Real volume
Definition: WindAndWaterController.h:470
agxCollide::Space
This class contains all Geometries and performs Broad Phase and Narrow Phase collision detection to c...
Definition: Space.h:81
agxModel::WindAndWaterParameters::ShapeTessellation
ShapeTessellation
Tessellation levels of native, non-mesh shapes, e.g, sphere, capsule and cylinder.
Definition: WindAndWaterParameters.h:35
agxModel::ConstantWindGenerator::getVelocity
const agx::Vec3 & getVelocity() const
agxModel::WindAndWaterController::Segment::gravity
agx::Vec3 gravity
Definition: WindAndWaterController.h:469
agxModel::WindAndWaterController::WaterWrapperContainer
agx::HashVector< const agxCollide::Geometry *, WaterWrapperRef > WaterWrapperContainer
Definition: WindAndWaterController.h:1050
agxModel::WindAndWaterController::AerodynamicsDataRef
agx::ref_ptr< AerodynamicsData > AerodynamicsDataRef
Definition: WindAndWaterController.h:919
agxModel::WindAndWaterController::WindWrapper
Wraps wind related things.
Definition: WindAndWaterController.h:136
agxModel::WindAndWaterController::PressureFieldRendererData::pressureField
agxModel::PressureFieldRendererRef pressureField
Definition: WindAndWaterController.h:903
agxModel::WindAndWaterController::m_algorithms
AlgorithmContainer m_algorithms
Definition: WindAndWaterController.h:1128
agxModel::ConstantWaterFlowGenerator::getVelocity
const agx::Vec3 & getVelocity() const
agxModel::WaterWrapper::m_worldToShape
agx::AffineMatrix4x4 m_worldToShape
Definition: WindAndWaterController.h:1332
agx::Referenced
Base class providing referencing counted objects.
Definition: Referenced.h:119
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
agxModel::WindAndWaterController::HydrodynamicsParametersContainer
agx::HashVector< const agxCollide::Shape *, HydrodynamicsParametersRef > HydrodynamicsParametersContainer
Definition: WindAndWaterController.h:1042
PressureFieldRenderer.h
agxModel::WindAndWaterController::AlgorithmContainer
agx::Vector< agxModel::WindAndWaterController::AlgorithmRef > AlgorithmContainer
Definition: WindAndWaterController.h:1040
agxModel::WindAndWaterController::AerodynamicsData
Definition: WindAndWaterController.h:911
agxCollide
This namespace consists of a set of classes for handling geometric intersection tests including boole...
Definition: ContactForceFilterParticipant.h:22
agx::Bool
bool Bool
Definition: Integer.h:40
agxModel::WindAndWaterController::m_hydrodynamicsParametersLinkedStructures
HydrodynamicsParametersLinkedStructureContainer m_hydrodynamicsParametersLinkedStructures
Definition: WindAndWaterController.h:1140
agx::TimeStamp
agx::Real TimeStamp
Definition: TimeStamp.h:26
agxModel::HydrodynamicsParameters
Definition: WindAndWaterParameters.h:151
agxModel::WindAndWaterController::pre
virtual void pre(agxModel::WindAndWaterController *)
Called before all data is collected and before updateInteraction is called.
Definition: WindAndWaterController.h:1174
agxModel::WindAndWaterController::ObjectDataRef
agx::ref_ptr< ObjectData > ObjectDataRef
Definition: WindAndWaterController.h:427
AddedMassDb.h
agxModel::WindAndWaterController::PressureFieldRendererData::~PressureFieldRendererData
virtual ~PressureFieldRendererData()
Definition: WindAndWaterController.h:907
AGXMODEL_EXPORT
#define AGXMODEL_EXPORT
Definition: agxModel/export.h:42
agxModel::WaterWrapper::m_shape
const agxCollide::Shape * m_shape
Definition: WindAndWaterController.h:1331
agxModel::WindAndWaterController::WirePair::WirePair
WirePair(agxWire::Node *node1, agxWire::Node *node2, const agxCollide::Geometry *water, agx::Vec3 gravity)
Definition: WindAndWaterController.h:436
agxModel::WindAndWaterController::LIFT
@ LIFT
Definition: WindAndWaterController.h:54
agxModel::WindAndWaterController::getForceType
virtual WindAndWaterController::ForceType getForceType() const
Definition: WindAndWaterController.h:1186
agxModel::WindAndWaterController::DynamicsWireData
Hydro- and aerodynamic results for a wire.
Definition: WindAndWaterController.h:554
agxModel::WindAndWaterController::GeometryForceTorqueContainer
agx::HashVector< const agxCollide::Geometry *, std::pair< agx::Vec3Vector, agx::Vec3Vector > > GeometryForceTorqueContainer
Definition: WindAndWaterController.h:1051
agxModel::WaterWrapper::m_geometry
agxCollide::GeometryConstObserver m_geometry
Definition: WindAndWaterController.h:1329
agxModel::WindAndWaterController::DynamicsData::bodyFrameAddedInertia
agx::Matrix3x3 bodyFrameAddedInertia
Definition: WindAndWaterController.h:548
agxModel::WindAndWaterController::m_waterWrappers
WaterWrapperContainer m_waterWrappers
Definition: WindAndWaterController.h:1145
agxModel::WindAndWaterController::WirePair::node1
agxWire::Node * node1
Definition: WindAndWaterController.h:440
agxModel::WindAndWaterControllerRef
agx::ref_ptr< WindAndWaterController > WindAndWaterControllerRef
Definition: WindAndWaterController.h:39
agx::Vec3T< Real >
agxModel::WindAndWaterController::AerodynamicsData::geometry
agxCollide::GeometryConstObserver geometry
Definition: WindAndWaterController.h:914
agxModel::WindAndWaterController::ObjectData::lock
void lock() const
Perform a mutex lock for this ObjectData.
Definition: WindAndWaterController.h:395
agxModel::WindAndWaterController::WirePair::node2
agxWire::Node * node2
Definition: WindAndWaterController.h:441
agx::Uuid
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
Definition: Uuid.h:41
agxModel::WindAndWaterController::PressureFieldRendererDataRef
agx::ref_ptr< PressureFieldRendererData > PressureFieldRendererDataRef
Definition: WindAndWaterController.h:909
agx::Matrix3x3T< Real >
agxModel::WindAndWaterController::EnableCbContainer
agx::HashVector< const agxCollide::Geometry *, std::pair< bool, agxCollide::GeometryConstObserver > > EnableCbContainer
Definition: WindAndWaterController.h:1053
agxModel::WindAndWaterController::WirePair
Definition: WindAndWaterController.h:430
agxModel::WindAndWaterController::Segment
Definition: WindAndWaterController.h:455
agxWire::Node
Class defining a node that is part of a wire.
Definition: agxWire/Node.h:511
WindAndWaterParameters.h
agxModel::WindAndWaterController::m_windGenerator
WindGeneratorRef m_windGenerator
Definition: WindAndWaterController.h:1143
agxModel::TriangleData
Triangle data for a normal or a clipped triangle.
Definition: WindAndWaterUtils.h:60
agx::HashVector< const agxCollide::Shape *, AerodynamicsParametersRef >
agxModel::WindAndWaterController::DynamicsLinkedStructureData::DynamicsLinkedStructureData
DynamicsLinkedStructureData()
Definition: WindAndWaterController.h:569
agxModel::WindAndWaterController::BUOYANCY
@ BUOYANCY
Definition: WindAndWaterController.h:55
agxModel::WindAndWaterController::CenterOfBuoyancyContainer
agx::HashVector< const agxCollide::Geometry *, std::pair< agx::Vec3, agx::Real > > CenterOfBuoyancyContainer
Definition: WindAndWaterController.h:1052
AGX_FORCE_INLINE
#define AGX_FORCE_INLINE
Definition: macros.h:58
agxModel::WindAndWaterController::m_globalHydrodynamicsParameters
HydrodynamicsParametersRef m_globalHydrodynamicsParameters
Definition: WindAndWaterController.h:1137
agxModel::WindAndWaterController::ObjectData
agxModel::WindAndWaterController::ObjectData ObjectData
Definition: WindAndWaterController.h:1163
agxModel::WindAndWaterController::AerodynamicsData::~AerodynamicsData
virtual ~AerodynamicsData()
Definition: WindAndWaterController.h:917
agxModel::WindAndWaterController::m_aerodynamicsParametersWires
AerodynamicsParametersWireContainer m_aerodynamicsParametersWires
Definition: WindAndWaterController.h:1135
agxModel::WindAndWaterController::m_trianglePool
GlobalTriangleData::Container m_trianglePool
Definition: WindAndWaterController.h:1148
agxModel::WindAndWaterController::Segment::Segment
Segment(agx::RigidBody *rb, agx::Vec3 point1, agx::Vec3 point2, agx::Vec3 velocity, agx::Vec3 velocityOfFluid, agx::Real fluidDensity, agx::Vec3 gravity, agx::Real volume)
Definition: WindAndWaterController.h:457