rotation d'objet

This commit is contained in:
Frater 2026-05-11 17:53:07 +02:00
commit 69b06b5b14
3 changed files with 108 additions and 6 deletions

View file

@ -81,7 +81,12 @@ typedef struct {
} Camera;
/* Mesh dynamique conservé pour save/load uniquement */
typedef struct { Vector3 *verts; Vector3 *v_normals; Face *faces; int num_verts, num_faces; } Mesh;
typedef struct {
Vector3 *verts;
Vector3 *v_normals;
Face *faces;
int num_verts, num_faces;
} Mesh;
/* Globales */
extern fixed sintab[360], costab[360];
@ -101,9 +106,10 @@ void mat3_rotate_x(Matrix3 *m, int angle);
void mat3_rotate_y(Matrix3 *m, int angle);
void mat3_mul(Matrix3 *res, Matrix3 *a, Matrix3 *b);
void set_object_pos(Object3D *obj, fixed x, fixed y, fixed z);
void move_object(Object3D *obj, fixed dx, fixed dy, fixed dz);
void set_object_color(Object3D *obj, uint8_t col);
void set_object_pos (Object3D *obj, fixed x, fixed y, fixed z);
void move_object (Object3D *obj, fixed dx, fixed dy, fixed dz);
void set_object_color (Object3D *obj, uint8_t col);
void bake_object_rotation(Universe *uni, Object3D *obj, int ax, int ay, int az);
/* Retournent un pointeur sur le nouvel Object3D, NULL si pool saturé */
Object3D* add_box (Universe *uni, fixed x, fixed y, fixed z, fixed dx, fixed dy, fixed dz, uint8_t col, uint8_t wire);