mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-08 21:36:52 +02:00
Merge branch 'master' of https://github.com/worklist/hifi into noculus
This commit is contained in:
commit
e84f5a59aa
10 changed files with 53 additions and 37 deletions
|
@ -3704,7 +3704,7 @@ void Application::renderAvatars(bool forceRenderHead, bool selfAvatarOnly) {
|
||||||
if (!avatar->isInitialized()) {
|
if (!avatar->isInitialized()) {
|
||||||
avatar->init();
|
avatar->init();
|
||||||
}
|
}
|
||||||
avatar->render(false, Menu::getInstance()->isOptionChecked(MenuOption::AvatarAsBalls));
|
avatar->render(false);
|
||||||
avatar->setDisplayingLookatVectors(Menu::getInstance()->isOptionChecked(MenuOption::LookAtVectors));
|
avatar->setDisplayingLookatVectors(Menu::getInstance()->isOptionChecked(MenuOption::LookAtVectors));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3714,12 +3714,12 @@ void Application::renderAvatars(bool forceRenderHead, bool selfAvatarOnly) {
|
||||||
// render avatar fades
|
// render avatar fades
|
||||||
Glower glower;
|
Glower glower;
|
||||||
for (vector<Avatar*>::iterator fade = _avatarFades.begin(); fade != _avatarFades.end(); fade++) {
|
for (vector<Avatar*>::iterator fade = _avatarFades.begin(); fade != _avatarFades.end(); fade++) {
|
||||||
(*fade)->render(false, Menu::getInstance()->isOptionChecked(MenuOption::AvatarAsBalls));
|
(*fade)->render(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render my own Avatar
|
// Render my own Avatar
|
||||||
_myAvatar.render(forceRenderHead, Menu::getInstance()->isOptionChecked(MenuOption::AvatarAsBalls));
|
_myAvatar.render(forceRenderHead);
|
||||||
_myAvatar.setDisplayingLookatVectors(Menu::getInstance()->isOptionChecked(MenuOption::LookAtVectors));
|
_myAvatar.setDisplayingLookatVectors(Menu::getInstance()->isOptionChecked(MenuOption::LookAtVectors));
|
||||||
|
|
||||||
if (Menu::getInstance()->isOptionChecked(MenuOption::LookAtIndicator) && _lookatTargetAvatar) {
|
if (Menu::getInstance()->isOptionChecked(MenuOption::LookAtIndicator) && _lookatTargetAvatar) {
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "DataServerClient.h"
|
#include "DataServerClient.h"
|
||||||
#include "Hand.h"
|
#include "Hand.h"
|
||||||
#include "Head.h"
|
#include "Head.h"
|
||||||
|
#include "Menu.h"
|
||||||
#include "Physics.h"
|
#include "Physics.h"
|
||||||
#include "world.h"
|
#include "world.h"
|
||||||
#include "devices/OculusManager.h"
|
#include "devices/OculusManager.h"
|
||||||
|
@ -394,7 +395,7 @@ void Avatar::simulate(float deltaTime, Transmitter* transmitter) {
|
||||||
_skeletonModel.simulate(deltaTime);
|
_skeletonModel.simulate(deltaTime);
|
||||||
_head.setBodyRotation(glm::vec3(_bodyPitch, _bodyYaw, _bodyRoll));
|
_head.setBodyRotation(glm::vec3(_bodyPitch, _bodyYaw, _bodyRoll));
|
||||||
glm::vec3 headPosition;
|
glm::vec3 headPosition;
|
||||||
if (!_skeletonModel.getHeadPosition(headPosition)) {
|
if (Menu::getInstance()->isOptionChecked(MenuOption::AvatarAsBalls) || !_skeletonModel.getHeadPosition(headPosition)) {
|
||||||
headPosition = _bodyBall[BODY_BALL_HEAD_BASE].position;
|
headPosition = _bodyBall[BODY_BALL_HEAD_BASE].position;
|
||||||
}
|
}
|
||||||
_head.setPosition(headPosition);
|
_head.setPosition(headPosition);
|
||||||
|
@ -439,7 +440,7 @@ static TextRenderer* textRenderer() {
|
||||||
return renderer;
|
return renderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Avatar::render(bool forceRenderHead, bool renderAvatarBalls) {
|
void Avatar::render(bool forceRenderHead) {
|
||||||
|
|
||||||
if (Application::getInstance()->getAvatar()->getHand().isRaveGloveActive()) {
|
if (Application::getInstance()->getAvatar()->getHand().isRaveGloveActive()) {
|
||||||
_hand.setRaveLights(RAVE_LIGHTS_AVATAR);
|
_hand.setRaveLights(RAVE_LIGHTS_AVATAR);
|
||||||
|
@ -455,7 +456,7 @@ void Avatar::render(bool forceRenderHead, bool renderAvatarBalls) {
|
||||||
Glower glower(_moving && glm::length(toTarget) > GLOW_DISTANCE ? 1.0f : 0.0f);
|
Glower glower(_moving && glm::length(toTarget) > GLOW_DISTANCE ? 1.0f : 0.0f);
|
||||||
|
|
||||||
// render body
|
// render body
|
||||||
renderBody(forceRenderHead, renderAvatarBalls);
|
renderBody(forceRenderHead);
|
||||||
|
|
||||||
// render sphere when far away
|
// render sphere when far away
|
||||||
const float MAX_ANGLE = 10.f;
|
const float MAX_ANGLE = 10.f;
|
||||||
|
@ -666,7 +667,8 @@ void Avatar::updateArmIKAndConstraints(float deltaTime, AvatarJointID fingerTipJ
|
||||||
float distance = glm::length(armVector);
|
float distance = glm::length(armVector);
|
||||||
|
|
||||||
// don't let right hand get dragged beyond maximum arm length...
|
// don't let right hand get dragged beyond maximum arm length...
|
||||||
float armLength = _skeletonModel.isActive() ? _skeletonModel.getRightArmLength() : _skeleton.getArmLength();
|
float armLength = (_skeletonModel.isActive() && !Menu::getInstance()->isOptionChecked(MenuOption::AvatarAsBalls)) ?
|
||||||
|
_skeletonModel.getRightArmLength() : _skeleton.getArmLength();
|
||||||
const float ARM_RETRACTION = 0.75f;
|
const float ARM_RETRACTION = 0.75f;
|
||||||
float retractedArmLength = armLength * ARM_RETRACTION;
|
float retractedArmLength = armLength * ARM_RETRACTION;
|
||||||
if (distance > retractedArmLength) {
|
if (distance > retractedArmLength) {
|
||||||
|
@ -713,7 +715,7 @@ float Avatar::getBallRenderAlpha(int ball, bool forceRenderHead) const {
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Avatar::renderBody(bool forceRenderHead, bool renderAvatarBalls) {
|
void Avatar::renderBody(bool forceRenderHead) {
|
||||||
|
|
||||||
if (_head.getVideoFace().isFullFrame()) {
|
if (_head.getVideoFace().isFullFrame()) {
|
||||||
// Render the full-frame video
|
// Render the full-frame video
|
||||||
|
@ -721,7 +723,7 @@ void Avatar::renderBody(bool forceRenderHead, bool renderAvatarBalls) {
|
||||||
if (alpha > 0.0f) {
|
if (alpha > 0.0f) {
|
||||||
_head.getVideoFace().render(1.0f);
|
_head.getVideoFace().render(1.0f);
|
||||||
}
|
}
|
||||||
} else if (renderAvatarBalls || !(_voxels.getVoxelURL().isValid() || _skeletonModel.isActive())) {
|
} else if (Menu::getInstance()->isOptionChecked(MenuOption::AvatarAsBalls)) {
|
||||||
// Render the body as balls and cones
|
// Render the body as balls and cones
|
||||||
glm::vec3 skinColor, darkSkinColor;
|
glm::vec3 skinColor, darkSkinColor;
|
||||||
getSkinColors(skinColor, darkSkinColor);
|
getSkinColors(skinColor, darkSkinColor);
|
||||||
|
@ -738,7 +740,7 @@ void Avatar::renderBody(bool forceRenderHead, bool renderAvatarBalls) {
|
||||||
// Always render other people, and render myself when beyond threshold distance
|
// Always render other people, and render myself when beyond threshold distance
|
||||||
if (b == BODY_BALL_HEAD_BASE) { // the head is rendered as a special
|
if (b == BODY_BALL_HEAD_BASE) { // the head is rendered as a special
|
||||||
if (alpha > 0.0f) {
|
if (alpha > 0.0f) {
|
||||||
_head.render(alpha, false);
|
_head.render(alpha, true);
|
||||||
}
|
}
|
||||||
} else if (alpha > 0.0f) {
|
} else if (alpha > 0.0f) {
|
||||||
// Render the body ball sphere
|
// Render the body ball sphere
|
||||||
|
@ -746,10 +748,6 @@ void Avatar::renderBody(bool forceRenderHead, bool renderAvatarBalls) {
|
||||||
skinColor.g - _bodyBall[b].touchForce * 0.2f,
|
skinColor.g - _bodyBall[b].touchForce * 0.2f,
|
||||||
skinColor.b - _bodyBall[b].touchForce * 0.1f);
|
skinColor.b - _bodyBall[b].touchForce * 0.1f);
|
||||||
|
|
||||||
if (b == BODY_BALL_NECK_BASE && _head.getFaceModel().isActive()) {
|
|
||||||
continue; // don't render the neck if we have a face model
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((b != BODY_BALL_HEAD_TOP )
|
if ((b != BODY_BALL_HEAD_TOP )
|
||||||
&& (b != BODY_BALL_HEAD_BASE )) {
|
&& (b != BODY_BALL_HEAD_BASE )) {
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
@ -793,7 +791,7 @@ void Avatar::renderBody(bool forceRenderHead, bool renderAvatarBalls) {
|
||||||
void Avatar::getSkinColors(glm::vec3& lighter, glm::vec3& darker) {
|
void Avatar::getSkinColors(glm::vec3& lighter, glm::vec3& darker) {
|
||||||
lighter = glm::vec3(SKIN_COLOR[0], SKIN_COLOR[1], SKIN_COLOR[2]);
|
lighter = glm::vec3(SKIN_COLOR[0], SKIN_COLOR[1], SKIN_COLOR[2]);
|
||||||
darker = glm::vec3(DARK_SKIN_COLOR[0], DARK_SKIN_COLOR[1], DARK_SKIN_COLOR[2]);
|
darker = glm::vec3(DARK_SKIN_COLOR[0], DARK_SKIN_COLOR[1], DARK_SKIN_COLOR[2]);
|
||||||
if (_head.getFaceModel().isActive()) {
|
if (!Menu::getInstance()->isOptionChecked(MenuOption::AvatarAsBalls) && _head.getFaceModel().isActive()) {
|
||||||
lighter = glm::vec3(_head.getFaceModel().computeAverageColor());
|
lighter = glm::vec3(_head.getFaceModel().computeAverageColor());
|
||||||
const float SKIN_DARKENING = 0.9f;
|
const float SKIN_DARKENING = 0.9f;
|
||||||
darker = lighter * SKIN_DARKENING;
|
darker = lighter * SKIN_DARKENING;
|
||||||
|
|
|
@ -141,7 +141,7 @@ public:
|
||||||
void init();
|
void init();
|
||||||
void simulate(float deltaTime, Transmitter* transmitter);
|
void simulate(float deltaTime, Transmitter* transmitter);
|
||||||
void follow(Avatar* leadingAvatar);
|
void follow(Avatar* leadingAvatar);
|
||||||
void render(bool forceRenderHead, bool renderAvatarBalls);
|
void render(bool forceRenderHead);
|
||||||
|
|
||||||
//setters
|
//setters
|
||||||
void setDisplayingLookatVectors(bool displayingLookatVectors) { _head.setRenderLookatVectors(displayingLookatVectors); }
|
void setDisplayingLookatVectors(bool displayingLookatVectors) { _head.setRenderLookatVectors(displayingLookatVectors); }
|
||||||
|
@ -256,7 +256,7 @@ private:
|
||||||
// private methods...
|
// private methods...
|
||||||
glm::vec3 calculateAverageEyePosition() { return _head.calculateAverageEyePosition(); } // get the position smack-dab between the eyes (for lookat)
|
glm::vec3 calculateAverageEyePosition() { return _head.calculateAverageEyePosition(); } // get the position smack-dab between the eyes (for lookat)
|
||||||
float getBallRenderAlpha(int ball, bool forceRenderHead) const;
|
float getBallRenderAlpha(int ball, bool forceRenderHead) const;
|
||||||
void renderBody(bool forceRenderHead, bool renderAvatarBalls);
|
void renderBody(bool forceRenderHead);
|
||||||
void initializeBodyBalls();
|
void initializeBodyBalls();
|
||||||
void resetBodyBalls();
|
void resetBodyBalls();
|
||||||
void updateHandMovementAndTouching(float deltaTime, bool enableHandMovement);
|
void updateHandMovementAndTouching(float deltaTime, bool enableHandMovement);
|
||||||
|
|
|
@ -250,7 +250,9 @@ void Head::simulate(float deltaTime, bool isMine) {
|
||||||
calculateGeometry();
|
calculateGeometry();
|
||||||
|
|
||||||
// the blend face may have custom eye meshes
|
// the blend face may have custom eye meshes
|
||||||
_faceModel.getEyePositions(_leftEyePosition, _rightEyePosition);
|
if (!Menu::getInstance()->isOptionChecked(MenuOption::AvatarAsBalls)) {
|
||||||
|
_faceModel.getEyePositions(_leftEyePosition, _rightEyePosition);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Head::calculateGeometry() {
|
void Head::calculateGeometry() {
|
||||||
|
@ -295,10 +297,11 @@ void Head::calculateGeometry() {
|
||||||
+ up * _scale * NOSE_UPTURN;
|
+ up * _scale * NOSE_UPTURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Head::render(float alpha, bool isMine) {
|
void Head::render(float alpha, bool renderAvatarBalls) {
|
||||||
_renderAlpha = alpha;
|
_renderAlpha = alpha;
|
||||||
|
|
||||||
if (!(_videoFace.render(alpha) || _faceModel.render(alpha))) {
|
bool lookatVectorsVisible = _renderLookatVectors;
|
||||||
|
if (renderAvatarBalls) {
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
glEnable(GL_RESCALE_NORMAL);
|
glEnable(GL_RESCALE_NORMAL);
|
||||||
|
|
||||||
|
@ -309,9 +312,12 @@ void Head::render(float alpha, bool isMine) {
|
||||||
renderMouth();
|
renderMouth();
|
||||||
renderNose();
|
renderNose();
|
||||||
renderEyeBrows();
|
renderEyeBrows();
|
||||||
|
|
||||||
|
} else if (!_videoFace.render(alpha)) {
|
||||||
|
lookatVectorsVisible &= _faceModel.render(alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_renderLookatVectors) {
|
if (lookatVectorsVisible) {
|
||||||
renderLookatVectors(_leftEyePosition, _rightEyePosition, _lookAtPosition);
|
renderLookatVectors(_leftEyePosition, _rightEyePosition, _lookAtPosition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ public:
|
||||||
void init();
|
void init();
|
||||||
void reset();
|
void reset();
|
||||||
void simulate(float deltaTime, bool isMine);
|
void simulate(float deltaTime, bool isMine);
|
||||||
void render(float alpha, bool isMine);
|
void render(float alpha, bool renderAvatarBalls);
|
||||||
void renderMohawk();
|
void renderMohawk();
|
||||||
|
|
||||||
void setScale(float scale);
|
void setScale(float scale);
|
||||||
|
|
|
@ -325,7 +325,7 @@ void MyAvatar::simulate(float deltaTime, Transmitter* transmitter) {
|
||||||
_skeletonModel.simulate(deltaTime);
|
_skeletonModel.simulate(deltaTime);
|
||||||
_head.setBodyRotation(glm::vec3(_bodyPitch, _bodyYaw, _bodyRoll));
|
_head.setBodyRotation(glm::vec3(_bodyPitch, _bodyYaw, _bodyRoll));
|
||||||
glm::vec3 headPosition;
|
glm::vec3 headPosition;
|
||||||
if (!_skeletonModel.getHeadPosition(headPosition)) {
|
if (Menu::getInstance()->isOptionChecked(MenuOption::AvatarAsBalls) || !_skeletonModel.getHeadPosition(headPosition)) {
|
||||||
headPosition = _bodyBall[BODY_BALL_HEAD_BASE].position;
|
headPosition = _bodyBall[BODY_BALL_HEAD_BASE].position;
|
||||||
}
|
}
|
||||||
_head.setPosition(headPosition);
|
_head.setPosition(headPosition);
|
||||||
|
@ -497,7 +497,7 @@ static TextRenderer* textRenderer() {
|
||||||
return renderer;
|
return renderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::render(bool forceRenderHead, bool renderAvatarBalls) {
|
void MyAvatar::render(bool forceRenderHead) {
|
||||||
|
|
||||||
if (Application::getInstance()->getAvatar()->getHand().isRaveGloveActive()) {
|
if (Application::getInstance()->getAvatar()->getHand().isRaveGloveActive()) {
|
||||||
_hand.setRaveLights(RAVE_LIGHTS_AVATAR);
|
_hand.setRaveLights(RAVE_LIGHTS_AVATAR);
|
||||||
|
@ -507,7 +507,7 @@ void MyAvatar::render(bool forceRenderHead, bool renderAvatarBalls) {
|
||||||
renderDiskShadow(_position, glm::vec3(0.0f, 1.0f, 0.0f), _scale * 0.1f, 0.2f);
|
renderDiskShadow(_position, glm::vec3(0.0f, 1.0f, 0.0f), _scale * 0.1f, 0.2f);
|
||||||
|
|
||||||
// render body
|
// render body
|
||||||
renderBody(forceRenderHead, renderAvatarBalls);
|
renderBody(forceRenderHead);
|
||||||
|
|
||||||
// if this is my avatar, then render my interactions with the other avatar
|
// if this is my avatar, then render my interactions with the other avatar
|
||||||
_avatarTouch.render(Application::getInstance()->getCamera()->getPosition());
|
_avatarTouch.render(Application::getInstance()->getCamera()->getPosition());
|
||||||
|
@ -648,7 +648,7 @@ float MyAvatar::getBallRenderAlpha(int ball, bool forceRenderHead) const {
|
||||||
(distanceToCamera - DO_NOT_RENDER_INSIDE) / (RENDER_OPAQUE_OUTSIDE - DO_NOT_RENDER_INSIDE), 0.f, 1.f);
|
(distanceToCamera - DO_NOT_RENDER_INSIDE) / (RENDER_OPAQUE_OUTSIDE - DO_NOT_RENDER_INSIDE), 0.f, 1.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::renderBody(bool forceRenderHead, bool renderAvatarBalls) {
|
void MyAvatar::renderBody(bool forceRenderHead) {
|
||||||
|
|
||||||
if (_head.getVideoFace().isFullFrame()) {
|
if (_head.getVideoFace().isFullFrame()) {
|
||||||
// Render the full-frame video
|
// Render the full-frame video
|
||||||
|
@ -656,7 +656,7 @@ void MyAvatar::renderBody(bool forceRenderHead, bool renderAvatarBalls) {
|
||||||
if (alpha > 0.0f) {
|
if (alpha > 0.0f) {
|
||||||
_head.getVideoFace().render(1.0f);
|
_head.getVideoFace().render(1.0f);
|
||||||
}
|
}
|
||||||
} else if (renderAvatarBalls || !(_voxels.getVoxelURL().isValid() || _skeletonModel.isActive())) {
|
} else if (Menu::getInstance()->isOptionChecked(MenuOption::AvatarAsBalls)) {
|
||||||
// Render the body as balls and cones
|
// Render the body as balls and cones
|
||||||
glm::vec3 skinColor, darkSkinColor;
|
glm::vec3 skinColor, darkSkinColor;
|
||||||
getSkinColors(skinColor, darkSkinColor);
|
getSkinColors(skinColor, darkSkinColor);
|
||||||
|
@ -690,10 +690,6 @@ void MyAvatar::renderBody(bool forceRenderHead, bool renderAvatarBalls) {
|
||||||
alpha);
|
alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (b == BODY_BALL_NECK_BASE && _head.getFaceModel().isActive()) {
|
|
||||||
continue; // don't render the neck if we have a face model
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((b != BODY_BALL_HEAD_TOP )
|
if ((b != BODY_BALL_HEAD_TOP )
|
||||||
&& (b != BODY_BALL_HEAD_BASE )) {
|
&& (b != BODY_BALL_HEAD_BASE )) {
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
@ -729,7 +725,7 @@ void MyAvatar::renderBody(bool forceRenderHead, bool renderAvatarBalls) {
|
||||||
}
|
}
|
||||||
float alpha = getBallRenderAlpha(BODY_BALL_HEAD_BASE, forceRenderHead);
|
float alpha = getBallRenderAlpha(BODY_BALL_HEAD_BASE, forceRenderHead);
|
||||||
if (alpha > 0.0f) {
|
if (alpha > 0.0f) {
|
||||||
_head.render(alpha, true);
|
_head.render(alpha, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_hand.render();
|
_hand.render();
|
||||||
|
@ -1161,17 +1157,20 @@ bool operator<(const SortedAvatar& s1, const SortedAvatar& s2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::updateChatCircle(float deltaTime) {
|
void MyAvatar::updateChatCircle(float deltaTime) {
|
||||||
if (!Menu::getInstance()->isOptionChecked(MenuOption::ChatCircling)) {
|
if (!(_isChatCirclingEnabled = Menu::getInstance()->isOptionChecked(MenuOption::ChatCircling))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// find all members and sort by distance
|
// find all circle-enabled members and sort by distance
|
||||||
QVector<SortedAvatar> sortedAvatars;
|
QVector<SortedAvatar> sortedAvatars;
|
||||||
NodeList* nodeList = NodeList::getInstance();
|
NodeList* nodeList = NodeList::getInstance();
|
||||||
for (NodeList::iterator node = nodeList->begin(); node != nodeList->end(); node++) {
|
for (NodeList::iterator node = nodeList->begin(); node != nodeList->end(); node++) {
|
||||||
if (node->getLinkedData() && node->getType() == NODE_TYPE_AGENT) {
|
if (node->getLinkedData() && node->getType() == NODE_TYPE_AGENT) {
|
||||||
SortedAvatar sortedAvatar;
|
SortedAvatar sortedAvatar;
|
||||||
sortedAvatar.avatar = (Avatar*)node->getLinkedData();
|
sortedAvatar.avatar = (Avatar*)node->getLinkedData();
|
||||||
|
if (!sortedAvatar.avatar->isChatCirclingEnabled()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
sortedAvatar.distance = glm::distance(_position, sortedAvatar.avatar->getPosition());
|
sortedAvatar.distance = glm::distance(_position, sortedAvatar.avatar->getPosition());
|
||||||
sortedAvatars.append(sortedAvatar);
|
sortedAvatars.append(sortedAvatar);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ public:
|
||||||
void reset();
|
void reset();
|
||||||
void simulate(float deltaTime, Transmitter* transmitter);
|
void simulate(float deltaTime, Transmitter* transmitter);
|
||||||
void updateFromGyrosAndOrWebcam(bool turnWithHead);
|
void updateFromGyrosAndOrWebcam(bool turnWithHead);
|
||||||
void render(bool forceRenderHead, bool renderAvatarBalls);
|
void render(bool forceRenderHead);
|
||||||
void renderScreenTint(ScreenTintLayer layer);
|
void renderScreenTint(ScreenTintLayer layer);
|
||||||
|
|
||||||
// setters
|
// setters
|
||||||
|
@ -82,7 +82,7 @@ private:
|
||||||
|
|
||||||
// private methods
|
// private methods
|
||||||
float getBallRenderAlpha(int ball, bool forceRenderHead) const;
|
float getBallRenderAlpha(int ball, bool forceRenderHead) const;
|
||||||
void renderBody(bool forceRenderHead, bool renderAvatarBalls);
|
void renderBody(bool forceRenderHead);
|
||||||
void updateThrust(float deltaTime, Transmitter * transmitter);
|
void updateThrust(float deltaTime, Transmitter * transmitter);
|
||||||
void updateHandMovementAndTouching(float deltaTime, bool enableHandMovement);
|
void updateHandMovementAndTouching(float deltaTime, bool enableHandMovement);
|
||||||
void updateAvatarCollisions(float deltaTime);
|
void updateAvatarCollisions(float deltaTime);
|
||||||
|
|
|
@ -23,6 +23,8 @@ Profile::Profile(const QString &username) :
|
||||||
if (!_username.isEmpty()) {
|
if (!_username.isEmpty()) {
|
||||||
// we've been given a new username, ask the data-server for profile
|
// we've been given a new username, ask the data-server for profile
|
||||||
DataServerClient::getClientValueForKey(DataServerKey::UUID);
|
DataServerClient::getClientValueForKey(DataServerKey::UUID);
|
||||||
|
DataServerClient::getClientValueForKey(DataServerKey::FaceMeshURL);
|
||||||
|
DataServerClient::getClientValueForKey(DataServerKey::SkeletonURL);
|
||||||
|
|
||||||
// send our current domain server to the data-server
|
// send our current domain server to the data-server
|
||||||
updateDomain(NodeList::getInstance()->getDomainHostname());
|
updateDomain(NodeList::getInstance()->getDomainHostname());
|
||||||
|
|
|
@ -33,6 +33,7 @@ AvatarData::AvatarData(Node* owningNode) :
|
||||||
_leaderUUID(),
|
_leaderUUID(),
|
||||||
_handState(0),
|
_handState(0),
|
||||||
_keyState(NO_KEY_DOWN),
|
_keyState(NO_KEY_DOWN),
|
||||||
|
_isChatCirclingEnabled(false),
|
||||||
_headData(NULL),
|
_headData(NULL),
|
||||||
_handData(NULL)
|
_handData(NULL)
|
||||||
{
|
{
|
||||||
|
@ -120,6 +121,9 @@ int AvatarData::getBroadcastData(unsigned char* destinationBuffer) {
|
||||||
setSemiNibbleAt(bitItems,HAND_STATE_START_BIT,_handState);
|
setSemiNibbleAt(bitItems,HAND_STATE_START_BIT,_handState);
|
||||||
// faceshift state
|
// faceshift state
|
||||||
if (_headData->_isFaceshiftConnected) { setAtBit(bitItems, IS_FACESHIFT_CONNECTED); }
|
if (_headData->_isFaceshiftConnected) { setAtBit(bitItems, IS_FACESHIFT_CONNECTED); }
|
||||||
|
if (_isChatCirclingEnabled) {
|
||||||
|
setAtBit(bitItems, IS_CHAT_CIRCLING_ENABLED);
|
||||||
|
}
|
||||||
*destinationBuffer++ = bitItems;
|
*destinationBuffer++ = bitItems;
|
||||||
|
|
||||||
// If it is connected, pack up the data
|
// If it is connected, pack up the data
|
||||||
|
@ -248,6 +252,8 @@ int AvatarData::parseData(unsigned char* sourceBuffer, int numBytes) {
|
||||||
|
|
||||||
_headData->_isFaceshiftConnected = oneAtBit(bitItems, IS_FACESHIFT_CONNECTED);
|
_headData->_isFaceshiftConnected = oneAtBit(bitItems, IS_FACESHIFT_CONNECTED);
|
||||||
|
|
||||||
|
_isChatCirclingEnabled = oneAtBit(bitItems, IS_CHAT_CIRCLING_ENABLED);
|
||||||
|
|
||||||
// If it is connected, pack up the data
|
// If it is connected, pack up the data
|
||||||
if (_headData->_isFaceshiftConnected) {
|
if (_headData->_isFaceshiftConnected) {
|
||||||
memcpy(&_headData->_leftEyeBlink, sourceBuffer, sizeof(float));
|
memcpy(&_headData->_leftEyeBlink, sourceBuffer, sizeof(float));
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
const int KEY_STATE_START_BIT = 0; // 1st and 2nd bits
|
const int KEY_STATE_START_BIT = 0; // 1st and 2nd bits
|
||||||
const int HAND_STATE_START_BIT = 2; // 3rd and 4th bits
|
const int HAND_STATE_START_BIT = 2; // 3rd and 4th bits
|
||||||
const int IS_FACESHIFT_CONNECTED = 4; // 5th bit
|
const int IS_FACESHIFT_CONNECTED = 4; // 5th bit
|
||||||
|
const int IS_CHAT_CIRCLING_ENABLED = 5;
|
||||||
|
|
||||||
const float MAX_AUDIO_LOUDNESS = 1000.0; // close enough for mouth animation
|
const float MAX_AUDIO_LOUDNESS = 1000.0; // close enough for mouth animation
|
||||||
|
|
||||||
|
@ -93,6 +94,8 @@ public:
|
||||||
const std::string& setChatMessage() const { return _chatMessage; }
|
const std::string& setChatMessage() const { return _chatMessage; }
|
||||||
QString getQStringChatMessage() { return QString(_chatMessage.data()); }
|
QString getQStringChatMessage() { return QString(_chatMessage.data()); }
|
||||||
|
|
||||||
|
bool isChatCirclingEnabled() const { return _isChatCirclingEnabled; }
|
||||||
|
|
||||||
const QUuid& getLeaderUUID() const { return _leaderUUID; }
|
const QUuid& getLeaderUUID() const { return _leaderUUID; }
|
||||||
|
|
||||||
void setHeadData(HeadData* headData) { _headData = headData; }
|
void setHeadData(HeadData* headData) { _headData = headData; }
|
||||||
|
@ -124,6 +127,8 @@ protected:
|
||||||
// chat message
|
// chat message
|
||||||
std::string _chatMessage;
|
std::string _chatMessage;
|
||||||
|
|
||||||
|
bool _isChatCirclingEnabled;
|
||||||
|
|
||||||
std::vector<JointData> _joints;
|
std::vector<JointData> _joints;
|
||||||
|
|
||||||
HeadData* _headData;
|
HeadData* _headData;
|
||||||
|
|
Loading…
Reference in a new issue