mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 16:30:39 +02:00
Glow/shrink avatars when killed, send kill message when we move between
domains, locations, etc.
This commit is contained in:
parent
092515e199
commit
083800dc59
7 changed files with 47 additions and 9 deletions
|
@ -1972,6 +1972,21 @@ void Application::updateAvatars(float deltaTime, glm::vec3 mouseRayOrigin, glm::
|
||||||
}
|
}
|
||||||
node->unlock();
|
node->unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// simulate avatar fades
|
||||||
|
for (vector<Avatar*>::iterator fade = _avatarFades.begin(); fade != _avatarFades.end(); fade++) {
|
||||||
|
Avatar* avatar = *fade;
|
||||||
|
const float SHRINK_RATE = 0.9f;
|
||||||
|
avatar->setNewScale(avatar->getNewScale() * SHRINK_RATE);
|
||||||
|
const float MINIMUM_SCALE = 0.001f;
|
||||||
|
if (avatar->getNewScale() < MINIMUM_SCALE) {
|
||||||
|
delete avatar;
|
||||||
|
_avatarFades.erase(fade--);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
avatar->simulate(deltaTime, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::updateMouseRay(float deltaTime, glm::vec3& mouseRayOrigin, glm::vec3& mouseRayDirection) {
|
void Application::updateMouseRay(float deltaTime, glm::vec3& mouseRayOrigin, glm::vec3& mouseRayDirection) {
|
||||||
|
@ -3841,6 +3856,12 @@ void Application::renderAvatars(bool forceRenderHead, bool selfAvatarOnly) {
|
||||||
|
|
||||||
node->unlock();
|
node->unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// render avatar fades
|
||||||
|
Glower glower;
|
||||||
|
for (vector<Avatar*>::iterator fade = _avatarFades.begin(); fade != _avatarFades.end(); fade++) {
|
||||||
|
(*fade)->render(false, Menu::getInstance()->isOptionChecked(MenuOption::AvatarAsBalls));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render my own Avatar
|
// Render my own Avatar
|
||||||
|
@ -4286,8 +4307,17 @@ void Application::nodeKilled(Node* node) {
|
||||||
_voxelServerSceneStats.erase(nodeUUID);
|
_voxelServerSceneStats.erase(nodeUUID);
|
||||||
}
|
}
|
||||||
_voxelSceneStatsLock.unlock();
|
_voxelSceneStatsLock.unlock();
|
||||||
} else if (node->getLinkedData() == _lookatTargetAvatar) {
|
|
||||||
_lookatTargetAvatar = NULL;
|
} else if (node->getType() == NODE_TYPE_AGENT) {
|
||||||
|
Avatar* avatar = static_cast<Avatar*>(node->getLinkedData());
|
||||||
|
if (avatar == _lookatTargetAvatar) {
|
||||||
|
_lookatTargetAvatar = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// take over the avatar in order to fade it out
|
||||||
|
node->setLinkedData(NULL);
|
||||||
|
|
||||||
|
_avatarFades.push_back(avatar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -471,6 +471,7 @@ private:
|
||||||
QReadWriteLock _voxelSceneStatsLock;
|
QReadWriteLock _voxelSceneStatsLock;
|
||||||
|
|
||||||
std::vector<VoxelFade> _voxelFades;
|
std::vector<VoxelFade> _voxelFades;
|
||||||
|
std::vector<Avatar*> _avatarFades;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(__interface__Application__) */
|
#endif /* defined(__interface__Application__) */
|
||||||
|
|
|
@ -173,6 +173,9 @@ void DataServerClient::processSendFromDataServer(unsigned char* packetData, int
|
||||||
|
|
||||||
if (coordinateItems.size() == 3) {
|
if (coordinateItems.size() == 3) {
|
||||||
|
|
||||||
|
// send a node kill request, indicating to other clients that they should play the "disappeared" effect
|
||||||
|
NodeList::getInstance()->sendKillNode(&NODE_TYPE_AVATAR_MIXER, 1);
|
||||||
|
|
||||||
qDebug() << "Changing domain to" << valueList[i].toLocal8Bit().constData() <<
|
qDebug() << "Changing domain to" << valueList[i].toLocal8Bit().constData() <<
|
||||||
"and position to" << valueList[i + 1].toLocal8Bit().constData() <<
|
"and position to" << valueList[i + 1].toLocal8Bit().constData() <<
|
||||||
"to go to" << userString << "\n";
|
"to go to" << userString << "\n";
|
||||||
|
|
|
@ -914,6 +914,9 @@ void Menu::goToDomain() {
|
||||||
newHostname = domainDialog.textValue();
|
newHostname = domainDialog.textValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// send a node kill request, indicating to other clients that they should play the "disappeared" effect
|
||||||
|
NodeList::getInstance()->sendKillNode(&NODE_TYPE_AVATAR_MIXER, 1);
|
||||||
|
|
||||||
// give our nodeList the new domain-server hostname
|
// give our nodeList the new domain-server hostname
|
||||||
NodeList::getInstance()->setDomainHostname(domainDialog.textValue());
|
NodeList::getInstance()->setDomainHostname(domainDialog.textValue());
|
||||||
}
|
}
|
||||||
|
@ -953,8 +956,11 @@ void Menu::goToLocation() {
|
||||||
glm::vec3 newAvatarPos(x, y, z);
|
glm::vec3 newAvatarPos(x, y, z);
|
||||||
|
|
||||||
if (newAvatarPos != avatarPos) {
|
if (newAvatarPos != avatarPos) {
|
||||||
|
// send a node kill request, indicating to other clients that they should play the "disappeared" effect
|
||||||
|
NodeList::getInstance()->sendKillNode(&NODE_TYPE_AVATAR_MIXER, 1);
|
||||||
|
|
||||||
qDebug("Going To Location: %f, %f, %f...\n", x, y, z);
|
qDebug("Going To Location: %f, %f, %f...\n", x, y, z);
|
||||||
myAvatar->setPosition(newAvatarPos);
|
myAvatar->setPosition(newAvatarPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1271,7 +1271,3 @@ void MyAvatar::setOrientation(const glm::quat& orientation) {
|
||||||
_bodyYaw = eulerAngles.y;
|
_bodyYaw = eulerAngles.y;
|
||||||
_bodyRoll = eulerAngles.z;
|
_bodyRoll = eulerAngles.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::setNewScale(const float scale) {
|
|
||||||
_newScale = scale;
|
|
||||||
}
|
|
||||||
|
|
|
@ -30,12 +30,10 @@ public:
|
||||||
void setLeanScale(float scale) { _leanScale = scale; }
|
void setLeanScale(float scale) { _leanScale = scale; }
|
||||||
void setGravity(glm::vec3 gravity);
|
void setGravity(glm::vec3 gravity);
|
||||||
void setOrientation(const glm::quat& orientation);
|
void setOrientation(const glm::quat& orientation);
|
||||||
void setNewScale(const float scale);
|
|
||||||
void setWantCollisionsOn(bool wantCollisionsOn) { _isCollisionsOn = wantCollisionsOn; }
|
void setWantCollisionsOn(bool wantCollisionsOn) { _isCollisionsOn = wantCollisionsOn; }
|
||||||
void setMoveTarget(const glm::vec3 moveTarget);
|
void setMoveTarget(const glm::vec3 moveTarget);
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
float getNewScale() const { return _newScale; }
|
|
||||||
float getSpeed() const { return _speed; }
|
float getSpeed() const { return _speed; }
|
||||||
AvatarMode getMode() const { return _mode; }
|
AvatarMode getMode() const { return _mode; }
|
||||||
float getLeanScale() const { return _leanScale; }
|
float getLeanScale() const { return _leanScale; }
|
||||||
|
|
|
@ -75,6 +75,10 @@ public:
|
||||||
float getBodyRoll() const { return _bodyRoll; }
|
float getBodyRoll() const { return _bodyRoll; }
|
||||||
void setBodyRoll(float bodyRoll) { _bodyRoll = bodyRoll; }
|
void setBodyRoll(float bodyRoll) { _bodyRoll = bodyRoll; }
|
||||||
|
|
||||||
|
// Scale
|
||||||
|
float getNewScale() const { return _newScale; }
|
||||||
|
void setNewScale(float newScale) { _newScale = newScale; }
|
||||||
|
|
||||||
// Hand State
|
// Hand State
|
||||||
void setHandState(char s) { _handState = s; }
|
void setHandState(char s) { _handState = s; }
|
||||||
char getHandState() const { return _handState; }
|
char getHandState() const { return _handState; }
|
||||||
|
|
Loading…
Reference in a new issue