Dawn/temp/render/look.c

31 lines
650 B
C

/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "look.h"
void pokerLookAtPlayer(camera_t *camera, uint8_t seat, float distance) {
float x, z, angle;
angle = POKER_SEAT_ANGLE(seat);
x = sin(angle) * (0.8 + distance);
z = cos(angle) * (0.8 + distance);
cameraLookAt(camera,
x, 0.3, z,
-x, 0.3, -z
);
}
void pokerLookAtHand(camera_t *camera, uint8_t seat) {
float x, z, angle;
angle = POKER_SEAT_ANGLE(seat);
x = sin(angle);
z = cos(angle);
cameraLookAt(camera,
x*0.1, 0.8, z*0.1,
-x*0.5, 0.2, -z*0.5
);
}