mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-08 23:12:16 +02:00
Merge branch 'master' of github.com:worklist/hifi
This commit is contained in:
commit
0f0cee1a46
5 changed files with 73 additions and 18 deletions
11
.gitignore
vendored
11
.gitignore
vendored
|
@ -23,4 +23,13 @@ profile
|
|||
*.moved-aside
|
||||
DerivedData
|
||||
.idea/
|
||||
*.hmap
|
||||
*.hmap
|
||||
|
||||
interface/Debug/
|
||||
interface/external/
|
||||
interface/hifi.build/
|
||||
|
||||
shared/Debug/
|
||||
shared/hifi.build/
|
||||
|
||||
interface/includes/InterfaceConfig.h
|
||||
|
|
BIN
interface/resources/images/green_eye.png
Normal file
BIN
interface/resources/images/green_eye.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
|
@ -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
|
||||
|
|
|
@ -8,10 +8,13 @@
|
|||
|
||||
#include <iostream>
|
||||
#include <glm/glm.hpp>
|
||||
#include <cstring>
|
||||
#include "Head.h"
|
||||
#include "Util.h"
|
||||
#include "SerialInterface.h"
|
||||
#include <vector>
|
||||
#include <lodepng.h>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
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<unsigned char> 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();
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "Texture.h"
|
||||
|
||||
#include "InterfaceConfig.h"
|
||||
#include <LodePNG/lodepng.h>
|
||||
#include <lodepng.h>
|
||||
#include <vector>
|
||||
#include <cstdio>
|
||||
|
||||
|
|
Loading…
Reference in a new issue