Last change
on this file since 8544 was
8544,
checked in by patrick, 18 years ago
|
bsp: md3 animation parsing and reading construct finished
|
File size:
1.4 KB
|
Rev | Line | |
---|
[8526] | 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_CFG_H |
---|
| 9 | #define _MD3_ANIMATION_CFG_H |
---|
| 10 | |
---|
| 11 | #include "vector.h" |
---|
| 12 | |
---|
| 13 | #include <string> |
---|
| 14 | #include <map> |
---|
| 15 | |
---|
[8532] | 16 | #include <iostream> |
---|
| 17 | #include <fstream> |
---|
[8526] | 18 | |
---|
[8532] | 19 | |
---|
| 20 | |
---|
[8526] | 21 | namespace md3 |
---|
| 22 | { |
---|
| 23 | class MD3Animation; |
---|
| 24 | |
---|
| 25 | |
---|
| 26 | /** |
---|
| 27 | * a class with metadata describing an MD3 model animation |
---|
| 28 | */ |
---|
| 29 | class MD3AnimationCfg |
---|
| 30 | { |
---|
| 31 | |
---|
| 32 | public: |
---|
| 33 | MD3AnimationCfg(); |
---|
| 34 | MD3AnimationCfg(std::string filename); |
---|
| 35 | virtual ~MD3AnimationCfg(); |
---|
| 36 | |
---|
[8533] | 37 | void loadConfig(std::string filename); |
---|
[8526] | 38 | |
---|
[8541] | 39 | MD3Animation* getAnimation(std::string name); |
---|
| 40 | void putAnimation(MD3Animation* animation); |
---|
| 41 | |
---|
[8526] | 42 | |
---|
| 43 | public: |
---|
| 44 | std::string filename; //!< filename of the config file |
---|
| 45 | |
---|
| 46 | char sex; //!< sex of animated model: 'm' for male, 'f' for female |
---|
| 47 | Vector headOffset; //!< head offset. this is the offset of the head model in the HUD x,y,z |
---|
| 48 | std::string footsteps; //!< type of the footstep sounds associated with anumations (e.g. "mech", "default") |
---|
| 49 | |
---|
[8532] | 50 | std::ifstream dataStream; //!< the data stream |
---|
| 51 | |
---|
[8526] | 52 | std::map<std::string, MD3Animation*> animations; //!< mapping of animation names to MD3Animation objects. |
---|
| 53 | }; |
---|
| 54 | } |
---|
| 55 | |
---|
| 56 | #endif /* _MD3_ANIMATION_CFG_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.