00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
#ifndef OPENCAL_UTILS_WALKNAVIGATION_H
00012
#define OPENCAL_UTILS_WALKNAVIGATION_H
00013
00014
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
00026
00030 class OPENCAL_API WalkNavigation:
public Navigation
00031 {
00032
protected:
00033
00034
Vector3 m_position;
00035
float m_turnAngle, m_lookAngle;
00036
float m_walkSpeed, m_runSpeed, m_turnSpeed;
00037
00038
public:
00039
00040 WalkNavigation(
float walkSpeed = 3.0f,
float runSpeed = 7.0f,
float turnSpeed = 30.0f);
00041
virtual ~WalkNavigation();
00042
00043
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
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
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
00073
00074
00075
00076
00077
00078
00079
void reset();
00080 };
00081 }
00082 }
00083
00084
#endif // OPENCAL_UTILS_WALKNAVIGATION_H