FineKernelToolKit 4.2.13
読み取り中…
検索中…
一致する文字列を見つけられません
Matrix.h
[詳解]
1#if !defined(__FK_MATRIX_HEADER__)
2#define __FK_MATRIX_HEADER__
3
4#include <FK/Vector.h>
5#include <FK/Angle.h>
6
7namespace FK {
8
10
41 friend class fk_Matrix;
42 friend class fk_Vector;
43 friend class fk_HVector;
44
45 public:
46
48
52
55
58
61
63
71
73
119 double * operator [](int);
120
122
125
127
139 bool operator ==(const fk_OrthoMatrix &) const;
140
142
154 bool operator !=(const fk_OrthoMatrix &) const;
156
159
162
164
180
182
186
189 void init(void);
190
192
209 void set(int row, int col, double value);
210
212
230 void setRow(int row, const fk_Vector &V);
231
233
251 void setRow(int row, const fk_HVector &V);
252
254
272 void setCol(int col, const fk_Vector &V);
273
275
293 void setCol(int col, const fk_HVector &V);
294
296
305
307
316
318
328 bool inverse(void);
329
331
337 void negate(void);
338
340
346 void makeRot(double rad, fk_Axis axis);
347
349
356 void makeTrans(double x, double y, double z);
357
359
364 void makeTrans(const fk_Vector &V);
365
367
375 void makeEuler(double h, double p, double b);
376
378
384 void makeEuler(const fk_Angle &angle);
386
387#if !defined(FK_DOXYGEN_USER_PROCESS)
388 GLfloat * GetBuffer(void);
389 void Print(std::string = "") const;
390#endif
391
403
404 protected:
405
406#if !defined(FK_DOXYGEN_USER_PROCESS)
407 double m[4][4];
408 std::vector<GLfloat> buf;
409 bool updateStatus;
410 void MultVec(fk_HVector &, const fk_HVector &) const;
411#endif
412 };
413
414
416
427
429
442
444
457
459
472
474
485
487
498
500
511
513
524
525
527
549 class fk_Matrix : public fk_OrthoMatrix {
550
551 friend class fk_Vector;
552 friend class fk_HVector;
553
554 public:
555
557
561
564
568
577
579
583
595 bool operator ==(const fk_Matrix &) const;
596
598
610 bool operator !=(const fk_Matrix &) const;
611
613
616
619
622
624
635
637
642
644
655
657
662
664
680
682
687
689
692
694
700 bool isRegular(void) const;
701
703
712 bool isSingular(void) const;
713
715
725 bool inverse(void);
726
728
739 bool covariant(void);
740
742
749 void makeScale(double x, double y, double z);
750
752
758 void makeScale(const fk_Vector &V);
759
761
773 void makePerspective(double fovy, double near, double far, double aspect);
774
775
777
791 void makeFrustum(double left, double right, double bottom, double top, double near, double far);
792
794
806 void makeOrtho(double left, double right, double bottom, double top, double near, double far);
807
809
812
813 friend fk_HVector operator *(const fk_Matrix &, const fk_HVector &);
814 friend fk_Matrix operator *(const fk_Matrix &, const fk_Matrix &);
815 friend fk_Matrix operator *(double, const fk_Matrix &);
816 friend fk_Matrix operator *(const fk_Matrix &, double);
817 friend fk_Matrix operator +(const fk_Matrix &, const fk_Matrix &);
818 friend fk_Matrix operator -(const fk_Matrix &, const fk_Matrix &);
819
821 };
822
824
835
837
850
852
861
863
872
874
885
887
898}
899
900#endif /* !__FK_MATRIX_HEADER__ */
901
902/****************************************************************************
903 *
904 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
905 *
906 * Redistribution and use in source and binary forms,
907 * with or without modification, are permitted provided that the
908 * following conditions are met:
909 *
910 * - Redistributions of source code must retain the above
911 * copyright notice, this list of conditions and the
912 * following disclaimer.
913 *
914 * - Redistributions in binary form must reproduce the above
915 * copyright notice, this list of conditions and the
916 * following disclaimer in the documentation and/or
917 * other materials provided with the distribution.
918 *
919 * - Neither the name of the copyright holders nor the names
920 * of its contributors may be used to endorse or promote
921 * products derived from this software without specific
922 * prior written permission.
923 *
924 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
925 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
926 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
927 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
928 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
929 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
930 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
931 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
932 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
933 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
934 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
935 * POSSIBILITY OF SUCH DAMAGE.
936 *
937 ****************************************************************************/
938/****************************************************************************
939 *
940 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
941 *
942 * 本ソフトウェアおよびソースコードのライセンスは、基本的に
943 * 「修正 BSD ライセンス」に従います。以下にその詳細を記します。
944 *
945 * ソースコード形式かバイナリ形式か、変更するかしないかを問わず、
946 * 以下の条件を満たす場合に限り、再頒布および使用が許可されます。
947 *
948 * - ソースコードを再頒布する場合、上記の著作権表示、本条件一覧、
949 * および下記免責条項を含めること。
950 *
951 * - バイナリ形式で再頒布する場合、頒布物に付属のドキュメント等の
952 * 資料に、上記の著作権表示、本条件一覧、および下記免責条項を
953 * 含めること。
954 *
955 * - 書面による特別の許可なしに、本ソフトウェアから派生した製品の
956 * 宣伝または販売促進に、本ソフトウェアの著作権者の名前または
957 * コントリビューターの名前を使用してはならない。
958 *
959 * 本ソフトウェアは、著作権者およびコントリビューターによって「現
960 * 状のまま」提供されており、明示黙示を問わず、商業的な使用可能性、
961 * および特定の目的に対する適合性に関す暗黙の保証も含め、またそれ
962 * に限定されない、いかなる保証もないものとします。著作権者もコン
963 * トリビューターも、事由のいかんを問わず、損害発生の原因いかんを
964 * 問わず、かつ責任の根拠が契約であるか厳格責任であるか(過失その
965 * 他の)不法行為であるかを問わず、仮にそのような損害が発生する可
966 * 能性を知らされていたとしても、本ソフトウェアの使用によって発生
967 * した(代替品または代用サービスの調達、使用の喪失、データの喪失、
968 * 利益の喪失、業務の中断も含め、またそれに限定されない)直接損害、
969 * 間接損害、偶発的な損害、特別損害、懲罰的損害、または結果損害に
970 * ついて、一切責任を負わないものとします。
971 *
972 ****************************************************************************/
float GLfloat
Definition Vector.h:11
オイラー角を表すクラス
Definition Angle.h:21
4次元ベクトルを管理するクラス
Definition Vector.h:497
一般4元正方行列を管理するクラス
Definition Matrix.h:549
fk_Matrix & operator-=(const fk_Matrix &)
行列差代入演算子1
void makeScale(double x, double y, double z)
拡大縮小行列生成関数1
friend fk_Matrix operator-(const fk_Matrix &, const fk_Matrix &)
行列差二項演算子
bool isSingular(void) const
特異判定関数
void makeOrtho(double left, double right, double bottom, double top, double near, double far)
平行投影変換行列生成関数
fk_Matrix operator!(void) const
fk_Matrix(const fk_Matrix &)
コピーコンストラクタ
void makeFrustum(double left, double right, double bottom, double top, double near, double far)
一般透視投影変換行列生成関数
fk_Matrix & operator+=(const fk_Matrix &)
行列和代入演算子1
bool isRegular(void) const
正則判定関数
void makeScale(const fk_Vector &V)
拡大縮小行列生成関数2
bool operator==(const fk_Matrix &) const
fk_Matrix & operator=(const fk_Matrix &)
単純代入演算子
void makePerspective(double fovy, double near, double far, double aspect)
簡易透視投影変換行列生成関数
friend fk_HVector operator*(const fk_Matrix &, const fk_HVector &)
ベクトル変換二項演算子
bool inverse(void)
逆行列化関数
bool covariant(void)
反変変換行列化関数
friend fk_Matrix operator+(const fk_Matrix &, const fk_Matrix &)
行列和二項演算子
fk_Matrix(void)
コンストラクタ
bool operator!=(const fk_Matrix &) const
異値比較演算子
fk_Matrix & operator*=(const fk_Matrix &)
行列積代入演算子1
4元正方直交行列を管理するクラス
Definition Matrix.h:40
fk_HVector getRow(int row)
行ベクトル成分取得関数
void setRow(int row, const fk_HVector &V)
行ベクトル成分設定関数2
void makeTrans(double x, double y, double z)
平行移動行列生成関数1
void set(int row, int col, double value)
成分設定関数
bool inverse(void)
逆行列化関数
fk_OrthoMatrix(const fk_OrthoMatrix &)
コピーコンストラクタ
fk_OrthoMatrix(void)
コンストラクタ
friend fk_Matrix operator-(const fk_Matrix &, const fk_OrthoMatrix &)
行列差二項演算子1
void setRow(int row, const fk_Vector &V)
行ベクトル成分設定関数1
fk_OrthoMatrix & operator=(const fk_OrthoMatrix &)
単純代入演算子
void makeEuler(const fk_Angle &angle)
オイラー角回転行列生成関数2
void setCol(int col, const fk_HVector &V)
列ベクトル成分設定関数2
fk_HVector getCol(int col)
列ベクトル成分取得関数
friend fk_Matrix operator+(const fk_Matrix &, const fk_OrthoMatrix &)
行列和二項演算子1
bool operator==(const fk_OrthoMatrix &) const
同値比較演算子
void makeEuler(double h, double p, double b)
オイラー角回転行列生成関数1
void negate(void)
転置化関数
friend fk_HVector operator*(const fk_OrthoMatrix &, const fk_HVector &)
ベクトル変換二項演算子
void makeTrans(const fk_Vector &V)
平行移動行列生成関数2
double * operator[](int)
成分参照演算子
void makeRot(double rad, fk_Axis axis)
座標軸回転行列生成関数
bool operator!=(const fk_OrthoMatrix &) const
異値比較演算子
~fk_OrthoMatrix()
デストラクタ
fk_OrthoMatrix operator!(void) const
逆行列取得演算子
fk_OrthoMatrix & operator*=(const fk_OrthoMatrix &)
行列積代入演算子
void setCol(int col, const fk_Vector &V)
列ベクトル成分設定関数1
3次元ベクトルを管理するクラス
Definition Vector.h:45
Fine Kernel Toolkit 名前空間
Definition Angle.h:6
fk_Color operator+(const fk_Color &, const fk_Color &)
色要素和二項演算子
fk_Axis
座標軸を表す列挙型
Definition Vector.h:16
fk_Color operator-(const fk_Color &, const fk_Color &)
色要素差二項演算子
fk_Color operator*(const fk_Color &, double)
実数倍二項演算子1