Avionics
Dropship Simulator
Spatial.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../phidgets-2.1/phidget21.h"
4 #include "Bus.h"
5 
6 namespace Devices
7 {
8  struct SpatialConfig
9  {
10  bool enable;
12  int serialno;
13 
15  {
16  char axis;
17  float bias;
18  };
19 
20  std::vector<AccelerationAxis> accelerationAxes;
21  };
22 
23  class Spatial
24  {
25  private:
26  Logger* logger = nullptr;
27  SpatialConfig* config = nullptr;
28  Bus* bus = nullptr;
29 
30  CPhidgetSpatialHandle spatial = nullptr;
31 
32  int xyzMapping[3];
34  float cumulativeAccelTime = 0.0f;
36 
37  static int CCONV AttachHandler(CPhidgetHandle IFK, void* userptr);
38  static int CCONV DetachHandler(CPhidgetHandle IFK, void* userptr);
39  static int CCONV ErrorHandler(CPhidgetHandle IFK, void* userptr, int ErrorCode, const char* unknown);
40  static int CCONV SpatialDataHandler(CPhidgetSpatialHandle spatial, void* userptr, CPhidgetSpatial_SpatialEventDataHandle* data, int count);
41 
42  int display_properties(CPhidgetHandle phid) const;
43 
44  public:
45  void Destroy() const;
46  void Initialize(Logger* logger, SpatialConfig* config, Bus* prmBus);
47  void FrameMove(float fElapsed);
48  };
49 }
int display_properties(CPhidgetHandle phid) const
Definition: Spatial.cpp:72
static int CCONV DetachHandler(CPhidgetHandle IFK, void *userptr)
Definition: Spatial.cpp:24
Definition: Logger.h:5
static int CCONV AttachHandler(CPhidgetHandle IFK, void *userptr)
Definition: Spatial.cpp:5
void FrameMove(float fElapsed)
Definition: Spatial.cpp:180
okay, the portable keyboard numbers don&#39;t work like the outside keypad because the outside keypad is ...
Definition: Analog.cpp:3
void Initialize(Logger *logger, SpatialConfig *config, Bus *prmBus)
Definition: Spatial.cpp:108
static int CCONV SpatialDataHandler(CPhidgetSpatialHandle spatial, void *userptr, CPhidgetSpatial_SpatialEventDataHandle *data, int count)
Definition: Spatial.cpp:53
float cumulativeAccelTime
Definition: Spatial.h:34
Definition: Bus.h:12
CPhidgetSpatialHandle spatial
Definition: Spatial.h:30
void Destroy() const
Definition: Spatial.cpp:173
int xyzMapping[3]
Definition: Spatial.h:32
int cumulativeAccelSamples
Definition: Spatial.h:35
SpatialConfig * config
Definition: Spatial.h:27
std::vector< AccelerationAxis > accelerationAxes
Definition: Spatial.h:20
Logger * logger
Definition: Spatial.h:26
static int CCONV ErrorHandler(CPhidgetHandle IFK, void *userptr, int ErrorCode, const char *unknown)
Definition: Spatial.cpp:41
D3DXVECTOR3 cumulativeAcceleration
Definition: Spatial.h:33