18 #ifndef AGX__EMITTER_H 19 #define AGX__EMITTER_H 85 void setRate(
Real rate);
96 void setVelocity(
const Vec3& velocity);
101 const Vec3& getVelocity()
const;
111 void setDistributionTable(DistributionTable *table);
116 DistributionTable *getDistributionTable();
117 const DistributionTable *getDistributionTable()
const;
140 agx::Real getMaximumEmittedQuantity()
const;
151 void addCollisionGroup(
const agx::Name& name);
158 void removeCollisionGroup(
const agx::Name& name);
167 bool hasCollisionGroup(
agx::Name id)
const;
184 static
agxStream::Serializable* create() {
return nullptr; }
190 virtual
void run() override;
195 virtual
void emitBody(const
Vec3& position, const
Vec3& velocity, Emitter::DistributionModel *model) = 0;
196 virtual
bool preEmit() = 0;
197 virtual
void postEmit() = 0;
198 virtual
Real getDefaultElementQuantity(
Quantity quantity);
200 virtual
void store(
agxStream::OutputArchive&
out ) const override;
201 virtual
void restore(
agxStream::InputArchive&
in ) override;
203 void setEmittedQuantity(
agx::
Real quantity);
204 void setEmittedCount(
agx::
UInt emittedCount);
207 agx::
Real generateRandomNumber();
218 void setCollisionGroupSet(
agx::Physics::CollisionGroupSetPtr set);
221 Physics::EmitterPtr m_entity;
241 DistributionModel(
agx::Real probabilityWeight);
246 void setProbabilityWeight(
agx::Real weight);
271 virtual ~DistributionModel();
278 friend class DistributionTable;
279 void setDistribution(DistributionTable *distribution);
281 static bool rangeCompare(DistributionModel *model,
agx::Real value);
295 DistributionTable(
Quantity quantity = QUANTITY_COUNT);
300 void addModel(DistributionModel *model);
305 const DistributionModelRefVector& getModels()
const;
310 DistributionModel *getRandomModel();
325 void setProbabilityQuantity(
Quantity quantity);
330 Quantity getProbabilityQuantity()
const;
339 virtual ~DistributionTable();
342 friend class DistributionModel;
343 void rebuildProbabilityTable();
345 agx::Real getQuantifiedProbabilityWeight(DistributionModel *model)
const;
346 agx::Real calculateTotalQuantifiedWeight()
const;
351 DistributionModelRefVector m_models;
374 m_entity.collisionGroupSet() =
set;
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
void AGXPHYSICS_EXPORT init()
Initialize agx.
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive...
Vec3T< T > max(const Vec3T< T > &lhs, const Vec3T< T > &rhs)
agxCollide namespace consists of a set of classes for handling geometric intersection tests including...
DistributionTable * m_distribution
friend class DistributionTable
bool hasCollisionGroup(agx::UInt32 id) const
This is performing a linear search among the group id for this Emitter.
agx::Real m_probabilityWeight
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_POINTER_TYPES(type)
Representation of a name string.
Spawns new bodys inside a given volume.
Pointer to a entity instance of type Physics.CollisionGroupSet.
Base class providing referencing counted objects.
The geometry representation used by the collision detection engine.
agx::Physics::CollisionGroupSetPtr getCollisionGroupSet() const
Namespace agx contains the dynamics/math part of the AGX Dynamics API.
agxCollide::Geometry * getGeometry()
Contains classes for low level data storage for AGX.
typedef void(GLAD_API_PTR *GLDEBUGPROC)(GLenum source
static bool hasGroup(agx::Physics::CollisionGroupSetPtr set, agx::UInt32 groupId)
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Class for writing serialized data in binary format to a stream.
agx::UInt m_activationCount
agx::ref_ptr< Geometry > GeometryRef
#define AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(T)
Use this in a pure abstract Serializable class to add the required methods Important: Use full namesp...
agx::ref_ptr< Space > SpaceRef
This namespace contain classes for streaming classes into archives, ASCII, binary for storage (serial...
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
AGX_DECLARE_VECTOR_TYPES(Clock)