FineKernelToolKit 4.3.0
読み取り中…
検索中…
一致する文字列を見つけられません
Projection.h
[詳解]
1#if !defined(__FK_PROJECTION_HEADER__)
2#define __FK_PROJECTION_HEADER__
3
4#include <functional>
5#include <FK/Matrix.h>
6#include <FK/Math.h>
7
8namespace FK {
16
17
19
25
27 public:
28
31
33 virtual ~fk_ProjectBase();
34
36
42
43#if !defined(FK_DOXYGEN_USER_PROCESS)
44 fk_Matrix *GetMatrix(void);
45 std::function<void()> MakeMat;
46#endif
47
48 private:
49 fk_ProjectMode Mode;
50
51 protected:
52
53#if !defined(FK_DOXYGEN_USER_PROCESS)
54 std::unique_ptr<fk_Matrix> ProjM;
55 void SetMode(fk_ProjectMode);
56#endif
57
58 };
59
61
96
98#if !defined(FK_DOXYGEN_USER_PROCESS)
99
100 class Member {
101 public:
102 double Fovy;
103 double Near, Far;
104 double Aspect;
105 bool AutoMode;
106
107 Member(void);
108 };
109#endif
110 public:
111
113
120 fk_Perspective(double fovy = 2.0 * fk_Math::PI/9.0,
121 double near = 1.0,
122 double far = 6000.0);
123
126
129
132
134
139 void setFovy(double fovy);
140
142
147 void setNear(double near);
148
150
155 void setFar(double far);
156
158
166 void setAspect(double aspect);
167
169
176 void setAll(double fovy, double near, double far);
177
179
187 void setAll(double fovy, double near, double far, double aspect);
188
190
195 double getFovy(void) const;
196
197
199
204 double getNear(void) const;
205
207
212 double getFar(void) const;
213
215
220 double getAspect(void) const;
221
222 private:
223 std::unique_ptr<Member> _m;
224
225 void MakeInit(void);
226 };
227
229
261
262 class fk_Frustum : public fk_ProjectBase {
263
264#if !defined(FK_DOXYGEN_USER_PROCESS)
265 class Member {
266 public:
267 double Left, Right, Bottom, Top, Near, Far;
268
269 Member(void);
270 };
271#endif
272
273 public:
275
285 fk_Frustum(double left = -10.0,
286 double right = 10.0,
287 double bottom = -10.0,
288 double top = 10.0,
289 double near = 1.0,
290 double far = 6000.0);
291
293 virtual ~fk_Frustum();
294
297
300
302
307 void setLeft(double left);
308
310
315 void setRight(double right);
316
318
323 void setBottom(double bottom);
324
326
331 void setTop(double top);
332
334
339 void setNear(double near);
340
342
347 void setFar(double far);
348
350
360 void setAll(double left, double right, double bottom, double top, double near, double far);
361
363
368 double getLeft(void) const;
369
371
376 double getRight(void) const;
377
379
384 double getBottom(void) const;
385
387
392 double getTop(void) const;
393
395
400 double getNear(void) const;
401
403
408 double getFar(void) const;
409
410 private:
411 std::unique_ptr<Member> _m;
412
413 void MakeInit(void);
414 };
415
417
436
437 class fk_Ortho : public fk_ProjectBase {
438
439#if !defined(FK_DOXYGEN_USER_PROCESS)
440 class Member {
441 public:
442 double Left, Right, Bottom, Top, Near, Far;
443
444 Member(void);
445 };
446#endif
447 public:
448
450
461 fk_Ortho(double left = -500.0, double right = 500.0,
462 double bottom = -500.0, double top = 500.0,
463 double near = 0.0, double far = 10000.0);
464
466 virtual ~fk_Ortho();
467
470
473
475
480 void setLeft(double left);
481
483
488 void setRight(double right);
489
491
496 void setBottom(double bottom);
497
499
504 void setTop(double top);
505
507
512 void setNear(double near);
513
515
520 void setFar(double far);
521
523
534 void setAll(double left, double right, double bottom, double top, double near, double far);
535
537
542 double getLeft(void) const;
543
545
550 double getRight(void) const;
551
553
558 double getBottom(void) const;
559
561
566 double getTop(void) const;
567
569
574 double getNear(void) const;
575
577
582 double getFar(void) const;
583
584 private:
585 std::unique_ptr<Member> _m;
586 void MakeInit(void);
587 };
588}
589#endif // !__FK_PROJECTION_HEADER__
590
591/****************************************************************************
592 *
593 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
594 *
595 * Redistribution and use in source and binary forms,
596 * with or without modification, are permitted provided that the
597 * following conditions are met:
598 *
599 * - Redistributions of source code must retain the above
600 * copyright notice, this list of conditions and the
601 * following disclaimer.
602 *
603 * - Redistributions in binary form must reproduce the above
604 * copyright notice, this list of conditions and the
605 * following disclaimer in the documentation and/or
606 * other materials provided with the distribution.
607 *
608 * - Neither the name of the copyright holders nor the names
609 * of its contributors may be used to endorse or promote
610 * products derived from this software without specific
611 * prior written permission.
612 *
613 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
614 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
615 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
616 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
617 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
618 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
619 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
620 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
621 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
622 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
623 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
624 * POSSIBILITY OF SUCH DAMAGE.
625 *
626 ****************************************************************************/
627/****************************************************************************
628 *
629 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
630 *
631 * 本ソフトウェアおよびソースコードのライセンスは、基本的に
632 * 「修正 BSD ライセンス」に従います。以下にその詳細を記します。
633 *
634 * ソースコード形式かバイナリ形式か、変更するかしないかを問わず、
635 * 以下の条件を満たす場合に限り、再頒布および使用が許可されます。
636 *
637 * - ソースコードを再頒布する場合、上記の著作権表示、本条件一覧、
638 * および下記免責条項を含めること。
639 *
640 * - バイナリ形式で再頒布する場合、頒布物に付属のドキュメント等の
641 * 資料に、上記の著作権表示、本条件一覧、および下記免責条項を
642 * 含めること。
643 *
644 * - 書面による特別の許可なしに、本ソフトウェアから派生した製品の
645 * 宣伝または販売促進に、本ソフトウェアの著作権者の名前または
646 * コントリビューターの名前を使用してはならない。
647 *
648 * 本ソフトウェアは、著作権者およびコントリビューターによって「現
649 * 状のまま」提供されており、明示黙示を問わず、商業的な使用可能性、
650 * および特定の目的に対する適合性に関す暗黙の保証も含め、またそれ
651 * に限定されない、いかなる保証もないものとします。著作権者もコン
652 * トリビューターも、事由のいかんを問わず、損害発生の原因いかんを
653 * 問わず、かつ責任の根拠が契約であるか厳格責任であるか(過失その
654 * 他の)不法行為であるかを問わず、仮にそのような損害が発生する可
655 * 能性を知らされていたとしても、本ソフトウェアの使用によって発生
656 * した(代替品または代用サービスの調達、使用の喪失、データの喪失、
657 * 利益の喪失、業務の中断も含め、またそれに限定されない)直接損害、
658 * 間接損害、偶発的な損害、特別損害、懲罰的損害、または結果損害に
659 * ついて、一切責任を負わないものとします。
660 *
661 ****************************************************************************/
fk_BaseObject(fk_Type type=fk_Type::BASEOBJECT)
コンストラクタ
double getBottom(void) const
視錐台下側符号付き距離取得関数
void setTop(double top)
視錐台上側符号付き距離設定関数
double getFar(void) const
クリッピング遠距離面距離取得関数
fk_Frustum(double left=-10.0, double right=10.0, double bottom=-10.0, double top=10.0, double near=1.0, double far=6000.0)
コンストラクタ
void setFar(double far)
クリッピング遠距離面距離設定関数
void setNear(double near)
クリッピング近距離面距離設定関数
void setLeft(double left)
視錐台左側符号付き距離設定関数
fk_Frustum & operator=(const fk_Frustum &)
単純代入演算子
void setBottom(double bottom)
視錐台下側符号付き距離設定関数
double getNear(void) const
クリッピング近距離面距離取得関数
double getLeft(void) const
視錐台左側符号付き距離取得関数
double getTop(void) const
視錐台上側符号付き距離取得関数
fk_Frustum(const fk_Frustum &)
コピーコンストラクタ
double getRight(void) const
視錐台右側符号付き距離取得関数
void setAll(double left, double right, double bottom, double top, double near, double far)
一括設定関数
void setRight(double right)
視錐台右側符号付き距離設定関数
virtual ~fk_Frustum()
デストラクタ
static constexpr double PI
円周率
Definition Math.h:37
一般4元正方行列を管理するクラス
Definition Matrix.h:549
double getBottom(void) const
クリッピング下側面距離参照関数
fk_Ortho(double left=-500.0, double right=500.0, double bottom=-500.0, double top=500.0, double near=0.0, double far=10000.0)
コンストラクタ
double getRight(void) const
クリッピング右側面距離参照関数
double getFar(void) const
クリッピング遠距離距離参照関数
fk_Ortho(const fk_Ortho &)
コピーコンストラクタ
double getTop(void) const
クリッピング上側面距離参照関数
void setRight(double right)
クリッピング左側面距離設定関数
void setBottom(double bottom)
クリッピング左側面距離設定関数
double getNear(void) const
クリッピング近距離距離参照関数
fk_Ortho & operator=(const fk_Ortho &)
単純代入演算子
void setFar(double far)
クリッピング遠距離距離設定関数
void setNear(double near)
クリッピング近距離距離設定関数
virtual ~fk_Ortho()
デストラクタ
void setTop(double top)
クリッピング左側面距離設定関数
void setLeft(double left)
クリッピング左側面距離設定関数
double getLeft(void) const
クリッピング左側面距離参照関数
void setAll(double left, double right, double bottom, double top, double near, double far)
一括設定関数
double getFovy(void) const
視野角参照関数
double getNear(void) const
クリッピング近距離面距離参照関数
void setNear(double near)
クリッピング近距離面距離設定関数
void setAll(double fovy, double near, double far)
一括設定関数1
fk_Perspective(const fk_Perspective &)
コピーコンストラクタ
double getAspect(void) const
アスペクト比参照関数
fk_Perspective(double fovy=2.0 *fk_Math::PI/9.0, double near=1.0, double far=6000.0)
コンストラクタ
void setFar(double far)
クリッピング遠距離面距離設定関数
virtual ~fk_Perspective()
デストラクタ
void setAll(double fovy, double near, double far, double aspect)
一括設定関数2
void setAspect(double aspect)
アスペクト比設定関数
fk_Perspective & operator=(const fk_Perspective &)
単純代入演算子
void setFovy(double fovy)
視野角設定関数
double getFar(void) const
クリッピング遠距離面距離参照関数
fk_ProjectMode getMode(void) const
投影法参照関数
virtual ~fk_ProjectBase()
デストラクタ
fk_ProjectBase(fk_ProjectMode=fk_ProjectMode::NONE)
コンストラクタ
Fine Kernel Toolkit 名前空間
Definition Angle.h:6
@ NONE
未定義境界
Definition Boundary.h:19
@ FRUSTUM
fk_Frustum 型
Definition Base.h:90
@ ORTHO
fk_Ortho 型
Definition Base.h:91
@ PERSPECTIVE
fk_Perspective 型
Definition Base.h:89
fk_ProjectMode
投影法を表す列挙型
Definition Projection.h:10
@ NONE
指定なし
Definition Projection.h:11