FineKernelToolKit  2.9.0
 全て クラス ネームスペース ファイル 関数 変数 型定義 列挙型 列挙型の値 フレンド マクロ定義 ページ
MatAdmin.h
説明を見る。
1 /****************************************************************************
2  *
3  * Copyright (c) 1999-2014, Fine Kernel Project, All rights reserved.
4  *
5  * Redistribution and use in source and binary forms,
6  * with or without modification, are permitted provided that the
7  * following conditions are met:
8  *
9  * - Redistributions of source code must retain the above
10  * copyright notice, this list of conditions and the
11  * following disclaimer.
12  *
13  * - Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the
15  * following disclaimer in the documentation and/or
16  * other materials provided with the distribution.
17  *
18  * - Neither the name of the copyright holders nor the names
19  * of its contributors may be used to endorse or promote
20  * products derived from this software without specific
21  * prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
33  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  ****************************************************************************/
37 /****************************************************************************
38  *
39  * Copyright (c) 1999-2014, Fine Kernel Project, All rights reserved.
40  *
41  * 本ソフトウェアおよびソースコードのライセンスは、基本的に
42  * 「修正 BSD ライセンス」に従います。以下にその詳細を記します。
43  *
44  * ソースコード形式かバイナリ形式か、変更するかしないかを問わず、
45  * 以下の条件を満たす場合に限り、再頒布および使用が許可されます。
46  *
47  * - ソースコードを再頒布する場合、上記の著作権表示、本条件一覧、
48  * および下記免責条項を含めること。
49  *
50  * - バイナリ形式で再頒布する場合、頒布物に付属のドキュメント等の
51  * 資料に、上記の著作権表示、本条件一覧、および下記免責条項を
52  * 含めること。
53  *
54  * - 書面による特別の許可なしに、本ソフトウェアから派生した製品の
55  * 宣伝または販売促進に、本ソフトウェアの著作権者の名前または
56  * コントリビューターの名前を使用してはならない。
57  *
58  * 本ソフトウェアは、著作権者およびコントリビューターによって「現
59  * 状のまま」提供されており、明示黙示を問わず、商業的な使用可能性、
60  * および特定の目的に対する適合性に関す暗黙の保証も含め、またそれ
61  * に限定されない、いかなる保証もないものとします。著作権者もコン
62  * トリビューターも、事由のいかんを問わず、損害発生の原因いかんを
63  * 問わず、かつ責任の根拠が契約であるか厳格責任であるか(過失その
64  * 他の)不法行為であるかを問わず、仮にそのような損害が発生する可
65  * 能性を知らされていたとしても、本ソフトウェアの使用によって発生
66  * した(代替品または代用サービスの調達、使用の喪失、データの喪失、
67  * 利益の喪失、業務の中断も含め、またそれに限定されない)直接損害、
68  * 間接損害、偶発的な損害、特別損害、懲罰的損害、または結果損害に
69  * ついて、一切責任を負わないものとします。
70  *
71  ****************************************************************************/
72 #ifndef __FK_MATADMIN_HEADER__
73 #define __FK_MATADMIN_HEADER__
74 
75 #include <FK/Base.h>
76 #include <FK/Matrix.h>
77 #include <FK/Angle.h>
78 
80 
122 
123  protected:
124 
125 #ifndef FK_DOXYGEN_USER_PROCESS
126 
127  fk_OrthoMatrix OrthoMatrix; // Model Base Matrix
128  fk_HVector Position; // Model Position
129  fk_HVector Vec, UpVec; // Model Vector & Up Vector
130  fk_Angle Angle; // Model Angle (Heading Pitch Bank)
131  double Scale; // Model Scale
132  double xScale, yScale, zScale; // Axis Scale
133  bool ScaleMode;
134 
135  void RotateLtoG(fk_Vector *, const fk_Vector *,
136  const fk_Angle *) const;
137  void VectorToHeadPitch(fk_Angle *, const fk_Vector *) const;
138  void VectorToAngle(fk_Angle *, const fk_Vector *,
139  const fk_Vector *) const;
140  void AngleToVector(fk_Vector *, fk_Vector *,
141  const fk_Angle *) const;
142  void AddAngle(fk_Angle *, const fk_Angle *) const;
143 
144  void AdjustAngleToVec(void);
145  void AdjustVecToAngle(void);
146 
147  void UpdateMatrix(bool = true);
148 
149  fk_OrthoMatrix OrthonormalMatrix(const fk_Vector &, const fk_Vector &,
150  const double) const;
151  void SetScaleMode(void);
152 
153  void GlRotate_(const fk_Vector &, const fk_Vector &,
154  const double);
155  void LoRotate_(const fk_Vector &, const fk_Vector &,
156  const double);
157 
158  void GlRotateWithVec_(const fk_Vector &,
159  const fk_Vector &,
160  double);
161 
162  void LoRotateWithVec_(const fk_Vector &,
163  const fk_Vector &,
164  double);
165 
166 #endif
167 
168  public:
169 
172 
174  virtual ~fk_MatrixAdmin();
175 
177 
178 
180 
191  fk_Vector getPosition(void) const;
192 
194 
205  fk_Vector getVec(void) const;
206 
208 
219  fk_Vector getUpvec(void) const;
220 
221 #ifndef FK_DOXYGEN_USER_PROCESS
222  fk_Vector getUpVec(void) const;
223 #endif
224 
226 
238  fk_Angle getAngle(void) const;
239 
241 
252  fk_Matrix getMatrix(void) const;
253 
255 
267  fk_Matrix getInvMatrix(void) const;
268 
270 
282  fk_OrthoMatrix getBaseMatrix(void) const;
283 
285 
297  fk_OrthoMatrix getInvBaseMatrix(void) const;
298 
300 
302 
303 
305 
317  bool setScale(const double scale);
318 
320 
333  bool setScale(const double scale, fk_Axis axis);
334 
336 
350  bool setScale(const double x, const double y, const double z);
351 
353 
365  bool prdScale(const double scale);
366 
368 
381  bool prdScale(const double scale, fk_Axis axis);
382 
384 
398  bool prdScale(const double x, const double y, const double z);
399 
401 
406  double getScale(void) const;
407 
409 
416  double getScale(fk_Axis axis) const;
417 
419 
438  bool getScaleMode(void) const;
439 
441 
443 
444 
446 
465  bool glRotate(fk_Vector origin, fk_Axis axis, double theta);
466 
468 
489  bool glRotate(double orgX, double orgY, double orgZ,
490  fk_Axis axis, double theta);
491 
493 
513  bool glRotate(fk_Vector A, fk_Vector B, double theta);
514 
516 
540  bool glRotate(double Ax, double Ay, double Az,
541  double Bx, double By, double Bz, double theta);
542 
544 
564  bool loRotate(fk_Vector origin, fk_Axis axis, double theta);
565 
567 
589  bool loRotate(double orgX, double orgY, double orgZ,
590  fk_Axis axis, double theta);
591 
592 
594 
616  bool loRotate(fk_Vector A, fk_Vector B, double theta);
617 
619 
650  bool loRotate(double Ax, double Ay, double Az,
651  double Bx, double By, double Bz, double theta);
652 
654 
674  bool glRotateWithVec(fk_Vector origin,
675  fk_Axis axis, double theta);
676 
678 
700  bool glRotateWithVec(double orgX, double orgY, double orgZ,
701  fk_Axis axis, double theta);
702 
704 
725  bool glRotateWithVec(fk_Vector A, fk_Vector B, double theta);
726 
728 
753  bool glRotateWithVec(double Ax, double Ay, double Az,
754  double Bx, double By, double Bz,
755  double theta);
756 
758 
779  bool loRotateWithVec(fk_Vector origin,
780  fk_Axis axis, double theta);
781 
783 
806  bool loRotateWithVec(double orgX, double orgY, double orgZ,
807  fk_Axis axis, double theta);
808 
809 
811 
835  double theta);
836 
837 
839 
871  bool loRotateWithVec(double Ax, double Ay, double Az,
872  double Bx, double By, double Bz,
873  double theta);
874 
876 
878 
879 
881 
894  bool glTranslate(fk_Vector v);
895 
897 
912  bool glTranslate(double x, double y, double z);
913 
915 
928  bool loTranslate(fk_Vector v);
929 
931 
946  bool loTranslate(double x, double y, double z);
947 
949 
965  bool glMoveTo(fk_Vector p);
966 
968 
986  bool glMoveTo(double x, double y, double z);
987 
989 
991 
992 
994 
1013  bool glFocus(fk_Vector p);
1014 
1016 
1037  bool glFocus(double x, double y, double z);
1038 
1040 
1059  bool loFocus(fk_Vector p);
1060 
1062 
1083  bool loFocus(double x, double y, double z);
1084 
1086 
1109  bool glVec(fk_Vector v);
1110 
1112 
1137  bool glVec(double x, double y, double z);
1138 
1140 
1155  bool glUpvec(fk_Vector v);
1156 
1158 
1175  bool glUpvec(double x, double y, double z);
1176 
1178 
1196  bool loUpvec(fk_Vector v);
1197 
1199 
1219  bool loUpvec(double x, double y, double z);
1220 
1222 
1234  bool glAngle(fk_Angle angle);
1235 
1237 
1251  bool glAngle(double h, double p, double b);
1252 
1254 
1264  bool loAngle(fk_Angle angle);
1265 
1267 
1279  bool loAngle(double h, double p, double b);
1280 
1282 
1283 #ifndef FK_DOXYGEN_USER_PROCESS
1284 
1285  void snapShot(void);
1286  void restore(void);
1287  void restore(double t);
1288 
1289 #endif
1290 
1291 };
1292 
1293 #endif // !__FK_MATADMIN_HEADER__
bool glRotateWithVec(fk_Vector origin, fk_Axis axis, double theta)
グローバル座標系座標軸回転(姿勢付き)関数1
一般4元正方行列を管理するクラス
Definition: Matrix.h:586
bool loFocus(fk_Vector p)
ローカル座標系注視点設定関数1
fk_ObjectType
オブジェクトインスタンスのタイプを表す列挙型
Definition: Base.h:116
bool glFocus(fk_Vector p)
グローバル座標系注視点設定関数1
bool getScaleMode(void) const
拡大縮小状態判定関数
bool glMoveTo(fk_Vector p)
グローバル座標系位置指定関数1
fk_Vector getUpvec(void) const
アップベクトル取得関数
fk_MatrixAdmin 型
Definition: Base.h:118
virtual ~fk_MatrixAdmin()
デストラクタ
fk_Matrix getMatrix(void) const
変換行列取得関数
bool loRotate(fk_Vector origin, fk_Axis axis, double theta)
ローカル座標系座標軸回転関数1
オイラー角を表すクラス
Definition: Angle.h:90
3次元ベクトルを管理するクラス
Definition: Vector.h:110
fk_Angle getAngle(void) const
オイラー角取得関数
fk_Axis
座標軸を表す列挙型
Definition: Vector.h:82
bool loRotateWithVec(fk_Vector origin, fk_Axis axis, double theta)
ローカル座標系座標軸回転(姿勢付き)関数1
4次元ベクトルを管理するクラス
Definition: Vector.h:542
4元正方直交行列を管理するクラス
Definition: Matrix.h:114
bool glAngle(fk_Angle angle)
グローバル座標系オイラー角設定関数1
bool loTranslate(fk_Vector v)
ローカル座標系平行移動関数1
bool glTranslate(fk_Vector v)
グローバル座標系平行移動関数1
fk_MatrixAdmin(fk_ObjectType=FK_MATRIXADMIN)
コンストラクタ
fk_OrthoMatrix getBaseMatrix(void) const
移動・回転要素変換行列取得関数
bool setScale(const double scale)
全体絶対倍率設定関数
fk_Vector getPosition(void) const
位置ベクトル取得関数
double getScale(void) const
全体倍率取得関数
FK の各クラスの基盤となる基本クラス
Definition: Base.h:212
fk_Vector getVec(void) const
方向ベクトル取得関数
bool glVec(fk_Vector v)
グローバル座標系方向ベクトル設定関数1
bool loAngle(fk_Angle angle)
ローカル座標系オイラー角設定関数1
fk_Matrix getInvMatrix(void) const
逆変換行列取得関数
fk_OrthoMatrix getInvBaseMatrix(void) const
移動・回転要素逆変換行列取得関数
bool prdScale(const double scale)
全体相対倍率設定関数
bool glRotate(fk_Vector origin, fk_Axis axis, double theta)
グローバル座標系座標軸回転関数1
モデルの位置や姿勢を管理するクラス
Definition: MatAdmin.h:121
bool glUpvec(fk_Vector v)
グローバル座標系アップベクトル設定関数1
bool loUpvec(fk_Vector v)
ローカル座標系アップベクトル設定関数1