79# define __JO_MODEL_H__
81#ifdef JO_COMPILE_WITH_3D_SUPPORT
84# define JO_3D_MODEL_VERSION (1)
90# define JO_3D_MATERIAL_DUAL_PLANE (1 << 0)
92# define JO_3D_MATERIAL_SORT_MIN (1 << 1)
94# define JO_3D_MATERIAL_SORT_MAX (1 << 2)
97# define JO_3D_MATERIAL_SORT_PREVIOUS (JO_3D_MATERIAL_SORT_MIN | JO_3D_MATERIAL_SORT_MAX)
99# define JO_3D_MATERIAL_GOURAUD (1 << 3)
101# define JO_3D_MATERIAL_HALF_TRANSPARENT (1 << 4)
103# define JO_3D_MATERIAL_SCREEN_DOORS (1 << 5)
105# define JO_3D_MATERIAL_LIGHT (1 << 6)
107# define JO_3D_MATERIAL_FLIP_H (1 << 7)
109# define JO_3D_MATERIAL_FLIP_V (1 << 8)
111# define JO_3D_MATERIAL_END_CODES (1 << 9)
113# define JO_3D_MATERIAL_MIPMAPS (1 << 10)
115# define JO_3D_MATERIAL_SUBDIVISION (1 << 11)
118# define JO_3D_MATERIAL_SUBDIVISION_NEAR (1 << 12)
120# define JO_3D_MATERIAL_USER(N) (1 << (16 + (N)))
148# define JO_3D_MAX_BONES (32)
150# define JO_3D_BONE_NO_GROUP (0xFFFF)
152# define JO_3D_ANIMATION_LOOP (1 << 0)
154# define JO_3D_ANIMATION_TICKS_PER_SECOND (60)
245#ifdef JO_COMPILE_WITH_FS_SUPPORT
347 const jo_3d_pose *
const other,
const int weight);
static __jo_force_inline void jo_3d_mesh_draw(jo_3d_mesh *const mesh)
Draw a mesh.
Definition 3d.h:995
Mesh structure.
Definition 3d.h:216
unsigned int normal_count
Definition model.h:204
jo_3d_model_group * groups
Definition model.h:210
short parent
Definition model.h:161
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_...
char name[16]
Definition model.h:168
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 ...
Definition model.h:191
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 small...
jo_pos3D_fixed pivot
Definition model.h:162
jo_3d_mesh * mesh
Definition model.h:196
unsigned short subdivision_error
Definition model.h:131
jo_pos3D_fixed center
Definition model.h:197
char name[16]
Definition model.h:140
unsigned int texture_count
Definition model.h:202
jo_pos3D_fixed * normals
Definition model.h:205
unsigned char g
Definition model.h:127
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 t...
bool single_block
Definition model.h:222
unsigned short * polygon_materials
Definition model.h:201
void jo_3d_free_model(jo_3d_model *const model)
Free a model (the textures stay loaded).
unsigned int bone_count
Definition model.h:211
unsigned short gouraud_tables
Definition model.h:208
char name[16]
Definition model.h:125
unsigned int group_count
Definition model.h:209
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...
jo_3d_bone * bones
Definition model.h:212
unsigned short key_ticks
Definition model.h:170
int jo_3d_model_find_bone(const jo_3d_model *const model, const char *const name)
Find a bone of a model.
unsigned short first_polygon
Definition model.h:143
jo_angle angles[(32)][3]
Definition model.h:181
unsigned int animation_count
Definition model.h:215
jo_3d_animation * animations
Definition model.h:216
jo_3d_model * __jo_3d_load_model_for_lights(const char *const filename)
Load a model with a gouraud table per polygon (Internal usage: the cells, lit by the point lights,...
unsigned short group
Definition model.h:160
jo_pos3D_fixed root
Definition model.h:180
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.
unsigned int offset
Definition model.h:174
jo_fixed radius
Definition model.h:198
signed char * bone_children
Definition model.h:213
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,...
void * file
Definition model.h:218
static __jo_force_inline void jo_3d_model_draw(const jo_3d_model *const model)
Draw a model with the current matrix.
Definition model.h:368
char name[16]
Definition model.h:159
unsigned short first_point
Definition model.h:141
const unsigned char * animation_data
Definition model.h:217
unsigned int flags
Definition model.h:133
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).
#define JO_3D_MAX_BONES
Bones of a model at most (jo_3d_pose).
Definition model.h:148
jo_3d_material * materials
Definition model.h:200
unsigned short duplicate
Definition model.h:172
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 mode...
unsigned char r
Definition model.h:126
jo_3d_model * jo_3d_load_model(const char *const filename)
Load a model (JOM file) from the current directory of the CD.
int jo_3d_model_find_animation(const jo_3d_model *const model, const char *const name)
Find an animation of a model.
unsigned char b
Definition model.h:128
unsigned short polygon_count
Definition model.h:144
bool file_not_owned
Definition model.h:220
int * textures
Definition model.h:203
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.
unsigned short * corner_normals
Definition model.h:206
short texture
Definition model.h:130
unsigned short key_count
Definition model.h:169
int jo_3d_model_animation_duration(const jo_3d_model *const model, const int animation)
Duration of an animation.
unsigned int material_count
Definition model.h:199
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).
unsigned char shine
Definition model.h:129
unsigned short point_count
Definition model.h:142
jo_pos3D_fixed * vertex_colors
Definition model.h:207
unsigned int user
Definition model.h:134
unsigned short flags
Definition model.h:171
Animation of a skeleton (the same layout as the file: 28 bytes).
Definition model.h:167
Bone of a rigid skeleton (the same layout as the file: 32 bytes).
Definition model.h:158
Material of a model (the same layout as the file: 32 bytes).
Definition model.h:124
3D model loaded from a JOM file
Definition model.h:195
Group of a model: OBJ o or g (the same layout as the file: 24 bytes).
Definition model.h:139
Pose of a skeleton: the angles of the bones (see jo_3d_model_get_pose() and jo_3d_model_draw_pose()).
Definition model.h:179
#define __jo_force_inline
force inline attribute (and prevent Doxygen prototype parsing bug)
Definition types.h:39
short jo_angle
Angle.
Definition types.h:54
int jo_fixed
Fixed point Q16.16 number.
Definition types.h:48
3D position using fixed numbers
Definition types.h:92