Continue physics

This commit is contained in:
Miloslav Ciz 2024-09-05 22:51:11 +02:00
parent 1c6666b377
commit 46c8a4eade
4 changed files with 122 additions and 23 deletions

View file

@ -7,7 +7,7 @@
#define S3L_RESOLUTION_X LCR_SETTING_RESOLUTION_X
#define S3L_RESOLUTION_Y LCR_SETTING_RESOLUTION_Y
#define S3L_PIXEL_FUNCTION LCR_pixelFunc3D
#define S3L_PIXEL_FUNCTION _LCR_pixelFuncc3D
#define S3L_PERSPECTIVE_CORRECTION 2
#define S3L_NEAR_CROSS_STRATEGY 1
@ -82,7 +82,18 @@ struct
} LCR_renderer;
void LCR_pixelFunc3D(S3L_PixelInfo *pixel)
void LCR_rendererSetCarTransform(LCR_GameUnit position[3],
LCR_GameUnit rotation[3])
{
LCR_renderer.carModel->transform.translation.x =
(position[0] * LCR_RENDERER_UNIT) / LCR_GAME_UNIT;
LCR_renderer.carModel->transform.translation.y =
(position[1] * LCR_RENDERER_UNIT) / LCR_GAME_UNIT;
LCR_renderer.carModel->transform.translation.z =
(position[2] * LCR_RENDERER_UNIT) / LCR_GAME_UNIT;
}
void _LCR_pixelFuncc3D(S3L_PixelInfo *pixel)
{
// once we get a new triangle, we precompute things for it:
if (pixel->triangleID != LCR_renderer.previousTriID)