18 #ifndef AGX_RIGIDBODY_EMITTER_H
19 #define AGX_RIGIDBODY_EMITTER_H
48 CREATED_BY_RIGIDBODYEMITTER = 1 << 0
50 typedef agx::BitState< EState, agx::Int32 >
State;
52 RigidBodyEmitterInternalData() : state() {}
56 virtual ~RigidBodyEmitterInternalData() {}
62 child =
new RigidBodyEmitterInternalData();
64 child->
as<RigidBodyEmitterInternalData>()->state = this->state;
87 static void setRigidBodyIsEmitted(
agx::RigidBody * body,
bool isEmitted);
91 static
void storePersistentData(const agx::
RigidBody* rb, agxStream::OutputArchive&
out);
93 static
void restorePersistentData(agx::
RigidBody* rb, agxStream::InputArchive&
in);
98 static RigidBodyEmitterInternalData* getRigidBodyEmitterData(const agx::
RigidBody* obj);
100 static RigidBodyEmitterInternalData* getOrCreateRigidBodyEmitterData(agx::
RigidBody* obj);
107 virtual ~RigidBodyEmitter();
109 virtual
void emitBody(const
Vec3& position, const
Vec3& velocity,
Emitter::DistributionModel *model) override;
110 virtual
bool preEmit() override;
111 virtual
void postEmit() override;
121 agxSDK::Simulation *m_simulation;
147 virtual ~DistributionModel();
148 virtual agx::
Real calculateVolume() override;
149 virtual agx::
Real calculateMass() override;
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.
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...
friend class DistributionTable
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_POINTER_TYPES(type)
agx::ref_ptr< ICloneable > ICloneableRef
Event2< RigidBodyEmitter *, agx::RigidBody * > Event
Spawns new bodys inside a given volume.
T * as()
Subclass casting.
Smart pointer for handling referenced counted objects.
The rigid body class, combining a geometric model and a frame of reference.
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Interface class for a cloneable reference counted object.
Spawns new bodys inside a given volume.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
AGX_DECLARE_VECTOR_TYPES(Clock)