AGX Dynamics  2.37.3.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:
1128  AlgorithmContainer m_algorithms;
1129  GeometryConstObserverVector m_waterGeometries;
1130  AerodynamicsDataContainer m_aeroGeometries;
1131  WireObserverVector m_aeroWires;
1134  mutable AerodynamicsParametersContainer m_aerodynamicsParameters;
1135  mutable AerodynamicsParametersWireContainer m_aerodynamicsParametersWires;
1136  mutable AerodynamicsParametersLinkedStructureContainer m_aerodynamicsParametersLinkedStructures;
1138  mutable HydrodynamicsParametersContainer m_hydrodynamicsParameters;
1139  mutable HydrodynamicsParametersWireContainer m_hydrodynamicsParametersWires;
1140  mutable HydrodynamicsParametersLinkedStructureContainer m_hydrodynamicsParametersLinkedStructures;
1141  PressureFieldRendererDataContainer m_pressureFieldRenderers;
1144  WaterFlowGeneratorContainer m_flowGenerators;
1145  WaterWrapperContainer m_waterWrappers;
1150  GeometryForceTorqueContainer m_geomForcesAndTorques;
1151  CenterOfBuoyancyContainer m_centerOfBuoyancy;
1152  EnableCbContainer m_enableCenterOfBuoyancy;
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
Class to generate constant water flow in a scene.
virtual void updateInteraction(agxModel::WindAndWaterController::ObjectData &, const GlobalTriangleData::Container &)
Called when it&#39;s time to update interaction.
agx::HashVector< const agxSDK::LinkedStructure *, HydrodynamicsParametersRef > HydrodynamicsParametersLinkedStructureContainer
AerodynamicsParametersContainer m_aerodynamicsParameters
Vec3T< Real > Vec3
The object holding 3 dimensional vectors and providing basic arithmetic.
Definition: Vec3.h:36
Hydro- and aerodynamic results for a linked structure.
agx::HashVector< const agxCollide::Geometry *, AerodynamicsDataRef > AerodynamicsDataContainer
agx::Vector< agxCollide::GeometryConstObserver > GeometryConstObserverVector
Basic implementation of any structure where bodies are linked/constrained together in a well defined ...
Mesh is a common base class for triangle meshes, such as Mesh or HeightField.
Definition: Mesh.h:69
agx::HashVector< const agxCollide::Shape *, PressureFieldRendererDataRef > PressureFieldRendererDataContainer
Derive from this class to implement a listener for simulation step events.
Interface for generating water flow and wind.
agx::HashVector< const agxWire::Wire *, HydrodynamicsParametersRef > HydrodynamicsParametersWireContainer
agx::ref_ptr< WindAndWaterController > WindAndWaterControllerRef
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)
agx::ref_ptr< AerodynamicsData > AerodynamicsDataRef
bool Bool
Definition: Integer.h:48
Base class for a shape.
Definition: Shape.h:53
AerodynamicsParametersLinkedStructureContainer m_aerodynamicsParametersLinkedStructures
This namespace consists of a set of classes for handling geometric intersection tests including boole...
agx::HashVector< const agxCollide::Shape *, HydrodynamicsParametersRef > HydrodynamicsParametersContainer
agx::HashVector< const agxCollide::Geometry *, WaterWrapperRef > WaterWrapperContainer
agx::Vector< agxModel::WindAndWaterController::AlgorithmRef > AlgorithmContainer
Class to generate constant wind in a scene.
virtual void pre(agxModel::WindAndWaterController *)
Called before all data is collected and before updateInteraction is called.
const agxModel::HydrodynamicsParameters * getHydrodynamicsParameters() const
agx::AffineMatrix4x4 m_worldToShape
HydrodynamicsParametersLinkedStructureContainer m_hydrodynamicsParametersLinkedStructures
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
Controller that collects relevant data and executes algorithms (probably mostly aero- and hydrodynami...
agx::ref_ptr< ObjectData > ObjectDataRef
Representation of a name string.
Definition: Name.h:32
#define AGX_FORCE_INLINE
Definition: Object.h:59
agx::ref_ptr< PressureFieldRendererData > PressureFieldRendererDataRef
agx::Real TimeStamp
Definition: TimeStamp.h:26
virtual WindAndWaterController::ForceType getForceType() const
Interface for generating wind effects.
agx::HashVector< const agxCollide::Geometry *, std::pair< agx::Vec3Vector, agx::Vec3Vector > > GeometryForceTorqueContainer
agxCollide::GeometryConstObserver m_geometry
agx::HashVector< const agxCollide::Geometry *, std::pair< agx::Vec3, agx::Real > > CenterOfBuoyancyContainer
Base class providing referencing counted objects.
Definition: Referenced.h:119
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition: FlowUnit.h:36
HydrodynamicsParametersRef m_globalHydrodynamicsParameters
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
agxModel::WindAndWaterController::ObjectData ObjectData
Templated vector class.
Definition: Vector.h:52
AerodynamicsParametersWireContainer m_aerodynamicsParametersWires
WirePair(agxWire::Node *node1, agxWire::Node *node2, const agxCollide::Geometry *water, agx::Vec3 gravity)
void unLock() const
Perform a mutex unlock for this ObjectData.
virtual void preCollide(agxModel::WindAndWaterController *)
Called during normal preCollide events.
Interface and placeholder of controllers/helpers for wires.
Definition: Wire.h:61
uint32_t UInt
Definition: Integer.h:34
void lock() const
Perform a mutex lock for this ObjectData.
Water wrapper that can be inherited to create custom made wrappers.
This class contains all Geometries and performs Broad Phase and Narrow Phase collision detection to c...
Definition: Space.h:81
HydrodynamicsParametersContainer m_hydrodynamicsParameters
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Hydro- and aerodynamic results for a wire.
const agx::Vec3 & getVelocity() const
GeometryForceTorqueContainer m_geomForcesAndTorques
GlobalTriangleData::Container m_trianglePool
GeometryConstObserverVector m_waterGeometries
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
agx::Vector< ObjectDataRef > ObjectDataContainer
agx::ref_ptr< WireLinkedStructureData > WireLinkedStructureDataRef
agx::Vector< WirePair > WirePairContainer
Data for rigid body with aero/hydro static/dynamic forces and added mass and inertia matrices...
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:54
virtual void post(agxModel::WindAndWaterController *)
Called during normal post.
agx::HashVector< const agxWire::Wire *, AerodynamicsParametersRef > AerodynamicsParametersWireContainer
WaterFlowGeneratorContainer m_flowGenerators
HydrodynamicsParametersWireContainer m_hydrodynamicsParametersWires
PressureFieldRendererDataContainer m_pressureFieldRenderers
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
Definition: Uuid.h:41
agx::HashVector< const agxCollide::Shape *, AerodynamicsParametersRef > AerodynamicsParametersContainer
AerodynamicsDataContainer m_aeroGeometries
#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
agx::Vector< WindAndWaterController *> WindAndWaterControllerPtrVector
agx::HashVector< const agxCollide::Geometry *, bool > EnableCbContainer
Type
Define the type of a Shape.
Definition: Shape.h:58
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
AerodynamicsParametersRef m_globalAerodynamicsParameters
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
CenterOfBuoyancyContainer m_centerOfBuoyancy
Vertex data for all global vertices in a mesh.
const WindAndWaterController::WaterFlowGenerator * m_flowGenerator
#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
AerodynamicsData(const agxCollide::Geometry *geometryIn)
#define AGXMODEL_EXPORT
Class defining a node that is part of a wire.
Definition: agxWire/Node.h:511
double Real
Definition: Real.h:42
const agxCollide::Shape * m_shape
ShapeTessellation
Tessellation levels of native, non-mesh shapes, e.g, sphere, capsule and cylinder.
Triangle data for a normal or a clipped triangle.
Inheritance with partial specialization due to bug with ref_ptr containers.
agx::HashVector< const agxSDK::LinkedStructure *, AerodynamicsParametersRef > AerodynamicsParametersLinkedStructureContainer
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97
agx::HashVector< const agxCollide::Geometry *, WaterFlowGeneratorRef > WaterFlowGeneratorContainer
agx::Vector< WireLinkedStructureDataRef > WireLinkedStructureDataContainer
const agx::Vec3 & getVelocity() const
agx::Vector< agxWire::WireObserver > WireObserverVector