Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 336 vs 337 for /trunk/Source Code/Geometry/Animations/Headers/AnimationEvaluator.h

Diff revisions: vs.
  @@ -21,7 +21,7 @@
21 21 */
22 22
23 23 /*Code references:
24 - http://nolimitsdesigns.com/game-design/open-asset-import-library-animation-loader/
24 + http://nolimitsdesigns.com/game-design/open-asset-import-library-animation-loader/
25 25 */
26 26
27 27 #ifndef ANIMATION_EVALUATOR_H_
  @@ -37,62 +37,62 @@
37 37
38 38 class AnimationChannel {
39 39 public:
40 - stringImpl _name;
41 - vectorImpl<aiVectorKey > _positionKeys;
42 - vectorImpl<aiQuatKey > _rotationKeys;
43 - vectorImpl<aiVectorKey > _scalingKeys;
44 - /** The number of position keys */
45 - U32 _numPositionKeys;
46 - U32 _numRotationKeys;
47 - U32 _numScalingKeys;
40 + stringImpl _name;
41 + vectorImpl<aiVectorKey > _positionKeys;
42 + vectorImpl<aiQuatKey > _rotationKeys;
43 + vectorImpl<aiVectorKey > _scalingKeys;
44 + /** The number of position keys */
45 + U32 _numPositionKeys;
46 + U32 _numRotationKeys;
47 + U32 _numScalingKeys;
48 48 };
49 49
50 50
51 51 class AnimEvaluator{
52 52 public:
53 53
54 - AnimEvaluator(): _lastFrameIndex(0),
55 - _lastTime(0.0),
56 - _ticksPerSecond(0.0),
57 - _duration(0.0),
58 - _playAnimationForward(true)
59 - {}
60 -
61 - AnimEvaluator( const aiAnimation* pAnim);
62 -
63 - void Evaluate(const D32 dt, hashMapImpl<stringImpl, Bone*>& bones);
64 - void Save(std::ofstream& file);
65 - void Load(std::ifstream& file);
66 - I32 GetFrameIndexAt(const D32 elapsedTime);
67 -
68 - inline I32 GetFrameIndex() const {return _lastFrameIndex;}
69 - inline U32 GetFrameCount() const {return (U32)_transforms.size();}
70 - inline vectorImpl<mat4<F32> >& GetTransforms(const D32 elapsedTime) {
54 + AnimEvaluator(): _lastFrameIndex(0),
55 + _lastTime(0.0),
56 + _ticksPerSecond(0.0),
57 + _duration(0.0),
58 + _playAnimationForward(true)
59 + {}
60 +
61 + AnimEvaluator( const aiAnimation* pAnim);
62 +
63 + void Evaluate(const D32 dt, hashMapImpl<stringImpl, Bone*>& bones);
64 + void Save(std::ofstream& file);
65 + void Load(std::ifstream& file);
66 + I32 GetFrameIndexAt(const D32 elapsedTime);
67 +
68 + inline I32 GetFrameIndex() const {return _lastFrameIndex;}
69 + inline U32 GetFrameCount() const {return (U32)_transforms.size();}
70 + inline vectorImpl<mat4<F32> >& GetTransforms(const D32 elapsedTime) {
71 71 I32 frameIndex = GetFrameIndexAt(elapsedTime);
72 72 assert(frameIndex < static_cast<I32>(_transforms.size()));
73 73 return _transforms[frameIndex];
74 74 }
75 75
76 76 protected:
77 - friend class SceneAnimator;
78 - stringImpl _name;
77 + friend class SceneAnimator;
78 + stringImpl _name;
79 79
80 - /// Array to return transformations results inside.
81 - vectorImpl<vectorImpl<mat4<F32> >> _transforms;
82 - vectorImpl<vectorImpl<mat4<F32> >> _quatTransforms;
83 -
84 - /// play forward == true, play backward == false
85 - bool _playAnimationForward;
86 - D32 _lastTime;
87 - D32 _duration;
88 - D32 _ticksPerSecond;
80 + /// Array to return transformations results inside.
81 + vectorImpl<vectorImpl<mat4<F32> >> _transforms;
82 + vectorImpl<vectorImpl<mat4<F32> >> _quatTransforms;
83 +
84 + /// play forward == true, play backward == false
85 + bool _playAnimationForward;
86 + D32 _lastTime;
87 + D32 _duration;
88 + D32 _ticksPerSecond;
89 89
90 90 private:
91 91
92 - I32 _lastFrameIndex;
93 - vectorImpl<vec3<U32> > _lastPositions;
94 - ///vector that holds all bone channels
95 - vectorImpl<AnimationChannel> _channels;
92 + I32 _lastFrameIndex;
93 + vectorImpl<vec3<U32> > _lastPositions;
94 + ///vector that holds all bone channels
95 + vectorImpl<AnimationChannel> _channels;
96 96 };
97 97
98 98 }; //namespace Divide