Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/bsp_model/src/lib/graphics/importer/md3/md3_animation.h @ 8526

Last change on this file since 8526 was 8526, checked in by patrick, 18 years ago

bsp: md3 animation structures pumped up

File size: 1.9 KB
Line 
1/*!
2 * @file md3_animation.h
3 *
4 * Code heavely inspired by: JAVA MD3 Model Viewer - A Java based Quake 3 model viewer
5 * Copyright (C) 1999 Erwin 'KLR8' Vervaet
6 */
7
8#ifndef _MD3_ANIMATION_H
9#define _MD3_ANIMATION_H
10
11#include <string>
12
13
14typedef enum MD3AnimationType {
15  LEGS      = 0,             //!< animation only applicatble to the legs. top level model loaded from lower.md3
16  TORSO,                     //!< animation only applicatboe to the torso. normaly loaded from upper.md3
17  BOTH,                      //!< animation is applicable on both
18  ALL,                       //!< animation is applicable to all submodels
19
20  NUM_ANIMATION_TYPE         //!< number of animations
21};
22
23
24typedef struct MD3AnimationMap {
25  std::string        animationName;
26  MD3AnimationType   animationType;
27};
28
29
30
31
32/**
33 * a class with metadata describing an MD3 model animation
34 */
35class MD3Animation
36{
37
38  public:
39    MD3Animation();
40    MD3Animation(std::string line);
41    virtual ~MD3Animation();
42
43    void init();
44
45    std::string toString()
46    {
47      return std::string("Name: " + this->name);
48    }
49
50
51  public:
52    MD3AnimationType      type;                      //!< specifies for what parts of a model this animation is appilcable (e.g. LEGS)
53    std::string           name;                      //!< name of the animation
54
55    int                   offset;                    //!< for LEGS animation, this is the offset value to skip TORSO frames
56    int                   first;                     //!< first frame
57    int                   numFrames;                 //!< the number of frames in the anumation. < 0 means that all available frames used
58    int                   numLoopFrames;             //!< number of looping frames
59    int                   fps;                       //!< frames per second
60
61    static MD3AnimationMap animationList[25];         //!< the animation list
62};
63
64
65#endif /* _MD3_ANIMATION_H */
Note: See TracBrowser for help on using the repository browser.