[692] | 1 | /*
|
---|
| 2 | -----------------------------------------------------------------------------
|
---|
| 3 | This source file is part of OGRE
|
---|
| 4 | (Object-oriented Graphics Rendering Engine)
|
---|
| 5 | For the latest info, see http://www.ogre3d.org/
|
---|
| 6 |
|
---|
| 7 | Copyright (c) 2000-2005 The OGRE Team
|
---|
| 8 | Also see acknowledgements in Readme.html
|
---|
| 9 |
|
---|
| 10 | This program is free software; you can redistribute it and/or modify it under
|
---|
| 11 | the terms of the GNU Lesser General Public License as published by the Free Software
|
---|
| 12 | Foundation; either version 2 of the License, or (at your option) any later
|
---|
| 13 | version.
|
---|
| 14 |
|
---|
| 15 | This program is distributed in the hope that it will be useful, but WITHOUT
|
---|
| 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
---|
| 17 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
---|
| 18 |
|
---|
| 19 | You should have received a copy of the GNU Lesser General Public License along with
|
---|
| 20 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
---|
| 21 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to
|
---|
| 22 | http://www.gnu.org/copyleft/lesser.txt.
|
---|
| 23 | -----------------------------------------------------------------------------
|
---|
| 24 | */
|
---|
| 25 | #ifndef __SkeletonFileFormat_H__
|
---|
| 26 | #define __SkeletonFileFormat_H__
|
---|
| 27 |
|
---|
| 28 | #include "OgrePrerequisites.h"
|
---|
| 29 |
|
---|
| 30 | namespace Ogre {
|
---|
| 31 |
|
---|
| 32 | /** Definition of the OGRE .skeleton file format
|
---|
| 33 |
|
---|
| 34 | .skeleton files are binary files (for read efficiency at runtime) and are arranged into chunks
|
---|
| 35 | of data, very like 3D Studio's format.
|
---|
| 36 | A chunk always consists of:
|
---|
| 37 | unsigned short CHUNK_ID : one of the following chunk ids identifying the chunk
|
---|
| 38 | unsigned long LENGTH : length of the chunk in bytes, including this header
|
---|
| 39 | void* DATA : the data, which may contain other sub-chunks (various data types)
|
---|
| 40 |
|
---|
| 41 | A .skeleton file contains both the definition of the Skeleton object and the animations it contains. It
|
---|
| 42 | contains only a single skeleton but can contain multiple animations.
|
---|
| 43 |
|
---|
| 44 |
|
---|
| 45 | */
|
---|
| 46 | enum SkeletonChunkID {
|
---|
| 47 | SKELETON_HEADER = 0x1000,
|
---|
| 48 | // char* version : Version number check
|
---|
| 49 | SKELETON_BONE = 0x2000,
|
---|
| 50 | // Repeating section defining each bone in the system.
|
---|
| 51 | // Bones are assigned indexes automatically based on their order of declaration
|
---|
| 52 | // starting with 0.
|
---|
| 53 |
|
---|
| 54 | // char* name : name of the bone
|
---|
| 55 | // unsigned short handle : handle of the bone, should be contiguous & start at 0
|
---|
| 56 | // Vector3 position : position of this bone relative to parent
|
---|
| 57 | // Quaternion orientation : orientation of this bone relative to parent
|
---|
| 58 | // Vector3 scale : scale of this bone relative to parent
|
---|
| 59 |
|
---|
| 60 | SKELETON_BONE_PARENT = 0x3000,
|
---|
| 61 | // Record of the parent of a single bone, used to build the node tree
|
---|
| 62 | // Repeating section, listed in Bone Index order, one per Bone
|
---|
| 63 |
|
---|
| 64 | // unsigned short handle : child bone
|
---|
| 65 | // unsigned short parentHandle : parent bone
|
---|
| 66 |
|
---|
| 67 | SKELETON_ANIMATION = 0x4000,
|
---|
| 68 | // A single animation for this skeleton
|
---|
| 69 |
|
---|
| 70 | // char* name : Name of the animation
|
---|
| 71 | // float length : Length of the animation in seconds
|
---|
| 72 |
|
---|
| 73 | SKELETON_ANIMATION_TRACK = 0x4100,
|
---|
| 74 | // A single animation track (relates to a single bone)
|
---|
| 75 | // Repeating section (within SKELETON_ANIMATION)
|
---|
| 76 |
|
---|
| 77 | // unsigned short boneIndex : Index of bone to apply to
|
---|
| 78 |
|
---|
| 79 | SKELETON_ANIMATION_TRACK_KEYFRAME = 0x4110,
|
---|
| 80 | // A single keyframe within the track
|
---|
| 81 | // Repeating section
|
---|
| 82 |
|
---|
| 83 | // float time : The time position (seconds)
|
---|
| 84 | // Quaternion rotate : Rotation to apply at this keyframe
|
---|
| 85 | // Vector3 translate : Translation to apply at this keyframe
|
---|
| 86 | // Vector3 scale : Scale to apply at this keyframe
|
---|
| 87 | SKELETON_ANIMATION_LINK = 0x5000
|
---|
| 88 | // Link to another skeleton, to re-use its animations
|
---|
| 89 |
|
---|
| 90 | // char* skeletonName : name of skeleton to get animations from
|
---|
| 91 | // float scale : scale to apply to trans/scale keys
|
---|
| 92 |
|
---|
| 93 | };
|
---|
| 94 |
|
---|
| 95 | } // namespace
|
---|
| 96 |
|
---|
| 97 |
|
---|
| 98 | #endif
|
---|