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;
128 static void setRigidBodyIsEmitted(
agx::RigidBody * body,
bool isEmitted );
136 static void setRigidBodyIsLoaded(
agx::RigidBody * body,
bool isLoaded );
148 static void setRigidBodyIsTemplate(
agx::RigidBody* body,
bool isTemplate);
165 static RigidBodyEmitterInternalData* getRigidBodyEmitterData(const
agx::
RigidBody* obj);
167 static RigidBodyEmitterInternalData* getOrCreateRigidBodyEmitterData(
agx::
RigidBody* obj);
174 virtual ~RigidBodyEmitter();
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();
240 virtual
agx::
Real calculateVolume() override;
241 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...
Event3< RigidBodyEmitter *, agx::RigidBody *, DistributionModel * > Event
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...
friend class DistributionTable
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_POINTER_TYPES(type)
agx::ref_ptr< ICloneable > ICloneableRef
Spawns new bodys inside a given volume.
T * as()
Subclass casting.
Vector containing 'raw' data.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
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...
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Interface class for a cloneable reference counted object.
Spawns new Rigid Bodies inside a volume given to the Emitter.
#define AGX_DECLARE_VECTOR_TYPES(type)
This namespace contain classes for streaming classes into archives, ASCII, binary for storage (serial...
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
With this class you can attach an ObserverFrame object relative to a RigidBody.