Start main loop
This commit is contained in:
parent
ee15824329
commit
e21d5b7825
5 changed files with 86 additions and 24 deletions
31
renderer.h
31
renderer.h
|
@ -65,6 +65,34 @@ uint8_t LCR_rendererInit(void)
|
|||
return 1;
|
||||
}
|
||||
|
||||
void LCR_rendererMoveCamera(LCR_SpaceUnit forwRightUpOffset[3],
|
||||
LCR_SpaceUnit yawPitchOffset[2])
|
||||
{
|
||||
S3L_Vec4 f, r, u;
|
||||
|
||||
S3L_rotationToDirections(LCR_scene3D.camera.transform.rotation,
|
||||
S3L_FRACTIONS_PER_UNIT,&f,&r,&u);
|
||||
|
||||
LCR_scene3D.camera.transform.translation.x +=
|
||||
((f.x * forwRightUpOffset[0] + r.x * forwRightUpOffset[1] +
|
||||
u.x * forwRightUpOffset[2]) * S3L_FRACTIONS_PER_UNIT) / LCR_SQUARE_SIDE_LEN;
|
||||
|
||||
LCR_scene3D.camera.transform.translation.y +=
|
||||
((f.y * forwRightUpOffset[0] + r.y * forwRightUpOffset[1] +
|
||||
u.y * forwRightUpOffset[2]) * S3L_FRACTIONS_PER_UNIT) / LCR_SQUARE_SIDE_LEN;
|
||||
|
||||
LCR_scene3D.camera.transform.translation.z +=
|
||||
((f.z * forwRightUpOffset[0] + r.z * forwRightUpOffset[1] +
|
||||
u.z * forwRightUpOffset[2]) * S3L_FRACTIONS_PER_UNIT) / LCR_SQUARE_SIDE_LEN;
|
||||
|
||||
LCR_scene3D.camera.transform.rotation.y +=
|
||||
(yawPitchOffset[0] * S3L_FRACTIONS_PER_UNIT) / LCR_SQUARE_SIDE_LEN;
|
||||
|
||||
LCR_scene3D.camera.transform.rotation.x +=
|
||||
(yawPitchOffset[1] * S3L_FRACTIONS_PER_UNIT) / LCR_SQUARE_SIDE_LEN;
|
||||
}
|
||||
|
||||
/*
|
||||
void LCR_getCameraPos(LCR_SpaceUnit pos[3])
|
||||
{
|
||||
pos[0] = (LCR_scene3D.camera.transform.translation.x *
|
||||
|
@ -84,8 +112,9 @@ void LCR_setCameraPos(LCR_SpaceUnit pos[3])
|
|||
LCR_scene3D.camera.transform.translation.z =
|
||||
(pos[2] * S3L_FRACTIONS_PER_UNIT) / LCR_SQUARE_SIDE_LEN;
|
||||
}
|
||||
*/
|
||||
|
||||
void LCR_render(void)
|
||||
void LCR_rendererDraw(void)
|
||||
{
|
||||
S3L_newFrame();
|
||||
S3L_drawScene(LCR_scene3D);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue