Torque3D Documentation / _generateds / oculusVRSensorData.h

oculusVRSensorData.h

Engine/source/platform/input/oculusVR/oculusVRSensorData.h

More...

Classes:

Detailed Description

 1
 2//-----------------------------------------------------------------------------
 3// Copyright (c) 2012 GarageGames, LLC
 4//
 5// Permission is hereby granted, free of charge, to any person obtaining a copy
 6// of this software and associated documentation files (the "Software"), to
 7// deal in the Software without restriction, including without limitation the
 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 9// sell copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21// IN THE SOFTWARE.
22//-----------------------------------------------------------------------------
23
24#ifndef _OCULUSVRSENSORDATA_H_
25#define _OCULUSVRSENSORDATA_H_
26
27#include "platform/types.h"
28#include "math/mMatrix.h"
29#include "math/mQuat.h"
30#include "math/mPoint2.h"
31#include "OVR_CAPI_0_8_0.h"
32
33struct OculusVRSensorData
34{
35   enum DataDifferences {
36      DIFF_NONE            = 0,
37      DIFF_ROT             = (1<<0),
38      DIFF_ROTAXISX        = (1<<1),
39      DIFF_ROTAXISY        = (1<<2),
40      DIFF_ACCEL           = (1<<3),
41      DIFF_ANGVEL          = (1<<4),
42      DIFF_MAG             = (1<<5),
43      DIFF_POS             = (1<<6),
44      DIFF_STATUS          = (1<<7),
45
46      DIFF_ROTAXIS = (DIFF_ROTAXISX | DIFF_ROTAXISY),
47      DIFF_RAW = (DIFF_ACCEL | DIFF_ANGVEL | DIFF_MAG),
48   };
49
50   bool mDataSet;
51
52   // Position
53   Point3F mPosition;
54
55   // Rotation
56   MatrixF mRot;
57   QuatF   mRotQuat;
58   EulerF  mRotEuler;
59
60   // Controller rotation as axis x, y
61   Point2F mRotAxis;
62
63   // Raw values
64   VectorF mAcceleration;
65   EulerF  mAngVelocity;
66   VectorF mMagnetometer;
67
68   U32 mStatusFlags;
69
70   OculusVRSensorData();
71
72   /// Reset the data
73   void reset();
74
75   /// Set data based on given sensor fusion
76   void setData(ovrTrackingState& data, const F32& maxAxisRadius);
77
78   /// Compare this data and given and return differences
79   U32 compare(OculusVRSensorData* other, bool doRawCompare);
80};
81
82#endif   // _OCULUSVRSENSORDATA_H_
83