From cadc1a02cc7289dabd368dd1a1d237c042e9f82e Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Wed, 24 Apr 2024 09:51:15 -0500 Subject: 1285 GLTF Animation Prototype --- indra/newview/gltf/primitive.h | 57 ++++-------------------------------------- 1 file changed, 5 insertions(+), 52 deletions(-) (limited to 'indra/newview/gltf/primitive.h') diff --git a/indra/newview/gltf/primitive.h b/indra/newview/gltf/primitive.h index 7c47d9dac5..07e8e7deb2 100644 --- a/indra/newview/gltf/primitive.h +++ b/indra/newview/gltf/primitive.h @@ -56,7 +56,10 @@ namespace LL std::vector mNormals; std::vector mTangents; std::vector mPositions; - std::vector mIndexArray; + std::vector mJoints; + std::vector mWeights; + std::vector mColors; + std::vector mIndexArray; // raycast acceleration structure LLPointer mOctree; @@ -68,11 +71,6 @@ namespace LL S32 mIndices = -1; std::unordered_map mAttributes; - // copy the attribute in the given BufferView to the given destination - // assumes destination has enough storage for the attribute - template - void copyAttribute(Asset& asset, S32 bufferViewIdx, LLStrider& dst); - // create octree based on vertex buffer // must be called before buffer is unmapped and after buffer is populated with good data void createOctree(); @@ -87,52 +85,7 @@ namespace LL LLVector4a* tangent = NULL // return the surface tangent at the intersection point ); - const Primitive& operator=(const tinygltf::Primitive& src) - { - // load material - mMaterial = src.material; - - // load mode - mMode = src.mode; - - // load indices - mIndices = src.indices; - - // load attributes - for (auto& it : src.attributes) - { - mAttributes[it.first] = it.second; - } - - switch (mMode) - { - case TINYGLTF_MODE_POINTS: - mGLMode = LLRender::POINTS; - break; - case TINYGLTF_MODE_LINE: - mGLMode = LLRender::LINES; - break; - case TINYGLTF_MODE_LINE_LOOP: - mGLMode = LLRender::LINE_LOOP; - break; - case TINYGLTF_MODE_LINE_STRIP: - mGLMode = LLRender::LINE_STRIP; - break; - case TINYGLTF_MODE_TRIANGLES: - mGLMode = LLRender::TRIANGLES; - break; - case TINYGLTF_MODE_TRIANGLE_STRIP: - mGLMode = LLRender::TRIANGLE_STRIP; - break; - case TINYGLTF_MODE_TRIANGLE_FAN: - mGLMode = LLRender::TRIANGLE_FAN; - break; - default: - mGLMode = GL_TRIANGLES; - } - - return *this; - } + const Primitive& operator=(const tinygltf::Primitive& src); void allocateGLResources(Asset& asset); }; -- cgit v1.2.3