18#ifndef AGX_RIGIDBODY_EMITTER_H
19#define AGX_RIGIDBODY_EMITTER_H
54 CREATED_BY_RIGIDBODYEMITTER = 1 << 0,
55 CREATED_BY_SNAPSHOT_LOADING = 1 << 1,
56 IS_BODYMODEL_TEMPLATE = 1 << 2
58 typedef agx::BitState< EState, agx::Int32 > State;
60 RigidBodyEmitterInternalData() : state() {}
64 virtual ~RigidBodyEmitterInternalData() {}
70 child =
new RigidBodyEmitterInternalData();
72 child->
as<RigidBodyEmitterInternalData>()->state = this->state;
165 static RigidBodyEmitterInternalData* getRigidBodyEmitterData(const
agx::
RigidBody* obj);
167 static RigidBodyEmitterInternalData* getOrCreateRigidBodyEmitterData(
agx::
RigidBody* obj);
176 virtual
void emitBody(const
Vec3& position,
177 const
Quat& rotation,
178 const
Vec3& velocity,
179 Emitter::DistributionModel *model) override;
180 virtual
bool preEmit() override;
181 virtual
void postEmit() override;
183 virtual
void transfer(
agxSDK::Simulation *simulation) override;
192 agxSDK::Simulation *m_simulation;
239 virtual ~DistributionModel();
#define AGX_DECLARE_POINTER_TYPES(type)
#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)
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Spawns new bodys inside a given volume.
friend class DistributionTable
An event with three arguments.
Interface class for a cloneable reference counted object.
With this class you can attach an ObserverFrame object relative to a RigidBody.
T * as()
Subclass casting.
Spawns new Rigid Bodies inside a volume given to the Emitter.
agx::ObserverFrame * getPlacementObserver() const
static void setRigidBodyIsLoaded(agx::RigidBody *body, bool isLoaded)
Manually override setting that specifies if a RigidBody was loaded from an snapshot.
static void setRigidBodyIsEmitted(agx::RigidBody *body, bool isEmitted)
Manually override setting that specifies if a RigidBody was created from an Emitter.
static agx::RigidBodyPtrVector getEmittedBodiesInSimulation(agxSDK::Simulation *simulation)
static agx::RigidBodyRefVector spawnBodiesInBound(const agx::Bound3 &bound, agx::Emitter::DistributionTable *sourceTable, const agx::Vec3 &spacing, agx::Real jitterfactor=agx::Real(0))
Spawn Rigid Bodies inside a 3D bound based on a specified distribution table of rigid bodies.
DistributionModel(agx::RigidBody *bodyTemplate, agx::Real probabilityWeight, agx::ObserverFrame *placementObserver=nullptr)
Create a Rigid Body Distribution model for usage in the Emitter::DistributionTable class.
static bool rigidBodyIsLoaded(const agx::RigidBody *body)
static bool rigidBodyIsEmitted(const agx::RigidBody *body)
agx::RigidBody * getBodyTemplate()
DistributionModel()
Default constructor.
static bool rigidBodyIsTemplate(const agx::RigidBody *body)
Event3< RigidBodyEmitter *, agx::RigidBody *, DistributionModel * > Event
RigidBodyEmitter(Quantity quantity=QUANTITY_COUNT)
Default constructor for a RigidBodyEmitter.
static void setRigidBodyIsTemplate(agx::RigidBody *body, bool isTemplate)
Set state bit in the RigidBodyEmitterData for the specifed RigidBody that signals if it is used as a ...
The rigid body class, combining a geometric model and a frame of reference.
Smart pointer for handling referenced counted objects.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
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.
agx::ref_ptr< ICloneable > ICloneableRef