ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

stark/model/skeleton.h

Go to the documentation of this file.
00001 /* ResidualVM - A 3D game interpreter
00002  *
00003  * ResidualVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the AUTHORS
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef STARK_MODEL_SKELETON_H
00024 #define STARK_MODEL_SKELETON_H
00025 
00026 #include "common/array.h"
00027 #include "common/str.h"
00028 
00029 #include "math/aabb.h"
00030 #include "math/quat.h"
00031 #include "math/ray.h"
00032 #include "math/vector3d.h"
00033 
00034 namespace Stark {
00035 
00036 class ArchiveReadStream;
00037 class SkeletonAnim;
00038 
00039 class BoneNode {
00040 public:
00041     BoneNode() : _parent(-1), _idx(0), _u1(0) {}
00042     ~BoneNode() { }
00043 
00045     bool intersectRay(const Math::Ray &ray) const;
00046 
00047     Common::String _name;
00048     float _u1;
00049     Common::Array<uint32> _children;
00050     int _parent;
00051     uint32 _idx;
00052 
00053     Math::Vector3d _animPos;
00054     Math::Quaternion _animRot;
00055 
00057     Math::AABB _boundingBox;
00058 };
00059 
00063 class Skeleton {
00064 public:
00065     Skeleton();
00066     ~Skeleton();
00067 
00071     void animate(uint32 time);
00072 
00076     void setAnim(SkeletonAnim *anim);
00077 
00081     void readFromStream(ArchiveReadStream *stream);
00082 
00086     const Common::Array<BoneNode *> getBones();
00087 
00088 private:
00089     void setNode(uint32 time, BoneNode *bone, const BoneNode *parent);
00090 
00091     Common::Array<BoneNode *> _bones;
00092     SkeletonAnim *_anim;
00093 
00094     uint32 _lastTime;
00095 };
00096 
00097 } // End of namespace Stark
00098 
00099 #endif // STARK_MODEL_SKELETON_H


Generated on Sat Apr 9 2016 05:00:24 for ResidualVM by doxygen 1.7.1
curved edge   curved edge