raSystem
1.0 bata
raAnimated.cpp
Go to the documentation of this file.
1
#include "..\include\raMain.h"
2
3
namespace
System
4
{
5
raAnimated::raAnimated
(
void
)
6
{
7
m_pAnimation = NULL;
8
m_startKey = 0;
9
m_numKeys = 0;
10
}
11
12
UINT
raAnimated::GetAnimationKeyFromTime
(
float
fTime)
13
{
14
UINT aniFPS = m_pAnimation->m_pAnimationHeader->AnimationFPS;
15
UINT iTick = (UINT)(aniFPS * fTime);
16
17
iTick = iTick % (m_numKeys - 1);
18
iTick += m_startKey;
19
return
iTick;
20
}
21
void
raAnimated::SetAnimation
(UINT clip)
22
{
23
if
(!m_pAnimation->m_pAnimationHeader)
return
;
24
25
switch
(clip)
26
{
27
case
0:
//laufen
28
m_startKey = 442;
29
m_numKeys = 14;
30
break
;
31
case
1:
// Drehen
32
m_startKey = 1;
33
m_numKeys = 70;
34
break
;
35
case
2:
//BackFlip
36
m_startKey = 120;
37
m_numKeys = 80;
38
break
;
39
case
3:
//Kämpfen
40
m_startKey = 1164;
41
m_numKeys = 28;
42
break
;
43
case
4:
//Sterben
44
m_startKey = 622;
45
m_numKeys = 10;
46
break
;
47
default
:
48
m_startKey = 442;
49
m_numKeys = 14;
50
break
;
51
}
52
}
53
//--------------------------
54
void
raAnimatedNode::Update
(
raFrameMap
&m_FrameData,
float
fRunTime, UINT subScriptionNo)
55
{
56
UINT iTick = GetAnimationKeyFromTime(fRunTime);
57
m_pAnimation->UpdateFrameData(iTick, subScriptionNo);
58
59
raMatrix
Identy =
raMatrixIdentity
();
60
TransformFrame(&Identy);
61
}
62
};
raAnimated::GetAnimationKeyFromTime
UINT GetAnimationKeyFromTime(float fTime)
Definition:
raAnimated.cpp:12
raMatrix
Definition:
raMatrix.h:5
System
Definition:
raFNormalize.h:3
raMatrixIdentity
raMatrix raMatrixIdentity()
Definition:
raMatrix.h:211
raAnimated::raAnimated
raAnimated()
Definition:
raAnimated.cpp:5
raFrameMap
std::map< LPCSTR, System::RAANIMATION_FRAME_DATA * > raFrameMap
Definition:
raMain.h:157
raAnimated::SetAnimation
void SetAnimation(UINT clip)
Definition:
raAnimated.cpp:21
raAnimatedNode::Update
virtual void Update(raFrameMap &m_FrameData, float fTime, UINT subScriptionNo)
Definition:
raAnimated.cpp:54
src
raAnimated.cpp
Generated by
1.8.13