/
csgo_player_anim_state.h
215 lines (141 loc) · 5.13 KB
/
csgo_player_anim_state.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
#pragma once
struct animstate_pose_param_cache {
bool m_initialized;
char _pad0[ 0x3 ];
int m_index;
const char* m_name;
bool init( cs_player* player, const char* pose_param_name ) {
m_interfaces.m_mdl_cache->begin_lock( );
m_name = pose_param_name;
m_index = player->lookup_pose_parameter( pose_param_name );
if ( m_index != 1 )
m_initialized = true;
m_interfaces.m_mdl_cache->end_lock( );
return m_initialized;
}
void set_value( cs_player* player, float value ) {
if ( !m_initialized )
init( player, m_name );
if ( m_initialized && player ) {
m_interfaces.m_mdl_cache->begin_lock( );
player->set_pose_parameter( m_index, value );
m_interfaces.m_mdl_cache->end_lock( );
}
}
};
struct csgo_player_anim_state {
auto update( float y, float x ) {
static auto function = m_modules.m_client_dll.get_address( "CCSGOPlayerAnimState::Update" ).as< void( __vectorcall* )( void*, void*, float, float, float, void* ) >( );
return function( this, nullptr, 0.f, y, x, nullptr );
}
auto set_up_velocity( ) {
static auto function = m_modules.m_client_dll.get_address( "CCSGOPlayerAnimState::SetUpVelocity" ).as< void( __thiscall* )( void* ) >( );
return function( this );
}
auto set_up_aim_matrix( ) {
static auto function = m_modules.m_client_dll.get_address( "CCSGOPlayerAnimState::SetUpAimMatrix" ).as< void( __thiscall* )( void* ) >( );
return function( this );
}
auto set_up_weapon_action( ) {
static auto function = m_modules.m_client_dll.get_address( "CCSGOPlayerAnimState::SetUpWeaponAction" ).as< void( __thiscall* )( void* ) >( );
return function( this );
}
auto set_up_movement( ) {
static auto function = m_modules.m_client_dll.get_address( "CCSGOPlayerAnimState::SetUpMovement" ).as< void( __thiscall* )( void* ) >( );
return function( this );
}
auto set_up_alive_loop( ) {
static auto function = m_modules.m_client_dll.get_address( "CCSGOPlayerAnimState::SetUpAliveloop" ).as< void( __thiscall* )( void* ) >( );
return function( this );
}
auto set_up_whole_body_action( ) {
static auto function = m_modules.m_client_dll.get_address( "CCSGOPlayerAnimState::SetUpWholeBodyAction" ).as< void( __thiscall* )( void* ) >( );
return function( this );
}
auto set_up_flashed_reaction( ) {
// todo
}
auto set_up_flinch( ) {
static auto function = m_modules.m_client_dll.get_address( "CCSGOPlayerAnimState::SetUpFlinch" ).as< void( __thiscall* )( void* ) >( );
return function( this );
}
auto set_up_lean( ) {
static auto function = m_modules.m_client_dll.get_address( "CCSGOPlayerAnimState::SetUpLean" ).as< void( __thiscall* )( void* ) >( );
return function( this );
}
auto cache_sequences( ) {
static auto function = m_modules.m_client_dll.get_address( "CCSGOPlayerAnimState::CacheSequences" ).as< bool( __thiscall* )( void* ) >( );
return function( this );
}
auto increment_layer_cycle( int layer_index, bool allow_loop ) {
static auto function = m_modules.m_client_dll.get_address( "CCSGOPlayerAnimState::IncrementLayerCycle" ).as< void( __thiscall* )( void*, int, bool ) >( );
return function( this, layer_index, allow_loop );
}
auto increment_layer_weight( int layer_index ) {
static auto function = m_modules.m_client_dll.get_address( "CCSGOPlayerAnimState::IncrementLayerWeight" ).as< void( __thiscall* )( void*, int ) >( );
return function( this, layer_index );
}
char _pad0[ 0x4 ];
bool m_first_run_since_init;
char _pad1[ 0x5b ];
cs_player* m_player;
weapon_cs_base* m_weapon;
weapon_cs_base* m_weapon_last;
float m_last_update_time;
int m_last_update_frame;
float m_last_update_increment;
float m_eye_yaw;
float m_eye_pitch;
float m_foot_yaw;
float m_foot_yaw_last;
float m_move_yaw;
float m_move_yaw_ideal;
float m_move_yaw_current_to_ideal;
float m_time_to_align_lower_body;
float m_primary_cycle;
float m_move_weight;
float m_move_weight_smoothed;
float m_anim_duck_amount;
float m_duck_additional;
float m_recrouch_weight;
vector_3d m_position_current;
vector_3d m_position_last;
vector_3d m_velocity;
vector_3d m_velocity_normalized;
vector_3d m_velocity_normalized_non_zero;
float m_velocity_length_xy;
float m_velocity_length_z;
float m_speed_as_portion_of_run_top_speed;
float m_speed_as_portion_of_walk_top_speed;
float m_speed_as_portion_of_crouch_top_speed;
float m_duration_moving;
float m_duration_still;
bool m_on_ground;
bool m_landing;
char _pad2[ 0x12 ];
float m_walk_to_run_transition;
char _pad3[ 0x4 ];
float m_in_air_smooth_value;
bool m_on_ladder;
char _pad4[ 0x3 ];
float m_ladder_weight;
char _pad5[ 0x2c ];
vector_3d m_velocity_last;
char _pad6[ 0x45 ];
bool m_player_is_accelerating;
char _pad7[ 0x2 ];
animstate_pose_param_cache m_pose_param_mappings[ 20 ];
float m_duration_move_weight_is_too_high;
float m_static_approach_speed;
int m_previous_move_state;
float m_stutter_step;
char _pad8[ 0x80 ];
float m_aim_yaw_min;
float m_aim_yaw_max;
float m_aim_pitch_min;
float m_aim_pitch_max;
int m_animstate_version;
// custom members
bool m_adjust_started;
float m_lower_body_realign_timer;
};