Refactoring some of the poker game logic again.
This commit is contained in:
30
temp/render/look.c
Normal file
30
temp/render/look.c
Normal file
@ -0,0 +1,30 @@
|
||||
/**
|
||||
* 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
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user