|
FineKernelToolKit 4.2.13
|
パーティクル単体を制御するクラス [詳解]
#include <FK/Particle.h>
FK::fk_Particle の継承関係図
FK::fk_Particle 連携図公開メンバ関数 | |
| void | init (void) |
| 初期化関数 | |
| int | getID (void) const |
| ID参照関数 | |
| unsigned int | getCount (void) const |
| 年齢参照関数 | |
| fk_Vector | getPosition (void) const |
| 位置ベクトル参照設定 | |
| void | setPosition (const fk_Vector &pos) |
| 位置ベクトル設定関数1 | |
| void | setPosition (double x, double y, double z) |
| 位置ベクトル設定関数2 | |
| fk_Vector | getVelocity (void) const |
| 速度ベクトル参照設定 | |
| void | setVelocity (const fk_Vector &vel) |
| 速度ベクトル設定関数1 | |
| void | setVelocity (double x, double y, double z) |
| 速度ベクトル設定関数2 | |
| fk_Vector | getAccel (void) const |
| 加速度ベクトル参照設定 | |
| void | setAccel (const fk_Vector &acc) |
| 加速度ベクトル設定関数1 | |
| void | setAccel (double x, double y, double z) |
| 加速度ベクトル設定関数2 | |
| void | handle (void) |
| 年齢更新関数 | |
| void | setColor (const fk_Color &col) |
| 色設定関数1 | |
| void | setColor (fk_Color *col) |
| 色設定関数2 | |
| fk_Color | getColor (void) |
| 色取得関数 | |
| bool | getDrawMode (void) const |
| 描画有無取得関数 | |
| void | setDrawMode (bool mode) |
| 描画有無設定関数 | |
基底クラス FK::fk_Attribute に属する継承公開メンバ関数 | |
| fk_Attribute (void) | |
| コンストラクタ | |
| virtual | ~fk_Attribute () |
| デストラクタ | |
| bool | setAttrII (const int key, const int value) |
| キーが int 型、値が int 型である属性設定関数 | |
| bool | setAttrID (const int key, const double value) |
| キーが int 型、値が double 型である属性設定関数 | |
| bool | setAttrIS (const int key, const std::string value) |
| キーが int 型、値が std::string 型である属性設定関数 | |
| bool | setAttrSI (const std::string key, const int value) |
| キーが std::string 型、値が int 型である属性設定関数 | |
| bool | setAttrSD (const std::string key, const double value) |
| キーが std::string 型、値が double 型である属性設定関数 | |
| bool | setAttrSS (const std::string key, const std::string value) |
| キーが std::string 型、値が std::string 型である属性設定関数 | |
| int | getAttrII (const int key) const |
| キーが int 型、値が int 型である属性参照関数 | |
| double | getAttrID (const int key) const |
| キーが int 型、値が double 型である属性参照関数 | |
| std::string | getAttrIS (const int key) const |
| キーが int 型、値が std::string 型である属性参照関数 | |
| int | getAttrSI (const std::string key) const |
| キーが std::string 型、値が int 型である属性参照関数 | |
| double | getAttrSD (const std::string key) const |
| キーが std::string 型、値が double 型である属性参照関数 | |
| std::string | getAttrSS (const std::string key) const |
| キーが std::string 型、値が std::string 型である属性参照関数 | |
| bool | existAttrII (const int key) const |
| キーが int 型、値が int 型である属性存在参照関数 | |
| bool | existAttrID (const int key) const |
| キーが int 型、値が double 型である属性存在参照関数 | |
| bool | existAttrIS (const int key) const |
| キーが int 型、値が std::string 型である属性存在参照関数 | |
| bool | existAttrSI (const std::string key) const |
| キーが std::string 型、値が int 型である属性存在参照関数 | |
| bool | existAttrSD (const std::string key) const |
| キーが std::string 型、値が double 型である属性存在参照関数 | |
| bool | existAttrSS (const std::string key) const |
| キーが std::string 型、値が std::string 型である属性存在参照関数 | |
| bool | deleteAttrII (const int key) |
| キーが int 型、値が int 型である属性消去関数 | |
| bool | deleteAttrID (const int key) |
| キーが int 型、値が double 型である属性消去関数 | |
| bool | deleteAttrIS (const int key) |
| キーが int 型、値が std::string 型である属性消去関数 | |
| bool | deleteAttrSI (const std::string key) |
| キーが std::string 型、値が int 型である属性消去関数 | |
| bool | deleteAttrSD (const std::string key) |
| キーが std::string 型、値が double 型である属性消去関数 | |
| bool | deleteAttrSS (const std::string key) |
| キーが std::string 型、値が std::string 型である属性消去関数 | |
基底クラス FK::fk_BaseObject に属する継承公開メンバ関数 | |
| fk_BaseObject (fk_Type type=fk_Type::BASEOBJECT) | |
| コンストラクタ | |
| fk_Type | getObjectType (void) const |
| タイプ取得関数 | |
パーティクル単体を制御するクラス
このクラスは、パーティクル集合中のパーティクル単体を制御する機能を提供します。
「パーティクル」とは粒子のことで、流体表現などに利用します。 本クラスは、インスタンスをユーザが直接生成するのではなく、 まずは fk_ParticleSet クラス(厳密にはその派生クラス)のインスタンスを用意し、 fk_ParticleSet::newParticle() を用いてインスタンスを生成します。
個々のパーティクルは、以下のような属性を持っています。
パーティクルは、 handle() を呼び出すか、 または fk_ParticleSet::handle() を呼び出すことで時間経過を行い、 速度は加速度によって自動的に更新され、位置も速度によって自動的に更新されます。 ただし、上記の属性はあらゆるタイミングで変更が可能となっており、 速度や加速度を零ベクトルに設定した上で自前で位置を制御することも可能です。
本クラスでは、あくまで個別のパーティクル情報しか得られないため、 パーティクル同士の相互作用など、他のパーティクルの情報を得ることはできません。 そのような場合は、 fk_ParticleSet の機能を利用して下さい。 また、パーティクルの消去は fk_ParticleSet::removeParticle() を利用して下さい。
fk_Particle クラスは fk_Attribute クラスの派生クラスですので、 パーティクルに対し独自の属性や情報を個別に持たせたい場合は、 fk_Attribute の機能を利用することができます。
このクラスと同様に点群を扱うクラスとして、 fk_Point があります。 fk_Particle や fk_ParticleSet が法則を記述することが主であることに対し、 fk_Point では点の制御をより直接的に行います。
| void FK::fk_Particle::init | ( | void | ) |
初期化関数
パーティクルを初期化します。
| int FK::fk_Particle::getID | ( | void | ) | const |
ID参照関数
パーティクルの ID を参照します。
| unsigned int FK::fk_Particle::getCount | ( | void | ) | const |
年齢参照関数
パーティクルの年齢を参照します。 年齢とは、パーティクルが生成されてから handle() および fk_ParticleSet::handle() が呼ばれた回数のことです。
| fk_Vector FK::fk_Particle::getPosition | ( | void | ) | const |
位置ベクトル参照設定
パーティクルの位置ベクトルを参照します。
| void FK::fk_Particle::setPosition | ( | const fk_Vector & | pos | ) |
位置ベクトル設定関数1
パーティクルの位置ベクトルを設定します。
| [in] | pos | 位置ベクトル |
| void FK::fk_Particle::setPosition | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) |
位置ベクトル設定関数2
パーティクルの位置ベクトルを設定します。
| [in] | x | 位置ベクトルのx成分 |
| [in] | y | 位置ベクトルのy成分 |
| [in] | z | 位置ベクトルのz成分 |
| fk_Vector FK::fk_Particle::getVelocity | ( | void | ) | const |
速度ベクトル参照設定
パーティクルの速度ベクトルを参照します。
| void FK::fk_Particle::setVelocity | ( | const fk_Vector & | vel | ) |
速度ベクトル設定関数1
パーティクルの速度ベクトルを設定します。
| [in] | vel | 速度ベクトル |
| void FK::fk_Particle::setVelocity | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) |
速度ベクトル設定関数2
パーティクルの速度ベクトルを設定します。
| [in] | x | 速度ベクトルのx成分 |
| [in] | y | 速度ベクトルのy成分 |
| [in] | z | 速度ベクトルのz成分 |
| fk_Vector FK::fk_Particle::getAccel | ( | void | ) | const |
加速度ベクトル参照設定
パーティクルの加速度ベクトルを参照します。
| void FK::fk_Particle::setAccel | ( | const fk_Vector & | acc | ) |
加速度ベクトル設定関数1
パーティクルの加速度ベクトルを設定します。
| [in] | acc | 加速度ベクトル |
| void FK::fk_Particle::setAccel | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) |
加速度ベクトル設定関数2
パーティクルの加速度ベクトルを設定します。
| [in] | x | 加速度ベクトルのx成分 |
| [in] | y | 加速度ベクトルのy成分 |
| [in] | z | 加速度ベクトルのz成分 |
| void FK::fk_Particle::handle | ( | void | ) |
年齢更新関数
パーティクルの年齢を更新します。 これにより、速度ベクトルには加速度ベクトルが追加され、 位置ベクトルには速度ベクトルが追加されます。 同じパーティクル集合に属する別のパーティクルには影響しません。
| void FK::fk_Particle::setColor | ( | const fk_Color & | col | ) |
色設定関数1
パーティクルの色を設定します。 この色設定によって表示するには、形状を登録するモデル側で、 fk_Model::setElementMode() 関数を用いて fk_ElementMode::ELEMENT を設定しておく必要があります。
| [in] | col | 色値 |
| void FK::fk_Particle::setColor | ( | fk_Color * | col | ) |
色設定関数2
パーティクルの色を設定します。 この色設定によって表示するには、形状を登録するモデル側で、 fk_Model::setElementMode() 関数を用いて fk_ElementMode::ELEMENT を設定しておく必要があります。
| [in] | col | 色値 |
| fk_Color FK::fk_Particle::getColor | ( | void | ) |
色取得関数
パーティクルの色を取得します。
| bool FK::fk_Particle::getDrawMode | ( | void | ) | const |
描画有無取得関数
現在このパーティクルが描画する状態にあるかどうかを取得します。
| void FK::fk_Particle::setDrawMode | ( | bool | mode | ) |
描画有無設定関数
このパーティクルの描画状態を設定します。 ここで false を設定してもパーティクル自体が消去されるわけではないことに注意して下さい。 パーティクル自体を消去するには fk_ParticleSet::removeParticle() を用いる必要があります。
| [in] | mode | 描画する場合 true を、しない場合 false を入力します。 |