155 template<
typename color_t>
159 static_assert(is_color<color_t>::value,
"color_t must be one of the color types defined in color.h");
236 void * ram1_buffer,
size_t ram1_size,
237 void * ram2_buffer,
size_t ram2_size,
238 const char * copy_order =
"VNTIF",
239 size_t * ram1_used =
nullptr,
240 size_t * ram2_used =
nullptr);
247 void * ram_buffer,
size_t ram_size,
248 const char * copy_order =
"VNTIF",
249 size_t * ram_used =
nullptr);
257#if defined(ARDUINO_TEENSY41)
283 bool copy_vertices =
false,
284 bool copy_normals =
false,
285 bool copy_texcoords =
false,
286 bool copy_textures =
true,
287 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 cached version of a Mesh3D object by copying selected data arrays into one or two user-supp...
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 Mesh3D object where selected PROGMEM arrays are copied to EXTMEM.
Utility/miscellaneous functions used throughout the library.
Image class [MAIN CLASS FOR THE 2D API].
Definition: Image.h:145
3D mesh data structure.
Definition: Mesh3D.h:157
const fVec3 * vertice
Vertex array.
Definition: Mesh3D.h:169
float ambiant_strength
Object ambient coefficient (how much it reflects the ambient light component). Typical value: 0....
Definition: Mesh3D.h:178
const char * name
Mesh name, or nullptr.
Definition: Mesh3D.h:187
uint16_t nb_vertices
Number of vertices in the vertex array.
Definition: Mesh3D.h:163
const Mesh3D * next
Next object to draw when chaining is enabled. nullptr at end of chain.
Definition: Mesh3D.h:183
fBox3 bounding_box
Object bounding box.
Definition: Mesh3D.h:185
uint16_t nb_texcoords
Number of texture coordinates in the texcoord array.
Definition: Mesh3D.h:164
float specular_strength
Object specular coefficient (how much it reflects the specular light component). Typical value: 0....
Definition: Mesh3D.h:180
const fVec2 * texcoord
Texture coord array (nullptr if none).
Definition: Mesh3D.h:170
const Image< color_t > * texture
Texture image (or nullptr if none).
Definition: Mesh3D.h:174
int specular_exponent
Specular exponent. 0 to disable specular lighting. Typical value between 4 and 64.
Definition: Mesh3D.h:181
float diffuse_strength
Object diffuse coefficient (how much it reflects the diffuse light component). Typical value: 0....
Definition: Mesh3D.h:179
RGBf color
Default color to use when texturing is disabled.
Definition: Mesh3D.h:176
uint16_t nb_normals
Number of normal vectors in the normal array.
Definition: Mesh3D.h:165
uint16_t nb_faces
Number of triangular faces in the mesh.
Definition: Mesh3D.h:166
const uint16_t * face
Array of triangles (format described above).
Definition: Mesh3D.h:172
const fVec3 * normal
Normal vector array (nullptr if none). all vectors must have unit norm.
Definition: Mesh3D.h:171
uint16_t len_face
Number of elements (uint16_t) in the face array.
Definition: Mesh3D.h:167
int32_t id
Set to 1 (may change in future version).
Definition: Mesh3D.h:161
Color in R,G,B float format.
Definition: Color.h:2407