summaryrefslogtreecommitdiffstats
path: root/MatchBloxEngine/MatchBloxEngine/C_Hand.cpp
diff options
context:
space:
mode:
authorDennis Peeten <dpeeten@onsneteindhoven.nl>2008-04-22 13:32:09 (GMT)
committerDennis Peeten <dpeeten@onsneteindhoven.nl>2008-04-22 13:32:09 (GMT)
commit2b53b94bdc1815fbc73f7ef0e5c2400f42a55508 (patch)
treed88af88abd415094b636a968d1640bf205bbb1c7 /MatchBloxEngine/MatchBloxEngine/C_Hand.cpp
parent92f2ef5fa1b80c6491ce46eab0ab0908eb9be9cc (diff)
download2iv55-2b53b94bdc1815fbc73f7ef0e5c2400f42a55508.zip
2iv55-2b53b94bdc1815fbc73f7ef0e5c2400f42a55508.tar.gz
2iv55-2b53b94bdc1815fbc73f7ef0e5c2400f42a55508.tar.bz2
Initial check in MatchBloxEngine
Diffstat (limited to 'MatchBloxEngine/MatchBloxEngine/C_Hand.cpp')
-rw-r--r--MatchBloxEngine/MatchBloxEngine/C_Hand.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/MatchBloxEngine/MatchBloxEngine/C_Hand.cpp b/MatchBloxEngine/MatchBloxEngine/C_Hand.cpp
new file mode 100644
index 0000000..54c1837
--- /dev/null
+++ b/MatchBloxEngine/MatchBloxEngine/C_Hand.cpp
@@ -0,0 +1,41 @@
+#include <GL\glut.h>
+#include "C_Hand.h"
+
+#define FADE_DURATION 500
+
+C_Hand::C_Hand(char* f_strFileName)
+: C_3DObject(f_strFileName), m_CurrState(IDLE), m_uiAnimStart(0)
+{
+}
+
+
+void C_Hand::Draw(unsigned int f_iElapsedTime)
+{
+ unsigned int l_uiDeltaTime = f_iElapsedTime - m_uiAnimStart;
+
+ if (l_uiDeltaTime > g_HandAnimDurations[(int)m_CurrState])
+ {
+ m_CurrState = IDLE;
+ }
+
+ glPushMatrix();
+ TransRotateScale();
+
+ switch (m_CurrState)
+ {
+ case GRAB:
+ C_3DObject::Draw();
+ break;
+
+ case RELEASE:
+ C_3DObject::Draw();
+ break;
+
+ case IDLE:
+ default:
+ C_3DObject::Draw();
+ break;
+ }
+
+ glPopMatrix();
+} \ No newline at end of file