Jo Engine  9
Jo Sega Saturn Engine
3d.h
Go to the documentation of this file.
1 /*
2 ** Jo Sega Saturn Engine
3 ** Copyright (c) 2012-2017, Johannes Fetz (johannesfetz@gmail.com)
4 ** All rights reserved.
5 **
6 ** Redistribution and use in source and binary forms, with or without
7 ** modification, are permitted provided that the following conditions are met:
8 ** * Redistributions of source code must retain the above copyright
9 ** notice, this list of conditions and the following disclaimer.
10 ** * Redistributions in binary form must reproduce the above copyright
11 ** notice, this list of conditions and the following disclaimer in the
12 ** documentation and/or other materials provided with the distribution.
13 ** * Neither the name of the Johannes Fetz nor the
14 ** names of its contributors may be used to endorse or promote products
15 ** derived from this software without specific prior written permission.
16 **
17 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 ** DISCLAIMED. IN NO EVENT SHALL Johannes Fetz BE LIABLE FOR ANY
21 ** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 ** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
36 #ifndef __JO_3D_H__
37 # define __JO_3D_H__
38 
39 #ifdef JO_COMPILE_WITH_3D_SUPPORT
40 
42 # define JO_3D_PLANE_VERTICES(SIZE) \
43 { \
44  { -SIZE, -SIZE, 0 }, \
45  { SIZE, -SIZE, 0 }, \
46  { SIZE, SIZE, 0 }, \
47  { -SIZE, SIZE, 0 } \
48 }
49 
51 # define JO_3D_TRIANGLE_VERTICES(SIZE) \
52 { \
53  { -SIZE, -SIZE, 0 }, \
54  { SIZE, -SIZE, 0 }, \
55  { SIZE, SIZE, 0 } \
56 }
57 
59 # define JO_3D_CUBE_VERTICES(SIZE) \
60 { \
61  { -SIZE, -SIZE, SIZE }, \
62  { SIZE, -SIZE, SIZE }, \
63  { SIZE, SIZE, SIZE }, \
64  { -SIZE, SIZE, SIZE }, \
65  { -SIZE, -SIZE, -SIZE }, \
66  { -SIZE, -SIZE, SIZE }, \
67  { -SIZE, SIZE, SIZE }, \
68  { -SIZE, SIZE, -SIZE }, \
69  { SIZE, -SIZE, -SIZE }, \
70  { -SIZE, -SIZE, -SIZE }, \
71  { -SIZE, SIZE, -SIZE }, \
72  { SIZE, SIZE, -SIZE }, \
73  { SIZE, -SIZE, SIZE }, \
74  { SIZE, -SIZE, -SIZE }, \
75  { SIZE, SIZE, -SIZE }, \
76  { SIZE, SIZE, SIZE }, \
77  { -SIZE, -SIZE, -SIZE }, \
78  { SIZE, -SIZE, -SIZE }, \
79  { SIZE, -SIZE, SIZE }, \
80  { -SIZE, -SIZE, SIZE }, \
81  { -SIZE, SIZE, SIZE }, \
82  { SIZE, SIZE, SIZE }, \
83  { SIZE, SIZE, -SIZE }, \
84  { -SIZE, SIZE, -SIZE } \
85 }
86 
89 
91 typedef struct
92 {
93  FIXED viewpoint[XYZ];
94  FIXED target[XYZ];
96 } jo_camera;
97 
99 typedef struct
100 {
103 } jo_3d_quad;
104 
106 typedef struct
107 {
109 } jo_3d_mesh;
110 
114 extern jo_3d_quad *__jo_sprite_quad[JO_MAX_SPRITE];
115 bool jo_3d_create_sprite_quad(const int sprite_id);
116 
117 /******************************************************
118 * CAMERA
119 *******************************************************/
120 
127 static __jo_force_inline void jo_3d_camera_set_viewpoint(jo_camera * const cam, const int x, const int y, const int z)
128 {
129  cam->viewpoint[X] = x * 65536;
130  cam->viewpoint[Y] = y * 65536;
131  cam->viewpoint[Z] = z * 65536;
132 }
133 
140 static __jo_force_inline void jo_3d_camera_set_target(jo_camera * const cam, const int x, const int y, const int z)
141 {
142  cam->target[X] = JO_MULT_BY_65536(x);
143  cam->target[Y] = JO_MULT_BY_65536(y);
144  cam->target[Z] = JO_MULT_BY_65536(z);
145 }
146 
151 static __jo_force_inline void jo_3d_camera_set_z_angle(jo_camera * const cam, const int angle )
152 {
153  cam->z_angle = DEGtoANG(angle);
154 }
155 
160 {
161  jo_3d_camera_set_viewpoint(cam, 0, 0, -150);
162  jo_3d_camera_set_target(cam, 0, 0, 0);
163  jo_3d_camera_set_z_angle(cam, 0);
164 }
165 
170 {
171  slLookAt(cam->viewpoint, cam->target, cam->z_angle);
172 }
173 
174 /******************************************************
175 * STATISTICS
176 *******************************************************/
177 
183 {
184  extern Uint16 TotalPolygons;
185  return TotalPolygons;
186 }
187 
193 {
194  extern Uint16 TotalVertices;
195  return TotalVertices;
196 }
197 
203 {
204  extern Uint16 DispPolygons;
205  return DispPolygons;
206 }
207 
208 /******************************************************
209 * CREATE SIMPLE OBJECT
210 *******************************************************/
211 
216 void jo_3d_create_plane(jo_3d_quad * const quad, jo_vertice * const vertices);
217 
222 void jo_3d_create_cube(jo_3d_quad * array, jo_vertice * const vertices);
223 
228 void jo_3d_create_triangle(jo_3d_quad * const quad, jo_vertice * const vertices);
229 
235 {
236  return (__jo_sprite_quad[sprite_id] == JO_NULL && !jo_3d_create_sprite_quad(sprite_id) ? JO_NULL : __jo_sprite_quad[sprite_id]);
237 }
238 
242 void jo_3d_free_sprite_quad(const int sprite_id);
243 
244 /******************************************************
245 * MESH
246 *******************************************************/
247 
253 {
254  return mesh->data.nbPolygon;
255 }
256 
257 /******************************************************
258 * TEXTURE
259 *******************************************************/
260 
266 void jo_3d_set_mesh_polygon_texture(jo_3d_mesh * const mesh, const int sprite_id, const unsigned int index);
267 
272 void jo_3d_set_mesh_texture(jo_3d_mesh * const mesh, const int sprite_id);
273 
278 static __jo_force_inline void jo_3d_set_texture(jo_3d_quad * const quad, const int sprite_id)
279 {
280  jo_3d_set_mesh_polygon_texture((jo_3d_mesh *)quad, sprite_id, 0);
281 }
282 
283 /******************************************************
284 * LIGHT
285 *******************************************************/
286 
292 static __jo_force_inline void jo_3d_light(const int x, const int y, const int z)
293 {
294  FIXED p[XYZ];
295  p[0] = JO_MULT_BY_65536(x);
296  p[1] = JO_MULT_BY_65536(y);
297  p[2] = JO_MULT_BY_65536(z);
298  slLight(p);
299 }
300 
306 void jo_3d_set_mesh_polygon_light(jo_3d_mesh * const mesh, const bool enabled, const unsigned int index);
307 
312 void jo_3d_set_mesh_light(jo_3d_mesh * const mesh, const bool enabled);
313 
318 static __jo_force_inline void jo_3d_set_light(jo_3d_quad *const quad, const bool enabled)
319 {
320  jo_3d_set_mesh_polygon_light((jo_3d_mesh *)quad, enabled, 0);
321 }
322 
323 /******************************************************
324 * SCREEN DOORS
325 *******************************************************/
326 
332 void jo_3d_set_mesh_polygon_screen_doors(jo_3d_mesh * const mesh, const bool enabled, const unsigned int index);
333 
338 void jo_3d_set_mesh_screen_doors(jo_3d_mesh * const mesh, const bool enabled);
339 
344 static __jo_force_inline void jo_3d_set_screen_doors(jo_3d_quad *const quad, const bool enabled)
345 {
346  jo_3d_set_mesh_polygon_screen_doors((jo_3d_mesh *)quad, enabled, 0);
347 }
348 
349 /******************************************************
350 * TRANSPARENCY
351 *******************************************************/
352 
358 void jo_3d_set_mesh_polygon_transparency(jo_3d_mesh * const mesh, const bool enabled, const unsigned int index);
359 
364 void jo_3d_set_mesh_transparency(jo_3d_mesh * const mesh, const bool enabled);
365 
370 static __jo_force_inline void jo_3d_set_transparency(jo_3d_quad *const quad, const bool enabled)
371 {
372  jo_3d_set_mesh_polygon_transparency((jo_3d_mesh *)quad, enabled, 0);
373 }
374 
375 /******************************************************
376 * COLOR
377 *******************************************************/
378 
384 void jo_3d_set_mesh_polygon_color(jo_3d_mesh * const mesh, const jo_color color, const unsigned int index);
385 
390 void jo_3d_set_mesh_color(jo_3d_mesh * const mesh, const jo_color color);
391 
396 static __jo_force_inline void jo_3d_set_color(jo_3d_quad * const quad, const jo_color color)
397 {
398  jo_3d_set_mesh_polygon_color((jo_3d_mesh *)quad, color, 0);
399 }
400 
401 
402 /******************************************************
403 * MATRIX TRANSFORMATION
404 *******************************************************/
405 
409 {
410  slPushMatrix();
411 }
412 
416 {
417  slPopMatrix();
418 }
419 
425 static __jo_force_inline void jo_3d_rotate_matrix(short x, short y, short z)
426 {
427  slRotX(JO_MULT_BY_65536(x) / 360.0);
428  slRotY(JO_MULT_BY_65536(y) / 360.0);
429  slRotZ(JO_MULT_BY_65536(z) / 360.0);
430 }
431 
436 {
437  slRotX(JO_MULT_BY_65536(x) / 360.0);
438 }
439 
444 {
445  slRotY(JO_MULT_BY_65536(y) / 360.0);
446 }
447 
452 {
453  slRotZ(JO_MULT_BY_65536(z) / 360.0);
454 }
455 
461 static __jo_force_inline void jo_3d_rotate_matrix_rad(float x, float y, float z)
462 {
463  slRotX(toFIXED(x));
464  slRotY(toFIXED(y));
465  slRotZ(toFIXED(z));
466 }
467 
472 {
473  slRotX(toFIXED(x));
474 }
475 
480 {
481  slRotY(toFIXED(y));
482 }
483 
488 {
489  slRotZ(toFIXED(z));
490 }
491 
497 static __jo_force_inline void jo_3d_translate_matrixf(float x, float y, float z)
498 {
499  slTranslate(toFIXED(x), toFIXED(y), toFIXED(z));
500 }
501 
507 static __jo_force_inline void jo_3d_translate_matrix(int x, int y, int z)
508 {
510 }
511 
516 {
517  slTranslate(JO_MULT_BY_65536(x), 0, 0);
518 }
519 
524 {
525  slTranslate(0, JO_MULT_BY_65536(y), 0);
526 }
527 
532 {
533  slTranslate(0, 0, JO_MULT_BY_65536(z));
534 }
535 
536 /******************************************************
537 * DRAW
538 *******************************************************/
539 
543 static __jo_force_inline void jo_3d_draw(jo_3d_quad *const quad)
544 {
545  slPutPolygon(&quad->data);
546 }
547 
552 {
553  slPutPolygon(&mesh->data);
554 }
555 
560 {
561  jo_3d_draw((jo_3d_quad * const)node->data.ptr);
562 }
563 
567 static __jo_force_inline void jo_3d_draw_list(jo_list *const list)
568 {
570 }
571 
576 static __jo_force_inline void jo_3d_draw_array(jo_3d_quad * const array, int array_size)
577 {
578  while (--array_size >= 0) jo_3d_draw(array + array_size);
579 }
580 
585 static __jo_force_inline bool jo_3d_draw_sprite(const int sprite_id)
586 {
587  if (__jo_sprite_quad[sprite_id] == JO_NULL && !jo_3d_create_sprite_quad(sprite_id)) return (false);
588  jo_3d_draw(__jo_sprite_quad[sprite_id]);
589  return (true);
590 }
591 
598 static __jo_force_inline void jo_3d_draw_sprite_at(const int sprite_id, const int x, const int y, const int z)
599 {
601  jo_3d_translate_matrix(x, y, z);
602  jo_3d_draw_sprite(sprite_id);
604 }
605 
606 /******************************************************
607 * SCALE
608 *******************************************************/
609 
615 static __jo_force_inline void jo_3d_set_scalef(const float x, const float y, const float z)
616 {
617  slScale(toFIXED(x), toFIXED(y), toFIXED(z));
618 }
619 
625 static __jo_force_inline void jo_3d_set_scale(const int x, const int y, const int z)
626 {
628 }
629 
630 /******************************************************
631 * WINDOW & PROJECTION
632 *******************************************************/
633 
644 static __jo_force_inline bool jo_3d_window(const int left, const int top, const int right, const int bottom, const int z_limit, const int center_x, const int center_y)
645 {
646  return slWindow(left, top, right, bottom, z_limit, center_x, center_y) != 0;
647 }
648 
652 static __jo_force_inline void jo_3d_perspective_angle(const int angle)
653 {
654  slPerspective(DEGtoANG(angle));
655 }
656 
660 static __jo_force_inline void jo_3d_display_level(const unsigned short level)
661 {
662  slZdspLevel(level);
663 }
664 
665 /******************************************************
666 * TOOLS
667 *******************************************************/
668 
675 static __jo_force_inline void jo_3d_draw_billboard(const int sprite_id, const int x, const int y, const int z)
676 {
678  jo_sprite_draw(sprite_id, &__jo_sprite_pos, true, true);
679 }
680 
688 static __jo_force_inline void jo_3d_draw_scaled_billboard(const int sprite_id, const int x, const int y, const int z, const int scale)
689 {
690  if (scale == 1)
691  jo_3d_draw_billboard(sprite_id, x, y, z);
692  else
693  {
695  unsigned int previous_scale = __jo_sprite_attributes.fixed_scale;
697  jo_sprite_draw(sprite_id, &__jo_sprite_pos, true, true);
698  __jo_sprite_attributes.fixed_scale = previous_scale;
699  }
700 }
701 
702 #endif /* !JO_COMPILE_WITH_3D_SUPPORT */
703 
704 #endif /* !__JO_3D_H__ */
705 
706 /*
707 ** END OF FILE
708 */
Definition: sgl_prototypes.h:110
static __jo_force_inline void jo_3d_pop_matrix(void)
Pop 3D matrix.
Definition: 3d.h:415
static __jo_force_inline void jo_3d_translate_matrix(int x, int y, int z)
Translate 3D matrix.
Definition: 3d.h:507
static __jo_force_inline void jo_3d_rotate_matrix_x(short x)
Rotate 3D matrix using degree (X axis)
Definition: 3d.h:435
static __jo_force_inline void jo_3d_draw_scaled_billboard(const int sprite_id, const int x, const int y, const int z, const int scale)
Draw billboard with a specific scale.
Definition: 3d.h:688
static __jo_force_inline void jo_3d_draw_array(jo_3d_quad *const array, int array_size)
Draw an array of quadrilateral.
Definition: 3d.h:576
static __jo_force_inline unsigned int jo_3d_get_displayed_polygon_count(void)
Get displayed polygon count.
Definition: 3d.h:202
FIXED target[XYZ]
Definition: 3d.h:94
static __jo_force_inline void jo_3d_set_texture(jo_3d_quad *const quad, const int sprite_id)
Set a texture on the quadrilateral.
Definition: 3d.h:278
static __jo_force_inline void jo_3d_set_color(jo_3d_quad *const quad, const jo_color color)
Set the color on the quadrilateral.
Definition: 3d.h:396
void jo_3d_create_triangle(jo_3d_quad *const quad, jo_vertice *const vertices)
Create a triangle.
void jo_3d_set_mesh_texture(jo_3d_mesh *const mesh, const int sprite_id)
Set a texture on the mesh.
Bool slPushMatrix(void)
Camera structure.
Definition: 3d.h:91
static __jo_force_inline unsigned int jo_3d_get_mesh_polygon_count(jo_3d_mesh *const mesh)
Get polygon count on the mesh.
Definition: 3d.h:252
static __jo_force_inline unsigned int jo_3d_get_polygon_count(void)
Get polygon count (visible and not visible)
Definition: 3d.h:182
unsigned short Uint16
Definition: sgl_prototypes.h:103
static __jo_force_inline void jo_3d_push_matrix(void)
Push 3D matrix.
Definition: 3d.h:408
void jo_3d_set_mesh_screen_doors(jo_3d_mesh *const mesh, const bool enabled)
Enable/Disable screen doors transparency on the mesh.
unsigned short jo_color
15 bits color type
Definition: types.h:39
jo_pos3D jo_vertice
Vertice structure.
Definition: 3d.h:88
jo_list_data data
Definition: list.h:64
static __jo_force_inline void jo_3d_perspective_angle(const int angle)
Set the perspective angle.
Definition: 3d.h:652
void jo_3d_set_mesh_polygon_light(jo_3d_mesh *const mesh, const bool enabled, const unsigned int index)
Enable/Disable light on one polygon on the mesh.
void jo_3d_set_mesh_light(jo_3d_mesh *const mesh, const bool enabled)
Enable/Disable light on the mesh.
void * ptr
Definition: list.h:57
static __jo_force_inline void jo_3d_rotate_matrix_z(short z)
Rotate 3D matrix using degree (Z axis)
Definition: 3d.h:451
static __jo_force_inline void jo_3d_camera_init(jo_camera *const cam)
Initialize the camera with default values.
Definition: 3d.h:159
static __jo_force_inline void jo_3d_rotate_matrix_rad_x(float x)
Rotate 3D matrix using radian (X axis)
Definition: 3d.h:471
static __jo_force_inline void jo_3d_light(const int x, const int y, const int z)
Use a light source.
Definition: 3d.h:292
static __jo_force_inline void jo_3d_camera_set_target(jo_camera *const cam, const int x, const int y, const int z)
Set the target of the camera (where the scene is located)
Definition: 3d.h:140
void jo_sprite_draw(const int sprite_id, const jo_pos3D *const pos, const bool centered_style_coordinates, const bool billboard)
(internal engine usage)
#define __jo_force_inline
force inline attribute (and prevent Doxygen prototype parsing bug)
Definition: conf.h:154
static __jo_force_inline void jo_list_foreach(jo_list *const list, jo_node_callback callback)
Iterate on the list.
Definition: list.h:188
static __jo_force_inline void jo_3d_draw_sprite_at(const int sprite_id, const int x, const int y, const int z)
Draw a sprite.
Definition: 3d.h:598
Uint32 nbPolygon
Definition: sgl_prototypes.h:216
Bool slWindow(Sint16, Sint16, Sint16, Sint16, Sint16, Sint16, Sint16)
void slRotZ(ANGLE)
static __jo_force_inline void jo_3d_set_scale(const int x, const int y, const int z)
Change scale.
Definition: 3d.h:625
void jo_3d_create_plane(jo_3d_quad *const quad, jo_vertice *const vertices)
Create a four vertices polygon (Quadrilateral shape)
static __jo_force_inline void jo_3d_draw(jo_3d_quad *const quad)
Draw a quadrilateral.
Definition: 3d.h:543
List struct.
Definition: list.h:70
void jo_3d_set_mesh_polygon_transparency(jo_3d_mesh *const mesh, const bool enabled, const unsigned int index)
Enable/Disable transparency on one polygon on the mesh.
static __jo_force_inline void jo_3d_translate_matrix_x(int x)
Translate 3D matrix (X axis)
Definition: 3d.h:515
static __jo_force_inline void __jo_poylgon_draw_iterator(jo_node *node)
Internal usage for polygon display.
Definition: 3d.h:559
static __jo_force_inline bool jo_3d_window(const int left, const int top, const int right, const int bottom, const int z_limit, const int center_x, const int center_y)
Sets up a window region on the projection surface.
Definition: 3d.h:644
jo_sprite_attributes __jo_sprite_attributes
Current displayed sprite attribute (internal engine usage)
void slLookAt(FIXED *camera, FIXED *target, ANGLE)
Definition: sgl_prototypes.h:110
static __jo_force_inline void jo_3d_camera_set_viewpoint(jo_camera *const cam, const int x, const int y, const int z)
Set the viewpoint of the camera (where the cameraman is)
Definition: 3d.h:127
3D position
Definition: types.h:51
static __jo_force_inline void jo_3d_translate_matrixf(float x, float y, float z)
Translate 3D matrix (using floating numbers)
Definition: 3d.h:497
void jo_3d_create_cube(jo_3d_quad *array, jo_vertice *const vertices)
Create a cube.
static __jo_force_inline void jo_3d_draw_billboard(const int sprite_id, const int x, const int y, const int z)
Draw billboard.
Definition: 3d.h:675
void slZdspLevel(Uint16)
static __jo_force_inline void jo_3d_rotate_matrix_rad_z(float z)
Rotate 3D matrix using radian (Z axis)
Definition: 3d.h:487
Bool slPopMatrix(void)
void slTranslate(FIXED, FIXED, FIXED)
jo_pos3D __jo_sprite_pos
Current displayed sprite position (internal engine usage)
Sint16 ANGLE
Definition: sgl_prototypes.h:125
Quadrilateral shape structure.
Definition: 3d.h:99
static __jo_force_inline unsigned int jo_3d_get_vertices_count(void)
Get vertice count.
Definition: 3d.h:192
Mesh structure.
Definition: 3d.h:106
void slRotX(ANGLE)
PDATA data
Definition: 3d.h:108
void jo_3d_free_sprite_quad(const int sprite_id)
Delete sprite quad.
PDATA data
Definition: 3d.h:101
static __jo_force_inline jo_3d_quad * jo_3d_get_sprite_quad(const int sprite_id)
Get sprite quad.
Definition: 3d.h:234
static __jo_force_inline void jo_3d_rotate_matrix_y(short y)
Rotate 3D matrix using degree (Y axis)
Definition: 3d.h:443
void jo_3d_set_mesh_polygon_texture(jo_3d_mesh *const mesh, const int sprite_id, const unsigned int index)
Set a texture on one polygon on the mesh.
Sint32 FIXED
Definition: sgl_prototypes.h:126
bool jo_3d_create_sprite_quad(const int sprite_id)
static __jo_force_inline void jo_3d_set_light(jo_3d_quad *const quad, const bool enabled)
Enable/Disable light on the quad.
Definition: 3d.h:318
void jo_3d_set_mesh_transparency(jo_3d_mesh *const mesh, const bool enabled)
Enable/Disable transparency on the mesh.
static __jo_force_inline void jo_3d_draw_list(jo_list *const list)
Draw a list of quadrilateral.
Definition: 3d.h:567
static __jo_force_inline void jo_3d_display_level(const unsigned short level)
Set the display level of the viewing volume.
Definition: 3d.h:660
void jo_3d_set_mesh_color(jo_3d_mesh *const mesh, const jo_color color)
Set the color on the mesh.
void jo_3d_set_mesh_polygon_screen_doors(jo_3d_mesh *const mesh, const bool enabled, const unsigned int index)
Enable/Disable screen doors transparency on one polygon on the mesh.
static __jo_force_inline void jo_3d_set_scalef(const float x, const float y, const float z)
Change scale using floating number.
Definition: 3d.h:615
Definition: sgl_prototypes.h:194
static __jo_force_inline void jo_3d_rotate_matrix(short x, short y, short z)
Rotate 3D matrix using degree.
Definition: 3d.h:425
static __jo_force_inline bool jo_3d_draw_sprite(const int sprite_id)
Draw a sprite.
Definition: 3d.h:585
#define JO_NULL
NULL implementation.
Definition: tools.h:150
#define toFIXED(a)
Definition: sgl_prototypes.h:70
static __jo_force_inline void jo_3d_set_transparency(jo_3d_quad *const quad, const bool enabled)
Enable/Disable transparency on the quadrilateral.
Definition: 3d.h:370
static __jo_force_inline void jo_3d_translate_matrix_y(int y)
Translate 3D matrix (Y axis)
Definition: 3d.h:523
static __jo_force_inline void jo_3d_mesh_draw(jo_3d_mesh *const mesh)
Draw a mesh.
Definition: 3d.h:551
ANGLE z_angle
Definition: 3d.h:95
static __jo_force_inline void jo_3d_rotate_matrix_rad_y(float y)
Rotate 3D matrix using radian (Y axis)
Definition: 3d.h:479
Definition: sgl_prototypes.h:110
static __jo_force_inline void jo_3d_camera_set_z_angle(jo_camera *const cam, const int angle)
Set the angle of the camera.
Definition: 3d.h:151
static __jo_force_inline void jo_3d_rotate_matrix_rad(float x, float y, float z)
Rotate 3D matrix using radian.
Definition: 3d.h:461
#define JO_MULT_BY_65536(X)
Multiply a variable by 65536.
Definition: math.h:123
static __jo_force_inline void jo_3d_translate_matrix_z(int z)
Translate 3D matrix (Z axis)
Definition: 3d.h:531
Definition: sgl_prototypes.h:110
Bool slPutPolygon(PDATA *)
void jo_3d_set_mesh_polygon_color(jo_3d_mesh *const mesh, const jo_color color, const unsigned int index)
Set the color on one polygon on the mesh.
static __jo_force_inline void jo_3d_set_screen_doors(jo_3d_quad *const quad, const bool enabled)
Enable/Disable screen doors transparency on the quad.
Definition: 3d.h:344
ATTR attribute
Definition: 3d.h:102
static __jo_force_inline void jo_3d_camera_look_at(jo_camera *const cam)
look at the camera
Definition: 3d.h:169
unsigned int fixed_scale
Definition: types.h:153
Node struct.
Definition: list.h:62
jo_3d_quad * __jo_sprite_quad[JO_MAX_SPRITE]
Sprite quads (internal engine usage)
Definition: sgl_prototypes.h:211
void slLight(VECTOR)
void slRotY(ANGLE)
static __jo_force_inline void __internal_jo_sprite_set_position3D(const int x, const int y, const int z)
Internal usage don't use it.
Definition: sprites.h:76
#define DEGtoANG(d)
Definition: sgl_prototypes.h:72
void slPerspective(ANGLE)
FIXED viewpoint[XYZ]
Definition: 3d.h:93
void slScale(FIXED, FIXED, FIXED)