CKeepUpright::Simulate
0x007a5380 · 391 bytes · __thiscall
_ZN12CKeepUpright8SimulateEP24IPhysicsMotionControllerP14IPhysicsObjectfR6VectorS5_
Decompiled
undefined (6 params)
/* CKeepUpright::Simulate(IPhysicsMotionController*, IPhysicsObject*, float, Vector&, Vector&) */
undefined4 __thiscall
CKeepUpright::Simulate
(CKeepUpright *this,IPhysicsMotionController *param_1,IPhysicsObject *param_2,
float param_3,Vector *param_4,Vector *param_5)
{
float fVar1;
float local_70;
float local_6c;
float local_68;
Vector local_64 [12];
float local_58;
float local_54;
float local_50;
matrix3x4_t local_4c [60];
if (this[0x46c] == (CKeepUpright)0x0) {
return 0;
}
*(undefined4 *)param_4 = 0;
*(undefined4 *)(param_4 + 4) = 0;
*(undefined4 *)(param_4 + 8) = 0;
(**(code **)(*(int *)param_2 + 0xd4))(param_2,0,&local_70);
(**(code **)(*(int *)param_2 + 200))(param_2,local_4c);
VectorIRotate((float *)(this + 0x444),local_4c,(float *)local_64);
fVar1 = 1.0 / param_3;
if (this[0x46d] == (CKeepUpright)0x0) {
ComputeRotSpeedToAlignAxes
((Vector *)&local_58,(Vector *)(this + 0x450),local_64,(float)&local_70,1.0,fVar1);
}
else {
ComputeRotSpeedToAlignAxes
((Vector *)&local_58,(Vector *)(this + 0x450),local_64,(float)&local_70,0.0,fVar1);
local_58 = local_58 - local_70;
local_54 = local_54 - local_6c;
local_50 = local_50 - local_68;
}
*(float *)param_5 = local_58 * fVar1;
*(float *)(param_5 + 4) = local_54 * fVar1;
*(float *)(param_5 + 8) = local_50 * fVar1;
return 1;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.