1 #ifndef PLAYER_DEVICE_DEAD_H
2 #define PLAYER_DEVICE_DEAD_H
4 #include "player_interface.h"
6 #include "player_model.h"
8 struct player_device_dead
12 VG_STATIC
void player_dead_pre_update( player_interface
*player
,
13 player_attachment
*at
)
17 VG_STATIC
void player_dead_update( player_interface
*player
,
18 player_attachment
*at
)
20 player_ragdoll_iter( &player
->ragdoll
);
23 VG_STATIC
void player_dead_post_update( player_interface
*player
,
24 player_attachment
*at
)
26 copy_ragdoll_pose_to_avatar( &player
->ragdoll
, player
->playeravatar
);
29 VG_STATIC
void player_dead_ui( player_interface
*player
,
30 player_attachment
*at
)
34 VG_STATIC
void player_dead_bind( player_interface
*player
,
35 player_attachment
*at
)
37 copy_avatar_pose_to_ragdoll( player
->playeravatar
, &player
->ragdoll
,
41 VG_STATIC
void player_dead_pose( player_interface
*player
,
42 player_attachment
*at
,
43 player_pose pose
, m4x3f transform
)
47 /* FIXME: player_device_common */
48 VG_STATIC
void player_skate_get_camera( player_interface
*player
,
49 player_attachment
*at
, camera
*cam
);
50 VG_STATIC
void skate_camera_vector_look( camera
*cam
, v3f v
, float C
, float k
);
52 VG_STATIC
void player_dead_get_camera( player_interface
*player
,
53 player_attachment
*at
, camera
*cam
)
55 struct player_avatar
*av
= player
->playeravatar
;
57 v3f vp
= {-0.1f
,1.8f
,0.0f
},
58 vd
= {-1.0f
,0.0f
,0.0f
};
60 m4x3_mulv( av
->sk
.final_mtx
[ av
->id_head
-1 ], vp
, cam
->pos
);
61 m3x3_mulv( av
->sk
.final_mtx
[ av
->id_head
-1 ], vd
, vd
);
63 v3_zero( cam
->angles
);
66 skate_camera_vector_look( cam
, vd
, 1.0f
, 0.0f
);
69 VG_STATIC
void player_dead_transport( player_interface
*player
,
70 player_attachment
*at
,
75 VG_STATIC player_device player_device_dead
=
77 .pre_update
= player_dead_pre_update
,
78 .update
= player_dead_update
,
79 .post_update
= player_dead_post_update
,
80 .get_camera
= player_dead_get_camera
,
81 .debug_ui
= player_dead_ui
,
82 .bind
= player_dead_bind
,
84 .pose
= player_dead_pose
,
86 .gate_transport
= player_dead_transport
88 #endif /* PLAYER_DEVICE_DEAD_H */