]>
Dogcows Code - chaz/yoink/blob - src/moof/mesh.hh
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
10 **************************************************************************/
12 #ifndef _MOOF_MESH_HH_
13 #define _MOOF_MESH_HH_
17 * Defines classes for loading and manipulating meshes.
22 #include <boost/noncopyable.hpp>
23 #include <boost/shared_ptr.hpp>
25 #include <moof/drawable.hh>
26 #include <moof/image.hh>
27 #include <moof/math.hh>
28 #include <moof/resource.hh>
34 class mesh
: public boost::noncopyable
, public drawable
38 explicit mesh(const std::string
& path
);
40 void draw(scalar alpha
= SCALAR(0.0)) const;
45 material(const std::string
& id
) :
59 void set_material(int index
) const;
60 void set_material(const material
& material
) const;
62 struct material_group
: public drawable
66 void draw(scalar alpha
= SCALAR(0.0)) const;
69 std::vector
<unsigned> triangles
;
70 std::vector
<vector2
> triangles_uv
;
75 typedef boost::shared_ptr
<object
> object_ptr
;
80 texrep(SCALAR(1.0), SCALAR(1.0)) {}
82 static object_ptr
alloc()
84 return object_ptr(new object
);
88 void draw(const mesh
& mesh
, scalar alpha
= SCALAR(0.0)) const;
98 std::vector
<vector3
> verts
;
99 std::vector
<material_group
> faces
;
101 std::vector
<object_ptr
> kids
;
108 void import(std::istream
& stream
);
110 std::vector
<material
> materials_
;
111 std::vector
<object_ptr
> objects_
;
114 typedef resource_handle
<mesh
> mesh_handle
;
119 #endif // _MOOF_MESH_HH_
This page took 0.035666 seconds and 5 git commands to generate.