242 bool hasCollisionGroup(
agx::Name id)
const;
286 Physics::EmitterPtr getEntity() const;
288 virtual
void transfer(
agxSDK::Simulation *simulation);
292 static
agxStream::Serializable* create() {
return nullptr; }
298 virtual
void run() override;
303 virtual
void emitBody(const
Vec3& position,
304 const
Quat& rotation,
305 const
Vec3& velocity,
306 Emitter::DistributionModel *model) = 0;
307 virtual
bool preEmit() = 0;
308 virtual
void postEmit() = 0;
311 virtual
void store(
agxStream::OutputArchive& out ) const override;
312 virtual
void restore(
agxStream::InputArchive& in ) override;
323 OVERRIDE_RENDER_SETTINGS = 1 << 0,
324 SHOULD_RENDER_EMITTED_OBJECTS = 1 << 1,
325 FIXED_POSITION_DEPRECATED = 1 << 2,
326 FIXED_ROTATION_DEPRECATED = 1 << 3,
327 FIXED_ROTATION_X = 1 << 4,
328 FIXED_ROTATION_Y = 1 << 5,
329 FIXED_ROTATION_Z = 1 << 6,
330 FIXED_POSITION_X = 1 << 7,
331 FIXED_POSITION_Y = 1 << 8,
332 FIXED_POSITION_Z = 1 << 9,
334 using Flags = agx::BitState<StateFlags, agx::UInt32>;
396 static
agxStream::Serializable* create() {
return nullptr; }
402 virtual ~DistributionModel();
405 virtual
void store(
agxStream::OutputArchive& out ) const override;
406 virtual
void restore(
agxStream::InputArchive& in ) override;
409 friend class DistributionTable;
410 void setDistribution(DistributionTable *distribution);
412 static
bool rangeCompare(DistributionModel *model,
agx::
Real value);
415 DistributionTable *m_distribution;
470 virtual ~DistributionTable();
473 friend class DistributionModel;
474 void rebuildProbabilityTable();
476 agx::
Real getQuantifiedProbabilityWeight(DistributionModel *model) const;
477 agx::
Real calculateTotalQuantifiedWeight() const;
505 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 setFixedPositionOffset(const agx::Vec3 &fixedPositionOffset)
Set the fixed position offset of the objects created from the emitter.
void addModel(DistributionModel *model)
Add a particle model.
void setUseFixedRotation(bool enable, agx::Int axis=-1)
Set if a fixed rotation should be used on objects created from this emitter.
agx::UInt getActivationCount() 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 ...
DistributionTable * getDistributionTable()
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.
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.
const DistributionModelRefVector & getModels() const
void removeCollisionGroup(const agx::Name &name)
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.
agx::Quat m_fixedRotationOffset
bool getUseFixedPosition(agx::Int axis=-1) const
const DistributionTable * getDistributionTable() const
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::Quat getFixedRotationOffset() const
agx::Real getMass() const
Emitter(Quantity quantity=QUANTITY_COUNT)
Create an emitter.
bool getUseFixedRotation(agx::Int axis=-1) const
void setUseFixedPosition(bool enable, agx::Int axis=-1)
Set if fixed position should be used on objects created from this emitter.
void setEnableOverrideRenderSettings(bool enable)
Sets whenever the render settings of emitted objects should be overriden.
void setProbabilityQuantity(Quantity quantity)
Set The probability quantity.
const Vec3 & getVelocity() const
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
DistributionModel * getRandomModel()
bool getEnableRenderEmittedObjects() const
DistributionTable(Quantity quantity=QUANTITY_COUNT)
agx::Vec3 m_fixedPositionOffset
agx::Real getProbabilityWeight() const
void setFixedRotationOffset(const agx::Quat &fixedRotationOffset)
Set the fixed rotation offset of the objects created from the emitter.
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)
Set emitter name.
DistributionModel(agx::Real probabilityWeight)
agx::Vec3 getFixedPositionOffset() const
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...
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...
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
void AGXPHYSICS_EXPORT init()
Initialize AGX Dynamics API including thread resources and must be executed before using the AGX API.
agx::SetVector< ref_ptr< Emitter > > EmitterRefSetVector