4 * Copyright (C) 2021-2024 Mt.ZERO Software - All Rights Reserved
9 #include "player_api.h"
11 #include "vg/vg_rigidbody.h"
12 #include "vg/vg_rigidbody_constraints.h"
14 struct player_ragdoll
{
18 /* Collider transform relative to bone */
32 enum bone_collider type
;
43 rb_constr_pos position_constraints
[32];
44 u32 position_constraints_count
;
46 rb_constr_swingtwist cone_constraints
[32];
47 u32 cone_constraints_count
;
49 /* TODO: Fix duplicated data */
50 u32 constraint_associations
[32][2];
54 enum player_die_type
{
55 k_player_die_type_generic
,
56 k_player_die_type_head
,
57 k_player_die_type_feet
60 void player_ragdoll_init(void);
61 void player_init_ragdoll_bone_collider( struct skeleton_bone
*bone
,
62 struct ragdoll_part
*rp
);
63 u32
ragdoll_bone_parent( struct player_ragdoll
*rd
, u32 bone_id
);
64 void setup_ragdoll_from_skeleton( struct skeleton
*sk
,
65 struct player_ragdoll
*rd
);
66 void copy_ragdoll_pose_to_localplayer( struct player_ragdoll
*rd
);
67 void copy_localplayer_to_ragdoll( struct player_ragdoll
*rd
,
68 enum player_die_type type
);
70 void player_debug_ragdoll(void);
71 void player_ragdoll_iter( struct player_ragdoll
*rd
);