mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 23:36:41 +02:00
cleaned up some code
This commit is contained in:
parent
f1346604f4
commit
ab9fa0a556
4 changed files with 31 additions and 34 deletions
|
@ -461,6 +461,7 @@ void Avatar::simulate(float deltaTime) {
|
|||
_joint[ AVATAR_JOINT_RIGHT_FINGERTIPS ].springyPosition += headLean * 0.0f;
|
||||
}
|
||||
|
||||
|
||||
// update head state
|
||||
_head.setPositionRotationAndScale(
|
||||
_joint[ AVATAR_JOINT_HEAD_BASE ].springyPosition,
|
||||
|
@ -880,7 +881,6 @@ void Avatar::render(bool lookingInMirror, glm::vec3 cameraPosition) {
|
|||
|
||||
// render head
|
||||
if (_displayingHead) {
|
||||
//renderHead(lookingInMirror);
|
||||
_head.render(lookingInMirror, _bodyYaw);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,10 +3,8 @@
|
|||
// hifi
|
||||
//
|
||||
// Created by Jeffrey on May, 10, 2013
|
||||
// Copyright (c) 2013 Physical, Inc.. All rights reserved.
|
||||
//
|
||||
// To avoid code bloat in Avatar.cpp, and to keep all head-related code in one place,
|
||||
// I have started moving the head code over to its own class. But it's gonna require
|
||||
// some work - so this is not done yet.
|
||||
|
||||
#include "Head.h"
|
||||
#include <vector>
|
||||
|
|
|
@ -3,10 +3,8 @@
|
|||
// hifi
|
||||
//
|
||||
// Created by Jeffrey on May, 10, 2013
|
||||
// Copyright (c) 2013 Physical, Inc.. All rights reserved.
|
||||
//
|
||||
// To avoid code bloat in Avatar.cpp, and to keep all head-related code in one place,
|
||||
// I have started moving the head code over to its own class. But it's gonna require
|
||||
// some work - so this is not done yet.
|
||||
|
||||
#ifndef hifi_Head_h
|
||||
#define hifi_Head_h
|
||||
|
@ -18,7 +16,6 @@
|
|||
#include "InterfaceConfig.h"
|
||||
#include "SerialInterface.h"
|
||||
|
||||
|
||||
enum eyeContactTargets {LEFT_EYE, RIGHT_EYE, MOUTH};
|
||||
|
||||
class Head {
|
||||
|
@ -89,7 +86,6 @@ public:
|
|||
|
||||
GLUquadric* sphere;
|
||||
|
||||
|
||||
// Strength of return springs
|
||||
float returnSpringScale;
|
||||
};
|
||||
|
|
|
@ -105,6 +105,7 @@ int HEIGHT = 800;
|
|||
int fullscreen = 0;
|
||||
float aspectRatio = 1.0f;
|
||||
|
||||
bool USING_MOUSE_VIEW_SHIFT = false;
|
||||
float MOUSE_VIEW_SHIFT_RATE = 40.0f;
|
||||
float MOUSE_VIEW_SHIFT_YAW_MARGIN = (float)(WIDTH * 0.2f);
|
||||
float MOUSE_VIEW_SHIFT_PITCH_MARGIN = (float)(HEIGHT * 0.2f);
|
||||
|
@ -417,6 +418,8 @@ void updateAvatar(float deltaTime) {
|
|||
}
|
||||
|
||||
|
||||
if (USING_MOUSE_VIEW_SHIFT)
|
||||
{
|
||||
//make it so that when your mouse hits the edge of the screen, the camera shifts
|
||||
float rightBoundary = (float)WIDTH - MOUSE_VIEW_SHIFT_YAW_MARGIN;
|
||||
float bottomBoundary = (float)HEIGHT - MOUSE_VIEW_SHIFT_PITCH_MARGIN;
|
||||
|
@ -440,7 +443,7 @@ void updateAvatar(float deltaTime) {
|
|||
mouseViewShiftPitch -= MOUSE_VIEW_SHIFT_RATE * f * deltaTime;
|
||||
if (mouseViewShiftPitch < -MOUSE_VIEW_SHIFT_PITCH_LIMIT) { mouseViewShiftPitch = -MOUSE_VIEW_SHIFT_PITCH_LIMIT; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (OculusManager::isConnected()) {
|
||||
float yaw, pitch, roll;
|
||||
|
|
Loading…
Reference in a new issue