13 #ifndef OGLPLUS_SHAPES_BLENDER_MESH_1206011111_HPP
14 #define OGLPLUS_SHAPES_BLENDER_MESH_1206011111_HPP
25 #include <oglplus/imports/blend_file.hpp>
27 #include <oglplus/detail/any_iter.hpp>
39 :
public DrawingInstructionWriter
43 struct _loading_options
45 const char* scene_name;
52 _loading_options(
bool load_all =
true)
58 _loading_options&
All(
bool load_all =
true)
60 load_normals = load_all;
61 load_tangents = load_all;
62 load_bitangents = load_all;
63 load_texcoords = load_all;
64 load_materials = load_all;
68 _loading_options& Nothing(
void)
73 _loading_options&
Normals(
bool load =
true)
79 _loading_options&
Tangents(
bool load =
true)
87 load_bitangents = load;
91 _loading_options& TexCoords(
bool load =
true)
93 load_texcoords = load;
97 _loading_options& Materials(
bool load =
true)
99 load_materials = load;
105 std::vector<GLfloat> _pos_data;
107 std::vector<GLfloat> _nml_data;
109 std::vector<GLfloat> _tgt_data;
111 std::vector<GLfloat> _btg_data;
113 std::vector<GLfloat> _uvc_data;
115 std::vector<GLshort> _mtl_data;
118 std::vector<GLuint> _idx_data;
121 std::vector<GLuint> _mesh_offsets;
122 std::vector<GLuint> _mesh_n_elems;
125 imports::BlendFileFlatStructBlockData _find_scene(
126 const _loading_options& ,
127 imports::BlendFile& blend_file,
128 imports::BlendFileStructGlobBlock& glob_block
132 return blend_file[glob_block.curscene];
137 const _loading_options& opts,
138 imports::BlendFile& blend_file,
139 imports::BlendFileFlatStructBlockData& object_mesh_data,
140 const Mat4f& mesh_matrix,
146 const _loading_options& opts,
147 aux::AnyInputIter<const char*> names_begin,
148 aux::AnyInputIter<const char*> names_end,
149 imports::BlendFile& blend_file,
150 imports::BlendFileFlatStructBlockData& object_data,
151 imports::BlendFilePointer object_data_ptr,
156 const _loading_options& opts,
157 aux::AnyInputIter<const char*> names_begin,
158 aux::AnyInputIter<const char*> names_end,
159 imports::BlendFile& blend_file
162 void _call_load_meshes(
163 imports::BlendFile& blend_file,
164 const char* scene_name,
165 aux::AnyInputIter<const char*> names_begin,
166 aux::AnyInputIter<const char*> names_end,
167 _loading_options opts
170 typedef _loading_options LoadingOptions;
177 (
const char**)
nullptr,
178 (
const char**)
nullptr,
183 template <
typename NameStr, std::
size_t NN>
185 imports::BlendFile& blend_file,
186 const std::array<NameStr, NN>& names,
187 LoadingOptions opts = LoadingOptions()
205 typedef GLuint (
BlenderMesh::*VertexAttribFunc)(std::vector<GLfloat>&)
const;
208 template <
typename T>
212 dest.insert(dest.end(), _pos_data.begin(), _pos_data.end());
217 template <
typename T>
221 dest.insert(dest.end(), _nml_data.begin(), _nml_data.end());
226 template <
typename T>
230 dest.insert(dest.end(), _tgt_data.begin(), _tgt_data.end());
235 template <
typename T>
239 dest.insert(dest.end(), _btg_data.begin(), _btg_data.end());
244 template <
typename T>
248 dest.insert(dest.end(), _uvc_data.begin(), _uvc_data.end());
252 template <
typename T>
253 GLuint MaterialNumbers(std::vector<T>& dest)
const
256 dest.insert(dest.end(), _mtl_data.begin(), _mtl_data.end());
260 #if OGLPLUS_DOCUMENTATION_ONLY
269 typedef VertexAttribsInfo<
276 VertexTexCoordinatesTag,
277 VertexMaterialNumbersTag
282 Spheref GetBoundingSphere(
void)
const;
285 template <
typename T>
307 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
308 #include <oglplus/shapes/blender_mesh.ipp>
309 #endif // OGLPLUS_LINK_LIBRARY
311 #endif // include guard
Implementation of shape draw instructions.
IndexArray Indices(Default=Default()) const
Returns element indices that are used with the drawing instructions.
Definition: blender_mesh.hpp:295
FaceOrientation
Face orientation enumeration.
Definition: face_mode.hpp:62
OpenGL face type-related enumeration.
GLuint Positions(std::vector< T > &dest) const
Makes the vertex positions and returns the number of values per vertex.
Definition: blender_mesh.hpp:209
GLuint Bitangents(std::vector< T > &dest) const
Makes the vertex bitangents and returns the number of values per vertex.
Definition: blender_mesh.hpp:236
GLuint Tangents(std::vector< T > &dest) const
Makes the vertex tangents and returns the number of values per vertex.
Definition: blender_mesh.hpp:227
Class providing vertex attributes and instructions for drawing of a mesh.
Definition: blender_mesh.hpp:38
VertexAttribsInfo< BlenderMesh > VertexAttribs
Vertex attribute information for this shape builder.
Definition: blender_mesh.hpp:267
void BoundingSphere(oglplus::Sphere< T > &bounding_sphere) const
Queries the bounding sphere coordinates and dimensions.
Definition: blender_mesh.hpp:286
GLuint Normals(std::vector< T > &dest) const
Makes the vertex normals and returns the number of values per vertex.
Definition: blender_mesh.hpp:218
Classes providing additional information about the shape builders.
Class encapsulating the instructions for drawing of a shape.
Definition: draw.hpp:219
std::vector< GLuint > IndexArray
The type of the index container returned by Indices()
Definition: blender_mesh.hpp:292
FaceOrientation FaceWinding(void) const
Returns the winding direction of faces.
Definition: blender_mesh.hpp:200
GLuint TexCoordinates(std::vector< T > &dest) const
Makes the texture coordinates and returns the number of values per vertex.
Definition: blender_mesh.hpp:245
DrawingInstructions Instructions(Default=Default()) const
Returns the instructions for rendering of faces.