mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 19:01:09 +02:00
Fix AC not sending Avatar Mixer a frustum
This commit is contained in:
parent
538f24162f
commit
ddde0228ba
3 changed files with 18 additions and 2 deletions
|
@ -594,9 +594,24 @@ void Agent::sendAvatarIdentityPacket() {
|
||||||
auto scriptedAvatar = DependencyManager::get<ScriptableAvatar>();
|
auto scriptedAvatar = DependencyManager::get<ScriptableAvatar>();
|
||||||
scriptedAvatar->markIdentityDataChanged();
|
scriptedAvatar->markIdentityDataChanged();
|
||||||
scriptedAvatar->sendIdentityPacket();
|
scriptedAvatar->sendIdentityPacket();
|
||||||
|
sendAvatarViewFrustum();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Agent::sendAvatarViewFrustum() {
|
||||||
|
auto scriptedAvatar = DependencyManager::get<ScriptableAvatar>();
|
||||||
|
ViewFrustum view;
|
||||||
|
view.setPosition(scriptedAvatar->getWorldPosition());
|
||||||
|
view.setOrientation(scriptedAvatar->getHeadOrientation());
|
||||||
|
auto viewFrustumByteArray = view.toByteArray();
|
||||||
|
|
||||||
|
auto avatarPacket = NLPacket::create(PacketType::ViewFrustum, viewFrustumByteArray.size());
|
||||||
|
avatarPacket->write(viewFrustumByteArray);
|
||||||
|
|
||||||
|
DependencyManager::get<NodeList>()->broadcastToNodes(std::move(avatarPacket),
|
||||||
|
{ NodeType::AvatarMixer });
|
||||||
|
}
|
||||||
|
|
||||||
void Agent::processAgentAvatar() {
|
void Agent::processAgentAvatar() {
|
||||||
if (!_scriptEngine->isFinished() && _isAvatar) {
|
if (!_scriptEngine->isFinished() && _isAvatar) {
|
||||||
auto scriptedAvatar = DependencyManager::get<ScriptableAvatar>();
|
auto scriptedAvatar = DependencyManager::get<ScriptableAvatar>();
|
||||||
|
|
|
@ -97,6 +97,7 @@ private:
|
||||||
void setAvatarSound(SharedSoundPointer avatarSound) { _avatarSound = avatarSound; }
|
void setAvatarSound(SharedSoundPointer avatarSound) { _avatarSound = avatarSound; }
|
||||||
|
|
||||||
void sendAvatarIdentityPacket();
|
void sendAvatarIdentityPacket();
|
||||||
|
void sendAvatarViewFrustum();
|
||||||
|
|
||||||
QString _scriptContents;
|
QString _scriptContents;
|
||||||
QTimer* _scriptRequestTimeout { nullptr };
|
QTimer* _scriptRequestTimeout { nullptr };
|
||||||
|
|
|
@ -5806,8 +5806,8 @@ void Application::update(float deltaTime) {
|
||||||
|
|
||||||
void Application::sendAvatarViewFrustum() {
|
void Application::sendAvatarViewFrustum() {
|
||||||
QByteArray viewFrustumByteArray = _viewFrustum.toByteArray();
|
QByteArray viewFrustumByteArray = _viewFrustum.toByteArray();
|
||||||
if (hasSecondaryViewFrustum()) {
|
if (_hasSecondaryViewFrustum) {
|
||||||
viewFrustumByteArray += _viewFrustum.toByteArray();
|
viewFrustumByteArray += _secondaryViewFrustum.toByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto avatarPacket = NLPacket::create(PacketType::ViewFrustum, viewFrustumByteArray.size());
|
auto avatarPacket = NLPacket::create(PacketType::ViewFrustum, viewFrustumByteArray.size());
|
||||||
|
|
Loading…
Reference in a new issue