![]() |
Jo Engine 2026.11.6
Jo Sega Saturn Engine
|
3D models (.JOM files): meshes made with a 3D software, converted by Compiler/COMMON/jo_model.py More...
Go to the source code of this file.
Data Structures | |
| struct | jo_3d_material |
| Material of a model (the same layout as the file: 32 bytes). More... | |
| struct | jo_3d_model_group |
| Group of a model: OBJ o or g (the same layout as the file: 24 bytes). More... | |
| struct | jo_3d_bone |
| Bone of a rigid skeleton (the same layout as the file: 32 bytes). More... | |
| struct | jo_3d_animation |
| Animation of a skeleton (the same layout as the file: 28 bytes). More... | |
| struct | jo_3d_morph |
| Vertex animation (morph targets: the position of each point at each frame, the same layout as the file: 28 bytes). Unlike a skeleton, the surface bends (a knee, a cloth, a face): see jo_3d_model_draw_morph(). More... | |
| struct | jo_3d_skin_point |
| A point of a skeleton that follows 2 bones (the same layout as the file: 8 bytes): drawn by the bone of its group, moved toward where the other bone puts it (the knee between the thigh and the shin). More... | |
| struct | jo_3d_pose |
| Pose of a skeleton: the angles of the bones (see jo_3d_model_get_pose() and jo_3d_model_draw_pose()). More... | |
| struct | jo_3d_model |
| 3D model loaded from a JOM file More... | |
| struct | jo_3d_model_pool |
| Models read one after the other from a file (the parts of a level) into big memory blocks, used in place (jo_3d_create_model_in_place()): no copy, no small memory blocks for each model. Measured (a 3D game, about 1000 models): the copies of jo_3d_create_model_from_memory() took 11 s (about 12 memory blocks each, every block allocated after a search among the ones before). More... | |
Macros | |
| #define | JO_3D_MODEL_VERSION |
| Version of the JOM files read by this engine. | |
| #define | JO_3D_MATERIAL_DUAL_PLANE |
| Material: drawn on both sides (JO_3D_DUAL_PLANE). | |
| #define | JO_3D_MATERIAL_SORT_MIN |
| Material: sorted with the nearest point (JO_3D_SORT_MIN). | |
| #define | JO_3D_MATERIAL_SORT_MAX |
| Material: sorted with the farthest point (JO_3D_SORT_MAX). | |
| #define | JO_3D_MATERIAL_SORT_PREVIOUS |
| Material: sorted with the depth of the previous polygon of the model (JO_3D_SORT_PREVIOUS): a decal drawn over the face before it (a grille, a sign), whatever their nearest points. | |
| #define | JO_3D_MATERIAL_GOURAUD |
| Material: gouraud shading with the vertex colors ("GOUR" chunk). | |
| #define | JO_3D_MATERIAL_HALF_TRANSPARENT |
| Material: half transparent. | |
| #define | JO_3D_MATERIAL_SCREEN_DOORS |
| Material: screen doors (mesh). | |
| #define | JO_3D_MATERIAL_LIGHT |
| Material: lit by the light of the engine (jo_3d_light()). | |
| #define | JO_3D_MATERIAL_FLIP_H |
| Material: texture flipped horizontally. | |
| #define | JO_3D_MATERIAL_FLIP_V |
| Material: texture flipped vertically. | |
| #define | JO_3D_MATERIAL_END_CODES |
| Material: the texture stops each line after its last visible pixel (jo_sprite_add_end_codes()). | |
| #define | JO_3D_MATERIAL_MIPMAPS |
| Material: smaller copies of the texture far away (jo_3d_set_texture_mipmaps()). | |
| #define | JO_3D_MATERIAL_SUBDIVISION |
| Material: the polygons near the camera are drawn in parts (jo_3d_set_texture_subdivision()). | |
| #define | JO_3D_MATERIAL_SUBDIVISION_NEAR |
| Material: only the polygons that cross the near plane are drawn in parts (jo_3d_set_texture_subdivision_near_only(), MTL: jo_subdivision 2). | |
| #define | JO_3D_MATERIAL_HIGH_SPEED_SHRINK |
| Material: the VDP1 reads every other texel of a texture drawn smaller than it is (JO_VDP1_HIGH_SPEED_SHRINK, MTL: jo_high_speed_shrink 1; all the textures: jo_3d_set_high_speed_shrink()). | |
| #define | JO_3D_MATERIAL_USER(N) |
| First flag of the program (bits 16 to 31, MTL: jo_user). | |
| #define | JO_3D_MAX_BONES |
| Bones of a model at most (jo_3d_pose). | |
| #define | JO_3D_BONE_NO_GROUP |
| jo_3d_bone.group: the bone has no polygons | |
| #define | JO_3D_ANIMATION_LOOP |
| jo_3d_animation.flags: the last key goes back to the first one | |
| #define | JO_3D_ANIMATION_TICKS_PER_SECOND |
| Ticks of the animations per second (the time of jo_3d_model_get_pose()). | |
| #define | JO_3D_MORPH_LOOP |
| jo_3d_morph.flags: the last frame goes back to the first one | |
| #define | JO_3D_MORPH_NORMALS |
| Directions of the normals of the vertex animations (see jo_3d_morph_normal()). | |
| #define | JO_3D_SKIN_ONE |
| jo_3d_skin_point.weight: 1.0 | |
| #define | JO_3D_MODEL_POOL_MAX_BLOCKS |
| Maximum of memory blocks of a pool of models. | |
Typedefs | |
| typedef void(*) | jo_3d_bone_callback(const int bone, void *const param, const jo_fixed(*const matrix)[3]) |
| Called by jo_3d_model_draw_pose() after each bone is drawn, with the matrix of the bone (the program draws a weapon in a hand, a muzzle flash...). | |
Functions | |
| jo_3d_model * | jo_3d_create_model_from_memory (const unsigned char *const data, const unsigned int size) |
| Create a model from the content of a JOM file. | |
| jo_3d_model * | jo_3d_create_model_in_place (const unsigned char *const data, const unsigned int size) |
| Create a model that uses the content of a JOM file in place (like jo_3d_load_model(): the points, the polygons, the materials are not copied): much faster than jo_3d_create_model_from_memory() for many models (a level read in one block: 4 memory blocks per model instead of about 12), and smaller. | |
| const unsigned char * | jo_3d_model_find_chunk (const void *const data, const char *const tag, unsigned int *const size) |
| Find a chunk in the content of a JOM file (a chunk of the program too: the loader skips the chunks it doesn't know). | |
| const unsigned short * | jo_3d_model_file_gouraud_colors (const void *const data, const unsigned int polygon_count) |
| The gouraud colors of the polygons in the content of a JOM file ("GOUR" chunk). | |
| static __jo_force_inline const unsigned short * | jo_3d_model_gouraud_colors (const jo_3d_model *const model) |
| The gouraud colors of a model as they were loaded: a game that writes its gouraud tables again (a light on a car) starts from them (its tables in the VRAM may not be written yet). | |
| bool | jo_3d_model_set_environment (jo_3d_model *const model, const int sprite_id, const int tiles, const unsigned int material_flags) |
| Environment map on the polygons of a model whose material has a flag (the paint and the glass of a car, see jo_3d_set_mesh_environment()). | |
| void | jo_3d_model_pool_init (jo_3d_model_pool *const pool, const unsigned int block_size, const unsigned int bytes) |
| Start a pool of models. | |
| jo_3d_model * | jo_3d_model_pool_read (jo_3d_model_pool *const pool, jo_file *const file, const unsigned int size) |
| Read the next model of a file (the content of a JOM file, see jo_3d_create_model_in_place()) into a pool. | |
| void | jo_3d_model_pool_free (jo_3d_model_pool *const pool) |
| Free the memory blocks of a pool (after its models: jo_3d_free_model()). | |
| jo_3d_model * | jo_3d_load_model (const char *const filename) |
| Load a model (JOM file) from the current directory of the CD. | |
| void | jo_3d_set_unique_gouraud_tables (const bool unique) |
| The next models created or loaded get a gouraud table per polygon, in the order of the polygons (default: the polygons with the same 4 colors share a table): for a model whose tables the game writes again polygon by polygon (the light on a car). | |
| void | jo_3d_set_neutral_gouraud_skipped (const bool skipped) |
| The next models created or loaded draw without gouraud only the polygons whose 4 gouraud colors leave the texels as they are (16, 16, 16 each): the same picture (see jo_3d_set_uniform_gouraud_skipped(), on by default, that does it too). | |
| void | jo_3d_set_uniform_gouraud_skipped (const bool skipped) |
| The next models created or loaded draw without gouraud the polygons whose 4 gouraud colors are the same (a flat light), the light put in their color: the same picture, the VDP1 draws them faster (default: on). | |
| int | jo_3d_model_texture (const char *const filename) |
| Get the sprite id of a texture of the models (loaded the first time: a texture shared by several models, or by the program, is loaded once). | |
| int | jo_3d_model_loaded_texture (const char *const name) |
| Get the sprite id of a texture already loaded by the models (embedded in a model, or loaded by jo_3d_model_texture()), without loading it. | |
| void | jo_3d_free_model (jo_3d_model *const model) |
| Free a model (the textures stay loaded). | |
| void | jo_3d_model_free_textures_from (const int sprite_id) |
| Free the sprites added since a sprite (the textures of the models loaded since, their tiles and smaller copies, their gouraud tables, the sprites added by the program): the VRAM of the VDP1 is given back. | |
| const jo_3d_model_group * | jo_3d_model_find_group (const jo_3d_model *const model, const char *const name) |
| Find a group of a model. | |
| int | jo_3d_model_find_bone (const jo_3d_model *const model, const char *const name) |
| Find a bone of a model. | |
| int | jo_3d_model_find_animation (const jo_3d_model *const model, const char *const name) |
| Find an animation of a model. | |
| bool | jo_3d_model_is_animation (const jo_3d_model *const model, const int animation, const char *const name) |
| Check if an animation is the one jo_3d_model_find_animation() finds for a name (faster: the name of this one is compared, the ones before it only when it matches). | |
| int | jo_3d_model_animation_duration (const jo_3d_model *const model, const int animation) |
| Duration of an animation. | |
| void | jo_3d_model_get_pose (const jo_3d_model *const model, const int animation, int time, jo_3d_pose *const pose) |
| Pose of a skeleton at a time of an animation (the keys are interpolated). | |
| void | jo_3d_pose_blend (const jo_3d_model *const model, jo_3d_pose *const pose, const jo_3d_pose *const other, const int weight) |
| Blend 2 poses (a smooth change of animation). | |
| void | jo_3d_model_draw_pose (const jo_3d_model *const model, const jo_3d_pose *const pose, const jo_3d_bone_callback callback, void *const param) |
| Draw a model with a skeleton with the current matrix. | |
| void | jo_3d_slave_model_draw_pose (const jo_3d_model *const model, const jo_3d_pose *const pose, const jo_3d_bone_callback callback, void *const param, const unsigned int hidden_bones) |
| Draw a model with a skeleton in a pose on the slave CPU (call it on the slave CPU, see jo_3d_model_draw_pose()). | |
| void | jo_3d_model_set_hidden_bones (const unsigned int mask) |
| Bones not drawn by the next jo_3d_model_draw_pose() (a hat shot off the head of a character: its bone hidden, the hat drawn alone where it falls: the other bones hidden). | |
| int | jo_3d_model_find_morph (const jo_3d_model *const model, const char *const name) |
| Find a vertex animation of a model. | |
| int | jo_3d_model_morph_duration (const jo_3d_model *const model, const int morph) |
| Duration of a vertex animation. | |
| void | jo_3d_model_draw_morph (const jo_3d_model *const model, const int morph, const int time) |
| Draw a model with the current matrix, its points at a time of a vertex animation (the 2 frames around it are interpolated). | |
| bool | jo_3d_slave_model_draw_morph (const jo_3d_model *const model, const int morph, const int time) |
| jo_3d_model_draw_morph() on the slave CPU (call it on the slave CPU: its own buffer, the master CPU can draw the same model at the same time) | |
| void | jo_3d_morph_normal (const int index, jo_pos3D_fixed *const normal) |
| Direction of a normal of the vertex animations (the frames give the normal of each polygon as one byte). | |
| bool | jo_3d_model_use_fast_memory (jo_3d_model *const model) |
| Move what the drawing of a model reads for each vertex, polygon and bone (its points, its polygons, their attributes, its bones and their groups) to the high work RAM, when it is in a slower memory (the low work RAM, a RAM cartridge). | |
| static __jo_force_inline void | jo_3d_model_draw (const jo_3d_model *const model) |
| Draw a model with the current matrix. | |
3D models (.JOM files): meshes made with a 3D software, converted by Compiler/COMMON/jo_model.py
JOM file (all the values are big endian, the chunks are aligned on 4 bytes):
| struct jo_3d_material |
| struct jo_3d_model_group |
| struct jo_3d_bone |
Bone of a rigid skeleton (the same layout as the file: 32 bytes).
| Data Fields | ||
|---|---|---|
| unsigned short | group | |
| char | name[16] | |
| short | parent | |
| jo_pos3D_fixed | pivot | |
| struct jo_3d_animation |
| struct jo_3d_morph |
Vertex animation (morph targets: the position of each point at each frame, the same layout as the file: 28 bytes). Unlike a skeleton, the surface bends (a knee, a cloth, a face): see jo_3d_model_draw_morph().
| Data Fields | ||
|---|---|---|
| unsigned short | duplicate | |
| unsigned short | flags | |
| unsigned short | frame_count | |
| unsigned short | frame_ticks | |
| char | name[16] | |
| unsigned int | offset | |
| struct jo_3d_skin_point |
A point of a skeleton that follows 2 bones (the same layout as the file: 8 bytes): drawn by the bone of its group, moved toward where the other bone puts it (the knee between the thigh and the shin).
| Data Fields | ||
|---|---|---|
| unsigned char | bone | |
| unsigned char | other | |
| unsigned short | point | |
| unsigned short | reserved | |
| unsigned short | weight | |
| struct jo_3d_pose |
Pose of a skeleton: the angles of the bones (see jo_3d_model_get_pose() and jo_3d_model_draw_pose()).
| Data Fields | ||
|---|---|---|
| jo_angle | angles[(32)][3] | |
| jo_pos3D_fixed | root | |
| struct jo_3d_model |
3D model loaded from a JOM file
| Data Fields | ||
|---|---|---|
| unsigned int | animation_count | |
| const unsigned char * | animation_data | |
| jo_3d_animation * | animations | |
| signed char * | bone_children | |
| unsigned int | bone_count | |
| jo_3d_bone * | bones | |
| jo_pos3D_fixed | center | |
| unsigned short * | corner_normals | |
| void * | fast_block | |
| void * | file | |
| bool | file_not_owned | |
| unsigned short | gouraud_table_count | |
| unsigned short | gouraud_tables | |
| unsigned int | group_count | |
| jo_3d_model_group * | groups | |
| unsigned int | material_count | |
| jo_3d_material * | materials | |
| jo_3d_mesh * | mesh | |
| unsigned int | morph_count | |
| const unsigned char * | morph_data | |
| jo_3d_polygon_data * | morph_draw[2] | |
| unsigned int | morph_frame_size | |
| bool | morph_normals | |
| unsigned short | morph_shift | |
| jo_3d_morph * | morphs | |
| unsigned int | normal_count | |
| jo_pos3D_fixed * | normals | |
| unsigned short * | polygon_materials | |
| jo_fixed | radius | |
| bool | single_block | |
| const jo_3d_skin_point * | skin | |
| unsigned int | skin_count | |
| unsigned int | texture_count | |
| int * | textures | |
| jo_pos3D_fixed * | vertex_colors | |
| struct jo_3d_model_pool |
Models read one after the other from a file (the parts of a level) into big memory blocks, used in place (jo_3d_create_model_in_place()): no copy, no small memory blocks for each model. Measured (a 3D game, about 1000 models): the copies of jo_3d_create_model_from_memory() took 11 s (about 12 memory blocks each, every block allocated after a search among the ones before).
| Data Fields | ||
|---|---|---|
| unsigned char * | block | |
| int | block_count | |
| unsigned int | block_size | |
| unsigned char * | blocks[(256)] | |
| unsigned int | bytes_left | |
| unsigned int | left | |
| #define JO_3D_ANIMATION_LOOP |
jo_3d_animation.flags: the last key goes back to the first one
| #define JO_3D_ANIMATION_TICKS_PER_SECOND |
Ticks of the animations per second (the time of jo_3d_model_get_pose()).
| #define JO_3D_BONE_NO_GROUP |
jo_3d_bone.group: the bone has no polygons
| #define JO_3D_MATERIAL_DUAL_PLANE |
Material: drawn on both sides (JO_3D_DUAL_PLANE).
| #define JO_3D_MATERIAL_END_CODES |
Material: the texture stops each line after its last visible pixel (jo_sprite_add_end_codes()).
| #define JO_3D_MATERIAL_FLIP_H |
Material: texture flipped horizontally.
| #define JO_3D_MATERIAL_FLIP_V |
Material: texture flipped vertically.
| #define JO_3D_MATERIAL_GOURAUD |
Material: gouraud shading with the vertex colors ("GOUR" chunk).
| #define JO_3D_MATERIAL_HALF_TRANSPARENT |
Material: half transparent.
| #define JO_3D_MATERIAL_HIGH_SPEED_SHRINK |
Material: the VDP1 reads every other texel of a texture drawn smaller than it is (JO_VDP1_HIGH_SPEED_SHRINK, MTL: jo_high_speed_shrink 1; all the textures: jo_3d_set_high_speed_shrink()).
| #define JO_3D_MATERIAL_LIGHT |
Material: lit by the light of the engine (jo_3d_light()).
| #define JO_3D_MATERIAL_MIPMAPS |
Material: smaller copies of the texture far away (jo_3d_set_texture_mipmaps()).
| #define JO_3D_MATERIAL_SCREEN_DOORS |
Material: screen doors (mesh).
| #define JO_3D_MATERIAL_SORT_MAX |
Material: sorted with the farthest point (JO_3D_SORT_MAX).
| #define JO_3D_MATERIAL_SORT_MIN |
Material: sorted with the nearest point (JO_3D_SORT_MIN).
| #define JO_3D_MATERIAL_SORT_PREVIOUS |
Material: sorted with the depth of the previous polygon of the model (JO_3D_SORT_PREVIOUS): a decal drawn over the face before it (a grille, a sign), whatever their nearest points.
| #define JO_3D_MATERIAL_SUBDIVISION |
Material: the polygons near the camera are drawn in parts (jo_3d_set_texture_subdivision()).
| #define JO_3D_MATERIAL_SUBDIVISION_NEAR |
Material: only the polygons that cross the near plane are drawn in parts (jo_3d_set_texture_subdivision_near_only(), MTL: jo_subdivision 2).
| #define JO_3D_MATERIAL_USER | ( | N | ) |
First flag of the program (bits 16 to 31, MTL: jo_user).
| #define JO_3D_MAX_BONES |
Bones of a model at most (jo_3d_pose).
| #define JO_3D_MODEL_POOL_MAX_BLOCKS |
Maximum of memory blocks of a pool of models.
| #define JO_3D_MODEL_VERSION |
Version of the JOM files read by this engine.
| #define JO_3D_MORPH_LOOP |
jo_3d_morph.flags: the last frame goes back to the first one
| #define JO_3D_MORPH_NORMALS |
Directions of the normals of the vertex animations (see jo_3d_morph_normal()).
| #define JO_3D_SKIN_ONE |
| typedef void(*) jo_3d_bone_callback(const int bone, void *const param, const jo_fixed(*const matrix)[3]) |
Called by jo_3d_model_draw_pose() after each bone is drawn, with the matrix of the bone (the program draws a weapon in a hand, a muzzle flash...).
| bone | Index of the bone |
| param | Parameter of jo_3d_model_draw_pose() |
| matrix | Matrix of the bone (4 rows of 3, see jo_3d_transform_point_by()); the current matrix is not the one of the bone |
| jo_3d_model * jo_3d_create_model_from_memory | ( | const unsigned char *const | data, |
| const unsigned int | size ) |
Create a model from the content of a JOM file.
| data | Content of the file (4 bytes aligned) |
| size | Size in bytes |
| jo_3d_model * jo_3d_create_model_in_place | ( | const unsigned char *const | data, |
| const unsigned int | size ) |
Create a model that uses the content of a JOM file in place (like jo_3d_load_model(): the points, the polygons, the materials are not copied): much faster than jo_3d_create_model_from_memory() for many models (a level read in one block: 4 memory blocks per model instead of about 12), and smaller.
| data | Content of the file (4 bytes aligned), kept by the caller as long as the model exists |
| size | Size in bytes |
| void jo_3d_free_model | ( | jo_3d_model *const | model | ) |
Free a model (the textures stay loaded).
| model | Model |
| jo_3d_model * jo_3d_load_model | ( | const char *const | filename | ) |
Load a model (JOM file) from the current directory of the CD.
| filename | File name (example: "MODEL.JOM") |
| int jo_3d_model_animation_duration | ( | const jo_3d_model *const | model, |
| const int | animation ) |
Duration of an animation.
| model | Model |
| animation | Index of the animation |
|
static |
Draw a model with the current matrix.
| model | Model |
| void jo_3d_model_draw_morph | ( | const jo_3d_model *const | model, |
| const int | morph, | ||
| const int | time ) |
Draw a model with the current matrix, its points at a time of a vertex animation (the 2 frames around it are interpolated).
| model | Model |
| morph | Index of the vertex animation (see jo_3d_model_find_morph()), -1 or wrong: the points of the OBJ |
| time | Ticks (1/60 s) from the start of the animation |
| void jo_3d_model_draw_pose | ( | const jo_3d_model *const | model, |
| const jo_3d_pose *const | pose, | ||
| const jo_3d_bone_callback | callback, | ||
| void *const | param ) |
Draw a model with a skeleton with the current matrix.
| model | Model |
| pose | Pose (JO_NULL: the pose of the OBJ) |
| callback | Called after each bone is drawn, with the matrix of the bone (JO_NULL: none) |
| param | Parameter of the callback |
| const unsigned short * jo_3d_model_file_gouraud_colors | ( | const void *const | data, |
| const unsigned int | polygon_count ) |
The gouraud colors of the polygons in the content of a JOM file ("GOUR" chunk).
| data | Content of the file (4 bytes aligned) |
| polygon_count | Polygons of the model |
| int jo_3d_model_find_animation | ( | const jo_3d_model *const | model, |
| const char *const | name ) |
Find an animation of a model.
| model | Model |
| name | Name of the animation |
| int jo_3d_model_find_bone | ( | const jo_3d_model *const | model, |
| const char *const | name ) |
Find a bone of a model.
| model | Model |
| name | Name of the bone |
| const unsigned char * jo_3d_model_find_chunk | ( | const void *const | data, |
| const char *const | tag, | ||
| unsigned int *const | size ) |
Find a chunk in the content of a JOM file (a chunk of the program too: the loader skips the chunks it doesn't know).
| data | Content of the file (4 bytes aligned): model->file of a model that keeps it (jo_3d_load_model(), jo_3d_create_model_in_place()) |
| tag | Tag of the chunk (4 characters, example: "GOUR") |
| size | Size of the data of the chunk (output, JO_NULL: not wanted) |
| const jo_3d_model_group * jo_3d_model_find_group | ( | const jo_3d_model *const | model, |
| const char *const | name ) |
Find a group of a model.
| model | Model |
| name | Name of the group (OBJ o or g) |
| int jo_3d_model_find_morph | ( | const jo_3d_model *const | model, |
| const char *const | name ) |
Find a vertex animation of a model.
| model | Model |
| name | Name of the vertex animation (case insensitive) |
| void jo_3d_model_free_textures_from | ( | const int | sprite_id | ) |
Free the sprites added since a sprite (the textures of the models loaded since, their tiles and smaller copies, their gouraud tables, the sprites added by the program): the VRAM of the VDP1 is given back.
| sprite_id | First sprite to free (jo_sprite_count() before the models were loaded) |
| void jo_3d_model_get_pose | ( | const jo_3d_model *const | model, |
| const int | animation, | ||
| int | time, | ||
| jo_3d_pose *const | pose ) |
Pose of a skeleton at a time of an animation (the keys are interpolated).
| model | Model |
| animation | Index of the animation, -1: the bones don't turn (the pose of the OBJ) |
| time | Ticks (1/60 s) from the start of the animation |
| pose | Pose |
|
static |
The gouraud colors of a model as they were loaded: a game that writes its gouraud tables again (a light on a car) starts from them (its tables in the VRAM may not be written yet).
| model | Model that keeps the content of its file (jo_3d_load_model(), jo_3d_create_model_in_place()) |
| bool jo_3d_model_is_animation | ( | const jo_3d_model *const | model, |
| const int | animation, | ||
| const char *const | name ) |
Check if an animation is the one jo_3d_model_find_animation() finds for a name (faster: the name of this one is compared, the ones before it only when it matches).
| model | Model |
| animation | Index of the animation |
| name | Name (case insensitive) |
| int jo_3d_model_loaded_texture | ( | const char *const | name | ) |
Get the sprite id of a texture already loaded by the models (embedded in a model, or loaded by jo_3d_model_texture()), without loading it.
| name | Name of the texture (its file name, or its name in the model) |
| int jo_3d_model_morph_duration | ( | const jo_3d_model *const | model, |
| const int | morph ) |
Duration of a vertex animation.
| model | Model |
| morph | Index of the vertex animation |
| void jo_3d_model_pool_free | ( | jo_3d_model_pool *const | pool | ) |
Free the memory blocks of a pool (after its models: jo_3d_free_model()).
| pool | Pool (empty after the call) |
| void jo_3d_model_pool_init | ( | jo_3d_model_pool *const | pool, |
| const unsigned int | block_size, | ||
| const unsigned int | bytes ) |
Start a pool of models.
| pool | Pool |
| block_size | Size of its memory blocks (64 KB for example: a bigger model has a block of its size) |
| bytes | Bytes of all the models it will read, each one rounded up to 4 bytes: the last block is no bigger than the models left (0: unknown) |
| jo_3d_model * jo_3d_model_pool_read | ( | jo_3d_model_pool *const | pool, |
| jo_file *const | file, | ||
| const unsigned int | size ) |
Read the next model of a file (the content of a JOM file, see jo_3d_create_model_in_place()) into a pool.
| pool | Pool |
| file | File open at the model (many small models: a bigger read buffer, see jo_fs_set_read_sector_count()) |
| size | Size of the model in the file (the next one starts after it, rounded up to 4 bytes) |
| bool jo_3d_model_set_environment | ( | jo_3d_model *const | model, |
| const int | sprite_id, | ||
| const int | tiles, | ||
| const unsigned int | material_flags ) |
Environment map on the polygons of a model whose material has a flag (the paint and the glass of a car, see jo_3d_set_mesh_environment()).
| model | Model |
| sprite_id | The picture of the surroundings (RGB) |
| tiles | Tiles on a side (4 to 8) |
| material_flags | Flags of the materials (jo_3d_material.flags, example: JO_3D_MATERIAL_USER(0)): the polygons of a material with one of them show the environment map |
| void jo_3d_model_set_hidden_bones | ( | const unsigned int | mask | ) |
Bones not drawn by the next jo_3d_model_draw_pose() (a hat shot off the head of a character: its bone hidden, the hat drawn alone where it falls: the other bones hidden).
| mask | Bit k: the polygons of the bone k hidden (its children are drawn), 0: all drawn |
| int jo_3d_model_texture | ( | const char *const | filename | ) |
Get the sprite id of a texture of the models (loaded the first time: a texture shared by several models, or by the program, is loaded once).
| filename | File name on the CD (.BIN: jo_sprite_add_bin(), .TGA: jo_sprite_add_tga()) |
| bool jo_3d_model_use_fast_memory | ( | jo_3d_model *const | model | ) |
Move what the drawing of a model reads for each vertex, polygon and bone (its points, its polygons, their attributes, its bones and their groups) to the high work RAM, when it is in a slower memory (the low work RAM, a RAM cartridge).
| model | Model loaded by jo_3d_load_model() (its data in the file: the copies replace them, the file stays) |
| void jo_3d_morph_normal | ( | const int | index, |
| jo_pos3D_fixed *const | normal ) |
Direction of a normal of the vertex animations (the frames give the normal of each polygon as one byte).
| index | 0 to JO_3D_MORPH_NORMALS - 1 (directions spread evenly on the sphere: a golden angle spiral, the same as jo_model.py) |
| normal | Unit vector (16.16 fixed) |
| void jo_3d_pose_blend | ( | const jo_3d_model *const | model, |
| jo_3d_pose *const | pose, | ||
| const jo_3d_pose *const | other, | ||
| const int | weight ) |
Blend 2 poses (a smooth change of animation).
| model | Model |
| pose | First pose, the result |
| other | Second pose |
| weight | Weight of the second pose (0 to 256) |
| void jo_3d_set_neutral_gouraud_skipped | ( | const bool | skipped | ) |
The next models created or loaded draw without gouraud only the polygons whose 4 gouraud colors leave the texels as they are (16, 16, 16 each): the same picture (see jo_3d_set_uniform_gouraud_skipped(), on by default, that does it too).
| skipped | true: only those polygons without gouraud; false: all the polygons keep their gouraud table |
| void jo_3d_set_uniform_gouraud_skipped | ( | const bool | skipped | ) |
The next models created or loaded draw without gouraud the polygons whose 4 gouraud colors are the same (a flat light), the light put in their color: the same picture, the VDP1 draws them faster (default: on).
| skipped | true: those polygons without gouraud (the neutral ones too, see jo_3d_set_neutral_gouraud_skipped()); false: all the polygons keep their gouraud table (the models that the game tints or lights by their tables, see below). Both: the copies of the color lookup tables made until then are not shared with the next models any more |
| void jo_3d_set_unique_gouraud_tables | ( | const bool | unique | ) |
The next models created or loaded get a gouraud table per polygon, in the order of the polygons (default: the polygons with the same 4 colors share a table): for a model whose tables the game writes again polygon by polygon (the light on a car).
| unique | true: a table per polygon |
| bool jo_3d_slave_model_draw_morph | ( | const jo_3d_model *const | model, |
| const int | morph, | ||
| const int | time ) |
jo_3d_model_draw_morph() on the slave CPU (call it on the slave CPU: its own buffer, the master CPU can draw the same model at the same time)
| model | Model |
| morph | Index of the vertex animation |
| time | Ticks (1/60 s) from the start of the animation |
| void jo_3d_slave_model_draw_pose | ( | const jo_3d_model *const | model, |
| const jo_3d_pose *const | pose, | ||
| const jo_3d_bone_callback | callback, | ||
| void *const | param, | ||
| const unsigned int | hidden_bones ) |
Draw a model with a skeleton in a pose on the slave CPU (call it on the slave CPU, see jo_3d_model_draw_pose()).
| model | Model |
| pose | Pose (JO_NULL: the pose of the OBJ) |
| callback | Called after each bone (JO_NULL: none; on the slave CPU: what it writes is read by the master CPU without its cache) |
| param | Parameter of the callback |
| hidden_bones | Bones not drawn (bits, see jo_3d_model_set_hidden_bones()) |