Use avatar position as orb position when head position not available

This commit is contained in:
David Rowe 2021-11-09 12:12:55 +13:00
parent afd7993152
commit a2ac43289c

View file

@ -64,7 +64,11 @@ void OtherAvatar::removeOrb() {
void OtherAvatar::updateOrbPosition() {
if (!_otherAvatarOrbMeshPlaceholderID.isNull()) {
EntityItemProperties properties;
properties.setPosition(getHead()->getPosition());
glm::vec3 headPosition;
if (!_skeletonModel->getHeadPosition(headPosition)) {
headPosition = getWorldPosition();
}
properties.setPosition(headPosition);
DependencyManager::get<EntityScriptingInterface>()->editEntity(_otherAvatarOrbMeshPlaceholderID, properties);
}
}