diff --git a/.gitignore b/.gitignore index b6ca7c09e8..fa3df0078e 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,13 @@ profile *.moved-aside DerivedData .idea/ -*.hmap \ No newline at end of file +*.hmap + +interface/Debug/ +interface/external/ +interface/hifi.build/ + +shared/Debug/ +shared/hifi.build/ + +interface/includes/InterfaceConfig.h diff --git a/interface/resources/images/green_eye.png b/interface/resources/images/green_eye.png new file mode 100644 index 0000000000..05bf108a00 Binary files /dev/null and b/interface/resources/images/green_eye.png differ diff --git a/interface/src/Audio.h b/interface/src/Audio.h index 4061d7afee..e4760c4f6f 100644 --- a/interface/src/Audio.h +++ b/interface/src/Audio.h @@ -29,11 +29,12 @@ public: void getInputLoudness(float * lastLoudness, float * averageLoudness); void updateMixerParams(in_addr_t mixerAddress, in_port_t mixerPort); + void setSourcePosition(glm::vec3 position); + // terminates audio I/O bool terminate(); private: bool initialized; - AudioData *audioData; // protects constructor so that public init method is used diff --git a/interface/src/Head.cpp b/interface/src/Head.cpp index a6ec9e2a0d..cc330c396c 100644 --- a/interface/src/Head.cpp +++ b/interface/src/Head.cpp @@ -8,10 +8,13 @@ #include #include -#include #include "Head.h" -#include "Util.h" -#include "SerialInterface.h" +#include +#include +#include +#include + +using namespace std; float skinColor[] = {1.0, 0.84, 0.66}; float browColor[] = {210.0/255.0, 105.0/255.0, 30.0/255.0}; @@ -28,6 +31,14 @@ float browThickness = 0.16; const float DECAY = 0.1; +char iris_texture_file[] = "interface.app/Contents/Resources/images/green_eye.png"; + +vector iris_texture; +unsigned int iris_texture_width = 512; +unsigned int iris_texture_height = 256; + +GLUquadric *sphere = gluNewQuadric(); + Head::Head() { position.x = position.y = position.z = 0; @@ -64,10 +75,24 @@ Head::Head() setNoise(0); hand = new Hand(glm::vec3(skinColor[0], skinColor[1], skinColor[2])); + + + if (iris_texture.size() == 0) { + unsigned error = lodepng::decode(iris_texture, iris_texture_width, iris_texture_height, iris_texture_file); + if (error != 0) { + std::cout << "error " << error << ": " << lodepng_error_text(error) << std::endl; + } + } } Head::~Head() { - // all data is primitive, do nothing + if (sphere) { + gluDeleteQuadric(sphere); + } +} + +Head* Head::clone() const { + return new Head(*this); } Head* Head::clone() const { @@ -218,11 +243,11 @@ void Head::simulate(float deltaTime) { SetNewHeadTarget((randFloat()-0.5)*20.0, (randFloat()-0.5)*45.0); } - + if (0) { - - // Pick new target + + // Pick new target PitchTarget = (randFloat() - 0.5)*45; YawTarget = (randFloat() - 0.5)*22; } @@ -341,14 +366,29 @@ void Head::render(int faceToFace, int isMine, float * myLocation) glutSolidSphere(0.25, 30, 30); } glPopMatrix(); + // Right Pupil + if (!sphere) { + sphere = gluNewQuadric(); + gluQuadricTexture(sphere, GL_TRUE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + gluQuadricOrientation(sphere, GLU_OUTSIDE); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, iris_texture_width, iris_texture_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, &iris_texture[0]); + } + glPushMatrix(); + { glRotatef(EyeballPitch[1], 1, 0, 0); glRotatef(EyeballYaw[1] + PupilConverge, 0, 1, 0); glTranslatef(0,0,.35); - if (!eyeContact) glColor3f(0,0,0); else glColor3f(0.3,0.3,0.3); - //glRotatef(90,0,1,0); - glutSolidSphere(PupilSize, 15, 15); + glRotatef(-75,1,0,0); + glScalef(1.0, 0.4, 1.0); + + glEnable(GL_TEXTURE_2D); + gluSphere(sphere, PupilSize, 15, 15); + glDisable(GL_TEXTURE_2D); + } glPopMatrix(); // Left Eye @@ -364,14 +404,19 @@ void Head::render(int faceToFace, int isMine, float * myLocation) glPopMatrix(); // Left Pupil glPushMatrix(); + { glRotatef(EyeballPitch[0], 1, 0, 0); glRotatef(EyeballYaw[0] - PupilConverge, 0, 1, 0); - glTranslatef(0,0,.35); - if (!eyeContact) glColor3f(0,0,0); else glColor3f(0.3,0.3,0.3); - //glRotatef(90,0,1,0); - glutSolidSphere(PupilSize, 15, 15); - glPopMatrix(); + glTranslatef(0, 0, .35); + glRotatef(-75, 1, 0, 0); + glScalef(1.0, 0.4, 1.0); + + glEnable(GL_TEXTURE_2D); + gluSphere(sphere, PupilSize, 15, 15); + glDisable(GL_TEXTURE_2D); + } + glPopMatrix(); } glPopMatrix(); diff --git a/interface/src/Texture.cpp b/interface/src/Texture.cpp index d7fc2c9a26..e0671cc881 100644 --- a/interface/src/Texture.cpp +++ b/interface/src/Texture.cpp @@ -9,7 +9,7 @@ #include "Texture.h" #include "InterfaceConfig.h" -#include +#include #include #include