|
Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
|
#include <tfParticle.h>


Public Member Functions | |
| struct ParticleHandle * | handle () |
| Get a handle for this particle. | |
| HRESULT | addpart (int32_t uid) |
| HRESULT | removepart (int32_t uid) |
| Particle * | particle (int i) |
| FVector3 | global_position () |
| Get the global position. | |
| void | set_global_position (const FVector3 &pos) |
| Set the global position. | |
| bool | verify () |
| operator Cluster * () | |
| Cast to a cluster type. Limits casting to cluster by type. | |
| std::string | toString () |
| Get a JSON string representation. | |
Static Public Member Functions | |
| static Particle * | fromString (const std::string &str) |
| Create from a JSON string representation. | |
Public Attributes | ||
| union { | ||
| FPTYPE f [4] | ||
| FVector3 force | ||
| struct { | ||
| FPTYPE __dummy0 [3] | ||
| FPTYPE number_density | ||
| } | ||
| }; | ||
| union { | ||
| FVector3 force_i | ||
| }; | ||
| union { | ||
| FPTYPE v [4] | ||
| FVector3 velocity | ||
| struct { | ||
| FPTYPE __dummy1 [3] | ||
| FPTYPE inv_number_density | ||
| } | ||
| }; | ||
| union { | ||
| FPTYPE x [4] | ||
| FVector3 position | ||
| struct { | ||
| FPTYPE __dummy2 [3] | ||
| uint32_t creation_time | ||
| } | ||
| }; | ||
| union { | ||
| FVector3 persistent_force | ||
| }; | ||
| FPTYPE | imass | |
| FPTYPE | radius | |
| FPTYPE | mass | |
| FPTYPE | q | |
| FVector3 | p0 | |
| FVector3 | v0 | |
| FVector3 | xk [4] | |
| FVector3 | vk [4] | |
| int | id | |
| int | vid | |
| int16_t | typeId | |
| int32_t | clusterId | |
| uint16_t | flags | |
| struct ParticleHandle * | _handle | |
| int32_t * | parts | |
| uint16_t | nr_parts | |
| uint16_t | size_parts | |
| rendering::Style * | style | |
| struct state::StateVector * | state_vector | |
The particle data structure.
Instance vars for each particle.
Note that the arrays for x, v and f are 4 entries long for proper alignment.
All particles are stored in a series of contiguous blocks of memory that are owned by the space cells. Each space cell has a array of particle structs.
If you're building a model, you should probably instead be working with a ParticleHandle.
| HRESULT TissueForge::Particle::addpart | ( | int32_t | uid | ) |
add a particle (id) to this type
|
static |
Create from a JSON string representation.
The returned particle is not automatically registered with the engine.
To properly register a particle from a string, pass the string to the particle constructor of the appropriate particle type or cluster.
| str | constructor string, as returned by toString |
| TissueForge::Particle::operator Cluster * | ( | ) |
Cast to a cluster type. Limits casting to cluster by type.
|
inline |
Get the ith particle, if this particle is a cluster.
| HRESULT TissueForge::Particle::removepart | ( | int32_t | uid | ) |
removes a particle from this cluster. Sets the particle cluster id to -1, and removes if from this cluster's list.
| bool TissueForge::Particle::verify | ( | ) |
performs a self-verify, in debug mode raises assertion if not valid
| union { ... } TissueForge::Particle |
Particle position
| union { ... } TissueForge::Particle |
Random force.
| union { ... } TissueForge::Particle |
| union { ... } TissueForge::Particle |
Initial particle force
At each step, the total force acting on a particle is reset to this settable value.
| union { ... } TissueForge::Particle |
Particle velocity
| struct ParticleHandle* TissueForge::Particle::_handle |
pointer to the handle.
Particle data gets moved around between cells, and the handle provides a safe way to retrieve them.
| int32_t TissueForge::Particle::clusterId |
Cluster id of this part
| uint16_t TissueForge::Particle::flags |
Particle flags
| int TissueForge::Particle::id |
Particle id, virtual id TODO: not sure what virtual id is...
| FPTYPE TissueForge::Particle::imass |
Inverse mass
| FPTYPE TissueForge::Particle::mass |
Particle mass
| uint16_t TissueForge::Particle::nr_parts |
number of particle ids that belong to this particle, if it is a cluster.
| int32_t* TissueForge::Particle::parts |
list of particle ids that belong to this particle, if it is a cluster.
| FPTYPE TissueForge::Particle::q |
Individual particle charge, if needed
| FPTYPE TissueForge::Particle::radius |
Particle radius
| uint16_t TissueForge::Particle::size_parts |
size of particle ids that belong to this particle, if it is a cluster.
| struct state::StateVector* TissueForge::Particle::state_vector |
optional pointer to state vector
Set at construction time when species are present in a simulation.
| rendering::Style* TissueForge::Particle::style |
Style pointer, set at object construction time. Can be set by the user after construction. The base particle type has a default style.
| int16_t TissueForge::Particle::typeId |
Particle type id