153 template<
typename color_t>
157 static_assert(is_color<color_t>::value,
"color_t must be one of the color types defined in color.h");
228 void * ram1_buffer,
size_t ram1_size,
229 void * ram2_buffer,
size_t ram2_size,
230 const char * copy_order =
"VNTIF",
231 size_t * ram1_used =
nullptr,
232 size_t * ram2_used =
nullptr);
240#if defined(ARDUINO_TEENSY41)
265 bool copy_vertices =
false,
266 bool copy_normals =
false,
267 bool copy_texcoords =
false,
268 bool copy_textures =
true,
269 bool copy_faces =
false);
Color classes [RGB565, RGB24, RGB32, RGB64, RGBf, HSV].
void freeMeshEXTMEM(Mesh3D< color_t > *mesh)
Delete a mesh allocated with copyMeshEXTMEM().
const Mesh3D< color_t > * cacheMesh(const Mesh3D< color_t > *mesh, void *ram1_buffer, size_t ram1_size, void *ram2_buffer, size_t ram2_size, const char *copy_order="VNTIF", size_t *ram1_used=nullptr, size_t *ram2_used=nullptr)
Creates a "cache version" of a mesh by copying part of its data into fast memory buffers.
Mesh3D< color_t > * copyMeshEXTMEM(const Mesh3D< color_t > *mesh, bool copy_vertices=false, bool copy_normals=false, bool copy_texcoords=false, bool copy_textures=true, bool copy_faces=false)
Create a copy of a mesh where specified arrays in PROGMEM are copied to EXTMEM.
Utility/miscellaneous functions used throughout the library.
Image class [MAIN CLASS FOR THE 2D API].
Definition: Image.h:143
3D mesh data stucture.
Definition: Mesh3D.h:155
const fVec3 * vertice
Vertex array.
Definition: Mesh3D.h:167
float ambiant_strength
Object ambiant coefficient (how much it reflects the ambiant light component). Typical value: 0....
Definition: Mesh3D.h:176
const char * name
Mesh name, or nullptr.
Definition: Mesh3D.h:185
uint16_t nb_vertices
Number of vertices in the vertex array.
Definition: Mesh3D.h:161
const Mesh3D * next
Next object to draw when chaining is enabled. nullptr at end of chain.
Definition: Mesh3D.h:181
fBox3 bounding_box
Object bounding box.
Definition: Mesh3D.h:183
uint16_t nb_texcoords
Number of texture coordinates in the texcoord array.
Definition: Mesh3D.h:162
float specular_strength
Object ambiant coefficient (how much it reflects the specular light component). Typical value: 0....
Definition: Mesh3D.h:178
const fVec2 * texcoord
Texture coord array (nullptr if none).
Definition: Mesh3D.h:168
const Image< color_t > * texture
Texture image (or nullptr if none).
Definition: Mesh3D.h:172
int specular_exponent
Specular exponent. 0 to disable specular lightning. Typical value between 4 and 64.
Definition: Mesh3D.h:179
float diffuse_strength
Object diffuse coefficient (how much it reflects the diffuse light component). Typical value: 0....
Definition: Mesh3D.h:177
RGBf color
Default color to use when texturing is disabled.
Definition: Mesh3D.h:174
uint16_t nb_normals
Number of normal vectors in the normal array.
Definition: Mesh3D.h:163
uint16_t nb_faces
Number of triangular faces in the mesh.
Definition: Mesh3D.h:164
const uint16_t * face
Array of triangles (format described above).
Definition: Mesh3D.h:170
const fVec3 * normal
Normal vector array (nullptr if none). all vectors must have unit norm.
Definition: Mesh3D.h:169
uint16_t len_face
Number of elements (uint16_t) in the face array.
Definition: Mesh3D.h:165
int32_t id
Set to 1 (may change in future version).
Definition: Mesh3D.h:159
Color in R,G,B float format.
Definition: Color.h:2407