Help! Function Pointer Vector3 Argument

Kaorin333

Solid & Active Platinian
Does anyone know how to call a function with a vector as an argument?

C++:
// Token: 0x06000810 RID: 2064 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x60007B5")]
[Address(RVA = "0x19AA9BC", Offset = "0x19AA9BC", VA = "0x19AA9BC")]
public void playerCameraTo(Vector3 vector, bool anim, [Optional] Action onComplete)
{
}

C++:
void (*playerCameraTo)(void *instance, void <int> vector, bool anim);


//FUNCTION

void *hack_thread(void *) {
    playerCameraTo = (void (*)(void *, <int>vector, false)) getAbsoluteAddress(targetLibName, 0x19AA9BC);
}


// CALL

case 4:
    vector<int> vector1(100, 200, 0);

    playerCameraTo(vector1, false);

break;


Im totally lost. Would be happy if someone could help.
 
A vector3 is just a struct with x, y, z:

C++:
struct Vector3 {
    int x, y, z;
};

void (*playerCameraTo)(void *instance, Vector3* vector, bool anim);

void *hack_thread(void *) {
    playerCameraTo = (void (*)(void *, Vector3*, bool)) getAbsoluteAddress(targetLibName, 0x19AA9BC);
}

case 4:
    Vector3 v3 = {1, 2, 3};
    playerCameraTo(instance, &v3, false);
break;

Also your code is a mess. You're not even calling playerCameraTo with a valid instance of whatever the class is.
 
Back
Top Bottom