17 #ifndef AGXMODEL_WINDANDWATERCONTROLLER_H 18 #define AGXMODEL_WINDANDWATERCONTROLLER_H 214 bool enableCenterOfBuoyancy);
334 const agx::Bool& containsAddedMass()
const;
370 const agx::Vec3& getCenterOfBuoyancy()
const;
380 const agx::Real& getVolumeInWater()
const;
390 bool getEnableCenterOfBuoyancy();
395 void lock()
const { m_mutex.lock(); };
400 void unLock()
const { m_mutex.unlock(); };
421 mutable std::mutex m_mutex;
424 bool m_enableCenterOfBuoyancy;
433 : node1( nullptr ), node2( nullptr ), water( nullptr ), gravity(
agx::
Vec3() )
437 : node1( node1 ), node2( node2 ), water( water ), gravity( gravity )
459 : rb( rb ), point1( point1 ), point2( point2 ), velocity( velocity ), velocityOfFluid( velocityOfFluid ),
460 fluidDensity( fluidDensity ), gravity( gravity ), volume(volume)
497 void addWaterSegment(
const Segment& segment );
502 void addAirSegment(
const Segment& segment );
507 SegmentContainer& getAirSegments();
512 SegmentContainer& getWaterSegments();
519 SegmentContainer m_airSegments;
520 SegmentContainer m_waterSegments;
543 void getAddedMassAndInertiaDiagonalCoefficients(
const agx::RigidBody* rb,
agx::Vec3& addedMassDiagonalCoefficients,
agx::Vec3& addedInertiaDiagonalCoefficients )
const;
558 size_t numWaterSegments{0};
559 size_t numAirSegments{0};
598 virtual void setEnableAerodynamics(
agx::Bool enable );
629 void setAirDensity(
agx::Real airDensity );
881 void setEnableCenterOfBuoyancy(
agx::RigidBody* body,
bool enable);
932 void garbageCollect();
938 : shape( shapeIn ), mesh( meshIn )
942 virtual void checkSize(
agx::Real resolution ) = 0;
948 virtual ~PrimitiveData() {}
951 struct CapsuleData : PrimitiveData
954 : PrimitiveData( shapeIn, meshIn ), radius( radiusIn ), height( heightIn )
958 virtual void checkSize(
agx::Real resolution )
override;
964 virtual ~CapsuleData() {}
967 struct ConeData : PrimitiveData
970 : PrimitiveData( shapeIn, meshIn ), topRadius( topRadiusIn ), bottomRadius( bottomRadiusIn ),
975 virtual void checkSize(
agx::Real resolution )
override;
982 virtual ~ConeData() {}
985 struct HollowConeData : PrimitiveData
990 : PrimitiveData( shapeIn, meshIn ), topOuterRadius( topOuterRadiusIn ),
991 bottomInnerRadius( bottomInnerRadiusIn ), height( heightIn ), thickness( thicknessIn )
995 virtual void checkSize(
agx::Real resolution )
override;
1003 virtual ~HollowConeData() {}
1006 struct HollowCylinderData : PrimitiveData
1009 : PrimitiveData( shapeIn, meshIn ), innerRadius( innerRadiusIn ), height( heightIn ),
1010 thickness( thicknessIn )
1014 virtual void checkSize(
agx::Real resolution )
override;
1021 virtual ~HollowCylinderData() {}
1034 mutable MeshContainer m_cache;
1037 mutable std::mutex meshCreationMutex;
1066 virtual void updateAlgorithms(
const ObjectDataContainer& data,
bool updateRenderers );
1072 void configureDefaultAlgorithms();
1077 void garbageCollect();
1106 WirePairContainer wirePairs,
1207 void setVelocity(
const agx::Vec3& velocity );
1246 void setVelocity(
const agx::Vec3& velocity );
1339 void setWaterGeometry(
agxCollide::Geometry* waterGeometry );
1346 return m_aeroParams;
1351 return m_hydroParams;
1365 #endif // AGXMODEL_WINDANDWATERCONTROLLER_H WireObserverVector m_aeroWires
Class to generate constant water flow in a scene.
agx::Vec3 velocityOfFluid
virtual void updateInteraction(agxModel::WindAndWaterController::ObjectData &, const GlobalTriangleData::Container &)
Called when it'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.
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.
agx::HashVector< const agxCollide::Shape *, PressureFieldRendererDataRef > PressureFieldRendererDataContainer
agxCollide::ShapeConstObserver shape
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)
Wraps wind related things.
const HydrodynamicsParameters * m_hydroParams
agx::ref_ptr< AerodynamicsData > AerodynamicsDataRef
Data for different objects.
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
agxCollide::GeometryConstObserver geometry
Class to generate constant wind in a scene.
virtual void pre(agxModel::WindAndWaterController *)
Called before all data is collected and before updateInteraction is called.
AlgorithmContainer m_algorithms
const agxModel::HydrodynamicsParameters * getHydrodynamicsParameters() const
agx::AffineMatrix4x4 m_worldToShape
HydrodynamicsParametersLinkedStructureContainer m_hydrodynamicsParametersLinkedStructures
#define AGX_DECLARE_POINTER_TYPES(type)
Controller that collects relevant data and executes algorithms (probably mostly aero- and hydrodynami...
agx::ref_ptr< ObjectData > ObjectDataRef
Representation of a name string.
agx::ref_ptr< PressureFieldRendererData > PressureFieldRendererDataRef
virtual WindAndWaterController::ForceType getForceType() const
const agxCollide::Geometry * water
Interface for generating wind effects.
agx::HashVector< const agxCollide::Geometry *, std::pair< agx::Vec3Vector, agx::Vec3Vector > > GeometryForceTorqueContainer
WindGeneratorRef m_windGenerator
WaterWrapperContainer m_waterWrappers
agxCollide::GeometryConstObserver m_geometry
agx::HashVector< const agxCollide::Geometry *, std::pair< agx::Vec3, agx::Real > > CenterOfBuoyancyContainer
Base class providing referencing counted objects.
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
HydrodynamicsParametersRef m_globalHydrodynamicsParameters
The geometry representation used by the collision detection engine.
agx::Matrix3x3 bodyFrameAddedMass
agxModel::WindAndWaterController::ObjectData ObjectData
Data for a wire or a linked structure.
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.
const AerodynamicsParameters * m_aeroParams
Interface and placeholder of controllers/helpers for wires.
AddedMassDbRef m_addedMassDb
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...
HydrodynamicsParametersContainer m_hydrodynamicsParameters
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
agx::Vector< Segment > SegmentContainer
Hydro- and aerodynamic results for a wire.
const agx::Vec3 & getVelocity() const
GeometryForceTorqueContainer m_geomForcesAndTorques
GlobalTriangleData::Container m_trianglePool
GeometryConstObserverVector m_waterGeometries
agx::Matrix3x3 bodyFrameAddedInertia
UnitPrimitiveCache m_unitPrimitiveCache
Smart pointer for handling referenced counted objects.
agx::Vector< ObjectDataRef > ObjectDataContainer
agx::ref_ptr< WireLinkedStructureData > WireLinkedStructureDataRef
agx::Vector< WirePair > WirePairContainer
Interface for generating water flow.
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.
virtual void post(agxModel::WindAndWaterController *)
Called during normal post.
agx::HashVector< const agxWire::Wire *, AerodynamicsParametersRef > AerodynamicsParametersWireContainer
DynamicsLinkedStructureData()
WaterFlowGeneratorContainer m_flowGenerators
HydrodynamicsParametersWireContainer m_hydrodynamicsParametersWires
virtual ~AerodynamicsData()
PressureFieldRendererDataContainer m_pressureFieldRenderers
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
agxModel::PressureFieldRendererRef pressureField
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...
agx::Vector< WindAndWaterController *> WindAndWaterControllerPtrVector
agx::HashVector< const agxCollide::Geometry *, bool > EnableCbContainer
Type
Define the type of a Shape.
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
AerodynamicsParametersRef m_globalAerodynamicsParameters
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
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...
AerodynamicsData(const agxCollide::Geometry *geometryIn)
Class defining a node that is part of a wire.
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.
VertexData::Container m_vertexPool
Inheritance with partial specialization due to bug with ref_ptr containers.
agx::HashVector< const agxSDK::LinkedStructure *, AerodynamicsParametersRef > AerodynamicsParametersLinkedStructureContainer
const WindGenerator * m_windGenerator
virtual ~PressureFieldRendererData()
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
agx::HashVector< const agxCollide::Geometry *, WaterFlowGeneratorRef > WaterFlowGeneratorContainer
agx::Vector< WireLinkedStructureDataRef > WireLinkedStructureDataContainer
EnableCbContainer m_enableCenterOfBuoyancy
const agx::Vec3 & getVelocity() const
agx::Vector< agxWire::WireObserver > WireObserverVector