#include "picointernal.h"
Go to the source code of this file.
Definition at line 1555 of file picomodel.c.
Referenced by _pico_normal_is_unit_length().
#define HASH_NORMAL_EPSILON 0.02f |
Definition at line 1125 of file picomodel.c.
Referenced by PicoFindVertexCombinationInHashTable().
#define HASH_ST_EPSILON 0.0001f |
Definition at line 1124 of file picomodel.c.
Referenced by PicoFindVertexCombinationInHashTable().
#define HASH_XYZ_EPSILON 0.01f |
Definition at line 1122 of file picomodel.c.
Referenced by PicoFindVertexCombinationInHashTable().
#define HASH_XYZ_EPSILONSPACE_MULTIPLIER 1.f / HASH_XYZ_EPSILON |
Definition at line 1123 of file picomodel.c.
Referenced by PicoVertexCoordGenerateHash().
#define HASHTABLE_SIZE 7919 |
Definition at line 1121 of file picomodel.c.
Referenced by PicoFreeVertexCombinationHashTable(), PicoNewVertexCombinationHashTable(), and PicoVertexCoordGenerateHash().
#define NORMAL_UNIT_LENGTH_EPSILON 0.01 |
Definition at line 1554 of file picomodel.c.
Referenced by _pico_normal_is_unit_length().
#define PICOMODEL_C |
Definition at line 36 of file picomodel.c.
typedef struct _BinaryTree BinaryTree |
typedef struct _BinaryTreeNode BinaryTreeNode |
typedef struct _IndexArray IndexArray |
typedef int(* LessFunc)(void *, picoIndex_t, picoIndex_t) |
Definition at line 1370 of file picomodel.c.
typedef picoIndex_t* picoIndexIter_t |
Definition at line 1509 of file picomodel.c.
typedef picoVec3_t* picoNormalIter_t |
Definition at line 1508 of file picomodel.c.
typedef struct picoSmoothVertices_s picoSmoothVertices_t |
typedef struct _UniqueIndices UniqueIndices |
static double _pico_length_vec | ( | picoVec3_t | vec | ) | [static] |
Definition at line 1549 of file picomodel.c.
Referenced by _pico_normal_is_unit_length().
static int _pico_normal_is_unit_length | ( | picoVec3_t | normal | ) | [static] |
Definition at line 1557 of file picomodel.c.
References _pico_length_vec(), FLOAT_EQUAL_EPSILON, and NORMAL_UNIT_LENGTH_EPSILON.
Referenced by _pico_normals_assign_generated_normals().
static int _pico_normal_within_tolerance | ( | picoVec3_t | normal, | |
picoVec3_t | other | |||
) | [static] |
Definition at line 1562 of file picomodel.c.
References _pico_dot_vec().
Referenced by _pico_normals_assign_generated_normals().
static void _pico_normals_assign_generated_normals | ( | picoNormalIter_t | first, | |
picoNormalIter_t | last, | |||
picoNormalIter_t | generated | |||
) | [static] |
Definition at line 1567 of file picomodel.c.
References _pico_copy_vec(), _pico_normal_is_unit_length(), and _pico_normal_within_tolerance().
Referenced by PicoFixSurfaceNormals().
static void _pico_normals_normalize | ( | picoNormalIter_t | first, | |
picoNormalIter_t | last | |||
) | [static] |
Definition at line 1542 of file picomodel.c.
References _pico_normalize_vec().
Referenced by PicoFixSurfaceNormals().
static void _pico_normals_zero | ( | picoNormalIter_t | first, | |
picoNormalIter_t | last | |||
) | [static] |
Definition at line 1535 of file picomodel.c.
References _pico_zero_vec().
Referenced by PicoFixSurfaceNormals().
static void _pico_triangles_generate_weighted_normals | ( | picoIndexIter_t | first, | |
picoIndexIter_t | end, | |||
picoVec3_t * | xyz, | |||
picoVec3_t * | normals | |||
) | [static] |
Definition at line 1511 of file picomodel.c.
References _pico_add_vec(), _pico_cross_vec(), and _pico_subtract_vec().
Referenced by PicoFixSurfaceNormals().
static void _pico_vertices_combine_shared_normals | ( | picoVec3_t * | xyz, | |
picoIndex_t * | smoothingGroups, | |||
picoVec3_t * | normals, | |||
picoIndex_t | numVertices | |||
) | [static] |
Definition at line 1469 of file picomodel.c.
References _pico_add_vec(), _pico_copy_vec(), _IndexArray::data, i, indexarray_clear(), indexarray_push_back(), indexarray_reserve(), _UniqueIndices::indices, _IndexArray::last, lessSmoothVertex(), UniqueIndices_destroy(), UniqueIndices_init(), UniqueIndices_insert(), UniqueIndices_reserve(), and UniqueIndices_size().
Referenced by PicoFixSurfaceNormals().
static void binarytree_clear | ( | BinaryTree * | self | ) | [static] |
Definition at line 1365 of file picomodel.c.
References _pico_free().
Referenced by UniqueIndices_destroy().
static void binarytree_extend | ( | BinaryTree * | self | ) | [static] |
Definition at line 1348 of file picomodel.c.
Referenced by UniqueIndices_find_or_insert(), and UniqueIndices_insert().
static void binarytree_reserve | ( | BinaryTree * | self, | |
size_t | size | |||
) | [static] |
Definition at line 1360 of file picomodel.c.
References _pico_calloc().
Referenced by UniqueIndices_reserve().
static size_t binarytree_size | ( | BinaryTree * | self | ) | [static] |
Definition at line 1355 of file picomodel.c.
Referenced by UniqueIndices_find_or_insert(), and UniqueIndices_size().
static void indexarray_clear | ( | IndexArray * | self | ) | [static] |
Definition at line 1331 of file picomodel.c.
References _pico_free().
Referenced by _pico_vertices_combine_shared_normals(), and UniqueIndices_destroy().
static void indexarray_push_back | ( | IndexArray * | self, | |
picoIndex_t | value | |||
) | [static] |
Definition at line 1321 of file picomodel.c.
Referenced by _pico_vertices_combine_shared_normals(), UniqueIndices_find_or_insert(), and UniqueIndices_insert().
static void indexarray_reserve | ( | IndexArray * | self, | |
size_t | size | |||
) | [static] |
Definition at line 1326 of file picomodel.c.
References _pico_calloc().
Referenced by _pico_vertices_combine_shared_normals(), and UniqueIndices_reserve().
static int lessSmoothVertex | ( | void * | data, | |
picoIndex_t | first, | |||
picoIndex_t | second | |||
) | [static] |
Definition at line 1454 of file picomodel.c.
References picoSmoothVertices_s::smoothingGroups, and picoSmoothVertices_s::xyz.
Referenced by _pico_vertices_combine_shared_normals().
void PicoAddTriangleToModel | ( | picoModel_t * | model, | |
picoVec3_t ** | xyz, | |||
picoVec3_t ** | normals, | |||
int | numSTs, | |||
picoVec2_t ** | st, | |||
int | numColors, | |||
picoColor_t ** | colors, | |||
picoShader_t * | shader, | |||
picoIndex_t * | smoothingGroup | |||
) |
A nice way to add individual triangles to the model. Chooses an appropriate surface based on the shader, or adds a new surface if necessary.
Definition at line 1598 of file picomodel.c.
References _pico_printf(), i, picoShader_s::name, picoModel_s::numSurfaces, PICO_ERROR, PICO_TRIANGLES, PicoFindSurfaceVertexNum(), PicoGetSurfaceNumIndexes(), PicoGetSurfaceNumVertexes(), PicoNewSurface(), PicoSetSurfaceColor(), PicoSetSurfaceIndex(), PicoSetSurfaceName(), PicoSetSurfaceNormal(), PicoSetSurfaceShader(), PicoSetSurfaceSmoothingGroup(), PicoSetSurfaceST(), PicoSetSurfaceType(), PicoSetSurfaceXYZ(), picoSurface_s::shader, and picoModel_s::surface.
Referenced by _ase_submit_triangles().
picoVertexCombinationHash_t* PicoAddVertexCombinationToHashTable | ( | picoVertexCombinationHash_t ** | hashTable, | |
picoVec3_t | xyz, | |||
picoVec3_t | normal, | |||
picoVec3_t | st, | |||
picoColor_t | color, | |||
picoIndex_t | index | |||
) |
Definition at line 1229 of file picomodel.c.
References _pico_alloc(), _pico_copy_color(), _pico_copy_vec(), _pico_copy_vec2(), picoVertexCombinationData_s::color, picoVertexCombinationHash_s::data, hash(), picoVertexCombinationHash_s::index, picoVertexCombinationHash_s::next, picoVertexCombinationData_s::normal, PicoVertexCoordGenerateHash(), picoVertexCombinationData_s::st, picoVertexCombinationHash_s::vcd, and picoVertexCombinationData_s::xyz.
int PicoAdjustModel | ( | picoModel_t * | model, | |
int | numShaders, | |||
int | numSurfaces | |||
) |
adjusts a models's memory allocations to handle the requested sizes. will always grow, never shrink
Definition at line 285 of file picomodel.c.
References _pico_realloc(), picoModel_s::maxShaders, picoModel_s::maxSurfaces, picoModel_s::numShaders, picoModel_s::numSurfaces, PICO_GROW_SHADERS, PICO_GROW_SURFACES, picoModel_s::shader, and picoModel_s::surface.
Referenced by PicoNewShader(), and PicoNewSurface().
int PicoAdjustSurface | ( | picoSurface_t * | surface, | |
int | numVertexes, | |||
int | numSTArrays, | |||
int | numColorArrays, | |||
int | numIndexes, | |||
int | numFaceNormals | |||
) |
adjusts a surface's memory allocations to handle the requested sizes. will always grow, never shrink
Definition at line 485 of file picomodel.c.
References _pico_alloc(), _pico_realloc(), picoSurface_s::color, picoSurface_s::faceNormal, i, picoSurface_s::index, picoSurface_s::maxColorArrays, picoSurface_s::maxFaceNormals, picoSurface_s::maxIndexes, picoSurface_s::maxSTArrays, picoSurface_s::maxVertexes, picoSurface_s::normal, picoSurface_s::numColorArrays, picoSurface_s::numFaceNormals, picoSurface_s::numIndexes, picoSurface_s::numSTArrays, picoSurface_s::numVertexes, PICO_GROW_ARRAYS, PICO_GROW_FACES, PICO_GROW_INDEXES, PICO_GROW_VERTEXES, picoSurface_s::smoothingGroup, picoSurface_s::st, and picoSurface_s::xyz.
Referenced by PicoSetFaceNormal(), PicoSetSurfaceColor(), PicoSetSurfaceIndex(), PicoSetSurfaceIndexes(), PicoSetSurfaceNormal(), PicoSetSurfaceSmoothingGroup(), PicoSetSurfaceST(), and PicoSetSurfaceXYZ().
int PicoError | ( | void | ) |
returns last picomodel error code (see PME_* defines)
Definition at line 62 of file picomodel.c.
picoShader_t* PicoFindShader | ( | picoModel_t * | model, | |
char * | name, | |||
int | caseSensitive | |||
) |
finds a named shader in a model
Definition at line 387 of file picomodel.c.
References _pico_stricmp, i, picoShader_s::name, picoModel_s::numShaders, and picoModel_s::shader.
picoSurface_t* PicoFindSurface | ( | picoModel_t * | model, | |
char * | name, | |||
int | caseSensitive | |||
) |
Finds first matching named surface in a model.
Definition at line 587 of file picomodel.c.
References _pico_stricmp, i, picoSurface_s::name, picoModel_s::numSurfaces, and picoModel_s::surface.
int PicoFindSurfaceVertexNum | ( | picoSurface_t * | surface, | |
picoVec3_t | xyz, | |||
picoVec3_t | normal, | |||
int | numSTs, | |||
picoVec2_t * | st, | |||
int | numColors, | |||
picoColor_t * | color, | |||
picoIndex_t | smoothingGroup | |||
) |
finds a vertex matching the set parameters
Definition at line 1262 of file picomodel.c.
References picoSurface_s::color, i, picoSurface_s::normal, picoSurface_s::numVertexes, picoSurface_s::smoothingGroup, picoSurface_s::st, and picoSurface_s::xyz.
Referenced by PicoAddTriangleToModel().
picoVertexCombinationHash_t* PicoFindVertexCombinationInHashTable | ( | picoVertexCombinationHash_t ** | hashTable, | |
picoVec3_t | xyz, | |||
picoVec3_t | normal, | |||
picoVec3_t | st, | |||
picoColor_t | color | |||
) |
Definition at line 1187 of file picomodel.c.
References picoVertexCombinationData_s::color, hash(), HASH_NORMAL_EPSILON, HASH_ST_EPSILON, HASH_XYZ_EPSILON, picoVertexCombinationHash_s::next, picoVertexCombinationData_s::normal, PicoVertexCoordGenerateHash(), picoVertexCombinationData_s::st, picoVertexCombinationHash_s::vcd, and picoVertexCombinationData_s::xyz.
void PicoFixSurfaceNormals | ( | picoSurface_t * | surface | ) |
Definition at line 1577 of file picomodel.c.
References _pico_calloc(), _pico_free(), _pico_normals_assign_generated_normals(), _pico_normals_normalize(), _pico_normals_zero(), _pico_triangles_generate_weighted_normals(), _pico_vertices_combine_shared_normals(), picoSurface_s::index, picoSurface_s::normal, picoSurface_s::numIndexes, picoSurface_s::numVertexes, picoSurface_s::smoothingGroup, and picoSurface_s::xyz.
void PicoFreeModel | ( | picoModel_t * | model | ) |
frees a model and all associated data
Definition at line 252 of file picomodel.c.
References _pico_free(), picoModel_s::fileName, i, picoModel_s::name, picoModel_s::numShaders, picoModel_s::numSurfaces, PicoFreeShader(), PicoFreeSurface(), picoModel_s::shader, and picoModel_s::surface.
Referenced by _ase_load(), _md2_load(), and _md3_load().
void PicoFreeShader | ( | picoShader_t * | shader | ) |
frees a shader and all associated data -sea
Definition at line 368 of file picomodel.c.
References _pico_free(), picoShader_s::mapName, and picoShader_s::name.
Referenced by PicoFreeModel().
void PicoFreeSurface | ( | picoSurface_t * | surface | ) |
frees a surface and all associated data
Definition at line 451 of file picomodel.c.
References _pico_free(), picoSurface_s::color, picoSurface_s::faceNormal, i, picoSurface_s::index, picoSurface_s::name, picoSurface_s::normal, picoSurface_s::numColorArrays, picoSurface_s::numSTArrays, picoSurface_s::smoothingGroup, picoSurface_s::st, and picoSurface_s::xyz.
Referenced by PicoFreeModel().
void PicoFreeVertexCombinationHashTable | ( | picoVertexCombinationHash_t ** | hashTable | ) |
Definition at line 1159 of file picomodel.c.
References _pico_free(), picoVertexCombinationHash_s::data, HASHTABLE_SIZE, i, and picoVertexCombinationHash_s::next.
picoVec_t* PicoGetFaceNormal | ( | picoSurface_t * | surface, | |
int | num | |||
) |
Definition at line 1099 of file picomodel.c.
References picoSurface_s::faceNormal, and picoSurface_s::numFaceNormals.
void* PicoGetModelData | ( | picoModel_t * | model | ) |
Definition at line 879 of file picomodel.c.
References picoModel_s::data.
char* PicoGetModelFileName | ( | picoModel_t * | model | ) |
Definition at line 856 of file picomodel.c.
References picoModel_s::fileName.
int PicoGetModelFrameNum | ( | picoModel_t * | model | ) |
Definition at line 865 of file picomodel.c.
References picoModel_s::frameNum.
char* PicoGetModelName | ( | picoModel_t * | model | ) |
Definition at line 847 of file picomodel.c.
References picoModel_s::name.
int PicoGetModelNumFrames | ( | picoModel_t * | model | ) |
Definition at line 872 of file picomodel.c.
References picoModel_s::numFrames.
int PicoGetModelNumShaders | ( | picoModel_t * | model | ) |
Definition at line 886 of file picomodel.c.
References picoModel_s::numShaders.
int PicoGetModelNumSurfaces | ( | picoModel_t * | model | ) |
Definition at line 907 of file picomodel.c.
References picoModel_s::numSurfaces.
picoShader_t* PicoGetModelShader | ( | picoModel_t * | model, | |
int | num | |||
) |
Definition at line 893 of file picomodel.c.
References picoModel_s::numShaders, and picoModel_s::shader.
Referenced by _md2_load().
picoSurface_t* PicoGetModelSurface | ( | picoModel_t * | model, | |
int | num | |||
) |
Definition at line 914 of file picomodel.c.
References picoModel_s::numSurfaces, and picoModel_s::surface.
int PicoGetModelTotalIndexes | ( | picoModel_t * | model | ) |
Definition at line 944 of file picomodel.c.
References count, i, picoModel_s::numSurfaces, PicoGetSurfaceNumIndexes(), and picoModel_s::surface.
int PicoGetModelTotalVertexes | ( | picoModel_t * | model | ) |
Definition at line 928 of file picomodel.c.
References count, i, picoModel_s::numSurfaces, PicoGetSurfaceNumVertexes(), and picoModel_s::surface.
picoByte_t* PicoGetShaderAmbientColor | ( | picoShader_t * | shader | ) |
Definition at line 978 of file picomodel.c.
References picoShader_s::ambientColor.
picoByte_t* PicoGetShaderDiffuseColor | ( | picoShader_t * | shader | ) |
Definition at line 985 of file picomodel.c.
References picoShader_s::diffuseColor.
char* PicoGetShaderMapName | ( | picoShader_t * | shader | ) |
Definition at line 969 of file picomodel.c.
References picoShader_s::mapName.
char* PicoGetShaderName | ( | picoShader_t * | shader | ) |
Definition at line 960 of file picomodel.c.
References picoShader_s::name.
float PicoGetShaderShininess | ( | picoShader_t * | shader | ) |
Definition at line 1006 of file picomodel.c.
References picoShader_s::shininess.
picoByte_t* PicoGetShaderSpecularColor | ( | picoShader_t * | shader | ) |
Definition at line 992 of file picomodel.c.
References picoShader_s::specularColor.
float PicoGetShaderTransparency | ( | picoShader_t * | shader | ) |
Definition at line 999 of file picomodel.c.
References picoShader_s::transparency.
picoByte_t* PicoGetSurfaceColor | ( | picoSurface_t * | surface, | |
int | array, | |||
int | num | |||
) |
Definition at line 1071 of file picomodel.c.
References picoSurface_s::color, picoSurface_s::numColorArrays, and picoSurface_s::numVertexes.
void* PicoGetSurfaceData | ( | picoSurface_t * | surface | ) |
Definition at line 1013 of file picomodel.c.
References picoSurface_s::data.
picoIndex_t PicoGetSurfaceIndex | ( | picoSurface_t * | surface, | |
int | num | |||
) |
Definition at line 1085 of file picomodel.c.
References picoSurface_s::index, and picoSurface_s::numIndexes.
picoIndex_t* PicoGetSurfaceIndexes | ( | picoSurface_t * | surface, | |
int | num | |||
) |
Definition at line 1092 of file picomodel.c.
References picoSurface_s::index, and picoSurface_s::numIndexes.
char * PicoGetSurfaceName | ( | picoSurface_t * | surface | ) |
Definition at line 1027 of file picomodel.c.
References picoSurface_s::name.
picoVec_t* PicoGetSurfaceNormal | ( | picoSurface_t * | surface, | |
int | num | |||
) |
Definition at line 1057 of file picomodel.c.
References picoSurface_s::normal, and picoSurface_s::numVertexes.
int PicoGetSurfaceNumIndexes | ( | picoSurface_t * | surface | ) |
Definition at line 1078 of file picomodel.c.
References picoSurface_s::numIndexes.
Referenced by PicoAddTriangleToModel(), and PicoGetModelTotalIndexes().
int PicoGetSurfaceNumVertexes | ( | picoSurface_t * | surface | ) |
Definition at line 1043 of file picomodel.c.
References picoSurface_s::numVertexes.
Referenced by PicoAddTriangleToModel(), and PicoGetModelTotalVertexes().
picoShader_t* PicoGetSurfaceShader | ( | picoSurface_t * | surface | ) |
Definition at line 1036 of file picomodel.c.
References picoSurface_s::shader.
int PicoGetSurfaceSpecial | ( | picoSurface_t * | surface, | |
int | num | |||
) |
Definition at line 1106 of file picomodel.c.
References PICO_MAX_SPECIAL, and picoSurface_s::special.
picoVec_t* PicoGetSurfaceST | ( | picoSurface_t * | surface, | |
int | array, | |||
int | num | |||
) |
Definition at line 1064 of file picomodel.c.
References picoSurface_s::numSTArrays, picoSurface_s::numVertexes, and picoSurface_s::st.
picoSurfaceType_t PicoGetSurfaceType | ( | picoSurface_t * | surface | ) |
Definition at line 1020 of file picomodel.c.
References PICO_BAD, and picoSurface_s::type.
picoVec_t* PicoGetSurfaceXYZ | ( | picoSurface_t * | surface, | |
int | num | |||
) |
Definition at line 1050 of file picomodel.c.
References picoSurface_s::numVertexes, and picoSurface_s::xyz.
int PicoInit | ( | void | ) |
Definition at line 46 of file picomodel.c.
picoModel_t* PicoLoadModel | ( | char * | fileName, | |
int | frameNum | |||
) |
the meat and potatoes function
Definition at line 136 of file picomodel.c.
References _pico_free_file(), _pico_load_file(), _pico_printf(), picoModule_s::canload, picoModule_s::load, PICO_ERROR, PicoModuleList(), and PicoModuleLoadModel().
static picoModel_t* PicoModuleLoadModel | ( | const picoModule_t * | pm, | |
const char * | fileName, | |||
picoByte_t * | buffer, | |||
int | bufSize, | |||
int | frameNum | |||
) | [static] |
Definition at line 112 of file picomodel.c.
References _pico_free_file(), picoModule_s::canload, picoModule_s::load, picoModel_s::module, and PICO_PMV_OK.
Referenced by PicoLoadModel(), and PicoModuleLoadModelStream().
picoModel_t* PicoModuleLoadModelStream | ( | const picoModule_t * | module, | |
const char * | fileName, | |||
void * | inputStream, | |||
PicoInputStreamReadFunc | inputStreamRead, | |||
size_t | streamLength, | |||
int | frameNum | |||
) |
Definition at line 191 of file picomodel.c.
References _pico_alloc(), _pico_free(), _pico_printf(), int(), PICO_ERROR, and PicoModuleLoadModel().
picoModel_t* PicoNewModel | ( | void | ) |
creates a new pico model
Definition at line 227 of file picomodel.c.
References _pico_alloc(), _pico_zero_bounds(), picoModel_s::maxs, picoModel_s::mins, and picoModel_s::numFrames.
Referenced by _ase_load(), _md2_load(), _md3_load(), and _obj_load().
picoShader_t* PicoNewShader | ( | picoModel_t * | model | ) |
creates a new pico shader and returns its index. -sea
Definition at line 329 of file picomodel.c.
References _pico_alloc(), _pico_free(), _pico_set_color(), picoShader_s::ambientColor, picoShader_s::diffuseColor, picoShader_s::model, picoModel_s::numShaders, PicoAdjustModel(), picoModel_s::shader, shader, picoShader_s::shininess, picoShader_s::specularColor, and picoShader_s::transparency.
Referenced by _ase_load(), _md2_load(), _md3_load(), and _obj_default_shader().
picoSurface_t* PicoNewSurface | ( | picoModel_t * | model | ) |
creates a new pico surface
Definition at line 416 of file picomodel.c.
References _pico_alloc(), _pico_free(), picoSurface_s::model, picoModel_s::numSurfaces, PicoAdjustModel(), PicoSetSurfaceName(), and picoModel_s::surface.
Referenced by _md2_load(), _md3_load(), _obj_load(), and PicoAddTriangleToModel().
picoVertexCombinationHash_t** PicoNewVertexCombinationHashTable | ( | void | ) |
Definition at line 1150 of file picomodel.c.
References _pico_alloc(), and HASHTABLE_SIZE.
void PicoSetFaceNormal | ( | picoSurface_t * | surface, | |
int | num, | |||
picoVec3_t | normal | |||
) |
Definition at line 822 of file picomodel.c.
References _pico_copy_vec(), picoSurface_s::faceNormal, and PicoAdjustSurface().
void PicoSetFreeFileFunc | ( | void(*)(void *) | func | ) |
sets the ptr to the free function
Definition at line 97 of file picomodel.c.
References _pico_ptr_free_file.
void PicoSetFreeFunc | ( | void(*)(void *) | func | ) |
sets the ptr to the free function
Definition at line 79 of file picomodel.c.
References _pico_ptr_free.
void PicoSetLoadFileFunc | ( | void(*)(char *, unsigned char **, int *) | func | ) |
sets the ptr to the file load function
Definition at line 88 of file picomodel.c.
References _pico_ptr_load_file.
void PicoSetMallocFunc | ( | void *(*)(size_t) | func | ) |
sets the ptr to the malloc function
Definition at line 70 of file picomodel.c.
References _pico_ptr_malloc.
void PicoSetModelData | ( | picoModel_t * | model, | |
void * | data | |||
) |
Definition at line 648 of file picomodel.c.
References picoModel_s::data.
void PicoSetModelFileName | ( | picoModel_t * | model, | |
const char * | fileName | |||
) |
Definition at line 624 of file picomodel.c.
References _pico_clone_alloc(), _pico_free(), and picoModel_s::fileName.
Referenced by _ase_load(), _md2_load(), _md3_load(), and _obj_load().
void PicoSetModelFrameNum | ( | picoModel_t * | model, | |
int | frameNum | |||
) |
Definition at line 634 of file picomodel.c.
References picoModel_s::frameNum.
Referenced by _ase_load(), _md2_load(), _md3_load(), and _obj_load().
void PicoSetModelName | ( | picoModel_t * | model, | |
const char * | name | |||
) |
Definition at line 614 of file picomodel.c.
References _pico_clone_alloc(), _pico_free(), and picoModel_s::name.
Referenced by _ase_load(), _md2_load(), _md3_load(), and _obj_load().
void PicoSetModelNumFrames | ( | picoModel_t * | model, | |
int | numFrames | |||
) |
Definition at line 641 of file picomodel.c.
References picoModel_s::numFrames.
Referenced by _md2_load(), and _md3_load().
void PicoSetPrintFunc | ( | void(*)(int, const char *) | func | ) |
sets the ptr to the print function
Definition at line 106 of file picomodel.c.
References _pico_ptr_print.
void PicoSetShaderAmbientColor | ( | picoShader_t * | shader, | |
picoColor_t | color | |||
) |
Definition at line 675 of file picomodel.c.
References picoShader_s::ambientColor.
Referenced by _ase_load().
void PicoSetShaderDiffuseColor | ( | picoShader_t * | shader, | |
picoColor_t | color | |||
) |
Definition at line 685 of file picomodel.c.
References picoShader_s::diffuseColor.
Referenced by _ase_load().
void PicoSetShaderMapName | ( | picoShader_t * | shader, | |
char * | mapName | |||
) |
Definition at line 665 of file picomodel.c.
References _pico_clone_alloc(), _pico_free(), and picoShader_s::mapName.
Referenced by _ase_load().
void PicoSetShaderName | ( | picoShader_t * | shader, | |
const char * | name | |||
) |
Definition at line 655 of file picomodel.c.
References _pico_clone_alloc(), _pico_free(), and picoShader_s::name.
Referenced by _ase_load(), _md2_load(), _md3_load(), and _obj_default_shader().
void PicoSetShaderShininess | ( | picoShader_t * | shader, | |
float | value | |||
) |
Definition at line 718 of file picomodel.c.
References picoShader_s::shininess.
Referenced by _ase_load().
void PicoSetShaderSpecularColor | ( | picoShader_t * | shader, | |
picoColor_t | color | |||
) |
Definition at line 695 of file picomodel.c.
References picoShader_s::specularColor.
Referenced by _ase_load().
void PicoSetShaderTransparency | ( | picoShader_t * | shader, | |
float | value | |||
) |
Definition at line 705 of file picomodel.c.
References picoShader_s::transparency.
Referenced by _ase_load().
void PicoSetSurfaceColor | ( | picoSurface_t * | surface, | |
int | array, | |||
int | num, | |||
const picoColor_t | color | |||
) |
Definition at line 792 of file picomodel.c.
References picoSurface_s::color, and PicoAdjustSurface().
Referenced by _md2_load(), _md3_load(), and PicoAddTriangleToModel().
void PicoSetSurfaceData | ( | picoSurface_t * | surface, | |
void * | data | |||
) |
Definition at line 731 of file picomodel.c.
References picoSurface_s::data.
void PicoSetSurfaceIndex | ( | picoSurface_t * | surface, | |
int | num, | |||
picoIndex_t | index | |||
) |
Definition at line 804 of file picomodel.c.
References picoSurface_s::index, and PicoAdjustSurface().
Referenced by _md2_load(), _md3_load(), _obj_load(), and PicoAddTriangleToModel().
void PicoSetSurfaceIndexes | ( | picoSurface_t * | surface, | |
int | num, | |||
picoIndex_t * | index, | |||
int | count | |||
) |
Definition at line 813 of file picomodel.c.
References picoSurface_s::index, and PicoAdjustSurface().
void PicoSetSurfaceName | ( | picoSurface_t * | surface, | |
char * | name | |||
) |
Definition at line 745 of file picomodel.c.
References _pico_clone_alloc(), _pico_free(), and picoSurface_s::name.
Referenced by _md2_load(), _md3_load(), _obj_load(), PicoAddTriangleToModel(), and PicoNewSurface().
void PicoSetSurfaceNormal | ( | picoSurface_t * | surface, | |
int | num, | |||
picoVec3_t | normal | |||
) |
Definition at line 773 of file picomodel.c.
References _pico_copy_vec(), picoSurface_s::normal, and PicoAdjustSurface().
Referenced by _md2_load(), _md3_load(), _obj_load(), and PicoAddTriangleToModel().
void PicoSetSurfaceShader | ( | picoSurface_t * | surface, | |
picoShader_t * | shader | |||
) |
Definition at line 755 of file picomodel.c.
References picoSurface_s::shader.
Referenced by _md2_load(), _md3_load(), _obj_load(), and PicoAddTriangleToModel().
void PicoSetSurfaceSmoothingGroup | ( | picoSurface_t * | surface, | |
int | num, | |||
picoIndex_t | smoothingGroup | |||
) |
Definition at line 831 of file picomodel.c.
References PicoAdjustSurface(), and picoSurface_s::smoothingGroup.
Referenced by PicoAddTriangleToModel().
void PicoSetSurfaceSpecial | ( | picoSurface_t * | surface, | |
int | num, | |||
int | special | |||
) |
Definition at line 840 of file picomodel.c.
References PICO_MAX_SPECIAL, and picoSurface_s::special.
void PicoSetSurfaceST | ( | picoSurface_t * | surface, | |
int | array, | |||
int | num, | |||
picoVec2_t | st | |||
) |
Definition at line 782 of file picomodel.c.
References PicoAdjustSurface(), and picoSurface_s::st.
Referenced by _md2_load(), _md3_load(), _obj_load(), and PicoAddTriangleToModel().
void PicoSetSurfaceType | ( | picoSurface_t * | surface, | |
picoSurfaceType_t | type | |||
) |
Definition at line 738 of file picomodel.c.
References picoSurface_s::type.
Referenced by _md2_load(), _md3_load(), _obj_load(), and PicoAddTriangleToModel().
void PicoSetSurfaceXYZ | ( | picoSurface_t * | surface, | |
int | num, | |||
picoVec3_t | xyz | |||
) |
Definition at line 762 of file picomodel.c.
References _pico_copy_vec(), _pico_expand_bounds(), picoModel_s::maxs, picoModel_s::mins, picoSurface_s::model, PicoAdjustSurface(), and picoSurface_s::xyz.
Referenced by _md2_load(), _md3_load(), _obj_load(), and PicoAddTriangleToModel().
void PicoShutdown | ( | void | ) |
shuts the pico model library down
Definition at line 55 of file picomodel.c.
unsigned int PicoVertexCoordGenerateHash | ( | picoVec3_t | xyz | ) |
Definition at line 1127 of file picomodel.c.
References _pico_scale_vec(), hash(), HASH_XYZ_EPSILONSPACE_MULTIPLIER, and HASHTABLE_SIZE.
Referenced by PicoAddVertexCombinationToHashTable(), and PicoFindVertexCombinationInHashTable().
static void UniqueIndices_destroy | ( | UniqueIndices * | self | ) | [static] |
Definition at line 1397 of file picomodel.c.
References binarytree_clear(), and indexarray_clear().
Referenced by _pico_vertices_combine_shared_normals().
static picoIndex_t UniqueIndices_find_or_insert | ( | UniqueIndices * | self, | |
picoIndex_t | value | |||
) | [static] |
Definition at line 1403 of file picomodel.c.
References binarytree_extend(), binarytree_size(), indexarray_push_back(), _BinaryTreeNode::left, and _BinaryTreeNode::right.
Referenced by UniqueIndices_insert().
static void UniqueIndices_init | ( | UniqueIndices * | self, | |
LessFunc | lessFunc, | |||
void * | lessData | |||
) | [static] |
Definition at line 1391 of file picomodel.c.
Referenced by _pico_vertices_combine_shared_normals().
static picoIndex_t UniqueIndices_insert | ( | UniqueIndices * | self, | |
picoIndex_t | value | |||
) | [static] |
Definition at line 1437 of file picomodel.c.
References binarytree_extend(), indexarray_push_back(), and UniqueIndices_find_or_insert().
Referenced by _pico_vertices_combine_shared_normals().
static void UniqueIndices_reserve | ( | UniqueIndices * | self, | |
size_t | size | |||
) | [static] |
Definition at line 1385 of file picomodel.c.
References binarytree_reserve(), and indexarray_reserve().
Referenced by _pico_vertices_combine_shared_normals().
static size_t UniqueIndices_size | ( | UniqueIndices * | self | ) | [static] |
Definition at line 1380 of file picomodel.c.
References binarytree_size().
Referenced by _pico_vertices_combine_shared_normals().