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 );
464 DynamicsData() : worldForce(), worldTorque(), bodyFrameAddedMass( agx::
Vec3() ), bodyFrameAddedInertia( agx::
Vec3() ) {}
473 void getAddedMassAndInertiaDiagonalCoefficients(
const agx::RigidBody* rb,
agx::Vec3& addedMassDiagonalCoefficients,
agx::Vec3& addedInertiaDiagonalCoefficients )
const;
486 DynamicsWireData() : waterForce(), airForce(), numWaterSegments( 0 ), numAirSegments( 0 ), lengthWater( 0 ), lengthAir( 0 ) {}
530 virtual void setEnableAerodynamics(
agx::Bool enable );
561 void setAirDensity(
agx::Real airDensity );
761 void garbageCollect();
767 : shape( shapeIn ), mesh( meshIn )
771 virtual void checkSize(
agx::Real resolution ) = 0;
777 virtual ~PrimitiveData() {}
780 struct CapsuleData : PrimitiveData
783 : PrimitiveData( shapeIn, meshIn ), radius( radiusIn ), height( heightIn )
787 virtual void checkSize(
agx::Real resolution )
override;
793 virtual ~CapsuleData() {}
796 struct ConeData : PrimitiveData
799 : PrimitiveData( shapeIn, meshIn ), topRadius( topRadiusIn ), bottomRadius( bottomRadiusIn ),
804 virtual void checkSize(
agx::Real resolution )
override;
811 virtual ~ConeData() {}
814 struct HollowConeData : PrimitiveData
819 : PrimitiveData( shapeIn, meshIn ), topOuterRadius( topOuterRadiusIn ),
820 bottomInnerRadius( bottomInnerRadiusIn ), height( heightIn ), thickness( thicknessIn )
824 virtual void checkSize(
agx::Real resolution )
override;
832 virtual ~HollowConeData() {}
835 struct HollowCylinderData : PrimitiveData
838 : PrimitiveData( shapeIn, meshIn ), innerRadius( innerRadiusIn ), height( heightIn ),
839 thickness( thicknessIn )
843 virtual void checkSize(
agx::Real resolution )
override;
850 virtual ~HollowCylinderData() {}
866 mutable std::mutex meshCreationMutex;
894 void configureDefaultAlgorithms();
899 void garbageCollect();
1020 void setVelocity(
const agx::Vec3& velocity );
1059 void setVelocity(
const agx::Vec3& velocity );
1152 void setWaterGeometry( agxCollide::Geometry* waterGeometry );
1159 return m_aeroParams;
1164 return m_hydroParams;
1178 #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
void lock() const
Perform a mutex lock for this ObjectData.
AerodynamicsParametersLinkedStructureContainer m_aerodynamicsParametersLinkedStructures
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
agx::HashVector< const agxCollide::Shape *, HydrodynamicsParametersRef > HydrodynamicsParametersContainer
agx::AffineMatrix4x4 m_worldToShape
const agxModel::HydrodynamicsParameters * getHydrodynamicsParameters() const
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
void unLock() const
Perform a mutex unlock for this ObjectData.
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.
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)
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.
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
agx::Vector< Segment > SegmentContainer
Hydro- and aerodynamic results for a wire.
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
const agx::Vec3 & getVelocity() const
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
agxModel::PressureFieldRendererRef pressureField
agx::Int numWaterSegments
const agx::Vec3 & getVelocity() const
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