History

Let's try subtracting the long-term average from the eye directions.

Andrzej Kapolka committed 13 years ago

Commit f8aee881 parent 8fec78d3 files · +33 −7Browse files

Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all

Unified · Split

interface/src/Application.cpp+5−6
@@ -1531,14 +1531,15 @@ void Application::update(float deltaTime) { · 1530 unmodified lines
15311531 // Set where I am looking based on my mouse ray (so that other people can see)
15321532 glm::vec3 lookAtSpot;
15331533
1534+ // Update faceshift
1535+ _faceshift.update();
1536+
15341537 // if we have faceshift, use that to compute the lookat direction
15351538 glm::vec3 lookAtRayOrigin = mouseRayOrigin, lookAtRayDirection = mouseRayDirection;
15361539 if (_faceshift.isActive()) {
15371540 lookAtRayOrigin = _myAvatar.getHead().calculateAverageEyePosition();
1538− float averagePitch = (_faceshift.getEyeGazeLeftPitch() + _faceshift.getEyeGazeRightPitch()) / 2.0f;
1539− float averageYaw = (_faceshift.getEyeGazeLeftYaw() + _faceshift.getEyeGazeRightYaw()) / 2.0f;
1540− lookAtRayDirection = _myAvatar.getHead().getOrientation() *
1541− glm::quat(glm::radians(glm::vec3(averagePitch, averageYaw, 0.0f))) * glm::vec3(0.0f, 0.0f, -1.0f);
1541+ lookAtRayDirection = _myAvatar.getHead().getOrientation() * glm::quat(glm::radians(glm::vec3(
1542+ _faceshift.getEstimatedEyePitch(), _faceshift.getEstimatedEyeYaw(), 0.0f))) * glm::vec3(0.0f, 0.0f, -1.0f);
15421543 }
15431544
15441545 _isLookingAtOtherAvatar = isLookingAtOtherAvatar(lookAtRayOrigin, lookAtRayDirection, lookAtSpot);
@@ -1707,8 +1708,6 @@ void Application::update(float deltaTime) { · 162 unmodified lines
17071708 _serialHeadSensor.readData(deltaTime);
17081709 }
17091710
1710− // Update transmitter
1711−
17121711 // Sample hardware, update view frustum if needed, and send avatar data to mixer/nodes
17131712 updateAvatar(deltaTime);
17141713

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t