summaryrefslogtreecommitdiff
path: root/indra/newview/gltfscenemanager.h
diff options
context:
space:
mode:
authorRunitaiLinden <davep@lindenlab.com>2024-04-09 19:21:10 -0500
committerGitHub <noreply@github.com>2024-04-09 19:21:10 -0500
commitb2a450a3087fb8393024876f6069a7cec9855bfd (patch)
tree05a08420a5f4797ad8ce4d63668d1bf688888704 /indra/newview/gltfscenemanager.h
parent5a47a3cb2366b9da9a595d37c88703497e111005 (diff)
#1126 gltf scene import prototype (#1172)
* #1126 GLTF Scene import initial prototype (working geometry import for some assets) * #1126 WIP -- Expand support for more vertex formats, PoC material import, shadow support, scale support * #1126 move GLTF implementation to newview/gltf * #1126 Refactor attribute loading to be less copy/pasta for each combination of types * #1126 Partially working object selection. Ability to have multiple scenes at once. Helpful message on how to use the preview button. * #1126 Add bounding box debug display and untangle GLTF raycast from LLVOVolume raycast * #1126 Working raycast on GLTF scenes. * #1126 Remove some #pragma optimize offs
Diffstat (limited to 'indra/newview/gltfscenemanager.h')
-rw-r--r--indra/newview/gltfscenemanager.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/indra/newview/gltfscenemanager.h b/indra/newview/gltfscenemanager.h
new file mode 100644
index 0000000000..50e1dd93da
--- /dev/null
+++ b/indra/newview/gltfscenemanager.h
@@ -0,0 +1,64 @@
+#pragma once
+
+/**
+ * @file gltfscenemanager.h
+ * @brief Builds menus out of items.
+ *
+ * $LicenseInfo:firstyear=2024&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2024, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "llsingleton.h"
+#include "llviewerobject.h"
+
+namespace LL
+{
+ class GLTFSceneManager : public LLSimpleton<GLTFSceneManager>
+ {
+ public:
+ ~GLTFSceneManager();
+ // load GLTF file from disk
+ void load(); // open filepicker to choose asset
+ void load(const std::string& filename); // load asset from filename
+ void renderOpaque();
+
+ LLDrawable* lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end,
+ BOOL pick_transparent,
+ BOOL pick_rigged,
+ BOOL pick_unselectable,
+ BOOL pick_reflection_probe,
+ S32* node_hit, // return the index of the node that was hit
+ S32* primitive_hit, // return the index of the primitive that was hit
+ LLVector4a* intersection, // return the intersection point
+ LLVector2* tex_coord, // return the texture coordinates of the intersection point
+ LLVector4a* normal, // return the surface normal at the intersection point
+ LLVector4a* tangent); // return the surface tangent at the intersection point
+
+ bool lineSegmentIntersect(LLVOVolume* obj, GLTF::Asset* asset, const LLVector4a& start, const LLVector4a& end, S32 face, BOOL pick_transparent, BOOL pick_rigged, BOOL pick_unselectable, S32* face_hitp, S32* primitive_hitp,
+ LLVector4a* intersection, LLVector2* tex_coord, LLVector4a* normal, LLVector4a* tangent);
+
+ void renderDebug();
+
+ std::vector<LLPointer<LLViewerObject>> mObjects;
+ };
+}
+
+