Continue ghost
This commit is contained in:
parent
0a91d5f54e
commit
0b16d64eef
2 changed files with 69 additions and 21 deletions
34
renderer.h
34
renderer.h
|
@ -115,11 +115,31 @@ struct
|
|||
with color stored in this variable. */
|
||||
} LCR_renderer;
|
||||
|
||||
void _LCR_rendererSetModelTransofmr(S3L_Model3D *model,
|
||||
LCR_GameUnit position[3], LCR_GameUnit rotation[3])
|
||||
{
|
||||
model->transform.translation.x =
|
||||
(position[0] * LCR_RENDERER_UNIT) / LCR_GAME_UNIT;
|
||||
model->transform.translation.y =
|
||||
(position[1] * LCR_RENDERER_UNIT) / LCR_GAME_UNIT;
|
||||
model->transform.translation.z =
|
||||
(position[2] * LCR_RENDERER_UNIT) / LCR_GAME_UNIT;
|
||||
|
||||
model->transform.rotation.x = S3L_wrap((rotation[0] *
|
||||
S3L_F) / LCR_GAME_UNIT,S3L_F);
|
||||
model->transform.rotation.y = S3L_wrap((rotation[1] *
|
||||
S3L_F) / LCR_GAME_UNIT,S3L_F);
|
||||
model->transform.rotation.z = S3L_wrap((rotation[2] *
|
||||
S3L_F) / LCR_GAME_UNIT,S3L_F);
|
||||
}
|
||||
|
||||
void LCR_rendererSetCarTransform(LCR_GameUnit position[3],
|
||||
LCR_GameUnit rotation[3])
|
||||
{
|
||||
LCR_LOG2("setting car transform");
|
||||
|
||||
_LCR_rendererSetModelTransofmr(LCR_renderer.carModel,position,rotation);
|
||||
/*
|
||||
LCR_renderer.carModel->transform.translation.x =
|
||||
(position[0] * LCR_RENDERER_UNIT) / LCR_GAME_UNIT;
|
||||
LCR_renderer.carModel->transform.translation.y =
|
||||
|
@ -133,6 +153,15 @@ void LCR_rendererSetCarTransform(LCR_GameUnit position[3],
|
|||
S3L_F) / LCR_GAME_UNIT,S3L_F);
|
||||
LCR_renderer.carModel->transform.rotation.z = S3L_wrap((rotation[2] *
|
||||
S3L_F) / LCR_GAME_UNIT,S3L_F);
|
||||
*/
|
||||
}
|
||||
|
||||
void LCR_rendererSetGhostTransform(LCR_GameUnit position[3],
|
||||
LCR_GameUnit rotation[3])
|
||||
{
|
||||
LCR_LOG2("setting ghost transform");
|
||||
|
||||
_LCR_rendererSetModelTransofmr(LCR_renderer.ghostModel,position,rotation);
|
||||
}
|
||||
|
||||
void LCR_rendererSetCarVisibility(uint8_t visible)
|
||||
|
@ -140,6 +169,11 @@ void LCR_rendererSetCarVisibility(uint8_t visible)
|
|||
LCR_renderer.carModel->config.visible = visible;
|
||||
}
|
||||
|
||||
void LCR_rendererSetGhostVisibility(uint8_t visible)
|
||||
{
|
||||
LCR_renderer.ghostModel->config.visible = visible;
|
||||
}
|
||||
|
||||
void _LCR_rendererDrawFontPixel(int x, int y, uint16_t color)
|
||||
{
|
||||
#if LCR_FONT_PIXEL_SIZE == 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue