92 void setRate(
Real rate);
103 void setVelocity(
const Vec3& velocity);
108 const Vec3& getVelocity()
const;
118 void setDistributionTable(DistributionTable *table);
126 void setUseFixedPosition(
bool enable);
131 bool getUseFixedPosition()
const;
139 void setUseFixedRotation(
bool enable );
144 bool getUseFixedRotation()
const;
153 void setFixedPositionOffset(
const agx::Vec3& fixedPositionOffset );
161 void setFixedRotationOffset(
const agx::Quat& fixedRotationOffset );
166 agx::Vec3 getFixedPositionOffset()
const;
171 agx::Quat getFixedRotationOffset()
const;
176 DistributionTable *getDistributionTable();
177 const DistributionTable *getDistributionTable()
const;
200 agx::Real getMaximumEmittedQuantity()
const;
211 void addCollisionGroup(
const agx::Name& name);
218 void removeCollisionGroup(
const agx::Name& name);
227 bool hasCollisionGroup(
agx::Name id)
const;
239 void setEnableOverrideRenderSettings(
bool enable);
244 bool getEnableOverrideRenderSettings()
const;
254 void setEnableRenderEmittedObjects(
bool enable);
260 bool getEnableRenderEmittedObjects()
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;
294 virtual
Real getDefaultElementQuantity(
Quantity quantity);
296 virtual
void store(
agxStream::OutputArchive&
out ) const override;
297 virtual
void restore(
agxStream::InputArchive&
in ) override;
299 void setEmittedQuantity(
agx::
Real quantity);
300 void setEmittedCount(
agx::
UInt emittedCount);
303 agx::
Real generateRandomNumber();
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>;
351 DistributionModel(
agx::Real probabilityWeight);
356 void setProbabilityWeight(
agx::Real weight);
381 virtual ~DistributionModel();
388 friend class DistributionTable;
389 void setDistribution(DistributionTable *distribution);
391 static bool rangeCompare(DistributionModel *model,
agx::Real value);
405 DistributionTable(
Quantity quantity = QUANTITY_COUNT);
410 void addModel(DistributionModel *model);
420 DistributionModel *getRandomModel();
435 void setProbabilityQuantity(
Quantity quantity);
440 Quantity getProbabilityQuantity()
const;
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;
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 Dynamics API including thread resources and must be executed before using the AGX API...
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)
This namespace consists of a set of classes for handling geometric intersection tests including boole...
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
DistributionTableRef m_distributionTable
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_POINTER_TYPES(type)
Representation of a name string.
agx::SetVector< ref_ptr< Emitter > > EmitterRefSetVector
agxCollide::GeometryRef m_proxySphere
Spawns new bodys inside a given volume.
Pointer to a entity instance of type Physics.CollisionGroupSet.
Base class providing referencing counted objects.
agxCollide::GeometryRef m_geometry
The geometry representation used by the collision detection engine.
agx::Physics::CollisionGroupSetPtr getCollisionGroupSet() const
agx::BitState< StateFlags, agx::UInt32 > Flags
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
agxCollide::Geometry * getGeometry()
ScalarParameterRef m_timestep
Pointer to a entity instance of type Physics.Emitter.
agx::Quat m_fixedRotationOffset
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::Vec3 m_fixedPositionOffset
agx::UInt m_activationCount
#define AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(T)
Use this in a pure abstract Serializable class to add the required methods Important: Use full namesp...
agxCollide::SpaceRef m_space
Physics::EmitterPtr m_entity
#define AGX_DECLARE_VECTOR_TYPES(type)
Axis aligned bounding box implementation.
This namespace contain classes for streaming classes into archives, ASCII, binary for storage (serial...
UniformRealGenerator m_generator
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
#define DOXYGEN_END_INTERNAL_BLOCK()
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
#define DOXYGEN_START_INTERNAL_BLOCK()
AGXCORE_EXPORT EntityModel * getEntity(const agx::Path &path)
Get a entity with a specified path.