mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 10:09:05 +02:00
Merge branch 'master' of https://github.com/worklist/hifi into dev4
This commit is contained in:
commit
fd2009738b
4 changed files with 11 additions and 12 deletions
|
@ -363,7 +363,7 @@ void Application::paintGL() {
|
||||||
glEnable(GL_LINE_SMOOTH);
|
glEnable(GL_LINE_SMOOTH);
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
float headCameraScale = _serialHeadSensor.isActive() ? _headCameraPitchYawScale : 1.0f;
|
float headCameraScale = (_serialHeadSensor.isActive() || _webcam.isActive()) ? _headCameraPitchYawScale : 1.0f;
|
||||||
|
|
||||||
if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
|
if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
|
||||||
_myCamera.setTightness (100.0f);
|
_myCamera.setTightness (100.0f);
|
||||||
|
@ -432,6 +432,9 @@ void Application::paintGL() {
|
||||||
void Application::resizeGL(int width, int height) {
|
void Application::resizeGL(int width, int height) {
|
||||||
float aspectRatio = ((float)width/(float)height); // based on screen resize
|
float aspectRatio = ((float)width/(float)height); // based on screen resize
|
||||||
|
|
||||||
|
// reset the camera FOV to our preference...
|
||||||
|
_myCamera.setFieldOfView(_horizontalFieldOfView);
|
||||||
|
|
||||||
// get the lens details from the current camera
|
// get the lens details from the current camera
|
||||||
Camera& camera = _viewFrustumFromOffset->isChecked() ? _viewFrustumOffsetCamera : _myCamera;
|
Camera& camera = _viewFrustumFromOffset->isChecked() ? _viewFrustumOffsetCamera : _myCamera;
|
||||||
float nearClip = camera.getNearClip();
|
float nearClip = camera.getNearClip();
|
||||||
|
|
|
@ -286,15 +286,17 @@ void Avatar::reset() {
|
||||||
|
|
||||||
// Update avatar head rotation with sensor data
|
// Update avatar head rotation with sensor data
|
||||||
void Avatar::updateHeadFromGyrosAndOrWebcam() {
|
void Avatar::updateHeadFromGyrosAndOrWebcam() {
|
||||||
const float AMPLIFY_PITCH = 1.f;
|
const float AMPLIFY_PITCH = 2.f;
|
||||||
const float AMPLIFY_YAW = 1.f;
|
const float AMPLIFY_YAW = 2.f;
|
||||||
const float AMPLIFY_ROLL = 1.f;
|
const float AMPLIFY_ROLL = 2.f;
|
||||||
|
|
||||||
SerialInterface* gyros = Application::getInstance()->getSerialHeadSensor();
|
SerialInterface* gyros = Application::getInstance()->getSerialHeadSensor();
|
||||||
Webcam* webcam = Application::getInstance()->getWebcam();
|
Webcam* webcam = Application::getInstance()->getWebcam();
|
||||||
glm::vec3 estimatedPosition, estimatedRotation;
|
glm::vec3 estimatedPosition, estimatedRotation;
|
||||||
if (gyros->isActive()) {
|
if (gyros->isActive()) {
|
||||||
estimatedPosition = gyros->getEstimatedPosition();
|
if (webcam->isActive()) {
|
||||||
|
estimatedPosition = webcam->getEstimatedPosition();
|
||||||
|
}
|
||||||
estimatedRotation = gyros->getEstimatedRotation();
|
estimatedRotation = gyros->getEstimatedRotation();
|
||||||
|
|
||||||
} else if (webcam->isActive()) {
|
} else if (webcam->isActive()) {
|
||||||
|
|
|
@ -179,7 +179,7 @@ void Head::simulate(float deltaTime, bool isMine) {
|
||||||
_browAudioLift *= 0.7f;
|
_browAudioLift *= 0.7f;
|
||||||
|
|
||||||
// update eyelid blinking
|
// update eyelid blinking
|
||||||
const float BLINK_SPEED = 5.0f;
|
const float BLINK_SPEED = 10.0f;
|
||||||
const float FULLY_OPEN = 0.0f;
|
const float FULLY_OPEN = 0.0f;
|
||||||
const float FULLY_CLOSED = 1.0f;
|
const float FULLY_CLOSED = 1.0f;
|
||||||
if (_leftEyeBlinkVelocity == 0.0f && _rightEyeBlinkVelocity == 0.0f) {
|
if (_leftEyeBlinkVelocity == 0.0f && _rightEyeBlinkVelocity == 0.0f) {
|
||||||
|
|
|
@ -341,12 +341,6 @@ void SerialInterface::readData(float deltaTime) {
|
||||||
|
|
||||||
_estimatedRotation = safeEulerAngles(estimatedRotation);
|
_estimatedRotation = safeEulerAngles(estimatedRotation);
|
||||||
|
|
||||||
// Fuse gyro roll with webcam roll
|
|
||||||
if (webcam->isActive()) {
|
|
||||||
_estimatedRotation.z = glm::mix(_estimatedRotation.z, webcam->getEstimatedRotation().z,
|
|
||||||
1.0f / SENSOR_FUSION_SAMPLES);
|
|
||||||
}
|
|
||||||
|
|
||||||
totalSamples++;
|
totalSamples++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue