zenilib: zenilib/jni/external/lib3ds/src/lib3ds_mesh.c File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Typedefs | Functions
lib3ds_mesh.c File Reference
`#include "lib3ds_impl.h"`

Go to the source code of this file.

## Typedefs

typedef struct Lib3dsFaces | Lib3dsFaces

## Functions

static void | face_array_read (Lib3dsFile *file, Lib3dsMesh *mesh, Lib3dsIo *io)
static void | face_array_write (Lib3dsFile *file, Lib3dsMesh *mesh, Lib3dsIo *io)
static void | flag_array_write (Lib3dsMesh *mesh, Lib3dsIo *io)
void | lib3ds_mesh_bounding_box (Lib3dsMesh *mesh, float bmin[3], float bmax[3])
void | lib3ds_mesh_calculate_face_normals (Lib3dsMesh *mesh, float(*face_normals)[3])
void | lib3ds_mesh_calculate_vertex_normals (Lib3dsMesh *mesh, float(*normals)[3])
void | lib3ds_mesh_free (Lib3dsMesh *mesh)
Lib3dsMesh * | lib3ds_mesh_new (const char *name)
void | lib3ds_mesh_read (Lib3dsFile *file, Lib3dsMesh *mesh, Lib3dsIo *io)
void | lib3ds_mesh_resize_faces (Lib3dsMesh *mesh, int nfaces)
void | lib3ds_mesh_resize_vertices (Lib3dsMesh *mesh, int nvertices, int use_texcos, int use_flags)
void | lib3ds_mesh_write (Lib3dsFile *file, Lib3dsMesh *mesh, Lib3dsIo *io)
static void | point_array_write (Lib3dsMesh *mesh, Lib3dsIo *io)
static void | texco_array_write (Lib3dsMesh *mesh, Lib3dsIo *io)

## Typedef Documentation

typedef struct Lib3dsFaces Lib3dsFaces

## Function Documentation

static void face_array_read | ( | Lib3dsFile * | file,
|  | Lib3dsMesh * | mesh,
|  | Lib3dsIo * | io
| ) |  |

static

Definition at line 238 of file lib3ds_mesh.c.

References Lib3dsMesh::box_back, Lib3dsMesh::box_bottom, Lib3dsMesh::box_front, Lib3dsMesh::box_left, Lib3dsMesh::box_right, Lib3dsMesh::box_top, CHK_FACE_ARRAY, CHK_MSH_BOXMAP, CHK_MSH_MAT_GROUP, CHK_SMOOTH_GROUP, chunk, Lib3dsMesh::faces, Lib3dsFace::flags, i, Lib3dsFace::index, lib3ds_chunk_read_end(), lib3ds_chunk_read_next(), lib3ds_chunk_read_start(), lib3ds_chunk_read_tell(), lib3ds_chunk_unknown(), lib3ds_file_material_by_name(), lib3ds_io_read_dword(), lib3ds_io_read_string(), lib3ds_io_read_word(), lib3ds_mesh_resize_faces(), Lib3dsFace::material, Lib3dsMesh::nfaces, and Lib3dsFace::smoothing_group.

Referenced by lib3ds_mesh_read().

static void face_array_write | ( | Lib3dsFile * | file,
|  | Lib3dsMesh * | mesh,
|  | Lib3dsIo * | io
| ) |  |

static

Definition at line 488 of file lib3ds_mesh.c.

References assert, Lib3dsMesh::box_back, Lib3dsMesh::box_bottom, Lib3dsMesh::box_front, Lib3dsMesh::box_left, Lib3dsMesh::box_right, Lib3dsMesh::box_top, calloc, CHK_FACE_ARRAY, CHK_MSH_BOXMAP, CHK_MSH_MAT_GROUP, CHK_SMOOTH_GROUP, Lib3dsChunk::chunk, Lib3dsMesh::faces, Lib3dsFace::flags, free, i, Lib3dsIo::impl, Lib3dsFace::index, j, lib3ds_chunk_write(), lib3ds_chunk_write_end(), lib3ds_chunk_write_start(), lib3ds_io_write_dword(), lib3ds_io_write_string(), lib3ds_io_write_word(), Lib3dsFace::material, Lib3dsFile::materials, Lib3dsMaterial::name, Lib3dsMesh::nfaces, Lib3dsFile::nmaterials, NULL, Lib3dsChunk::size, and Lib3dsFace::smoothing_group.

Referenced by lib3ds_mesh_write().

static void flag_array_write | ( | Lib3dsMesh * | mesh,
|  | Lib3dsIo * | io
| ) |  |

static

Definition at line 468 of file lib3ds_mesh.c.

References CHK_POINT_FLAG_ARRAY, Lib3dsChunk::chunk, i, lib3ds_chunk_write(), lib3ds_io_write_word(), Lib3dsMesh::nvertices, Lib3dsChunk::size, and Lib3dsMesh::vflags.

Referenced by lib3ds_mesh_write().

void lib3ds_mesh_read | ( | Lib3dsFile * | file,
|  | Lib3dsMesh * | mesh,
|  | Lib3dsIo * | io
| ) |  |

Definition at line 311 of file lib3ds_mesh.c.

References CHK_FACE_ARRAY, CHK_MESH_COLOR, CHK_MESH_MATRIX, CHK_MESH_TEXTURE_INFO, CHK_N_TRI_OBJECT, CHK_POINT_ARRAY, CHK_POINT_FLAG_ARRAY, CHK_TEX_VERTS, chunk, Lib3dsMesh::color, face_array_read(), i, if(), j, lib3ds_chunk_read_end(), lib3ds_chunk_read_next(), lib3ds_chunk_read_reset(), lib3ds_chunk_read_start(), lib3ds_chunk_unknown(), lib3ds_io_read_byte(), lib3ds_io_read_float(), lib3ds_io_read_vector(), lib3ds_io_read_word(), lib3ds_matrix_copy(), lib3ds_matrix_det(), lib3ds_matrix_identity(), lib3ds_matrix_inv(), lib3ds_matrix_mult(), lib3ds_matrix_scale(), lib3ds_mesh_resize_vertices(), lib3ds_vector_copy(), lib3ds_vector_transform(), Lib3dsMesh::map_cylinder_height, Lib3dsMesh::map_matrix, Lib3dsMesh::map_planar_size, Lib3dsMesh::map_pos, Lib3dsMesh::map_scale, Lib3dsMesh::map_tile, Lib3dsMesh::matrix, NULL, Lib3dsMesh::nvertices, Lib3dsMesh::texcos, Lib3dsMesh::vertices, and Lib3dsMesh::vflags.

Referenced by named_object_read().

void lib3ds_mesh_write | ( | Lib3dsFile * | file,
|  | Lib3dsMesh * | mesh,
|  | Lib3dsIo * | io
| ) |  |

Definition at line 610 of file lib3ds_mesh.c.

References CHK_MESH_COLOR, CHK_MESH_MATRIX, CHK_MESH_TEXTURE_INFO, CHK_N_TRI_OBJECT, Lib3dsChunk::chunk, Lib3dsMesh::color, face_array_write(), flag_array_write(), i, j, lib3ds_chunk_write(), lib3ds_chunk_write_end(), lib3ds_chunk_write_start(), lib3ds_io_write_byte(), lib3ds_io_write_float(), lib3ds_io_write_vector(), lib3ds_io_write_word(), LIB3DS_MAP_NONE, Lib3dsMesh::map_cylinder_height, Lib3dsMesh::map_matrix, Lib3dsMesh::map_planar_size, Lib3dsMesh::map_pos, Lib3dsMesh::map_scale, Lib3dsMesh::map_tile, Lib3dsMesh::map_type, Lib3dsMesh::matrix, point_array_write(), Lib3dsChunk::size, and texco_array_write().

Referenced by mdata_write().

static void point_array_write | ( | Lib3dsMesh * | mesh,
|  | Lib3dsIo * | io
| ) |  |

static

Definition at line 433 of file lib3ds_mesh.c.

References CHK_POINT_ARRAY, Lib3dsChunk::chunk, i, lib3ds_chunk_write(), lib3ds_io_write_vector(), lib3ds_io_write_word(), lib3ds_matrix_copy(), lib3ds_matrix_det(), lib3ds_matrix_inv(), lib3ds_matrix_mult(), lib3ds_matrix_scale(), lib3ds_vector_transform(), Lib3dsMesh::matrix, Lib3dsMesh::nvertices, Lib3dsChunk::size, and Lib3dsMesh::vertices.

Referenced by lib3ds_mesh_write().

static void texco_array_write | ( | Lib3dsMesh * | mesh,
|  | Lib3dsIo * | io
| ) |  |

static

Definition at line 589 of file lib3ds_mesh.c.

References CHK_TEX_VERTS, Lib3dsChunk::chunk, i, lib3ds_chunk_write(), lib3ds_io_write_float(), lib3ds_io_write_word(), Lib3dsMesh::nvertices, Lib3dsChunk::size, and Lib3dsMesh::texcos.

Referenced by lib3ds_mesh_write().