diff options
author | Dave Parks <davep@lindenlab.com> | 2024-05-28 09:45:40 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-28 09:45:40 -0500 |
commit | 2f4120038429c6aff865f153f708ceefb60d67f4 (patch) | |
tree | 85e63488eb66760996fd2e0c55c40fdc7b5b38b3 /indra/newview/gltf/primitive.h | |
parent | db627bc3544b828982a2a366972e0adf86e42f75 (diff) |
Remove tinygltf dependency from LL::GLTF (#1541)
* #1535 Image loading/saving support in boost::json driven GLTF parser
* #1536 GLB Support in boost::json drvien GLTF parser
Diffstat (limited to 'indra/newview/gltf/primitive.h')
-rw-r--r-- | indra/newview/gltf/primitive.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/indra/newview/gltf/primitive.h b/indra/newview/gltf/primitive.h index 18aadce808..9914ff3b08 100644 --- a/indra/newview/gltf/primitive.h +++ b/indra/newview/gltf/primitive.h @@ -48,6 +48,17 @@ namespace LL class Primitive { public: + enum class Mode : U8 + { + POINTS, + LINES, + LINE_LOOP, + LINE_STRIP, + TRIANGLES, + TRIANGLE_STRIP, + TRIANGLE_FAN + }; + ~Primitive(); // GPU copy of mesh data @@ -66,10 +77,10 @@ namespace LL // raycast acceleration structure LLPointer<LLVolumeOctree> mOctree; std::vector<LLVolumeTriangle> mOctreeTriangles; - + S32 mMaterial = -1; - S32 mMode = TINYGLTF_MODE_TRIANGLES; // default to triangles - U32 mGLMode = LLRender::TRIANGLES; + Mode mMode = Mode::TRIANGLES; // default to triangles + LLRender::eGeomModes mGLMode = LLRender::TRIANGLES; // for use with LLRender S32 mIndices = -1; std::unordered_map<std::string, S32> mAttributes; @@ -77,7 +88,7 @@ namespace LL // must be called before buffer is unmapped and after buffer is populated with good data void createOctree(); - //get the LLVolumeTriangle that intersects with the given line segment at the point + //get the LLVolumeTriangle that intersects with the given line segment at the point //closest to start. Moves end to the point of intersection. Returns nullptr if no intersection. //Line segment must be in the same coordinate frame as this Primitive const LLVolumeTriangle* lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, @@ -86,12 +97,11 @@ namespace LL LLVector4a* normal = NULL, // return the surface normal at the intersection point LLVector4a* tangent = NULL // return the surface tangent at the intersection point ); - + void serialize(boost::json::object& obj) const; const Primitive& operator=(const Value& src); - const Primitive& operator=(const tinygltf::Primitive& src); - void allocateGLResources(Asset& asset); + bool prep(Asset& asset); }; } } |