174 bool hasCollisionGroup(
agx::Name id)
const;
217 virtual
void transfer(
agxSDK::Simulation *simulation);
221 static
agxStream::Serializable* create() {
return nullptr; }
227 virtual
void run() override;
232 virtual
void emitBody(const
Vec3& position, const
Vec3& velocity,
Emitter::DistributionModel *model) = 0;
233 virtual
bool preEmit() = 0;
234 virtual
void postEmit() = 0;
249 OVERRIDE_RENDER_SETTINGS = 1 << 0,
250 SHOULD_RENDER_EMITTED_OBJECTS = 1 << 1
252 using Flags = agx::BitState<StateFlags, agx::UInt32>;
311 static
agxStream::Serializable* create() {
return nullptr; }
317 virtual ~DistributionModel();
324 friend class DistributionTable;
325 void setDistribution(DistributionTable *distribution);
327 static
bool rangeCompare(DistributionModel *model,
agx::
Real value);
330 DistributionTable *m_distribution;
385 virtual ~DistributionTable();
388 friend class DistributionModel;
389 void rebuildProbabilityTable();
391 agx::
Real getQuantifiedProbabilityWeight(DistributionModel *model) const;
392 agx::
Real calculateTotalQuantifiedWeight() const;
420 m_entity.collisionGroupSet() = set;
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(T)
Use this in a pure abstract Serializable class to add the required methods Important: Use full namesp...
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_VECTOR_TYPES(type)
Axis aligned bounding box implementation.
static bool hasGroup(agx::Physics::CollisionGroupSetPtr set, agx::UInt32 groupId)
The geometry representation used by the collision detection engine.
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Spawns new bodys inside a given volume.
void addModel(DistributionModel *model)
Add a particle model.
agx::UInt getActivationCount() const
const DistributionModelRefVector & getModels() const
void setSeed(const agx::UInt32 seed)
Set the seed for the random number generator of the emitter.
bool getEnableOverrideRenderSettings() const
void setGeometry(agxCollide::Geometry *geometry)
Set the volume that bodies will be spawned inside.
void addCollisionGroup(agx::UInt32 id)
Add the specified id to a vector of group id, this will make a bodies emitted from this emitter part ...
agx::Physics::CollisionGroupSetPtr getCollisionGroupSet() const
agx::Real getVolume() const
agx::Real calculateTotalWeight() const
agx::Real getMaximumEmittedQuantity() const
Get the maximum amount of quantity that this emitter is allowed to emit.
const Vec3 & getVelocity() const
Quantity getQuantity() const
ScalarParameterRef m_timestep
void setMaximumEmittedQuantity(const agx::Real max)
Sets the maximum amount of objects that this emitter is allowed to emit.
void setRate(Real rate)
Set the rate in which the emitter emits objects, measured in the specified quantity QUANTITY_COUNT - ...
agxCollide::GeometryRef m_proxySphere
agxCollide::GeometryRef m_geometry
void setVelocity(const Vec3 &velocity)
Set the initial velocity for the bodys when spawned, in local geometry coordinates.
void removeCollisionGroup(const agx::Name &name)
DistributionModel * getRandomModel()
agx::Real getEmittedQuantity() const
Returns the quantity amount that this emitter has emitted.
agx::UInt getNumEmitted() const
void setProbabilityWeight(agx::Real weight)
Set the random probability weight.
DistributionTable * getDistributionTable()
void removeCollisionGroup(agx::UInt32 id)
Remove a group id from the vector of group ids.
void setSeed(agx::UInt32 seed)
Set the seed of the random number generator in the distribution table.
Physics::EmitterPtr m_entity
agx::Real getMass() const
Emitter(Quantity quantity=QUANTITY_COUNT)
Create an emitter.
const DistributionTable * getDistributionTable() const
void setEnableOverrideRenderSettings(bool enable)
Sets whenever the render settings of emitted objects should be overriden.
void setProbabilityQuantity(Quantity quantity)
Set The probability quantity.
void addCollisionGroup(const agx::Name &name)
void setQuantity(Quantity quantity)
Set the emitting quantity QUANTITY_COUNT - number of emitted objects QUANTITY_VOLUME - volume of emit...
void setDistributionTable(DistributionTable *table)
Set a distribution table to be used for body attributes.
bool hasCollisionGroup(agx::UInt32 id) const
This is performing a linear search among the group id for this Emitter.
UniformRealGenerator m_generator
bool getEnableRenderEmittedObjects() const
DistributionTable(Quantity quantity=QUANTITY_COUNT)
agx::Real getProbabilityWeight() const
void setEnableRenderEmittedObjects(bool enable)
Sets whenever the emitted objects should be rendered or not, if possible.
agxCollide::SpaceRef m_space
void setName(const agx::String &name)
DistributionModel(agx::Real probabilityWeight)
agx::BitState< StateFlags, agx::UInt32 > Flags
DistributionTableRef m_distributionTable
Quantity getProbabilityQuantity() const
agx::String getName() const
Representation of a name string.
Pointer to a entity instance of type Physics.CollisionGroupSet.
Pointer to a entity instance of type Physics.Emitter.
Base class providing referencing counted objects.
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
This namespace consists of a set of classes for handling geometric intersection tests including boole...
AGXCORE_EXPORT EntityModel * getEntity(const agx::Path &path)
Get a entity with a specified path.
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
This namespace contain classes for streaming classes into archives, ASCII, binary for storage (serial...
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...
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.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Vec3T< T > max(const Vec3T< T > &lhs, const Vec3T< T > &rhs)
void AGXPHYSICS_EXPORT init()
Initialize agx.
agx::SetVector< ref_ptr< Emitter > > EmitterRefSetVector