17 #ifndef AGXMODEL_WINDANDWATERCONTROLLER_H 18 #define AGXMODEL_WINDANDWATERCONTROLLER_H 294 const agx::Bool& containsAddedMass()
const;
330 void lock()
const { m_mutex.lock(); };
335 void unLock()
const { m_mutex.unlock(); };
354 mutable std::mutex m_mutex;
363 : node1( nullptr ), node2( nullptr ), water( nullptr ), gravity(
agx::
Vec3() )
367 : node1( node1 ), node2( node2 ), water( water ), gravity( gravity )
389 : rb( rb ), point1( point1 ), point2( point2 ), velocity( velocity ), velocityOfFluid( velocityOfFluid ),
390 fluidDensity( fluidDensity ), gravity( gravity ), volume(volume)
427 void addWaterSegment(
const Segment& segment );
432 void addAirSegment(
const Segment& segment );
437 SegmentContainer& getAirSegments();
442 SegmentContainer& getWaterSegments();
449 SegmentContainer m_airSegments;
450 SegmentContainer m_waterSegments;
473 void getAddedMassAndInertiaDiagonalCoefficients(
const agx::RigidBody* rb,
agx::Vec3& addedMassDiagonalCoefficients,
agx::Vec3& addedInertiaDiagonalCoefficients )
const;
488 size_t numWaterSegments{0};
489 size_t numAirSegments{0};
528 virtual void setEnableAerodynamics(
agx::Bool enable );
559 void setAirDensity(
agx::Real airDensity );
759 void garbageCollect();
765 : shape( shapeIn ), mesh( meshIn )
769 virtual void checkSize(
agx::Real resolution ) = 0;
775 virtual ~PrimitiveData() {}
778 struct CapsuleData : PrimitiveData
781 : PrimitiveData( shapeIn, meshIn ), radius( radiusIn ), height( heightIn )
785 virtual void checkSize(
agx::Real resolution )
override;
791 virtual ~CapsuleData() {}
794 struct ConeData : PrimitiveData
797 : PrimitiveData( shapeIn, meshIn ), topRadius( topRadiusIn ), bottomRadius( bottomRadiusIn ),
802 virtual void checkSize(
agx::Real resolution )
override;
809 virtual ~ConeData() {}
812 struct HollowConeData : PrimitiveData
817 : PrimitiveData( shapeIn, meshIn ), topOuterRadius( topOuterRadiusIn ),
818 bottomInnerRadius( bottomInnerRadiusIn ), height( heightIn ), thickness( thicknessIn )
822 virtual void checkSize(
agx::Real resolution )
override;
830 virtual ~HollowConeData() {}
833 struct HollowCylinderData : PrimitiveData
836 : PrimitiveData( shapeIn, meshIn ), innerRadius( innerRadiusIn ), height( heightIn ),
837 thickness( thicknessIn )
841 virtual void checkSize(
agx::Real resolution )
override;
848 virtual ~HollowCylinderData() {}
861 mutable MeshContainer m_cache;
864 mutable std::mutex meshCreationMutex;
892 void configureDefaultAlgorithms();
897 void garbageCollect();
1018 void setVelocity(
const agx::Vec3& velocity );
1057 void setVelocity(
const agx::Vec3& velocity );
1150 void setWaterGeometry(
agxCollide::Geometry* waterGeometry );
1157 return m_aeroParams;
1162 return m_hydroParams;
1176 #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.
AerodynamicsParametersContainer m_aerodynamicsParameters
Vec3T< Real > Vec3
The object holding 3 dimensional vectors and providing basic arithmetic.
Hydro- and aerodynamic results for a linked structure.
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.
agxCollide::ShapeConstObserver shape
Derive from this class to implement a listener for simulation step events.
Interface for generating water flow and wind.
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.
agx::HashVector< const agxWire::Wire *, AerodynamicsParametersRef > AerodynamicsParametersWireContainer
AerodynamicsParametersLinkedStructureContainer m_aerodynamicsParametersLinkedStructures
This namespace consists of a set of classes for handling geometric intersection tests including boole...
agx::HashVector< const agxCollide::Geometry *, AerodynamicsDataRef > AerodynamicsDataContainer
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::HashVector< const agxCollide::Shape *, HydrodynamicsParametersRef > HydrodynamicsParametersContainer
agx::AffineMatrix4x4 m_worldToShape
HydrodynamicsParametersLinkedStructureContainer m_hydrodynamicsParametersLinkedStructures
agx::HashVector< const agxCollide::Geometry *, WaterWrapperRef > WaterWrapperContainer
#define AGX_DECLARE_POINTER_TYPES(type)
Controller that collects relevant data and executes algorithms (probably mostly aero- and hydrodynami...
Representation of a name string.
agx::Vector< agxModel::WindAndWaterController::AlgorithmRef > AlgorithmContainer
agx::ref_ptr< PressureFieldRendererData > PressureFieldRendererDataRef
agx::HashVector< const agxSDK::LinkedStructure *, HydrodynamicsParametersRef > HydrodynamicsParametersLinkedStructureContainer
agx::HashVector< const agxCollide::Geometry *, WaterFlowGeneratorRef > WaterFlowGeneratorContainer
const agxCollide::Geometry * water
agx::HashVector< const agxWire::Wire *, HydrodynamicsParametersRef > HydrodynamicsParametersWireContainer
Interface for generating wind effects.
WindGeneratorRef m_windGenerator
WaterWrapperContainer m_waterWrappers
agxCollide::GeometryConstObserver m_geometry
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
Vector containing 'raw' data.
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
GlobalTriangleData::Container m_trianglePool
agx::Vector< agxWire::WireObserver > WireObserverVector
GeometryConstObserverVector m_waterGeometries
agx::Matrix3x3 bodyFrameAddedInertia
UnitPrimitiveCache m_unitPrimitiveCache
Smart pointer for handling referenced counted objects.
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.
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
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::HashVector< const agxCollide::Shape *, AerodynamicsParametersRef > AerodynamicsParametersContainer
agx::Vector< WindAndWaterController *> WindAndWaterControllerPtrVector
Type
Define the type of a Shape.
agx::ref_ptr< ObjectData > ObjectDataRef
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...
agx::HashVector< const agxCollide::Shape *, PressureFieldRendererDataRef > PressureFieldRendererDataContainer
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.
agx::HashVector< const agxSDK::LinkedStructure *, AerodynamicsParametersRef > AerodynamicsParametersLinkedStructureContainer
VertexData::Container m_vertexPool
Inheritance with partial specialization due to bug with ref_ptr containers.
const WindGenerator * m_windGenerator
agx::Vector< agxCollide::GeometryConstObserver > GeometryConstObserverVector
agx::Vector< ObjectDataRef > ObjectDataContainer
virtual ~PressureFieldRendererData()
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
agx::Vector< WireLinkedStructureDataRef > WireLinkedStructureDataContainer
const agx::Vec3 & getVelocity() const