Bike-X  0.8
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Bikex Class Reference

#include "Bikex.h"

Collaboration diagram for Bikex:
Collaboration graph

Public Member Functions

 Bikex ()
 
 ~Bikex ()
 
void init ()
 
void printCurrState ()
 
void calculatePlayerPosition ()
 
void calculatePlayerRotation ()
 
void setBreakIntensity ()
 
int writeDevices ()
 
int readDevices ()
 
void play ()
 
float calcFPS (int dt)
 

Data Fields

float dt
 
float FRAME_RATE
 
xyz currPosition
 
xyz currRotation
 
unsigned char currBattery
 
unsigned char currHearBeat
 
int currDistance
 
unsigned char currSpeed
 
unsigned char currDirection
 
float currAngle
 
Unityunity
 
Ovrovr
 
Batterybattery
 
Break_break
 
Directiondirection
 
Oximetryoximetry
 
Speedspeed
 

Detailed Description

Definition at line 20 of file Bikex.h.

Constructor & Destructor Documentation

Bikex::Bikex ( )

Definition at line 22 of file Bikex.cpp.

Bikex::~Bikex ( )

Definition at line 51 of file Bikex.cpp.

Member Function Documentation

float Bikex::calcFPS ( int  dt)

Calculate how long to sleep before building next frame it should return time in u_seconds to wait for the next frame to be built

Definition at line 216 of file Bikex.cpp.

void Bikex::calculatePlayerPosition ( )

Calculate the next x and z values for Player position

Definition at line 96 of file Bikex.cpp.

void Bikex::calculatePlayerRotation ( )

Calculate the next x, y and z values for Player rotation

Definition at line 112 of file Bikex.cpp.

void Bikex::init ( )

Initialize Bikex

Definition at line 66 of file Bikex.cpp.

void Bikex::play ( )

Method that is going to be executed 30 times a second

Definition at line 163 of file Bikex.cpp.

void Bikex::printCurrState ( )

Print current Bikex state values

Definition at line 81 of file Bikex.cpp.

int Bikex::readDevices ( )

Read all necessary data from passive devices Return 0 if success != otherwise

Definition at line 146 of file Bikex.cpp.

void Bikex::setBreakIntensity ( )

Based on y value from unity, set the intensity on the break

Definition at line 118 of file Bikex.cpp.

int Bikex::writeDevices ( )

Write all necessary data to active devices Return 0 if success != otherwise

Definition at line 127 of file Bikex.cpp.

Field Documentation

Break* Bikex::_break

Our own reference to Break

Definition at line 98 of file Bikex.h.

Battery* Bikex::battery

Our own reference to Battery

Definition at line 93 of file Bikex.h.

float Bikex::currAngle

Current player's angle referred to the origin point [0, 0] it's going to be helpful when the player is making a curve speed and direction will vary depending on wich angle the player is turning to The angle is in degress: from 0 to 360

Definition at line 78 of file Bikex.h.

unsigned char Bikex::currBattery

Current battery status

Definition at line 49 of file Bikex.h.

unsigned char Bikex::currDirection

Current player's direction, if turning to the right or to the left, to the left

Definition at line 69 of file Bikex.h.

int Bikex::currDistance

Current player's distance already biked, in meters

Definition at line 59 of file Bikex.h.

unsigned char Bikex::currHearBeat

Current player's heart beat rate

Definition at line 54 of file Bikex.h.

xyz Bikex::currPosition

Current player's position

Definition at line 39 of file Bikex.h.

xyz Bikex::currRotation

Current player's rotation

Definition at line 44 of file Bikex.h.

unsigned char Bikex::currSpeed

Current player's speed (intensity of going forward)

Definition at line 64 of file Bikex.h.

Direction* Bikex::direction

Our own reference to Direction

Definition at line 103 of file Bikex.h.

float Bikex::dt

Time difference, it meas the time window until the next frame it's very useful to determine the next position by the speed dt is in seconds (will be very small)

Definition at line 29 of file Bikex.h.

float Bikex::FRAME_RATE

How many frames per second

Definition at line 34 of file Bikex.h.

Ovr* Bikex::ovr

Our own reference to Ovr

Definition at line 88 of file Bikex.h.

Oximetry* Bikex::oximetry

Our own reference to Oximetry

Definition at line 108 of file Bikex.h.

Speed* Bikex::speed

Our own reference to Speed

Definition at line 113 of file Bikex.h.

Unity* Bikex::unity

Our own reference to Unity

Definition at line 83 of file Bikex.h.


The documentation for this class was generated from the following files: