Using 3 ofxUI2dPads for one 3D position

Hello everybody

I’m having trouble to properly design an interface to move a point in 3d.
I created a simple code to illustrate my problem.

The idea is that I have an ofVec3f called position, and I want three 2dPads to modify its XYZ. Until now I was using copies of that position in the pads, but every time one pad changed I have to manually update the other pads.

Now I thought that the smartest way would be to pass a pointer to the pad so that I don’t have to refresh the pads every time, and since my program is changing the variable in many places it would be a very bad design to keep copying and updating the same variable so many times.

Now the problem comes when I try to use that reference. First of all my experience with pointers is very little, so I don’t know how that would look like. And then I also have been looking at the 2dPad code and it doesn’t seem to be ready to do what I want to do…

Anybody could give me some advice on how what directions should I take?

here you can have a look at the code… it is very simple.

src.zip (1.5 KB)

Well I found to way to solve what I was trying to do.
So, in other words, if anyone is trying to use a 2DPad to move a point in 3D using pointers here is the solution to it.
https://github.com/wasawi/ofxUI/tree/3DPad/example-myVariableBinding

It is a bit dirty hack since I had to create one more enum in defines.h … but it works well.