Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VkCV Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vulkan2021
VkCV Framework
Commits
c4ef9acd
Commit
c4ef9acd
authored
3 years ago
by
Trevor Hollmann
Browse files
Options
Downloads
Patches
Plain Diff
[
#79
] Update documenting comments.
parent
564ac394
No related branches found
No related tags found
1 merge request
!69
Resolve "Rework Asset Loader API"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/asset_loader/include/vkcv/asset/asset_loader.hpp
+28
-8
28 additions, 8 deletions
modules/asset_loader/include/vkcv/asset/asset_loader.hpp
modules/asset_loader/src/vkcv/asset/asset_loader.cpp
+3
-0
3 additions, 0 deletions
modules/asset_loader/src/vkcv/asset/asset_loader.cpp
with
31 additions
and
8 deletions
modules/asset_loader/include/vkcv/asset/asset_loader.hpp
+
28
−
8
View file @
c4ef9acd
...
...
@@ -204,11 +204,11 @@ typedef struct {
std
::
vector
<
int
>
vertexGroups
;
}
Mesh
;
/** The scene struct is simply a collection of objects in the scene as well as
/**
* The scene struct is simply a collection of objects in the scene as well as
* the resources used by those objects.
* For now the only type of object are the meshes and they are represented in a
* flat array.
* Note that parent-child relations are not yet possible. */
* Note that parent-child relations are not yet possible.
*/
typedef
struct
{
std
::
vector
<
Mesh
>
meshes
;
std
::
vector
<
VertexGroup
>
vertexGroups
;
...
...
@@ -218,21 +218,41 @@ typedef struct {
}
Scene
;
/**
* Load every mesh from the glTF file, as well as materials and textures.
* Load every mesh from the glTF file, as well as materials, textures and other
* associated objects.
*
* @param path
must be the path to a glTF or glb
file.
* @param path
must be the path to a glTF
-
or glb
-
file.
* @param scene is a reference to a Scene struct that will be filled with the
* content of the glTF file being loaded.
*/
int
loadScene
(
const
std
::
filesystem
::
path
&
path
,
Scene
&
scene
);
/**
* TODO document
* Parse the given glTF file and create a shallow description of the content.
* Only the meta-data of the objects in the scene is loaded, not the binary
* content. The rationale is to provide a means of probing the content of a
* glTF file without the costly process of loading and decoding large amounts
* of data. The returned Scene struct can be used to search for specific meshes
* in the scene, that can then be loaded on their own using the loadMesh()
* function. Note that the Scene struct received as output argument will be
* overwritten by this function.
*
* @param path must be the path to a glTF- or glb-file.
* @param scene is a reference to a Scene struct that will be filled with the
* meta-data of all objects described in the glTF file.
*/
int
probeScene
(
const
std
::
filesystem
::
path
&
path
,
Scene
&
scene
);
/**
* TODO document
* This function loads a single mesh from the given file into the given Scene.
* TODO document whather this function extends or overwrites the given scene
* The names of meshes can be obtained by calling probeScene() and iterating
* through the array of meshes from the probed scene.
* Besides the mesh, this function will also add any associated data to the
* Scene struct such as Materials and Textures required by the Mesh.
*
* @param path must be the path to a glTF- or glb-file.
* @param scene is the scene struct to which the results will be written.
*/
int
loadMesh
(
const
std
::
filesystem
::
path
&
path
,
const
std
::
string
&
name
,
Scene
&
scene
);
...
...
This diff is collapsed.
Click to expand it.
modules/asset_loader/src/vkcv/asset/asset_loader.cpp
+
3
−
0
View file @
c4ef9acd
...
...
@@ -748,6 +748,9 @@ int probeScene(const std::filesystem::path& path, Scene& scene) {
}
// TODO Do we want to _extend_ the given scene with the newly loaded mesh or do
// we want to _clear_ the scene such that the result will always be an empty
// scene with only the given mesh (and associated textures etc)?
int
loadMesh
(
const
std
::
filesystem
::
path
&
path
,
const
std
::
string
&
name
,
Scene
&
scene
)
{
fx
::
gltf
::
Document
sceneObjects
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment