UQGL Beta(11/04/02)
|
多角形クラス. [詳細]
Public メソッド | |
void | setRectangle (int x, int y, int width, int height) |
長方形. | |
void | setRectangleTexture (int x, int y, int width, int height) |
テクスチャ座標設定. | |
void | setRegularPolygon (int n, Vector2D center, float radius) |
正多角形. | |
void | setColor (Color color) |
色設定. | |
void | translate (Vector2D vector) |
平行移動. | |
void | rotate (Vector2D center, float angle) |
回転. | |
void | scale (Vector2D center, float scaleX, float scaleY) |
拡大縮小. | |
Public 変数 | |
Vertex | vertex_ [VERTEX_COUNT_MAX_] |
頂点. | |
int | vertexCount_ |
頂点の個数. | |
Static Public 変数 | |
static const int | VERTEX_COUNT_MAX_ = 128 |
頂点の最大個数. |
多角形クラス.
多角形クラスです。 Vertex の配列を保持しています。
用意されたメソッド以外の操作は、メンバ変数を直接変更してください。
ポリゴンの裏側は表示されません。座標を変更する際は注意してください。
void UQ::Polygon::setRectangle | ( | int | x, |
int | y, | ||
int | width, | ||
int | height | ||
) |
長方形.
長方形にセットします。頂点の個数は4個に変更されます。
[in] | x | 左上x座標 |
[in] | y | 左上y座標 |
[in] | width | 幅 |
[in] | height | 高さ |
void UQ::Polygon::setRectangleTexture | ( | int | x, |
int | y, | ||
int | width, | ||
int | height | ||
) |
テクスチャ座標設定.
長方形(一般には四角形)の4つの頂点に対して、テクスチャ座標を設定します。
setRectangle() の呼び出し後にこの関数を用いると有効です。
[in] | x | 左上x座標 |
[in] | y | 左上y座標 |
[in] | width | 幅 |
[in] | height | 高さ |
void UQ::Polygon::setRegularPolygon | ( | int | n, |
Vector2D | center, | ||
float | radius | ||
) |
正多角形.
正多角形にセットします。頂点の数はn個に変更されます。
( center.x_ + radius, center.y_ ) の頂点を持つ正n角形になります。
[in] | n | 頂点の数(正n角形) |
[in] | center | 中心座標 |
[in] | radius | 半径(中心から頂点までの距離) |
void UQ::Polygon::setColor | ( | Color | color | ) |
色設定.
全ての頂点の色を設定します。
[in] | color | 色 |
void UQ::Polygon::translate | ( | Vector2D | vector | ) |
平行移動.
平行移動します。
[in] | vector | 移動ベクトル |
void UQ::Polygon::rotate | ( | Vector2D | center, |
float | angle | ||
) |
回転.
回転します。
[in] | center | 中心位置ベクトル |
[in] | angle | 角度(ラジアン) |
void UQ::Polygon::scale | ( | Vector2D | center, |
float | scaleX, | ||
float | scaleY | ||
) |
拡大縮小.
拡大縮小します。
[in] | center | 中心位置ベクトル |
[in] | scaleX | x軸方向の拡大値 |
[in] | scaleY | y軸方向の拡大値 |
const int UQ::Polygon::VERTEX_COUNT_MAX_ = 128 [static] |
頂点の最大個数.
頂点の個数.