update helpers/location to 'frosted' ui
[carveJwlIkooP6JGAAIwe30JlM.git] / player_basic_info.c
1 #include "player_basic_info.h"
2 #include "network_compression.h"
3
4 struct player_basic_info player_basic_info;
5 struct player_subsystem_interface player_subsystem_basic_info =
6 {
7 .pose = player__basic_info_pose,
8 .network_animator_exchange = player__basic_info_animator_exchange,
9 .animator_data = &player_basic_info.animator,
10 .animator_size = sizeof(player_basic_info.animator),
11 .name = "Basic Info"
12 };
13
14 void player__basic_info_animator_exchange(bitpack_ctx *ctx, void *data)
15 {
16 struct player_basic_info_animator *animator = data;
17 /* TODO: This range needs to be standardized in a common header */
18 bitpack_qv3f( ctx, 24, -1024.0f, 1024.0f, animator->root_co );
19 }
20
21 void player__basic_info_pose( void *_animator, player_pose *pose )
22 {
23 struct player_basic_info_animator *animator = _animator;
24 v3_copy( animator->root_co, pose->root_co );
25 q_identity( pose->root_q );
26 pose->type = k_player_pose_type_fk_2;
27 pose->board.lean = 0.0f;
28
29 for( int i=0; i<localplayer.skeleton.bone_count; i ++ ){
30 v3_zero(pose->keyframes[i].co);
31 q_identity(pose->keyframes[i].q);
32 v3_fill(pose->keyframes[i].s,1.0f);
33 }
34 }