source: GTP/trunk/App/Demos/Geom/OgreStuff/include/OgreSkeletonFileFormat.h @ 1092

Revision 1092, 4.3 KB checked in by gumbau, 18 years ago (diff)

LodStrips? and LODTrees demos

Line 
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4    (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2005 The OGRE Team
8Also see acknowledgements in Readme.html
9
10This program is free software; you can redistribute it and/or modify it under
11the terms of the GNU Lesser General Public License as published by the Free Software
12Foundation; either version 2 of the License, or (at your option) any later
13version.
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public License along with
20this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21Place - Suite 330, Boston, MA 02111-1307, USA, or go to
22http://www.gnu.org/copyleft/lesser.txt.
23-----------------------------------------------------------------------------
24*/
25#ifndef __SkeletonFileFormat_H__
26#define __SkeletonFileFormat_H__
27
28#include "OgrePrerequisites.h"
29
30namespace 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
59        SKELETON_BONE_PARENT       = 0x3000,
60        // Record of the parent of a single bone, used to build the node tree
61        // Repeating section, listed in Bone Index order, one per Bone
62
63            // unsigned short handle             : child bone
64            // unsigned short parentHandle   : parent bone
65
66        SKELETON_ANIMATION         = 0x4000,
67        // A single animation for this skeleton
68
69            // char* name                       : Name of the animation
70            // float length                      : Length of the animation in seconds
71
72            SKELETON_ANIMATION_TRACK = 0x4100,
73            // A single animation track (relates to a single bone)
74            // Repeating section (within SKELETON_ANIMATION)
75               
76                // unsigned short boneIndex     : Index of bone to apply to
77
78                SKELETON_ANIMATION_TRACK_KEYFRAME = 0x4110,
79                // A single keyframe within the track
80                // Repeating section
81
82                    // float time                    : The time position (seconds)
83                    // Quaternion rotate            : Rotation to apply at this keyframe
84                    // Vector3 translate            : Translation to apply at this keyframe
85                    // Vector3 scale                : Scale to apply at this keyframe
86                SKELETON_ANIMATION_LINK         = 0x5000
87                // Link to another skeleton, to re-use its animations
88
89                        // char* skeletonName                                   : name of skeleton to get animations from
90                        // float scale                                                  : scale to apply to trans/scale keys
91
92    };
93
94} // namespace
95
96
97#endif
Note: See TracBrowser for help on using the repository browser.