mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 11:37:58 +02:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
a1e3149d6a
6 changed files with 167 additions and 111 deletions
|
@ -250,8 +250,16 @@ int audioCallback (const void *inputBuffer,
|
||||||
}
|
}
|
||||||
// play whatever we have in the audio buffer
|
// play whatever we have in the audio buffer
|
||||||
|
|
||||||
|
//
|
||||||
// if we haven't fired off the flange effect, check if we should
|
// if we haven't fired off the flange effect, check if we should
|
||||||
int lastYawMeasured = fabsf(data->linkedHead->getLastMeasuredYaw());
|
//
|
||||||
|
|
||||||
|
//
|
||||||
|
// NOTE: PER - LastMeasuredHeadYaw is now relative to body position, represents the local
|
||||||
|
// rotation of the head relative to body, this may effect flange effect!
|
||||||
|
//
|
||||||
|
//
|
||||||
|
int lastYawMeasured = fabsf(data->linkedHead->getLastMeasuredHeadYaw());
|
||||||
|
|
||||||
if (!samplesLeftForFlange && lastYawMeasured > MIN_FLANGE_EFFECT_THRESHOLD) {
|
if (!samplesLeftForFlange && lastYawMeasured > MIN_FLANGE_EFFECT_THRESHOLD) {
|
||||||
// we should flange for one second
|
// we should flange for one second
|
||||||
|
|
|
@ -75,9 +75,9 @@ Head::Head(bool isMine) {
|
||||||
_head.interPupilDistance = 0.6;
|
_head.interPupilDistance = 0.6;
|
||||||
_head.interBrowDistance = 0.75;
|
_head.interBrowDistance = 0.75;
|
||||||
_head.nominalPupilSize = 0.10;
|
_head.nominalPupilSize = 0.10;
|
||||||
_head.yaw = 0.0;
|
//_head.yaw = 0.0;
|
||||||
_head.pitch = 0.0;
|
//_head.pitch = 0.0;
|
||||||
_head.roll = 0.0;
|
//_head.roll = 0.0;
|
||||||
_head.pitchRate = 0.0;
|
_head.pitchRate = 0.0;
|
||||||
_head.yawRate = 0.0;
|
_head.yawRate = 0.0;
|
||||||
_head.rollRate = 0.0;
|
_head.rollRate = 0.0;
|
||||||
|
@ -106,7 +106,6 @@ Head::Head(bool isMine) {
|
||||||
_head.eyeContactTarget = LEFT_EYE;
|
_head.eyeContactTarget = LEFT_EYE;
|
||||||
_head.scale = 1.0;
|
_head.scale = 1.0;
|
||||||
_head.audioAttack = 0.0;
|
_head.audioAttack = 0.0;
|
||||||
_head.loudness = 0.0;
|
|
||||||
_head.averageLoudness = 0.0;
|
_head.averageLoudness = 0.0;
|
||||||
_head.lastLoudness = 0.0;
|
_head.lastLoudness = 0.0;
|
||||||
_head.browAudioLift = 0.0;
|
_head.browAudioLift = 0.0;
|
||||||
|
@ -178,9 +177,9 @@ Head::Head(const Head &otherAvatar) {
|
||||||
_head.interPupilDistance = otherAvatar._head.interPupilDistance;
|
_head.interPupilDistance = otherAvatar._head.interPupilDistance;
|
||||||
_head.interBrowDistance = otherAvatar._head.interBrowDistance;
|
_head.interBrowDistance = otherAvatar._head.interBrowDistance;
|
||||||
_head.nominalPupilSize = otherAvatar._head.nominalPupilSize;
|
_head.nominalPupilSize = otherAvatar._head.nominalPupilSize;
|
||||||
_head.yaw = otherAvatar._head.yaw;
|
//_head.yaw = otherAvatar._head.yaw;
|
||||||
_head.pitch = otherAvatar._head.pitch;
|
//_head.pitch = otherAvatar._head.pitch;
|
||||||
_head.roll = otherAvatar._head.roll;
|
//_head.roll = otherAvatar._head.roll;
|
||||||
_head.yawRate = otherAvatar._head.yawRate;
|
_head.yawRate = otherAvatar._head.yawRate;
|
||||||
_head.pitchRate = otherAvatar._head.pitchRate;
|
_head.pitchRate = otherAvatar._head.pitchRate;
|
||||||
_head.rollRate = otherAvatar._head.rollRate;
|
_head.rollRate = otherAvatar._head.rollRate;
|
||||||
|
@ -209,7 +208,6 @@ Head::Head(const Head &otherAvatar) {
|
||||||
_head.eyeContactTarget = otherAvatar._head.eyeContactTarget;
|
_head.eyeContactTarget = otherAvatar._head.eyeContactTarget;
|
||||||
_head.scale = otherAvatar._head.scale;
|
_head.scale = otherAvatar._head.scale;
|
||||||
_head.audioAttack = otherAvatar._head.audioAttack;
|
_head.audioAttack = otherAvatar._head.audioAttack;
|
||||||
_head.loudness = otherAvatar._head.loudness;
|
|
||||||
_head.averageLoudness = otherAvatar._head.averageLoudness;
|
_head.averageLoudness = otherAvatar._head.averageLoudness;
|
||||||
_head.lastLoudness = otherAvatar._head.lastLoudness;
|
_head.lastLoudness = otherAvatar._head.lastLoudness;
|
||||||
_head.browAudioLift = otherAvatar._head.browAudioLift;
|
_head.browAudioLift = otherAvatar._head.browAudioLift;
|
||||||
|
@ -236,14 +234,14 @@ Head* Head::clone() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Head::reset() {
|
void Head::reset() {
|
||||||
_head.pitch = _head.yaw = _head.roll = 0;
|
_headPitch = _headYaw = _headRoll = 0;
|
||||||
_head.leanForward = _head.leanSideways = 0;
|
_head.leanForward = _head.leanSideways = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//this pertains to moving the head with the glasses
|
//this pertains to moving the head with the glasses
|
||||||
//---------------------------------------------------
|
//---------------------------------------------------
|
||||||
void Head::UpdateGyros(float frametime, SerialInterface * serialInterface, int head_mirror, glm::vec3 * gravity)
|
void Head::UpdateGyros(float frametime, SerialInterface * serialInterface, glm::vec3 * gravity)
|
||||||
// Using serial data, update avatar/render position and angles
|
// Using serial data, update avatar/render position and angles
|
||||||
{
|
{
|
||||||
const float PITCH_ACCEL_COUPLING = 0.5;
|
const float PITCH_ACCEL_COUPLING = 0.5;
|
||||||
|
@ -271,20 +269,15 @@ void Head::UpdateGyros(float frametime, SerialInterface * serialInterface, int h
|
||||||
const float MAX_YAW = 85;
|
const float MAX_YAW = 85;
|
||||||
const float MIN_YAW = -85;
|
const float MIN_YAW = -85;
|
||||||
|
|
||||||
if ((_head.pitch < MAX_PITCH) && (_head.pitch > MIN_PITCH))
|
if ((_headPitch < MAX_PITCH) && (_headPitch > MIN_PITCH))
|
||||||
addPitch(measured_pitch_rate * -HEAD_ROTATION_SCALE * frametime);
|
addHeadPitch(measured_pitch_rate * -HEAD_ROTATION_SCALE * frametime);
|
||||||
|
|
||||||
addRoll(-measured_roll_rate * HEAD_ROLL_SCALE * frametime);
|
addHeadRoll(measured_roll_rate * HEAD_ROLL_SCALE * frametime);
|
||||||
|
|
||||||
|
if ((_headYaw < MAX_YAW) && (_headYaw > MIN_YAW))
|
||||||
|
addHeadYaw(_head.yawRate * HEAD_ROTATION_SCALE * frametime);
|
||||||
|
|
||||||
if (head_mirror) {
|
|
||||||
if ((_head.yaw < MAX_YAW) && (_head.yaw > MIN_YAW))
|
|
||||||
addYaw(-_head.yawRate * HEAD_ROTATION_SCALE * frametime);
|
|
||||||
addLean(-measured_lateral_accel * frametime * HEAD_LEAN_SCALE, -measured_fwd_accel*frametime * HEAD_LEAN_SCALE);
|
addLean(-measured_lateral_accel * frametime * HEAD_LEAN_SCALE, -measured_fwd_accel*frametime * HEAD_LEAN_SCALE);
|
||||||
} else {
|
|
||||||
if ((_head.yaw < MAX_YAW) && (_head.yaw > MIN_YAW))
|
|
||||||
addYaw(_head.yawRate * -HEAD_ROTATION_SCALE * frametime);
|
|
||||||
addLean(measured_lateral_accel * frametime * -HEAD_LEAN_SCALE, measured_fwd_accel*frametime * HEAD_LEAN_SCALE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Head::addLean(float x, float z) {
|
void Head::addLean(float x, float z) {
|
||||||
|
@ -440,10 +433,6 @@ void Head::simulate(float deltaTime) {
|
||||||
_bodyYaw += _bodyYawDelta * deltaTime;
|
_bodyYaw += _bodyYawDelta * deltaTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
// we will be eventually getting head rotation from elsewhere. For now, just setting it to body rotation
|
|
||||||
_head.yaw = _bodyYaw;
|
|
||||||
_head.pitch = _bodyPitch;
|
|
||||||
_head.roll = _bodyRoll;
|
|
||||||
|
|
||||||
//----------------------------------------------------------
|
//----------------------------------------------------------
|
||||||
// decay body yaw delta
|
// decay body yaw delta
|
||||||
|
@ -465,21 +454,30 @@ void Head::simulate(float deltaTime) {
|
||||||
//----------------------------------------------------------
|
//----------------------------------------------------------
|
||||||
_velocity *= ( 1.0 - LIN_VEL_DECAY * deltaTime );
|
_velocity *= ( 1.0 - LIN_VEL_DECAY * deltaTime );
|
||||||
|
|
||||||
|
//
|
||||||
|
// Update Head information
|
||||||
|
//
|
||||||
|
|
||||||
|
// we will be eventually getting head rotation from elsewhere. For now, just setting it to body rotation
|
||||||
|
//_head.yaw = _bodyYaw;
|
||||||
|
//_head.pitch = _bodyPitch;
|
||||||
|
//_head.roll = _bodyRoll;
|
||||||
|
|
||||||
if (!_head.noise) {
|
if (!_head.noise) {
|
||||||
// Decay back toward center
|
// Decay back toward center
|
||||||
_head.pitch *= (1.0f - DECAY*2*deltaTime);
|
_headPitch *= (1.0f - DECAY * 2 * deltaTime);
|
||||||
_head.yaw *= (1.0f - DECAY*2*deltaTime);
|
_headYaw *= (1.0f - DECAY * 2 * deltaTime);
|
||||||
_head.roll *= (1.0f - DECAY*2*deltaTime);
|
_headRoll *= (1.0f - DECAY * 2 * deltaTime);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Move toward new target
|
// Move toward new target
|
||||||
_head.pitch += (_head.pitchTarget - _head.pitch)*10*deltaTime; // (1.f - DECAY*deltaTime)*Pitch + ;
|
_headPitch += (_head.pitchTarget - _headPitch) * 10 * deltaTime; // (1.f - DECAY*deltaTime)*Pitch + ;
|
||||||
_head.yaw += (_head.yawTarget - _head.yaw )*10*deltaTime; // (1.f - DECAY*deltaTime);
|
_headYaw += (_head.yawTarget - _headYaw ) * 10 * deltaTime; // (1.f - DECAY*deltaTime);
|
||||||
_head.roll *= (1.f - DECAY*deltaTime);
|
_headRoll *= 1.f - (DECAY * deltaTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
_head.leanForward *= (1.f - DECAY*30.f*deltaTime);
|
_head.leanForward *= (1.f - DECAY * 30 * deltaTime);
|
||||||
_head.leanSideways *= (1.f - DECAY*30.f*deltaTime);
|
_head.leanSideways *= (1.f - DECAY * 30 * deltaTime);
|
||||||
|
|
||||||
// Update where the avatar's eyes are
|
// Update where the avatar's eyes are
|
||||||
//
|
//
|
||||||
|
@ -489,8 +487,8 @@ void Head::simulate(float deltaTime) {
|
||||||
_head.eyeContact = 1;
|
_head.eyeContact = 1;
|
||||||
if (!_head.eyeContact) {
|
if (!_head.eyeContact) {
|
||||||
// If we just stopped making eye contact,move the eyes markedly away
|
// If we just stopped making eye contact,move the eyes markedly away
|
||||||
_head.eyeballPitch[0] = _head.eyeballPitch[1] = _head.eyeballPitch[0] + 5.0 + (randFloat() - 0.5)*10;
|
_head.eyeballPitch[0] = _head.eyeballPitch[1] = _head.eyeballPitch[0] + 5.0 + (randFloat() - 0.5) * 10;
|
||||||
_head.eyeballYaw [0] = _head.eyeballYaw [1] = _head.eyeballYaw [0] + 5.0 + (randFloat() - 0.5)*5;
|
_head.eyeballYaw [0] = _head.eyeballYaw [1] = _head.eyeballYaw [0] + 5.0 + (randFloat() - 0.5) * 5;
|
||||||
} else {
|
} else {
|
||||||
// If now making eye contact, turn head to look right at viewer
|
// If now making eye contact, turn head to look right at viewer
|
||||||
SetNewHeadTarget(0,0);
|
SetNewHeadTarget(0,0);
|
||||||
|
@ -517,39 +515,39 @@ void Head::simulate(float deltaTime) {
|
||||||
if (_head.eyeContactTarget == RIGHT_EYE) eye_target_yaw_adjust = -DEGREES_BETWEEN_VIEWER_EYES;
|
if (_head.eyeContactTarget == RIGHT_EYE) eye_target_yaw_adjust = -DEGREES_BETWEEN_VIEWER_EYES;
|
||||||
if (_head.eyeContactTarget == MOUTH) eye_target_pitch_adjust = DEGREES_TO_VIEWER_MOUTH;
|
if (_head.eyeContactTarget == MOUTH) eye_target_pitch_adjust = DEGREES_TO_VIEWER_MOUTH;
|
||||||
|
|
||||||
_head.eyeballPitch[0] = _head.eyeballPitch[1] = -_head.pitch + eye_target_pitch_adjust;
|
_head.eyeballPitch[0] = _head.eyeballPitch[1] = -_headPitch + eye_target_pitch_adjust;
|
||||||
_head.eyeballYaw[0] = _head.eyeballYaw[1] = -_head.yaw + eye_target_yaw_adjust;
|
_head.eyeballYaw[0] = _head.eyeballYaw[1] = -_headYaw + eye_target_yaw_adjust;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (_head.noise)
|
if (_head.noise)
|
||||||
{
|
{
|
||||||
_head.pitch += (randFloat() - 0.5)*0.2*_head.noiseEnvelope;
|
_headPitch += (randFloat() - 0.5) * 0.2 * _head.noiseEnvelope;
|
||||||
_head.yaw += (randFloat() - 0.5)*0.3*_head.noiseEnvelope;
|
_headYaw += (randFloat() - 0.5) * 0.3 *_head.noiseEnvelope;
|
||||||
//PupilSize += (randFloat() - 0.5)*0.001*NoiseEnvelope;
|
//PupilSize += (randFloat() - 0.5) * 0.001*NoiseEnvelope;
|
||||||
|
|
||||||
if (randFloat() < 0.005) _head.mouthWidth = MouthWidthChoices[rand()%3];
|
if (randFloat() < 0.005) _head.mouthWidth = MouthWidthChoices[rand()%3];
|
||||||
|
|
||||||
if (!_head.eyeContact) {
|
if (!_head.eyeContact) {
|
||||||
if (randFloat() < 0.01) _head.eyeballPitch[0] = _head.eyeballPitch[1] = (randFloat() - 0.5)*20;
|
if (randFloat() < 0.01) _head.eyeballPitch[0] = _head.eyeballPitch[1] = (randFloat() - 0.5) * 20;
|
||||||
if (randFloat() < 0.01) _head.eyeballYaw[0] = _head.eyeballYaw[1] = (randFloat()- 0.5)*10;
|
if (randFloat() < 0.01) _head.eyeballYaw[0] = _head.eyeballYaw[1] = (randFloat()- 0.5) * 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((randFloat() < 0.005) && (fabs(_head.pitchTarget - _head.pitch) < 1.0) && (fabs(_head.yawTarget - _head.yaw) < 1.0)) {
|
if ((randFloat() < 0.005) && (fabs(_head.pitchTarget - _headPitch) < 1.0) && (fabs(_head.yawTarget - _headYaw) < 1.0)) {
|
||||||
SetNewHeadTarget((randFloat()-0.5)*20.0, (randFloat()-0.5)*45.0);
|
SetNewHeadTarget((randFloat()-0.5) * 20.0, (randFloat()-0.5) * 45.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0) {
|
if (0) {
|
||||||
|
|
||||||
// Pick new target
|
// Pick new target
|
||||||
_head.pitchTarget = (randFloat() - 0.5)*45;
|
_head.pitchTarget = (randFloat() - 0.5) * 45;
|
||||||
_head.yawTarget = (randFloat() - 0.5)*22;
|
_head.yawTarget = (randFloat() - 0.5) * 22;
|
||||||
}
|
}
|
||||||
if (randFloat() < 0.01)
|
if (randFloat() < 0.01)
|
||||||
{
|
{
|
||||||
_head.eyebrowPitch[0] = _head.eyebrowPitch[1] = BrowPitchAngle[rand()%3];
|
_head.eyebrowPitch[0] = _head.eyebrowPitch[1] = BrowPitchAngle[rand()%3];
|
||||||
_head.eyebrowRoll [0] = _head.eyebrowRoll[1] = BrowRollAngle[rand()%5];
|
_head.eyebrowRoll [0] = _head.eyebrowRoll[1] = BrowRollAngle[rand()%5];
|
||||||
_head.eyebrowRoll [1]*=-1;
|
_head.eyebrowRoll [1] *=-1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -627,7 +625,7 @@ void Head::updateAvatarCollisionDetectionAndResponse( glm::vec3 collisionPositio
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Head::render(int faceToFace) {
|
void Head::render(bool lookingInMirror) {
|
||||||
|
|
||||||
//---------------------------------------------------
|
//---------------------------------------------------
|
||||||
// show avatar position
|
// show avatar position
|
||||||
|
@ -660,7 +658,7 @@ void Head::render(int faceToFace) {
|
||||||
//---------------------------------------------------
|
//---------------------------------------------------
|
||||||
// render head
|
// render head
|
||||||
//---------------------------------------------------
|
//---------------------------------------------------
|
||||||
renderHead(faceToFace);
|
renderHead(lookingInMirror);
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// if this is my avatar, then render my interactions with the other avatars
|
// if this is my avatar, then render my interactions with the other avatars
|
||||||
|
@ -686,7 +684,7 @@ void Head::render(int faceToFace) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Head::renderHead(int faceToFace) {
|
void Head::renderHead(bool lookingInMirror) {
|
||||||
int side = 0;
|
int side = 0;
|
||||||
|
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
|
@ -712,9 +710,15 @@ void Head::renderHead(int faceToFace) {
|
||||||
|
|
||||||
glScalef( 0.03, 0.03, 0.03 );
|
glScalef( 0.03, 0.03, 0.03 );
|
||||||
|
|
||||||
glRotatef(_head.yaw, 0, 1, 0);
|
if (lookingInMirror) {
|
||||||
glRotatef(_head.pitch, 1, 0, 0);
|
glRotatef(_bodyYaw - _headYaw, 0, 1, 0);
|
||||||
glRotatef(_head.roll, 0, 0, 1);
|
glRotatef(_bodyPitch + _headPitch, 1, 0, 0);
|
||||||
|
glRotatef(_bodyRoll - _headRoll, 0, 0, 1);
|
||||||
|
} else {
|
||||||
|
glRotatef(_bodyYaw + _headYaw, 0, 1, 0);
|
||||||
|
glRotatef(_bodyPitch + _headPitch, 1, 0, 0);
|
||||||
|
glRotatef(_bodyRoll + _headRoll, 0, 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
glScalef(2.0, 2.0, 2.0);
|
glScalef(2.0, 2.0, 2.0);
|
||||||
glColor3fv(skinColor);
|
glColor3fv(skinColor);
|
||||||
|
@ -734,17 +738,17 @@ void Head::renderHead(int faceToFace) {
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
|
||||||
// _eyebrows
|
// _eyebrows
|
||||||
_head.audioAttack = 0.9*_head.audioAttack + 0.1*fabs(_head.loudness - _head.lastLoudness);
|
_head.audioAttack = 0.9 * _head.audioAttack + 0.1 * fabs(_audioLoudness - _head.lastLoudness);
|
||||||
_head.lastLoudness = _head.loudness;
|
_head.lastLoudness = _audioLoudness;
|
||||||
|
|
||||||
const float BROW_LIFT_THRESHOLD = 100;
|
const float BROW_LIFT_THRESHOLD = 100;
|
||||||
if (_head.audioAttack > BROW_LIFT_THRESHOLD)
|
if (_head.audioAttack > BROW_LIFT_THRESHOLD)
|
||||||
_head.browAudioLift += sqrt(_head.audioAttack)/1000.0;
|
_head.browAudioLift += sqrt(_head.audioAttack) / 1000.0;
|
||||||
|
|
||||||
_head.browAudioLift *= .90;
|
_head.browAudioLift *= .90;
|
||||||
|
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslatef(-_head.interBrowDistance/2.0,0.4,0.45);
|
glTranslatef(-_head.interBrowDistance / 2.0,0.4,0.45);
|
||||||
for(side = 0; side < 2; side++) {
|
for(side = 0; side < 2; side++) {
|
||||||
glColor3fv(browColor);
|
glColor3fv(browColor);
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
@ -798,7 +802,7 @@ void Head::renderHead(int faceToFace) {
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
{
|
{
|
||||||
glRotatef(_head.eyeballPitch[1], 1, 0, 0);
|
glRotatef(_head.eyeballPitch[1], 1, 0, 0);
|
||||||
glRotatef(_head.eyeballYaw[1] + _head.yaw + _head.pupilConverge, 0, 1, 0);
|
glRotatef(_head.eyeballYaw[1] + _headYaw + _head.pupilConverge, 0, 1, 0);
|
||||||
glTranslatef(0,0,.35);
|
glTranslatef(0,0,.35);
|
||||||
glRotatef(-75,1,0,0);
|
glRotatef(-75,1,0,0);
|
||||||
glScalef(1.0, 0.4, 1.0);
|
glScalef(1.0, 0.4, 1.0);
|
||||||
|
@ -824,7 +828,7 @@ void Head::renderHead(int faceToFace) {
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
{
|
{
|
||||||
glRotatef(_head.eyeballPitch[0], 1, 0, 0);
|
glRotatef(_head.eyeballPitch[0], 1, 0, 0);
|
||||||
glRotatef(_head.eyeballYaw[0] + _head.yaw - _head.pupilConverge, 0, 1, 0);
|
glRotatef(_head.eyeballYaw[0] + _headYaw - _head.pupilConverge, 0, 1, 0);
|
||||||
glTranslatef(0, 0, .35);
|
glTranslatef(0, 0, .35);
|
||||||
glRotatef(-75, 1, 0, 0);
|
glRotatef(-75, 1, 0, 0);
|
||||||
glScalef(1.0, 0.4, 1.0);
|
glScalef(1.0, 0.4, 1.0);
|
||||||
|
@ -1245,7 +1249,7 @@ void Head::renderBody() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (( _usingBodySprings ) && ( _mousePressed )) {
|
if (( _usingBodySprings ) && ( getHandState() )) {
|
||||||
glColor4f( 1.0, 1.0, 0.5, 0.5 );
|
glColor4f( 1.0, 1.0, 0.5, 0.5 );
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslatef
|
glTranslatef
|
||||||
|
@ -1273,9 +1277,6 @@ void Head::renderBoneAsBlock( AvatarBoneID b ) {
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Head::SetNewHeadTarget(float pitch, float yaw) {
|
void Head::SetNewHeadTarget(float pitch, float yaw) {
|
||||||
_head.pitchTarget = pitch;
|
_head.pitchTarget = pitch;
|
||||||
_head.yawTarget = yaw;
|
_head.yawTarget = yaw;
|
||||||
|
|
|
@ -112,9 +112,6 @@ struct AvatarBone
|
||||||
|
|
||||||
struct AvatarHead
|
struct AvatarHead
|
||||||
{
|
{
|
||||||
float pitch;
|
|
||||||
float yaw;
|
|
||||||
float roll;
|
|
||||||
float pitchRate;
|
float pitchRate;
|
||||||
float yawRate;
|
float yawRate;
|
||||||
float rollRate;
|
float rollRate;
|
||||||
|
@ -146,7 +143,7 @@ struct AvatarHead
|
||||||
eyeContactTargets eyeContactTarget;
|
eyeContactTargets eyeContactTarget;
|
||||||
|
|
||||||
// Sound loudness information
|
// Sound loudness information
|
||||||
float loudness, lastLoudness;
|
float lastLoudness;
|
||||||
float averageLoudness;
|
float averageLoudness;
|
||||||
float audioAttack;
|
float audioAttack;
|
||||||
};
|
};
|
||||||
|
@ -160,11 +157,8 @@ class Head : public AvatarData {
|
||||||
Head* clone() const;
|
Head* clone() const;
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
void UpdateGyros(float frametime, SerialInterface * serialInterface, int head_mirror, glm::vec3 * gravity);
|
void UpdateGyros(float frametime, SerialInterface * serialInterface, glm::vec3 * gravity);
|
||||||
void setNoise (float mag) { _head.noise = mag; }
|
void setNoise (float mag) { _head.noise = mag; }
|
||||||
void setPitch(float p) {_head.pitch = p; }
|
|
||||||
void setYaw(float y) {_head.yaw = y; }
|
|
||||||
void setRoll(float r) {_head.roll = r; };
|
|
||||||
void setScale(float s) {_head.scale = s; };
|
void setScale(float s) {_head.scale = s; };
|
||||||
void setRenderYaw(float y) {_renderYaw = y;}
|
void setRenderYaw(float y) {_renderYaw = y;}
|
||||||
void setRenderPitch(float p) {_renderPitch = p;}
|
void setRenderPitch(float p) {_renderPitch = p;}
|
||||||
|
@ -172,14 +166,8 @@ class Head : public AvatarData {
|
||||||
float getRenderPitch() {return _renderPitch;}
|
float getRenderPitch() {return _renderPitch;}
|
||||||
void setLeanForward(float dist);
|
void setLeanForward(float dist);
|
||||||
void setLeanSideways(float dist);
|
void setLeanSideways(float dist);
|
||||||
void addPitch(float p) {_head.pitch -= p; }
|
|
||||||
void addYaw(float y){_head.yaw -= y; }
|
|
||||||
void addRoll(float r){_head.roll += r; }
|
|
||||||
void addLean(float x, float z);
|
void addLean(float x, float z);
|
||||||
float getPitch() {return _head.pitch;}
|
float getLastMeasuredHeadYaw() const {return _head.yawRate;}
|
||||||
float getRoll() {return _head.roll;}
|
|
||||||
float getYaw() {return _head.yaw;}
|
|
||||||
float getLastMeasuredYaw() {return _head.yawRate;}
|
|
||||||
float getBodyYaw() {return _bodyYaw;};
|
float getBodyYaw() {return _bodyYaw;};
|
||||||
void addBodyYaw(float y) {_bodyYaw += y;};
|
void addBodyYaw(float y) {_bodyYaw += y;};
|
||||||
|
|
||||||
|
@ -195,19 +183,17 @@ class Head : public AvatarData {
|
||||||
AvatarMode getMode();
|
AvatarMode getMode();
|
||||||
|
|
||||||
void setMousePressed( bool pressed );
|
void setMousePressed( bool pressed );
|
||||||
void render(int faceToFace);
|
void render(bool lookingInMirror);
|
||||||
void renderBody();
|
void renderBody();
|
||||||
void renderHead( int faceToFace);
|
void renderHead(bool lookingInMirror);
|
||||||
void simulate(float);
|
void simulate(float);
|
||||||
void startHandMovement();
|
void startHandMovement();
|
||||||
void stopHandMovement();
|
void stopHandMovement();
|
||||||
void setHandMovementValues( glm::vec3 movement );
|
void setHandMovementValues( glm::vec3 movement );
|
||||||
void updateHandMovement();
|
void updateHandMovement();
|
||||||
|
|
||||||
float getLoudness() {return _head.loudness;};
|
|
||||||
float getAverageLoudness() {return _head.averageLoudness;};
|
float getAverageLoudness() {return _head.averageLoudness;};
|
||||||
void setAverageLoudness(float al) {_head.averageLoudness = al;};
|
void setAverageLoudness(float al) {_head.averageLoudness = al;};
|
||||||
void setLoudness(float l) {_head.loudness = l;};
|
|
||||||
|
|
||||||
bool testForCollision( glm::vec3 collisionPosition, float collisionGirth, float collisionHeight, glm::vec3 collisionUpVector );
|
bool testForCollision( glm::vec3 collisionPosition, float collisionGirth, float collisionHeight, glm::vec3 collisionUpVector );
|
||||||
|
|
||||||
|
|
|
@ -96,8 +96,6 @@ int packetsPerSecond = 0;
|
||||||
int bytesPerSecond = 0;
|
int bytesPerSecond = 0;
|
||||||
int bytesCount = 0;
|
int bytesCount = 0;
|
||||||
|
|
||||||
int headMirror = 1; // Whether to mirror own head when viewing it
|
|
||||||
|
|
||||||
int WIDTH = 1200; // Window size
|
int WIDTH = 1200; // Window size
|
||||||
int HEIGHT = 800;
|
int HEIGHT = 800;
|
||||||
int fullscreen = 0;
|
int fullscreen = 0;
|
||||||
|
@ -163,7 +161,7 @@ int noiseOn = 0; // Whether to add random noise
|
||||||
float noise = 1.0; // Overall magnitude scaling for random noise levels
|
float noise = 1.0; // Overall magnitude scaling for random noise levels
|
||||||
|
|
||||||
int displayLevels = 0;
|
int displayLevels = 0;
|
||||||
int displayHead = 0;
|
bool lookingInMirror = 0; // Are we currently rendering one's own head as if in mirror?
|
||||||
int displayField = 0;
|
int displayField = 0;
|
||||||
|
|
||||||
int displayHeadMouse = 1; // Display sample mouse pointer controlled by head movement
|
int displayHeadMouse = 1; // Display sample mouse pointer controlled by head movement
|
||||||
|
@ -459,7 +457,7 @@ void updateAvatar(float frametime)
|
||||||
float gyroPitchRate = serialPort.getRelativeValue(HEAD_PITCH_RATE);
|
float gyroPitchRate = serialPort.getRelativeValue(HEAD_PITCH_RATE);
|
||||||
float gyroYawRate = serialPort.getRelativeValue(HEAD_YAW_RATE );
|
float gyroYawRate = serialPort.getRelativeValue(HEAD_YAW_RATE );
|
||||||
|
|
||||||
myAvatar.UpdateGyros(frametime, &serialPort, headMirror, &gravity);
|
myAvatar.UpdateGyros(frametime, &serialPort, &gravity);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Update gyro-based mouse (X,Y on screen)
|
// Update gyro-based mouse (X,Y on screen)
|
||||||
|
@ -819,7 +817,7 @@ void display(void)
|
||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
// camera settings
|
// camera settings
|
||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
if ( displayHead ) {
|
if ( ::lookingInMirror ) {
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
// set the camera to looking at my own face
|
// set the camera to looking at my own face
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
|
@ -912,7 +910,7 @@ void display(void)
|
||||||
drawGroundPlaneGrid( 5.0f, 9 );
|
drawGroundPlaneGrid( 5.0f, 9 );
|
||||||
|
|
||||||
// Draw cloud of dots
|
// Draw cloud of dots
|
||||||
if (!displayHead) cloud.render();
|
if (!::lookingInMirror) cloud.render();
|
||||||
|
|
||||||
// Draw voxels
|
// Draw voxels
|
||||||
if ( showingVoxels )
|
if ( showingVoxels )
|
||||||
|
@ -934,16 +932,16 @@ void display(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !displayHead ) balls.render();
|
if ( !::lookingInMirror ) balls.render();
|
||||||
|
|
||||||
// Render the world box
|
// Render the world box
|
||||||
if (!displayHead && statsOn) render_world_box();
|
if (!::lookingInMirror && statsOn) render_world_box();
|
||||||
|
|
||||||
// brad's frustum for debugging
|
// brad's frustum for debugging
|
||||||
if (::frustumOn) renderViewFrustum(::viewFrustum);
|
if (::frustumOn) renderViewFrustum(::viewFrustum);
|
||||||
|
|
||||||
//Render my own avatar
|
//Render my own avatar
|
||||||
myAvatar.render(true);
|
myAvatar.render(::lookingInMirror);
|
||||||
}
|
}
|
||||||
|
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
@ -961,7 +959,7 @@ void display(void)
|
||||||
if (audioScope.getState()) audioScope.render();
|
if (audioScope.getState()) audioScope.render();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (displayHeadMouse && !displayHead && statsOn) {
|
if (displayHeadMouse && !::lookingInMirror && statsOn) {
|
||||||
// Display small target box at center or head mouse target that can also be used to measure LOD
|
// Display small target box at center or head mouse target that can also be used to measure LOD
|
||||||
glColor3f(1.0, 1.0, 1.0);
|
glColor3f(1.0, 1.0, 1.0);
|
||||||
glDisable(GL_LINE_SMOOTH);
|
glDisable(GL_LINE_SMOOTH);
|
||||||
|
@ -1057,7 +1055,7 @@ int setValue(int state, bool *value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int setHead(int state) {
|
int setHead(int state) {
|
||||||
return setValue(state, &displayHead);
|
return setValue(state, &::lookingInMirror);
|
||||||
}
|
}
|
||||||
|
|
||||||
int setField(int state) {
|
int setField(int state) {
|
||||||
|
@ -1090,10 +1088,6 @@ int setMenu(int state) {
|
||||||
return setValue(state, &::menuOn);
|
return setValue(state, &::menuOn);
|
||||||
}
|
}
|
||||||
|
|
||||||
int setMirror(int state) {
|
|
||||||
return setValue(state, &headMirror);
|
|
||||||
}
|
|
||||||
|
|
||||||
int setDisplayFrustum(int state) {
|
int setDisplayFrustum(int state) {
|
||||||
return setValue(state, &::frustumOn);
|
return setValue(state, &::frustumOn);
|
||||||
}
|
}
|
||||||
|
@ -1199,10 +1193,9 @@ void initMenu() {
|
||||||
MenuColumn *menuColumnOptions, *menuColumnTools, *menuColumnDebug, *menuColumnFrustum;
|
MenuColumn *menuColumnOptions, *menuColumnTools, *menuColumnDebug, *menuColumnFrustum;
|
||||||
// Options
|
// Options
|
||||||
menuColumnOptions = menu.addColumn("Options");
|
menuColumnOptions = menu.addColumn("Options");
|
||||||
menuColumnOptions->addRow("(H)ead", setHead);
|
menuColumnOptions->addRow("Mirror (h)", setHead);
|
||||||
menuColumnOptions->addRow("Field (f)", setField);
|
menuColumnOptions->addRow("Field (f)", setField);
|
||||||
menuColumnOptions->addRow("(N)oise", setNoise);
|
menuColumnOptions->addRow("(N)oise", setNoise);
|
||||||
menuColumnOptions->addRow("Mirror", setMirror);
|
|
||||||
menuColumnOptions->addRow("(V)oxels", setVoxels);
|
menuColumnOptions->addRow("(V)oxels", setVoxels);
|
||||||
menuColumnOptions->addRow("Stars (*)", setStars);
|
menuColumnOptions->addRow("Stars (*)", setStars);
|
||||||
menuColumnOptions->addRow("(Q)uit", quitApp);
|
menuColumnOptions->addRow("(Q)uit", quitApp);
|
||||||
|
@ -1411,9 +1404,9 @@ void key(unsigned char k, int x, int y)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (k == 'h') {
|
if (k == 'h') {
|
||||||
displayHead = !displayHead;
|
::lookingInMirror = !::lookingInMirror;
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
audio.setMixerLoopbackFlag(displayHead);
|
audio.setMixerLoopbackFlag(::lookingInMirror);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,9 +34,14 @@ int unpackFloatAngleFromTwoByte(uint16_t* byteAnglePointer, float* destinationPo
|
||||||
}
|
}
|
||||||
|
|
||||||
AvatarData::AvatarData() :
|
AvatarData::AvatarData() :
|
||||||
|
_handPosition(0,0,0),
|
||||||
_bodyYaw(-90.0),
|
_bodyYaw(-90.0),
|
||||||
_bodyPitch(0.0),
|
_bodyPitch(0.0),
|
||||||
_bodyRoll(0.0),
|
_bodyRoll(0.0),
|
||||||
|
_headYaw(0),
|
||||||
|
_headPitch(0),
|
||||||
|
_headRoll(0),
|
||||||
|
_handState(0),
|
||||||
_cameraPosition(0,0,0),
|
_cameraPosition(0,0,0),
|
||||||
_cameraDirection(0,0,0),
|
_cameraDirection(0,0,0),
|
||||||
_cameraUp(0,0,0),
|
_cameraUp(0,0,0),
|
||||||
|
@ -63,16 +68,32 @@ int AvatarData::getBroadcastData(unsigned char* destinationBuffer) {
|
||||||
// that can pack any type given the number of bytes
|
// that can pack any type given the number of bytes
|
||||||
// and return the number of bytes to push the pointer
|
// and return the number of bytes to push the pointer
|
||||||
|
|
||||||
|
// Body world position
|
||||||
memcpy(destinationBuffer, &_bodyPosition, sizeof(float) * 3);
|
memcpy(destinationBuffer, &_bodyPosition, sizeof(float) * 3);
|
||||||
destinationBuffer += sizeof(float) * 3;
|
destinationBuffer += sizeof(float) * 3;
|
||||||
|
|
||||||
|
// Body rotation (NOTE: This needs to become a quaternion to save two bytes)
|
||||||
destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _bodyYaw);
|
destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _bodyYaw);
|
||||||
destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _bodyPitch);
|
destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _bodyPitch);
|
||||||
destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _bodyRoll);
|
destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _bodyRoll);
|
||||||
|
|
||||||
|
// Head rotation (NOTE: This needs to become a quaternion to save two bytes)
|
||||||
|
destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _headYaw);
|
||||||
|
destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _headPitch);
|
||||||
|
destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _headRoll);
|
||||||
|
|
||||||
|
// Hand Position
|
||||||
memcpy(destinationBuffer, &_handPosition, sizeof(float) * 3);
|
memcpy(destinationBuffer, &_handPosition, sizeof(float) * 3);
|
||||||
destinationBuffer += sizeof(float) * 3;
|
destinationBuffer += sizeof(float) * 3;
|
||||||
|
|
||||||
|
// Hand State (0 = not grabbing, 1 = grabbing)
|
||||||
|
memcpy(destinationBuffer, &_handState, sizeof(char));
|
||||||
|
destinationBuffer += sizeof(char);
|
||||||
|
|
||||||
|
// Instantaneous audio loudness (used to drive facial animation)
|
||||||
|
memcpy(destinationBuffer, &_audioLoudness, sizeof(float));
|
||||||
|
destinationBuffer += sizeof(float);
|
||||||
|
|
||||||
// camera details
|
// camera details
|
||||||
memcpy(destinationBuffer, &_cameraPosition, sizeof(_cameraPosition));
|
memcpy(destinationBuffer, &_cameraPosition, sizeof(_cameraPosition));
|
||||||
destinationBuffer += sizeof(_cameraPosition);
|
destinationBuffer += sizeof(_cameraPosition);
|
||||||
|
@ -91,6 +112,7 @@ int AvatarData::getBroadcastData(unsigned char* destinationBuffer) {
|
||||||
memcpy(destinationBuffer, &_cameraFarClip, sizeof(_cameraFarClip));
|
memcpy(destinationBuffer, &_cameraFarClip, sizeof(_cameraFarClip));
|
||||||
destinationBuffer += sizeof(_cameraFarClip);
|
destinationBuffer += sizeof(_cameraFarClip);
|
||||||
|
|
||||||
|
|
||||||
return destinationBuffer - bufferStart;
|
return destinationBuffer - bufferStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,16 +124,32 @@ int AvatarData::parseData(unsigned char* sourceBuffer, int numBytes) {
|
||||||
|
|
||||||
unsigned char* startPosition = sourceBuffer;
|
unsigned char* startPosition = sourceBuffer;
|
||||||
|
|
||||||
|
// Body world position
|
||||||
memcpy(&_bodyPosition, sourceBuffer, sizeof(float) * 3);
|
memcpy(&_bodyPosition, sourceBuffer, sizeof(float) * 3);
|
||||||
sourceBuffer += sizeof(float) * 3;
|
sourceBuffer += sizeof(float) * 3;
|
||||||
|
|
||||||
|
// Body rotation (NOTE: This needs to become a quaternion to save two bytes)
|
||||||
sourceBuffer += unpackFloatAngleFromTwoByte((uint16_t *)sourceBuffer, &_bodyYaw);
|
sourceBuffer += unpackFloatAngleFromTwoByte((uint16_t *)sourceBuffer, &_bodyYaw);
|
||||||
sourceBuffer += unpackFloatAngleFromTwoByte((uint16_t *)sourceBuffer, &_bodyPitch);
|
sourceBuffer += unpackFloatAngleFromTwoByte((uint16_t *)sourceBuffer, &_bodyPitch);
|
||||||
sourceBuffer += unpackFloatAngleFromTwoByte((uint16_t *)sourceBuffer, &_bodyRoll);
|
sourceBuffer += unpackFloatAngleFromTwoByte((uint16_t *)sourceBuffer, &_bodyRoll);
|
||||||
|
|
||||||
|
// Head rotation (NOTE: This needs to become a quaternion to save two bytes)
|
||||||
|
sourceBuffer += unpackFloatAngleFromTwoByte((uint16_t *)sourceBuffer, &_headYaw);
|
||||||
|
sourceBuffer += unpackFloatAngleFromTwoByte((uint16_t *)sourceBuffer, &_headPitch);
|
||||||
|
sourceBuffer += unpackFloatAngleFromTwoByte((uint16_t *)sourceBuffer, &_headRoll);
|
||||||
|
|
||||||
|
// Hand Position
|
||||||
memcpy(&_handPosition, sourceBuffer, sizeof(float) * 3);
|
memcpy(&_handPosition, sourceBuffer, sizeof(float) * 3);
|
||||||
sourceBuffer += sizeof(float) * 3;
|
sourceBuffer += sizeof(float) * 3;
|
||||||
|
|
||||||
|
// Hand State
|
||||||
|
memcpy(&_handState, sourceBuffer, sizeof(char));
|
||||||
|
sourceBuffer += sizeof(char);
|
||||||
|
|
||||||
|
// Instantaneous audio loudness (used to drive facial animation)
|
||||||
|
memcpy(&_audioLoudness, sourceBuffer, sizeof(float));
|
||||||
|
sourceBuffer += sizeof(float);
|
||||||
|
|
||||||
// camera details
|
// camera details
|
||||||
memcpy(&_cameraPosition, sourceBuffer, sizeof(_cameraPosition));
|
memcpy(&_cameraPosition, sourceBuffer, sizeof(_cameraPosition));
|
||||||
sourceBuffer += sizeof(_cameraPosition);
|
sourceBuffer += sizeof(_cameraPosition);
|
||||||
|
|
|
@ -27,15 +27,33 @@ public:
|
||||||
int getBroadcastData(unsigned char* destinationBuffer);
|
int getBroadcastData(unsigned char* destinationBuffer);
|
||||||
int parseData(unsigned char* sourceBuffer, int numBytes);
|
int parseData(unsigned char* sourceBuffer, int numBytes);
|
||||||
|
|
||||||
|
// Body Rotation
|
||||||
float getBodyYaw();
|
float getBodyYaw();
|
||||||
void setBodyYaw(float bodyYaw);
|
|
||||||
|
|
||||||
float getBodyPitch();
|
float getBodyPitch();
|
||||||
void setBodyPitch(float bodyPitch);
|
|
||||||
|
|
||||||
float getBodyRoll();
|
float getBodyRoll();
|
||||||
|
void setBodyYaw(float bodyYaw);
|
||||||
|
void setBodyPitch(float bodyPitch);
|
||||||
void setBodyRoll(float bodyRoll);
|
void setBodyRoll(float bodyRoll);
|
||||||
|
|
||||||
|
// Head Rotation
|
||||||
|
void setHeadPitch(float p) {_headPitch = p; }
|
||||||
|
void setHeadYaw(float y) {_headYaw = y; }
|
||||||
|
void setHeadRoll(float r) {_headRoll = r; };
|
||||||
|
const float getHeadPitch() const { return _headPitch; };
|
||||||
|
const float getHeadYaw() const { return _headYaw; };
|
||||||
|
const float getHeadRoll() const { return _headRoll; };
|
||||||
|
void addHeadPitch(float p) {_headPitch -= p; }
|
||||||
|
void addHeadYaw(float y){_headYaw -= y; }
|
||||||
|
void addHeadRoll(float r){_headRoll += r; }
|
||||||
|
|
||||||
|
// Hand State
|
||||||
|
void setHandState(char s) { _handState = s; };
|
||||||
|
const float getHandState() const {return _handState; };
|
||||||
|
|
||||||
|
// Instantaneous audio loudness to drive mouth/facial animation
|
||||||
|
void setLoudness(float l) { _audioLoudness = l; };
|
||||||
|
const float getLoudness() const {return _audioLoudness; };
|
||||||
|
|
||||||
// getters for camera details
|
// getters for camera details
|
||||||
const glm::vec3& getCameraPosition() const { return _cameraPosition; };
|
const glm::vec3& getCameraPosition() const { return _cameraPosition; };
|
||||||
const glm::vec3& getCameraDirection() const { return _cameraDirection; }
|
const glm::vec3& getCameraDirection() const { return _cameraDirection; }
|
||||||
|
@ -60,10 +78,22 @@ protected:
|
||||||
glm::vec3 _bodyPosition;
|
glm::vec3 _bodyPosition;
|
||||||
glm::vec3 _handPosition;
|
glm::vec3 _handPosition;
|
||||||
|
|
||||||
|
// Body rotation
|
||||||
float _bodyYaw;
|
float _bodyYaw;
|
||||||
float _bodyPitch;
|
float _bodyPitch;
|
||||||
float _bodyRoll;
|
float _bodyRoll;
|
||||||
|
|
||||||
|
// Head rotation (relative to body)
|
||||||
|
float _headYaw;
|
||||||
|
float _headPitch;
|
||||||
|
float _headRoll;
|
||||||
|
|
||||||
|
// Audio loudness (used to drive facial animation)
|
||||||
|
float _audioLoudness;
|
||||||
|
|
||||||
|
// Hand state (are we grabbing something or not)
|
||||||
|
char _handState;
|
||||||
|
|
||||||
// camera details for the avatar
|
// camera details for the avatar
|
||||||
glm::vec3 _cameraPosition;
|
glm::vec3 _cameraPosition;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue