3 Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include "irrlichttypes_extrabloated.h"
27 Create a new cube mesh.
28 Vertices are at (+-scale.X/2, +-scale.Y/2, +-scale.Z/2).
30 The resulting mesh has 6 materials (up, down, right, left, back, front)
31 which must be defined by the caller.
33 scene::IAnimatedMesh* createCubeMesh(v3f scale);
36 Create a new extruded mesh from a texture.
37 Maximum bounding box is (+-scale.X/2, +-scale.Y/2, +-scale.Z).
38 Thickness is in Z direction.
40 The resulting mesh has 1 material which must be defined by the caller.
42 scene::IAnimatedMesh* createExtrudedMesh(video::ITexture *texture,
43 video::IVideoDriver *driver, v3f scale);
46 Multiplies each vertex coordinate by the specified scaling factors
47 (componentwise vector multiplication).
49 void scaleMesh(scene::IMesh *mesh, v3f scale);
52 Translate each vertex coordinate by the specified vector.
54 void translateMesh(scene::IMesh *mesh, v3f vec);
57 Set a constant color for all vertices in the mesh
59 void setMeshColor(scene::IMesh *mesh, const video::SColor &color);
62 Set the color of all vertices in the mesh.
63 For each vertex, determine the largest absolute entry in
64 the normal vector, and choose one of colorX, colorY or
67 void setMeshColorByNormalXYZ(scene::IMesh *mesh,
68 const video::SColor &colorX,
69 const video::SColor &colorY,
70 const video::SColor &colorZ);
73 Render a mesh to a texture.
74 Returns NULL if render-to-texture failed.
76 video::ITexture *generateTextureFromMesh(scene::IMesh *mesh,
77 IrrlichtDevice *device,
78 core::dimension2d<u32> dim,
79 std::string texture_name,
82 core::CMatrix4<f32> camera_projection_matrix,
83 video::SColorf ambient_light,
85 video::SColorf light_color,