I\'m working with a particle simulation library. The way interactions are added to particles it through the following library function:
AddInteraction(Partic
What you describe is not possible because the library does not know it has to pass this parameter to your member functions. You could do it if interaction accepted an argument reserved for the user. If you have a single object instance calling AddInteraction at any given time, then you can store a pointer to the instance:
Object *Object::only_instance;
void Object::AddInteractionCaller() {
only_instance = this;
AddInteraction(set, interaction_fn);
}
void interaction_fn(xyz* p, xyz* v) {
only_instance->interaction(p, v);
}