FineKernelToolKit 4.2.13
読み取り中…
検索中…
一致する文字列を見つけられません
MotionCharactor.h
[詳解]
1#if !defined(__FK_MOTIONCHARACTOR_HEADER__)
2#define __FK_MOTIONCHARACTOR_HEADER__
3
4#include <FK/Shape.h>
5#include <FK/IFSTexture.h>
6#include <FK/Scene.h>
7#include <FK/MotionData.hh>
8#include <map>
9#include <deque>
10
11namespace FK {
13
44
45#if !defined(FK_DOXYGEN_USER_PROCESS)
46 class Member {
47 public:
48 std::vector<std::unique_ptr<fk_Model>> jointModel;
49 std::vector<std::weak_ptr<fk_Shape>> mesh;
50 std::vector<std::unique_ptr<fk_Model>> objModel;
51 std::vector<fk_Material> matPalette;
52 std::vector<int> matTable;
53 std::vector<std::weak_ptr<fk_Image>> texImage;
54 std::vector<std::string> texName;
55 std::vector<int> texTable;
56 std::string mqoName;
57 int objNum;
58 std::vector<std::string> objName;
59 std::map<int, int> parentTable;
60 bool parentConnect;
61 std::vector<std::vector<fk_PerformerMotion>> keyFrameData;
62 std::vector<int> nowFrame, maxFrame;
63 std::deque<bool> visibleInfo;
64 fk_Draw draw_mode;
65 int prevPlayMotionID, loopCnt;
66 fk_Model absParent;
67
68 Member(void);
69 };
70
71#endif
72
73 public:
78
80
89
92
94
102 bool loadObjectData(const std::string &filename);
103
105
113 bool loadJointData(const std::string &filename);
114
116
127 bool loadMotionData(const std::string &filename);
128
130
133
135
143 void entryScene(fk_Scene *scene);
144
146
154 void removeScene(fk_Scene *scene);
155
157
160
162
167 int getObjectNum(void);
168
170
183
185
201
203
221
223
226
228
237 int getNowFrame(int id);
238
240
249 int getTotalFrame(int id);
250
252
263 bool playMotion(int id);
264
266
274 void stillMotion(int motionID, int frameID);
275
277
285 void setNowFrame(int motionID, int frameID);
286
288
296 bool isMotionFinished(int id);
297
299
305 int getLoopCount(void);
306
308
309#if !defined(FK_OLD_NONSUPPORT) && !defined(FK_DOXYGEN_USER_PROCESS)
310 void setAsCamera(fk_Scene *);
311 void setDrawMode(bool);
312 void setMarkerShape(fk_Shape *);
313#endif
314
315#if !defined(FK_DOXYGEN_USER_PROCESS)
316 void SetFinalizeMode(void);
317#endif
318 private:
319 std::unique_ptr<Member> _m;
320
321 void init(void);
322 bool EnumObjectName(const std::string &);
323
324 // オイラー角版
325 bool LoadMotionDataEuler(const std::string &);
326 // スケール対応版
327 bool LoadMotionDataEulerScale(const std::string &);
328
329 bool IsPNG(std::string);
330 bool ReadPNG(fk_Image *, std::string);
331 bool IsJPG(std::string);
332 bool ReadJPG(fk_Image *, std::string);
333 bool ReadBMP(fk_Image *, std::string);
334
335 bool AlphaChannel(fk_Image *, std::string);
336 void JointToPoser(void);
337
338 static inline std::map<std::string, std::shared_ptr<fk_Shape>> _s_shapeCache;
339 static inline std::map<std::string, std::shared_ptr<fk_Image>> _s_imageCache;
340 };
341
342#if !defined(FK_OLD_NONSUPPORT) && !defined(FK_DOXYGEN_USER_PROCESS)
343 using fkut_Performer = fk_Performer;
344#endif
345}
346#endif
347
348/****************************************************************************
349 *
350 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
351 *
352 * Redistribution and use in source and binary forms,
353 * with or without modification, are permitted provided that the
354 * following conditions are met:
355 *
356 * - Redistributions of source code must retain the above
357 * copyright notice, this list of conditions and the
358 * following disclaimer.
359 *
360 * - Redistributions in binary form must reproduce the above
361 * copyright notice, this list of conditions and the
362 * following disclaimer in the documentation and/or
363 * other materials provided with the distribution.
364 *
365 * - Neither the name of the copyright holders nor the names
366 * of its contributors may be used to endorse or promote
367 * products derived from this software without specific
368 * prior written permission.
369 *
370 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
371 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
372 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
373 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
374 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
375 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
376 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
377 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
378 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
379 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
380 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
381 * POSSIBILITY OF SUCH DAMAGE.
382 *
383 ****************************************************************************/
384/****************************************************************************
385 *
386 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
387 *
388 * 本ソフトウェアおよびソースコードのライセンスは、基本的に
389 * 「修正 BSD ライセンス」に従います。以下にその詳細を記します。
390 *
391 * ソースコード形式かバイナリ形式か、変更するかしないかを問わず、
392 * 以下の条件を満たす場合に限り、再頒布および使用が許可されます。
393 *
394 * - ソースコードを再頒布する場合、上記の著作権表示、本条件一覧、
395 * および下記免責条項を含めること。
396 *
397 * - バイナリ形式で再頒布する場合、頒布物に付属のドキュメント等の
398 * 資料に、上記の著作権表示、本条件一覧、および下記免責条項を
399 * 含めること。
400 *
401 * - 書面による特別の許可なしに、本ソフトウェアから派生した製品の
402 * 宣伝または販売促進に、本ソフトウェアの著作権者の名前または
403 * コントリビューターの名前を使用してはならない。
404 *
405 * 本ソフトウェアは、著作権者およびコントリビューターによって「現
406 * 状のまま」提供されており、明示黙示を問わず、商業的な使用可能性、
407 * および特定の目的に対する適合性に関す暗黙の保証も含め、またそれ
408 * に限定されない、いかなる保証もないものとします。著作権者もコン
409 * トリビューターも、事由のいかんを問わず、損害発生の原因いかんを
410 * 問わず、かつ責任の根拠が契約であるか厳格責任であるか(過失その
411 * 他の)不法行為であるかを問わず、仮にそのような損害が発生する可
412 * 能性を知らされていたとしても、本ソフトウェアの使用によって発生
413 * した(代替品または代用サービスの調達、使用の喪失、データの喪失、
414 * 利益の喪失、業務の中断も含め、またそれに限定されない)直接損害、
415 * 間接損害、偶発的な損害、特別損害、懲罰的損害、または結果損害に
416 * ついて、一切責任を負わないものとします。
417 *
418 ****************************************************************************/
画像を生成、管理するクラス
Definition Image.h:260
モデルを生成、管理するクラス
Definition Model.h:98
FK Performer キャラクターランタイムクラス
Definition MotionCharactor.h:43
int getNowFrame(int id)
モーション再生位置取得関数
~fk_Performer(void)
デストラクタ
bool isMotionFinished(int id)
モーション再生終了状態取得関数
int getTotalFrame(int id)
モーションのトータルフレーム数取得関数
bool playMotion(int id)
モーション再生関数
int getObjectNum(void)
オブジェクト数取得関数
bool loadMotionData(const std::string &filename)
FKM モーション読み込み関数
fk_Model * getBaseModel(void)
ベースモデル取得関数
bool cloneCharactor(fk_Performer *perf)
キャラクタークローン関数
fk_Model * getObjectModel(int id)
オブジェクトモデル取得関数
void stillMotion(int motionID, int frameID)
姿勢制御付きフレーム頭出し関数
fk_Performer(void)
コンストラクタ
bool loadJointData(const std::string &filename)
FKC ジョイント読み込み関数
int getLoopCount(void)
モーションのループ回数取得関数
void removeScene(fk_Scene *scene)
シーン登録解除関数
void setNowFrame(int motionID, int frameID)
姿勢制御無しフレーム頭出し関数
bool loadObjectData(const std::string &filename)
MQO オブジェクト読み込み関数
void entryScene(fk_Scene *scene)
シーン登録関数
fk_Model * getJointModel(int id)
ジョイントモデル取得関数
シーンを制御するクラス
Definition Scene.h:48
形状用基底クラス
Definition Shape.h:44
Fine Kernel Toolkit 名前空間
Definition Angle.h:6
fk_Draw
描画モードを表す列挙型
Definition DrawMode.h:7