00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef __MOUSE_FILTER_H__
00015 #define __MOUSE_FILTER_H__
00016
00017
00018
00019 #include <ltbasedefs.h>
00020
00021
00023 #define MIN_INPUTBUFFERSIZE 1 // in frames
00024 #define MAX_INPUTBUFFERSIZE 500 // in frames
00025
00026 #define INITIAL_TARGETINPUTBUFFERTIME (0.5f) // in seconds
00027
00028 #define MIN_WEIGHTMOD (0.0f)
00029 #define MAX_WEIGHTMOD (1.0f)
00030 #define INITIAL_WEIGHTMOD (0.65f)
00031
00032
00034 class CMouseFilter
00035 {
00036 public:
00037
00038 CMouseFilter();
00039 ~CMouseFilter();
00040
00041 void PreUpdate();
00042
00043
00044
00045 LTVector3f GetFilteredAxisOffsets() { return m_vFilteredOffsets; }
00046
00047 float GetWeightMod() { return m_fWeightMod; }
00048 void SetWeightMod(float fWM);
00049
00050 float GetTargetInputBufferTime() { return m_fTargetInputBufferTime; }
00051 void SetTargetInputBufferTime(float fTime);
00052
00053 uint16 GetInputBufferSize() { return m_nInputBufferSize; }
00054
00055 private:
00056
00057
00058
00059 void CalcFilteredOffsets();
00060
00061
00062
00063 float m_fWeightMod;
00064 float m_fTargetInputBufferTime;
00065 uint16 m_nInputBufferSize;
00066 LTVector3f m_vInputBuffer[MAX_INPUTBUFFERSIZE];
00067 LTVector3f m_vFilteredOffsets;
00068
00069 uint16 m_nBufferOffset;
00070 uint16 m_nSamplesTaken;
00071 };
00072
00073
00074 #endif // __MOUSE_FILTER_H__