Good Day Stackoverflow people!
I stumbled upon a simple problem and I can't find a solution to it by myself.
There are two methods in my Transform class with variables which I want to call in another class but I can't figure out how:
Transform Class Methods:
public Vector3f GetPos() {
return m_pos;
}
public void SetPos(Vector3f pos) {
this.m_pos = pos;
}
The variables "m_pos" and "pos" are coordinates of a Vector3f which I need to use in a method called ProcessText which is in a different class:
Class2 Method:
public void ProcessText() {
String file_name = "C:/Users/Server/Desktop/textText.txt";
try {
ProcessCoords data = new ProcessCoords(file_name);
data.writeToFile("makeGrass:0,1,2");
System.out.println("Coordinates Saved!");
} catch (IOException e) {
System.out.println(e.getMessage());
}
}
Now instead of having the ProcessText method write to the file "makeGrass:0,1,2" I want it to use "m_pos" and "pos" from the methods in my Transform Class, so I can say:
data.writeToFile("makeGrass:" + m_pos + pos);
However I have no idea how to do get the variables "m_pos" and "pos" from both methods of my Transform Class, if anyone could help me out I would be very happy.