CMotorController::Simulate
0x007a3750 · 622 bytes · __thiscall
_ZN16CMotorController8SimulateEP24IPhysicsMotionControllerP14IPhysicsObjectfR6VectorS5_
Decompiled
undefined (6 params)
/* CMotorController::Simulate(IPhysicsMotionController*, IPhysicsObject*, float, Vector&, Vector&)
*/
undefined4 __thiscall
CMotorController::Simulate
(CMotorController *this,IPhysicsMotionController *param_1,IPhysicsObject *param_2,
float param_3,Vector *param_4,Vector *param_5)
{
undefined4 uVar1;
undefined4 uVar2;
undefined4 uVar3;
float fVar4;
float fVar5;
float fVar6;
float fVar7;
float fVar8;
float fVar9;
float local_70;
float local_6c;
float local_68;
float local_64;
float local_60;
float local_5c;
float local_58;
float local_54;
float local_50;
matrix3x4_t local_4c [60];
uVar3 = DAT_01053d50;
uVar2 = DAT_01053d4c;
uVar1 = vec3_origin;
*(undefined4 *)param_4 = vec3_origin;
*(undefined4 *)(param_4 + 4) = uVar2;
*(undefined4 *)(param_4 + 8) = uVar3;
*(undefined4 *)param_5 = uVar1;
*(undefined4 *)(param_5 + 4) = uVar2;
*(undefined4 *)(param_5 + 8) = uVar3;
if (*(float *)(this + 4) != 0.0) {
(**(code **)(*(int *)param_2 + 200))(param_2,local_4c);
(**(code **)(*(int *)param_2 + 0xd4))(param_2,0,&local_70);
VectorIRotate((float *)(this + 0xc),local_4c,&local_64);
fVar6 = local_60 * local_6c + local_64 * local_70 + local_5c * local_68;
(**(code **)(*(int *)param_2 + 0x80))(&local_58,param_2);
fVar8 = 0.0;
fVar7 = ABS(local_54 * local_60) + ABS(local_64 * local_58) + ABS(local_5c * local_50);
fVar5 = *(float *)(this + 0x20);
fVar4 = *(float *)(this + 0x18) * (*(float *)(this + 4) - fVar6) * fVar7;
if (0.0 < ABS(fVar5)) {
fVar9 = fVar6 - *(float *)(this + 0x1c);
if ((*(float *)(this + 4) - fVar6) * fVar9 <= 0.0) {
if ((fVar6 != 0.0) && (ABS(fVar9 / fVar5) < 0.05)) {
fVar4 = fVar4 + *(float *)(this + 0x28) * *(float *)(this + 0x24);
}
}
else {
fVar9 = fVar9 / fVar5;
if (fVar9 <= 1.0) {
if (fVar9 <= 0.0) {
fVar9 = fVar8;
}
fVar8 = 1.0 - fVar9;
}
fVar4 = fVar4 + *(float *)(this + 0x28) * *(float *)(this + 0x24) * fVar8;
}
}
fVar8 = *(float *)(this + 8);
fVar5 = fVar4;
if (((fVar8 != 0.0) && (fVar5 = fVar8, fVar4 <= fVar8)) && (fVar5 = fVar4, fVar4 <= -fVar8)) {
fVar5 = -fVar8;
}
*(float *)(this + 0x1c) = fVar6;
*(float *)(this + 0x24) = fVar5;
*(float *)(this + 0x20) = fVar5 / fVar7;
*(float *)param_5 = local_64 * fVar5;
*(float *)(param_5 + 4) = local_60 * fVar5;
*(float *)(param_5 + 8) = fVar5 * local_5c;
return 2;
}
return 0;
}
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.