Repository navigation
Expand file tree
/
Copy pathhead.h
More file actions
81 lines (71 loc) · 1.98 KB
/
Copy pathhead.h
File metadata and controls
81 lines (71 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//
// head.h
// interface
//
// Created by Philip Rosedale on 9/11/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#ifndef interface_head_h
#define interface_head_h
#include <iostream>
#include "field.h"
#include "world.h"
#include <GLUT/glut.h>
#include "SerialInterface.h"
class Head {
float noise;
float Pitch;
float Yaw;
float Roll;
float PitchRate;
float YawRate;
float RollRate;
float EyeballPitch[2];
float EyeballYaw[2];
float EyebrowPitch[2];
float EyebrowRoll[2];
float EyeballScaleX, EyeballScaleY, EyeballScaleZ;
float interPupilDistance;
float interBrowDistance;
float NominalPupilSize;
float PupilSize;
float MouthPitch;
float MouthYaw;
float MouthWidth;
float MouthHeight;
float leanForward;
float leanSideways;
float PitchTarget;
float YawTarget;
float NoiseEnvelope;
float PupilConverge;
glm::vec3 position;
void readSensors();
public:
Head(void);
void reset();
void UpdatePos(float frametime, int * adc_channels, float * avg_adc_channels,
int head_mirror, glm::vec3 * gravity);
void setNoise (float mag) { noise = mag; }
void setPitch(float p) {Pitch = p; }
void setYaw(float y) {Yaw = y; }
void setRoll(float r) {Roll = r; };
void setLeanForward(float dist);
void setLeanSideways(float dist);
void addPitch(float p) {Pitch -= p; }
void addYaw(float y){Yaw -= y; }
void addRoll(float r){Roll += r; }
void addLean(float x, float z);
float getPitch() {return Pitch;}
float getRoll() {return Roll;}
float getYaw() {return Yaw;}
void render();
void simulate(float);
// Send and receive network data
int getBroadcastData(char* data);
void recvBroadcastData(char * data, int size);
void SetNewHeadTarget(float, float);
glm::vec3 getPos() { return position; };
void setPos(glm::vec3 newpos) { position = newpos; };
};
#endif