FineKernelToolKit 4.2.13
|
形状用基底クラス [詳解]
#include <FK/Shape.h>
公開メンバ関数 | |
fk_Shape (fk_Type=fk_Type::SHAPE) | |
コンストラクタ | |
virtual | ~fk_Shape () |
デストラクタ | |
fk_RealShapeType | getRealShapeType (void) |
形状データ構造取得関数 | |
void | setShaderAttribute (std::string name, int dim, std::vector< int > *array, bool self=false) |
シェーダー内 attribute 変数設定関数1 | |
void | setShaderAttribute (std::string name, int dim, std::vector< float > *array, bool self=false) |
シェーダー内 attribute 変数設定関数2 | |
void | setShaderAttribute (std::string name, int dim, std::vector< fk_Vector > *array) |
シェーダー内 attribute 変数設定関数3 | |
void | setShaderAttribute (std::string name, int dim, std::vector< fk_TexCoord > *array) |
シェーダー内 attribute 変数設定関数4 | |
void | setShaderAttribute (std::string name, int dim, std::vector< fk_HVector > *array) |
シェーダー内 attribute 変数設定関数5 | |
void | modifyAttribute (std::string name) |
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_BaseObject (fk_Type type=fk_Type::BASEOBJECT) | |
コンストラクタ | |
fk_Type | getObjectType (void) const |
タイプ取得関数 | |
FK::fk_Shape::fk_Shape | ( | fk_Type | = fk_Type::SHAPE | ) |
コンストラクタ
|
virtual |
デストラクタ
fk_RealShapeType FK::fk_Shape::getRealShapeType | ( | void | ) |
形状データ構造取得関数
格納されているインスタンスの具体的なデータ構造を取得します。
void FK::fk_Shape::setShaderAttribute | ( | std::string | name, |
int | dim, | ||
std::vector< int > * | array, | ||
bool | self = false |
||
) |
シェーダー内 attribute 変数設定関数1
形状の各頂点に対応した attribute 変数値を整数型で登録します。
ここで登録する要素数は形状の頂点数、 厳密にはデータ要素数よりも多数である必要があります。
[in] | name | GLSL内での変数名 |
[in] | dim | 変数の次元数で、1から4まで設定することができます。 GLSL内での型は、1から順に int, ivec2, ivec3, ivec4 となります。 |
[in] | array | attribute 変数として転送するデータのポインタ。 このコンテナのサイズは、形状の頂点数と次元数の積以上である必要があります。 |
[in] | self | この引数が true の場合、 GPUに転送するデータ領域はインスタンスの内部に新たに確保されます。 その場合は本関数を使用後、array で指定した領域は解放しても問題ありません。 ただし、領域確保とデータコピーのため動作は遅くなります。 この引数が false の場合は、 GPUに転送するデータ領域として array をそのまま利用するため、 本関数利用後に array を解放するとプログラムが異常終了する恐れがあります。 本引数を省略した場合は false を指定したことと同義となります。 |
void FK::fk_Shape::setShaderAttribute | ( | std::string | name, |
int | dim, | ||
std::vector< float > * | array, | ||
bool | self = false |
||
) |
シェーダー内 attribute 変数設定関数2
形状の各頂点に対応した attribute 変数値を浮動小数点型で登録します。
ここで登録する要素数は形状の頂点数、 厳密にはデータ要素数よりも多数である必要があります。
[in] | name | GLSL内での変数名 |
[in] | dim | 変数の次元数で、1から4まで設定することができます。 GLSL内での型は、1から順に float, vec2, vec3, vec4 となります。 |
[in] | array | attribute 変数として転送するデータのポインタ。 このコンテナのサイズは、形状の頂点数と次元数の積以上である必要があります。 |
[in] | self | この引数が true の場合、 GPUに転送するデータ領域はインスタンスの内部に新たに確保されます。 その場合は本関数を使用後、array で指定した領域は解放しても問題ありません。 ただし、領域確保とデータコピーのため動作は遅くなります。 この引数が false の場合は、 GPUに転送するデータ領域として array をそのまま利用するため、 本関数利用後に array を解放するとプログラムが異常終了する恐れがあります。 本引数を省略した場合は false を指定したことと同義となります。 |
void FK::fk_Shape::setShaderAttribute | ( | std::string | name, |
int | dim, | ||
std::vector< fk_Vector > * | array | ||
) |
シェーダー内 attribute 変数設定関数3
形状の各頂点に対応した attribute 変数値を fk_Vector 型で登録します。
ここで登録する要素数は形状の頂点数、 厳密にはデータ要素数よりも多数である必要があります。
[in] | name | GLSL内での変数名 |
[in] | dim | 変数の次元数で、1から4まで設定することができます。 GLSL内での型は、1から順に float, vec2, vec3, vec4 となります。 1 を指定した場合、y,z 成分は無視されます。 2 を指定した場合、z 成分は無視されます。 4 を指定した場合、第4成分 (w成分) は 0 となります。 |
[in] | array | attribute 変数として転送するデータのポインタ。 このコンテナのサイズは、形状の頂点数と次元数の積以上である必要があります。 |
void FK::fk_Shape::setShaderAttribute | ( | std::string | name, |
int | dim, | ||
std::vector< fk_TexCoord > * | array | ||
) |
シェーダー内 attribute 変数設定関数4
形状の各頂点に対応した attribute 変数値を fk_TexCoord 型で登録します。
ここで登録する要素数は形状の頂点数、 厳密にはデータ要素数よりも多数である必要があります。
[in] | name | GLSL内での変数名 |
[in] | dim | 変数の次元数で、1から4まで設定することができます。 GLSL内での型は、1から順に float, vec2, vec3, vec4 となります。 1 を指定した場合、y 成分は無視されます。 3,4 を指定した場合、第3,4成分 (z,w成分) は 0 となります。 |
[in] | array | attribute 変数として転送するデータのポインタ。 このコンテナのサイズは、形状の頂点数と次元数の積以上である必要があります。 |
void FK::fk_Shape::setShaderAttribute | ( | std::string | name, |
int | dim, | ||
std::vector< fk_HVector > * | array | ||
) |
シェーダー内 attribute 変数設定関数5
形状の各頂点に対応した attribute 変数値を fk_HVector 型で登録します。
ここで登録する要素数は形状の頂点数、 厳密にはデータ要素数よりも多数である必要があります。
[in] | name | GLSL内での変数名 |
[in] | dim | 変数の次元数で、1から4まで設定することができます。 GLSL内での型は、1から順に float, vec2, vec3, vec4 となります。 1 を指定した場合は y,z,w 成分は無視されます。 2 を指定した場合は z,w 成分は無視されます。 3 を指定した場合は、w 成分は無視されま。 |
[in] | array | attribute 変数として転送するデータのポインタ。 このコンテナのサイズは、形状の頂点数と次元数の積以上である必要があります。 |
void FK::fk_Shape::modifyAttribute | ( | std::string | name | ) |
attribute 変数更新関数
attribute 変数用データに変更があった場合、 この関数を呼ぶ必要があります。この関数が呼ばれると、 対象となる attribute 変数用のデータは描画時に CPU から GPU へデータの転送が行われます。 もしこの関数が呼ばれないと、内部データが変更されても描画には反映されません。
[in] | name | 対象となる attribute 変数の GLSL 内での変数名 |