Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
DVDConverter.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2018 DIVIDE-Studio
3 Copyright (c) 2009 Ionut Cava
4
5 This file is part of DIVIDE Framework.
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software
9 and associated documentation files (the "Software"), to deal in the Software
10 without restriction,
11 including without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sublicense,
13 and/or sell copies of the Software, and to permit persons to whom the
14 Software is furnished to do so,
15 subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED,
22 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23 PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25 DAMAGES OR OTHER LIABILITY,
26 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27 IN CONNECTION WITH THE SOFTWARE
28 OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30 */
31
32/*
33Copyright (c) 2006-2012 assimp team
34All rights reserved.
35
36Redistribution and use in source and binary forms, with or without modification,
37are permitted provided that the following conditions are met:
38
39 Redistributions of source code must retain the above copyright notice, this
40list of conditions and the following disclaimer.
41 Redistributions in binary form must reproduce the above copyright notice,
42this list of conditions and the following disclaimer in the documentation and/or
43other materials provided with the distribution.
44 Neither the name of the assimp team nor the names of its contributors may be
45used to endorse or promote products derived from this software without specific
46prior written permission.
47
48THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
49ANY EXPRESS OR IMPLIED WARRANTIES,
50INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
51FITNESS FOR A PARTICULAR PURPOSE ARE
52DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
53ANY DIRECT, INDIRECT, INCIDENTAL,SPECIAL,
54EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
55OF SUBSTITUTE GOODS OR SERVICES; LOSS
56OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
57THEORY OF LIABILITY, WHETHER IN CONTRACT,
58STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
59OUT OF THE USE OF THIS SOFTWARE, EVEN IF
60ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61*/
62
63#pragma once
64#ifndef DVD_FORMAT_CONVERTER_H_
65#define DVD_FORMAT_CONVERTER_H_
66
70#include <assimp/matrix4x4.h>
71
72struct aiNode;
73struct aiMesh;
74struct aiScene;
75struct aiMaterial;
76
77namespace Divide {
78 enum class GeometryFormat : U8;
79
80 namespace Import {
81 struct NodeData;
82 struct ImportData;
83 struct SubMeshData;
84 struct MaterialData;
85 };
86
87class SubMesh;
88class VertexBuffer;
89class PlatformContext;
90
91namespace DVDConverter {
92 void OnStartup(const PlatformContext& context);
93 void OnShutdown();
94
95 [[nodiscard]] U32 PopulateNodeData(aiNode* node, MeshNodeData& target, const aiMatrix4x4& axisCorrectionBasis);
96 [[nodiscard]] bool Load(PlatformContext& context, Import::ImportData& target);
97
98 namespace detail{
99 void LoadSubMeshGeometry(const aiMesh* source,
100 Import::SubMeshData& subMeshData,
101 Import::ImportData& target);
102
104 const aiScene* source,
105 const ResourcePath& modelDirectoryName,
106 U16 materialIndex,
107 const Str<128>& materialName,
108 GeometryFormat format,
109 bool convertHeightToBumpMap);
110
112 }; //namespace Detail
113}; //namespace DVDConverter
114
115}; // namespace Divide
116
117#endif //DVD_FORMAT_CONVERTER_H_
void LoadSubMeshGeometry(const aiMesh *source, Import::SubMeshData &subMeshData, Import::ImportData &target)
void BuildGeometryBuffers(PlatformContext &context, Import::ImportData &target)
void LoadSubMeshMaterial(Import::MaterialData &material, const aiScene *source, const ResourcePath &modelDirectoryName, const U16 materialIndex, const Str< 128 > &materialName, const GeometryFormat format, bool convertHeightToBumpMap)
void OnStartup(const PlatformContext &context)
bool Load(PlatformContext &context, Import::ImportData &target)
U32 PopulateNodeData(aiNode *node, MeshNodeData &target, const aiMatrix4x4 &axisCorrectionBasis)
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
uint8_t U8
GeometryFormat
Definition: MeshImporter.h:43
uint16_t U16
uint32_t U32