FineKernelToolKit 4.2.13
読み取り中…
検索中…
一致する文字列を見つけられません
MatAdmin.h
[詳解]
1#if !defined(__FK_MATADMIN_HEADER__)
2#define __FK_MATADMIN_HEADER__
3
4#include <FK/Base.h>
5#include <FK/Matrix.h>
6#include <FK/Angle.h>
7
8namespace FK {
9
11
53
54#if !defined(FK_DOXYGEN_USER_PROCESS)
55 class Member {
56 public:
57 fk_OrthoMatrix M; // Model Base Matrix
58 fk_HVector pos; // Model Position
59 fk_HVector vec, uvec; // Model Vector & Up Vector
60 fk_Angle angle; // Model Angle (Heading Pitch Bank)
61 double scale; // Model Scale
62 double xScale, yScale, zScale; // Axis Scale
63 bool mode;
64
65 Member(void);
66 };
67#endif
68
69 public:
70
73
75 virtual ~fk_MatrixAdmin();
76
79
81
93
95
106 fk_Vector getVec(void) const;
107
109
120 fk_Vector getUpvec(void) const;
121
122#if !defined(FK_OLD_NONSUPPORT) && !defined(FK_DOXYGEN_USER_PROCESS)
123 fk_Vector getUpVec(void) const;
124#endif
125
127
139 fk_Angle getAngle(void) const;
140
142
153 fk_Matrix getMatrix(void) const;
154
156
169
171
184
186
199
201
204
206
218 bool setScale(const double scale);
219
221
234 bool setScale(const double scale, fk_Axis axis);
235
237
251 bool setScale(const double x, const double y, const double z);
252
254
266 bool prdScale(const double scale);
267
269
282 bool prdScale(const double scale, fk_Axis axis);
283
285
299 bool prdScale(const double x, const double y, const double z);
300
302
307 double getScale(void) const;
308
310
317 double getScale(fk_Axis axis) const;
318
320
339 bool getScaleMode(void) const;
340
342
345
347
370 bool glRotate_(fk_Vector &origin, fk_Axis axis, double theta);
371
373
396 bool glRotate_(double orgX, double orgY, double orgZ,
397 fk_Axis axis, double theta);
398
400
422 bool glRotate_(fk_Vector &A, fk_Vector &B, double theta);
423
425
451 bool glRotate_(double Ax, double Ay, double Az,
452 double Bx, double By, double Bz, double theta);
453
455
479 bool loRotate_(fk_Vector &origin, fk_Axis axis, double theta);
480
482
506 bool loRotate_(double orgX, double orgY, double orgZ,
507 fk_Axis axis, double theta);
508
510
534 bool loRotate_(fk_Vector &A, fk_Vector &B, double theta);
535
537
570 bool loRotate_(double Ax, double Ay, double Az,
571 double Bx, double By, double Bz, double theta);
572
574
596 bool glRotateWithVec_(fk_Vector &origin, fk_Axis axis, double theta);
597
599
623 bool glRotateWithVec_(double orgX, double orgY, double orgZ,
624 fk_Axis axis, double theta);
625
627
650 bool glRotateWithVec_(fk_Vector &A, fk_Vector &B, double theta);
651
653
680 bool glRotateWithVec_(double Ax, double Ay, double Az,
681 double Bx, double By, double Bz, double theta);
682
684
707 bool loRotateWithVec_(fk_Vector &origin, fk_Axis axis, double theta);
708
710
735 bool loRotateWithVec_(double orgX, double orgY, double orgZ,
736 fk_Axis axis, double theta);
737
739
764 bool loRotateWithVec_(fk_Vector &A, fk_Vector &B, double theta);
765
767
801 bool loRotateWithVec_(double Ax, double Ay, double Az,
802 double Bx, double By, double Bz, double theta);
804
807
809
823
825
841 bool glTranslate_(double x, double y, double z);
842
844
859
861
877 bool loTranslate_(double x, double y, double z);
878
880
898
900
919 bool glMoveTo_(double x, double y, double z);
920
922
925
927
947
949
970 bool glFocus(double x, double y, double z);
971
973
993
995
1016 bool loFocus(double x, double y, double z);
1017
1019
1043
1045
1070 bool glVec(double x, double y, double z);
1071
1073
1089
1091
1108 bool glUpvec(double x, double y, double z);
1109
1111
1130
1132
1152 bool loUpvec(double x, double y, double z);
1153
1155
1167 bool glAngle(fk_Angle angle);
1168
1170
1184 bool glAngle(double h, double p, double b);
1185
1187
1197 bool loAngle(fk_Angle angle);
1198
1200
1212 bool loAngle(double h, double p, double b);
1213
1215
1216 protected:
1217
1218#if !defined(FK_DOXYGEN_USER_PROCESS)
1219
1220 std::unique_ptr<Member> _m_MatAdmin;
1221
1222 void RotateLtoG(fk_Vector *, const fk_Vector *, const fk_Angle *) const;
1223 void VectorToHeadPitch(fk_Angle *, const fk_Vector *) const;
1224 void VectorToAngle(fk_Angle *, const fk_Vector *, const fk_Vector *) const;
1225 void AngleToVector(fk_Vector *, fk_Vector *, const fk_Angle *) const;
1226 void AddAngle(fk_Angle *, const fk_Angle *) const;
1227
1228 void AdjustAngleToVec(void);
1229 void AdjustVecToAngle(void);
1230
1231 void UpdateMatrix(bool = true);
1232
1233 fk_OrthoMatrix OrthonormalMatrix(const fk_Vector &, const fk_Vector &, const double) const;
1234 void SetScaleMode(void);
1235
1236 void GlRotate_(const fk_Vector &, const fk_Vector &, const double);
1237 void LoRotate_(const fk_Vector &, const fk_Vector &, const double);
1238 void GlRotateWithVec_(const fk_Vector &, const fk_Vector &, double);
1239 void LoRotateWithVec_(const fk_Vector &, const fk_Vector &, double);
1240#endif
1241 };
1242}
1243
1244#endif // !__FK_MATADMIN_HEADER__
1245
1246/****************************************************************************
1247 *
1248 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
1249 *
1250 * Redistribution and use in source and binary forms,
1251 * with or without modification, are permitted provided that the
1252 * following conditions are met:
1253 *
1254 * - Redistributions of source code must retain the above
1255 * copyright notice, this list of conditions and the
1256 * following disclaimer.
1257 *
1258 * - Redistributions in binary form must reproduce the above
1259 * copyright notice, this list of conditions and the
1260 * following disclaimer in the documentation and/or
1261 * other materials provided with the distribution.
1262 *
1263 * - Neither the name of the copyright holders nor the names
1264 * of its contributors may be used to endorse or promote
1265 * products derived from this software without specific
1266 * prior written permission.
1267 *
1268 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1269 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1270 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
1271 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
1272 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
1273 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
1274 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
1275 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1276 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
1277 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
1278 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
1279 * POSSIBILITY OF SUCH DAMAGE.
1280 *
1281 ****************************************************************************/
1282/****************************************************************************
1283 *
1284 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
1285 *
1286 * 本ソフトウェアおよびソースコードのライセンスは、基本的に
1287 * 「修正 BSD ライセンス」に従います。以下にその詳細を記します。
1288 *
1289 * ソースコード形式かバイナリ形式か、変更するかしないかを問わず、
1290 * 以下の条件を満たす場合に限り、再頒布および使用が許可されます。
1291 *
1292 * - ソースコードを再頒布する場合、上記の著作権表示、本条件一覧、
1293 * および下記免責条項を含めること。
1294 *
1295 * - バイナリ形式で再頒布する場合、頒布物に付属のドキュメント等の
1296 * 資料に、上記の著作権表示、本条件一覧、および下記免責条項を
1297 * 含めること。
1298 *
1299 * - 書面による特別の許可なしに、本ソフトウェアから派生した製品の
1300 * 宣伝または販売促進に、本ソフトウェアの著作権者の名前または
1301 * コントリビューターの名前を使用してはならない。
1302 *
1303 * 本ソフトウェアは、著作権者およびコントリビューターによって「現
1304 * 状のまま」提供されており、明示黙示を問わず、商業的な使用可能性、
1305 * および特定の目的に対する適合性に関す暗黙の保証も含め、またそれ
1306 * に限定されない、いかなる保証もないものとします。著作権者もコン
1307 * トリビューターも、事由のいかんを問わず、損害発生の原因いかんを
1308 * 問わず、かつ責任の根拠が契約であるか厳格責任であるか(過失その
1309 * 他の)不法行為であるかを問わず、仮にそのような損害が発生する可
1310 * 能性を知らされていたとしても、本ソフトウェアの使用によって発生
1311 * した(代替品または代用サービスの調達、使用の喪失、データの喪失、
1312 * 利益の喪失、業務の中断も含め、またそれに限定されない)直接損害、
1313 * 間接損害、偶発的な損害、特別損害、懲罰的損害、または結果損害に
1314 * ついて、一切責任を負わないものとします。
1315 *
1316 ****************************************************************************/
オイラー角を表すクラス
Definition Angle.h:21
FK の各クラスの基盤となる基本クラス
Definition Base.h:113
4次元ベクトルを管理するクラス
Definition Vector.h:497
モデルの位置や姿勢を管理するクラス
Definition MatAdmin.h:52
bool loRotate_(fk_Vector &origin, fk_Axis axis, double theta)
ローカル座標系座標軸回転関数1
fk_Matrix getInvMatrix(void) const
逆変換行列取得関数
bool glRotate_(fk_Vector &A, fk_Vector &B, double theta)
グローバル座標系任意軸回転関数1
bool glTranslate_(double x, double y, double z)
グローバル座標系平行移動関数2
bool loUpvec(double x, double y, double z)
ローカル座標系アップベクトル設定関数2
bool glUpvec(double x, double y, double z)
グローバル座標系アップベクトル設定関数2
bool loAngle(double h, double p, double b)
ローカル座標系オイラー角設定関数2
double getScale(void) const
全体倍率取得関数
bool glVec(fk_Vector v)
グローバル座標系方向ベクトル設定関数1
fk_Vector getUpvec(void) const
アップベクトル取得関数
bool glTranslate_(fk_Vector &v)
グローバル座標系平行移動関数1
bool loRotateWithVec_(fk_Vector &A, fk_Vector &B, double theta)
ローカル座標系任意軸回転(姿勢付き)関数1
bool glRotate_(double orgX, double orgY, double orgZ, fk_Axis axis, double theta)
グローバル座標系座標軸回転関数2
bool loRotateWithVec_(fk_Vector &origin, fk_Axis axis, double theta)
ローカル座標系座標軸回転(姿勢付き)関数1
bool loTranslate_(fk_Vector &v)
ローカル座標系平行移動関数1
bool glUpvec(fk_Vector v)
グローバル座標系アップベクトル設定関数1
bool glFocus(fk_Vector p)
グローバル座標系注視点設定関数1
bool glVec(double x, double y, double z)
グローバル座標系方向ベクトル設定関数2
bool setScale(const double x, const double y, const double z)
軸方向個別絶対倍率設定関数
bool glFocus(double x, double y, double z)
グローバル座標系注視点設定関数2
bool glRotate_(fk_Vector &origin, fk_Axis axis, double theta)
グローバル座標系座標軸回転関数1
bool loFocus(fk_Vector p)
ローカル座標系注視点設定関数1
fk_OrthoMatrix getInvBaseMatrix(void) const
移動・回転要素逆変換行列取得関数
bool setScale(const double scale, fk_Axis axis)
軸方向絶対倍率設定関数
bool glAngle(fk_Angle angle)
グローバル座標系オイラー角設定関数1
fk_Angle getAngle(void) const
オイラー角取得関数
virtual ~fk_MatrixAdmin()
デストラクタ
bool loRotateWithVec_(double orgX, double orgY, double orgZ, fk_Axis axis, double theta)
ローカル座標系座標軸回転(姿勢付き)関数2
bool loRotate_(double Ax, double Ay, double Az, double Bx, double By, double Bz, double theta)
ローカル座標系任意軸回転関数2
bool glMoveTo_(double x, double y, double z)
グローバル座標系位置指定関数2
bool glAngle(double h, double p, double b)
グローバル座標系オイラー角設定関数2
fk_Vector getVec(void) const
方向ベクトル取得関数
fk_MatrixAdmin(fk_Type=fk_Type::MATRIXADMIN)
コンストラクタ
bool glRotateWithVec_(double orgX, double orgY, double orgZ, fk_Axis axis, double theta)
グローバル座標系座標軸回転(姿勢付き)関数2
bool prdScale(const double scale, fk_Axis axis)
軸方向相対倍率設定関数
bool glRotateWithVec_(double Ax, double Ay, double Az, double Bx, double By, double Bz, double theta)
グローバル座標系任意軸回転(姿勢付き)関数2
bool glRotateWithVec_(fk_Vector &origin, fk_Axis axis, double theta)
グローバル座標系座標軸回転(姿勢付き)関数1
bool setScale(const double scale)
全体絶対倍率設定関数
bool prdScale(const double x, const double y, const double z)
軸方向個別相対倍率設定関数
fk_Vector getPosition(void) const
位置ベクトル取得関数
double getScale(fk_Axis axis) const
軸方向倍率取得関数
bool loAngle(fk_Angle angle)
ローカル座標系オイラー角設定関数1
bool loUpvec(fk_Vector v)
ローカル座標系アップベクトル設定関数1
bool glMoveTo_(fk_Vector &p)
グローバル座標系位置指定関数1
fk_Matrix getMatrix(void) const
変換行列取得関数
bool loRotate_(double orgX, double orgY, double orgZ, fk_Axis axis, double theta)
ローカル座標系座標軸回転関数2
bool loRotateWithVec_(double Ax, double Ay, double Az, double Bx, double By, double Bz, double theta)
ローカル座標系任意軸回転(姿勢付き)関数2
bool prdScale(const double scale)
全体相対倍率設定関数
bool getScaleMode(void) const
拡大縮小状態判定関数
bool loTranslate_(double x, double y, double z)
ローカル座標系平行移動関数2
bool loRotate_(fk_Vector &A, fk_Vector &B, double theta)
ローカル座標系任意軸回転関数1
bool glRotate_(double Ax, double Ay, double Az, double Bx, double By, double Bz, double theta)
グローバル座標系任意軸回転関数2
bool glRotateWithVec_(fk_Vector &A, fk_Vector &B, double theta)
グローバル座標系任意軸回転(姿勢付き)関数1
fk_OrthoMatrix getBaseMatrix(void) const
移動・回転要素変換行列取得関数
bool loFocus(double x, double y, double z)
ローカル座標系注視点設定関数2
一般4元正方行列を管理するクラス
Definition Matrix.h:549
4元正方直交行列を管理するクラス
Definition Matrix.h:40
3次元ベクトルを管理するクラス
Definition Vector.h:45
Fine Kernel Toolkit 名前空間
Definition Angle.h:6
fk_Axis
座標軸を表す列挙型
Definition Vector.h:16
fk_Type
オブジェクトインスタンスのタイプを表す列挙型
Definition Base.h:43
@ MATRIXADMIN
fk_MatrixAdmin 型