History

Glow/shrink avatars when killed, send kill message when we move between domains, locations, etc.

Andrzej Kapolka committed 12 years ago

Commit 083800d1 parent 092515e7 files · +47 −9Browse files

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

Unified · Split

interface/src/Application.cpp+32−2
@@ -1972,6 +1972,21 @@ void Application::updateAvatars(float deltaTime, glm::vec3 mouseRayOrigin, glm:: · 1971 unmodified lines
1972 }1972 }
1973 node->unlock();1973 node->unlock();
1974 }1974 }
1975
1976 // simulate avatar fades
1977 for (vector<Avatar*>::iterator fade = _avatarFades.begin(); fade != _avatarFades.end(); fade++) {
1978 Avatar* avatar = *fade;
1979 const float SHRINK_RATE = 0.9f;
1980 avatar->setNewScale(avatar->getNewScale() * SHRINK_RATE);
1981 const float MINIMUM_SCALE = 0.001f;
1982 if (avatar->getNewScale() < MINIMUM_SCALE) {
1983 delete avatar;
1984 _avatarFades.erase(fade--);
1985
1986 } else {
1987 avatar->simulate(deltaTime, NULL);
1988 }
1989 }
1975}1990}
1976 1991
1977void Application::updateMouseRay(float deltaTime, glm::vec3& mouseRayOrigin, glm::vec3& mouseRayDirection) {1992void Application::updateMouseRay(float deltaTime, glm::vec3& mouseRayOrigin, glm::vec3& mouseRayDirection) {
@@ -3841,6 +3856,12 @@ void Application::renderAvatars(bool forceRenderHead, bool selfAvatarOnly) { · 1863 unmodified lines
3841 3856
3842 node->unlock();3857 node->unlock();
3843 }3858 }
3859
3860 // render avatar fades
3861 Glower glower;
3862 for (vector<Avatar*>::iterator fade = _avatarFades.begin(); fade != _avatarFades.end(); fade++) {
3863 (*fade)->render(false, Menu::getInstance()->isOptionChecked(MenuOption::AvatarAsBalls));
3864 }
3844 }3865 }
3845 3866
3846 // Render my own Avatar3867 // Render my own Avatar
@@ -4286,8 +4307,17 @@ void Application::nodeKilled(Node* node) { · 439 unmodified lines
4286 _voxelServerSceneStats.erase(nodeUUID);4307 _voxelServerSceneStats.erase(nodeUUID);
4287 }4308 }
4288 _voxelSceneStatsLock.unlock();4309 _voxelSceneStatsLock.unlock();
4289 } else if (node->getLinkedData() == _lookatTargetAvatar) {4310
4290 _lookatTargetAvatar = NULL;4311 } else if (node->getType() == NODE_TYPE_AGENT) {
4312 Avatar* avatar = static_cast<Avatar*>(node->getLinkedData());
4313 if (avatar == _lookatTargetAvatar) {
4314 _lookatTargetAvatar = NULL;
4315 }
4316
4317 // take over the avatar in order to fade it out
4318 node->setLinkedData(NULL);
4319
4320 _avatarFades.push_back(avatar);
4291 }4321 }
4292}4322}
4293 4323

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