FineKernelToolKit 4.2.13
読み取り中…
検索中…
一致する文字列を見つけられません
BVHMotion.h
[詳解]
1#if !defined(__FK_BVHMOTION_HEADER__)
2#define __FK_BVHMOTION_HEADER__
3
4#include <FK/ParserBase.hh>
5#include <FK/Model.h>
6#include <map>
7
8namespace FK {
9
10#if !defined(FK_DOXYGEN_USER_PROCESS)
11 class fk_BVHBase : public fk_ParserBase {
12 public:
13 fk_BVHBase(void);
14 virtual ~fk_BVHBase();
15
16 virtual int getNodeNum(void) = 0;
17 virtual std::string getNodeName(int) = 0;
18 virtual int getPosSize(int) = 0;
19 virtual int getRotSize(int) = 0;
20 virtual double getOneFrameTime(void) = 0;
21 virtual fk_Vector getPos(int, int) = 0;
22 virtual fk_Angle getRot(int, int) = 0;
23 };
24#endif
26
38 class fk_BVHMotion : public fk_BVHBase {
39
40 friend class fk_D3DXAnimation;
41
42#if !defined(FK_DOXYGEN_USER_PROCESS)
43
44 enum class BVH_NodeType {
45 ROOT,
46 JOINT,
47 END
48 };
49
50 enum class BVH_ChannelType {
51 XPOS,
52 YPOS,
53 ZPOS,
54 XROT,
55 YROT,
56 ZROT
57 };
58
59 class Member {
60 public:
61 std::vector<std::unique_ptr<fk_Model>> nodeArray;
62 std::vector<std::string> nameArray;
63 std::vector<fk_Vector> offsetArray;
64 std::vector<BVH_NodeType> typeArray;
65 std::vector<std::vector<fk_Vector>> posArray;
66 std::vector<std::vector<fk_Angle>> rotArray;
67 std::map<std::string, fk_Model *> nameToNodeMap;
68 std::vector<std::pair<std::vector<int>::size_type, BVH_ChannelType>> frameFormat;
69 int nowFrame, length;
70 double oneFrameTime;
71
72 Member(void);
73 };
74#endif
75
76 public:
79
81 virtual ~fk_BVHMotion(void);
82
84
87 void init(void);
88
90
97 bool readBVHFile(const std::string fileName);
98
100
106 int getNodeNum(void);
107
109
117 std::string getNodeName(int index);
118
120
128 fk_Model * getNodeModel(int index);
129
131
140 fk_Model * getNodeModel(std::string nodeName);
141
142
144
150 int nextFrame(void);
151
153
160 void setFrameCount(int frame);
161
163
170 void setAnimationTime(double t);
171
172
174
180
182
187 int getFrameLength(void);
188
190
195 double getOneFrameTime(void);
196
197#if !defined(FK_DOXYGEN_USER_PROCESS)
198
199 int getPosSize(int);
200 int getRotSize(int);
201 fk_Vector getPos(int, int);
202 fk_Angle getRot(int, int);
203#endif
204
205 private:
206 std::unique_ptr<Member> _m;
207
208 int ReadHierarchy(std::vector<std::string> *, int);
209 int ReadMotion(std::vector<std::string> *, int);
210 int SetFrameFormat(std::vector<std::string> *, int);
211 };
212}
213
214#endif //__FK_BVHMOTION_HEADER__
215
216/****************************************************************************
217 *
218 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
219 *
220 * Redistribution and use in source and binary forms,
221 * with or without modification, are permitted provided that the
222 * following conditions are met:
223 *
224 * - Redistributions of source code must retain the above
225 * copyright notice, this list of conditions and the
226 * following disclaimer.
227 *
228 * - Redistributions in binary form must reproduce the above
229 * copyright notice, this list of conditions and the
230 * following disclaimer in the documentation and/or
231 * other materials provided with the distribution.
232 *
233 * - Neither the name of the copyright holders nor the names
234 * of its contributors may be used to endorse or promote
235 * products derived from this software without specific
236 * prior written permission.
237 *
238 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
239 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
240 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
241 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
242 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
243 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
244 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
245 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
246 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
247 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
248 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
249 * POSSIBILITY OF SUCH DAMAGE.
250 *
251 ****************************************************************************/
252/****************************************************************************
253 *
254 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
255 *
256 * 本ソフトウェアおよびソースコードのライセンスは、基本的に
257 * 「修正 BSD ライセンス」に従います。以下にその詳細を記します。
258 *
259 * ソースコード形式かバイナリ形式か、変更するかしないかを問わず、
260 * 以下の条件を満たす場合に限り、再頒布および使用が許可されます。
261 *
262 * - ソースコードを再頒布する場合、上記の著作権表示、本条件一覧、
263 * および下記免責条項を含めること。
264 *
265 * - バイナリ形式で再頒布する場合、頒布物に付属のドキュメント等の
266 * 資料に、上記の著作権表示、本条件一覧、および下記免責条項を
267 * 含めること。
268 *
269 * - 書面による特別の許可なしに、本ソフトウェアから派生した製品の
270 * 宣伝または販売促進に、本ソフトウェアの著作権者の名前または
271 * コントリビューターの名前を使用してはならない。
272 *
273 * 本ソフトウェアは、著作権者およびコントリビューターによって「現
274 * 状のまま」提供されており、明示黙示を問わず、商業的な使用可能性、
275 * および特定の目的に対する適合性に関す暗黙の保証も含め、またそれ
276 * に限定されない、いかなる保証もないものとします。著作権者もコン
277 * トリビューターも、事由のいかんを問わず、損害発生の原因いかんを
278 * 問わず、かつ責任の根拠が契約であるか厳格責任であるか(過失その
279 * 他の)不法行為であるかを問わず、仮にそのような損害が発生する可
280 * 能性を知らされていたとしても、本ソフトウェアの使用によって発生
281 * した(代替品または代用サービスの調達、使用の喪失、データの喪失、
282 * 利益の喪失、業務の中断も含め、またそれに限定されない)直接損害、
283 * 間接損害、偶発的な損害、特別損害、懲罰的損害、または結果損害に
284 * ついて、一切責任を負わないものとします。
285 *
286 ****************************************************************************/
オイラー角を表すクラス
Definition Angle.h:21
BVH 形式のモーションデータを読み込み、保持するクラス
Definition BVHMotion.h:38
void setAnimationTime(double t)
アニメーション時間設定関数
fk_Model * getNodeModel(std::string nodeName)
ノードモデル取得関数
int nextFrame(void)
モーション再生関数
fk_BVHMotion(void)
コンストラクタ
int getNodeNum(void)
ノード数取得関数
int getFrameLength(void)
モーション長取得関数
bool readBVHFile(const std::string fileName)
BVH ファイル入力関数
virtual ~fk_BVHMotion(void)
デストラクタ
fk_Model * getNodeModel(int index)
ノードモデル取得関数
std::string getNodeName(int index)
ノード名取得関数
void init(void)
初期化関数
friend class fk_D3DXAnimation
Definition BVHMotion.h:40
double getOneFrameTime(void)
1フレームの実時間取得関数
void setFrameCount(int frame)
モーション状態セット関数
int getNowFrameCount(void)
モーション現在位置取得関数
モデルを生成、管理するクラス
Definition Model.h:98
3次元ベクトルを管理するクラス
Definition Vector.h:45
Fine Kernel Toolkit 名前空間
Definition Angle.h:6
@ END
エンドキー