Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/OgreMain/include/OgreSkeletonFileFormat.h @ 3

Last change on this file since 3 was 3, checked in by anonymous, 17 years ago

=update

File size: 4.4 KB
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-2006 Torus Knot Software Ltd
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
24You may alternatively use this source under the terms of a specific version of
25the OGRE Unrestricted License provided you have obtained such a license from
26Torus Knot Software Ltd.
27-----------------------------------------------------------------------------
28*/
29#ifndef __SkeletonFileFormat_H__
30#define __SkeletonFileFormat_H__
31
32#include "OgrePrerequisites.h"
33
34namespace Ogre {
35
36/** Definition of the OGRE .skeleton file format
37
38    .skeleton files are binary files (for read efficiency at runtime) and are arranged into chunks
39    of data, very like 3D Studio's format.
40    A chunk always consists of:
41        unsigned short CHUNK_ID        : one of the following chunk ids identifying the chunk
42        unsigned long  LENGTH          : length of the chunk in bytes, including this header
43        void*          DATA            : the data, which may contain other sub-chunks (various data types)
44   
45    A .skeleton file contains both the definition of the Skeleton object and the animations it contains. It
46    contains only a single skeleton but can contain multiple animations.
47
48
49*/
50    enum SkeletonChunkID {
51        SKELETON_HEADER            = 0x1000,
52            // char* version           : Version number check
53        SKELETON_BONE              = 0x2000,
54        // Repeating section defining each bone in the system.
55        // Bones are assigned indexes automatically based on their order of declaration
56        // starting with 0.
57
58            // char* name                       : name of the bone
59            // unsigned short handle            : handle of the bone, should be contiguous & start at 0
60            // Vector3 position                 : position of this bone relative to parent
61            // Quaternion orientation           : orientation of this bone relative to parent
62            // Vector3 scale                    : scale of this bone relative to parent
63
64        SKELETON_BONE_PARENT       = 0x3000,
65        // Record of the parent of a single bone, used to build the node tree
66        // Repeating section, listed in Bone Index order, one per Bone
67
68            // unsigned short handle             : child bone
69            // unsigned short parentHandle   : parent bone
70
71        SKELETON_ANIMATION         = 0x4000,
72        // A single animation for this skeleton
73
74            // char* name                       : Name of the animation
75            // float length                      : Length of the animation in seconds
76
77            SKELETON_ANIMATION_TRACK = 0x4100,
78            // A single animation track (relates to a single bone)
79            // Repeating section (within SKELETON_ANIMATION)
80               
81                // unsigned short boneIndex     : Index of bone to apply to
82
83                SKELETON_ANIMATION_TRACK_KEYFRAME = 0x4110,
84                // A single keyframe within the track
85                // Repeating section
86
87                    // float time                    : The time position (seconds)
88                    // Quaternion rotate            : Rotation to apply at this keyframe
89                    // Vector3 translate            : Translation to apply at this keyframe
90                    // Vector3 scale                : Scale to apply at this keyframe
91                SKELETON_ANIMATION_LINK         = 0x5000
92                // Link to another skeleton, to re-use its animations
93
94                        // char* skeletonName                                   : name of skeleton to get animations from
95                        // float scale                                                  : scale to apply to trans/scale keys
96
97    };
98
99} // namespace
100
101
102#endif
Note: See TracBrowser for help on using the repository browser.