227 bool hasCollisionGroup(
agx::Name id)
const;
271 Physics::EmitterPtr getEntity() const;
273 virtual
void transfer(
agxSDK::Simulation *simulation);
277 static
agxStream::Serializable* create() {
return nullptr; }
283 virtual
void run() override;
288 virtual
void emitBody(const
Vec3& position,
289 const
Quat& rotation,
290 const
Vec3& velocity,
291 Emitter::DistributionModel *model) = 0;
292 virtual
bool preEmit() = 0;
293 virtual
void postEmit() = 0;
296 virtual
void store(
agxStream::OutputArchive& out ) const override;
297 virtual
void restore(
agxStream::InputArchive& in ) override;
308 OVERRIDE_RENDER_SETTINGS = 1 << 0,
309 SHOULD_RENDER_EMITTED_OBJECTS = 1 << 1,
310 FIXED_POSITION = 1 << 2,
311 FIXED_ROTATION = 1 << 3
313 using Flags = agx::BitState<StateFlags, agx::UInt32>;
375 static
agxStream::Serializable* create() {
return nullptr; }
381 virtual ~DistributionModel();
384 virtual
void store(
agxStream::OutputArchive& out ) const override;
385 virtual
void restore(
agxStream::InputArchive& in ) override;
388 friend class DistributionTable;
389 void setDistribution(DistributionTable *distribution);
391 static
bool rangeCompare(DistributionModel *model,
agx::
Real value);
394 DistributionTable *m_distribution;
449 virtual ~DistributionTable();
452 friend class DistributionModel;
453 void rebuildProbabilityTable();
455 agx::
Real getQuantifiedProbabilityWeight(DistributionModel *model) const;
456 agx::
Real calculateTotalQuantifiedWeight() const;
484 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.
agx::UInt getActivationCount() const
void setSeed(const agx::UInt32 seed)
Set the seed for the random number generator of the emitter.
bool getEnableOverrideRenderSettings() const
bool getUseFixedPosition() 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 setUseFixedRotation(bool enable)
Set if a fixed rotation should be used on objects created from this emitter.
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
void setUseFixedPosition(bool enable)
Set if fixed position should be used on objects created from this emitter.
bool getUseFixedRotation() 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.
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