summaryrefslogtreecommitdiff
path: root/indra/newview/gltf/primitive.h
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2024-05-28 09:45:40 -0500
committerGitHub <noreply@github.com>2024-05-28 09:45:40 -0500
commit2f4120038429c6aff865f153f708ceefb60d67f4 (patch)
tree85e63488eb66760996fd2e0c55c40fdc7b5b38b3 /indra/newview/gltf/primitive.h
parentdb627bc3544b828982a2a366972e0adf86e42f75 (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.h24
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);
};
}
}