Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

WalkNavigation.h

00001 /*************************************************************************** 00002 * This file is part of OpenCAL: Open Computer Animation Library * 00003 * I created OpenCAL as my master's thesis Computer Science (multimedia) * 00004 * at the tUL university in Diepenbeek, Belgium * 00005 * * 00006 * Copyright (C) 2003-2004 by Jeroen Dierckx * 00007 * jeroen.dierckx@student.luc.ac.be * 00008 * * 00009 ***************************************************************************/ 00010 00011 #ifndef OPENCAL_UTILS_WALKNAVIGATION_H 00012 #define OPENCAL_UTILS_WALKNAVIGATION_H 00013 00014 // Includes 00015 #include <OpenCAL/global.h> 00016 #include <OpenCAL/Navigation.h> 00017 00018 #include <OpenCAL/Vector3.h> 00019 00020 00021 namespace OpenCAL 00022 { 00023 namespace Utils 00024 { 00025 // Forward declarations 00026 00030 class OPENCAL_API WalkNavigation: public Navigation 00031 { 00032 protected: 00033 // Member variables 00034 Vector3 m_position; 00035 float m_turnAngle, m_lookAngle; 00036 float m_walkSpeed, m_runSpeed, m_turnSpeed; 00037 00038 public: 00039 // Constructors and destructor 00040 WalkNavigation(float walkSpeed = 3.0f, float runSpeed = 7.0f, float turnSpeed = 30.0f); 00041 virtual ~WalkNavigation(); 00042 00043 // Get functions 00044 const Vector3 &getPosition() const { return m_position; } 00045 Vector3 *getPositionP() { return &m_position; } 00046 float getTurnAngle() const { return m_turnAngle; } 00047 float getLookAngle() const { return m_lookAngle; } 00048 00049 // Set functions 00050 void setPosition(const Vector3 &position) { m_position = position; } 00051 void setTurnAngle(float angle) { m_turnAngle = angle; } 00052 void setLookAngle(float angle) { m_lookAngle = angle; } 00053 00054 // Speficif navigation functions 00055 void move(float distance); 00056 void strafe(float distance); 00057 void rotate(float angle); 00058 void look(float angle); 00059 00060 void walkForward(float deltaSeconds); 00061 void walkBackward(float deltaSeconds); 00062 void runForward(float deltaSeconds); 00063 void runBackward(float deltaSeconds); 00064 void strafeLeft(float deltaSeconds); 00065 void strafeRight(float deltaSeconds); 00066 void rotateLeft(float deltaSeconds); 00067 void rotateRight(float deltaSeconds); 00068 void lookUp(float deltaSeconds); 00069 void lookDown(float deltaSeconds); 00070 00071 /* 00072 #ifdef USE_OPENGL 00073 // OpenGL function 00074 void applyGL() const; 00075 #endif // USE_OPENGL 00076 */ 00077 00078 // Other functions 00079 void reset(); 00080 }; 00081 } 00082 } 00083 00084 #endif // OPENCAL_UTILS_WALKNAVIGATION_H

Generated on Sun Aug 15 19:19:23 2004 for OpenCAL: Open Computer Animation Library by doxygen 1.3.8