summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r--indra/newview/llviewerobject.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index b66d4b1dab..cc6f4403dd 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -107,6 +107,7 @@
#include "llmeshrepository.h"
#include "llgltfmateriallist.h"
#include "llgl.h"
+#include "gltf/asset.h"
//#define DEBUG_UPDATE_TYPE
@@ -4379,7 +4380,7 @@ LLMatrix4a LLViewerObject::getGLTFAssetToAgentTransform() const
LLMatrix4 root;
root.initScale(getScale());
root.rotate(getRenderRotation());
- root.translate(getPositionAgent());
+ root.translate(getRenderPosition());
LLMatrix4a mat;
mat.loadu((F32*)root.mMatrix);
@@ -4403,7 +4404,7 @@ LLMatrix4a LLViewerObject::getAgentToGLTFAssetTransform() const
scale.mV[1] = 1.f / scale.mV[1];
scale.mV[2] = 1.f / scale.mV[2];
- root.translate(-getPositionAgent());
+ root.translate(-getRenderPosition());
root.rotate(~getRenderRotation());
LLMatrix4 scale_mat;
@@ -4420,7 +4421,7 @@ LLMatrix4a LLViewerObject::getGLTFNodeTransformAgent(S32 node_index) const
{
LLMatrix4a mat;
- if (mGLTFAsset.notNull() && node_index >= 0 && node_index < mGLTFAsset->mNodes.size())
+ if (mGLTFAsset && node_index >= 0 && node_index < mGLTFAsset->mNodes.size())
{
auto& node = mGLTFAsset->mNodes[node_index];
@@ -4474,7 +4475,7 @@ void decomposeMatrix(const LLMatrix4a& mat, LLVector3& position, LLQuaternion& r
void LLViewerObject::setGLTFNodeRotationAgent(S32 node_index, const LLQuaternion& rotation)
{
- if (mGLTFAsset.notNull() && node_index >= 0 && node_index < mGLTFAsset->mNodes.size())
+ if (mGLTFAsset && node_index >= 0 && node_index < mGLTFAsset->mNodes.size())
{
auto& node = mGLTFAsset->mNodes[node_index];
@@ -4506,7 +4507,7 @@ void LLViewerObject::setGLTFNodeRotationAgent(S32 node_index, const LLQuaternion
void LLViewerObject::moveGLTFNode(S32 node_index, const LLVector3& offset)
{
- if (mGLTFAsset.notNull() && node_index >= 0 && node_index < mGLTFAsset->mNodes.size())
+ if (mGLTFAsset && node_index >= 0 && node_index < mGLTFAsset->mNodes.size())
{
auto& node = mGLTFAsset->mNodes[node_index];