Hey guys,
I've got the following problem with an array assignment...
I've got a global float array in Global.java declared as...
public static float camObjCoord[] = new float[8000];
I'm then filling its contents with.
public void addcube(float highx, float lowx, float highz, float lowz){
//Constructing new cube...
System.out.println("f = " + f);
Global.cubes++;
float y = 1.5f;
System.out.println("highx = " + highx + "lowx = " + lowx + "highz = " + highz + "lowz = " + lowz);
//FRONT
Global.camObjCoord[Global.i++] = highx;
System.out.println("cube i = " + Global.i);
}
I call this method like so...
addcube(-2.0f, 2.0f, -2.0f, 2.0f);
The following is a debug print..
07-13 16:01:16.220: INFO/System.out(4837): highx = -2.0lowx = 2.0highz = - 2.0lowz = 2.0 //This is the values coming in to the class
07-13 16:01:16.220: INFO/System.out(4837): 0.0 //This is the contents of index 0
07-13 16:01:16.220: INFO/System.out(4837): cube i = 1
07-13 16:01:16.220: INFO/System.out(4837): 0.0 //Contents of i 1
07-13 16:01:16.220: INFO/System.out(4837): cube i = 2
07-13 16:01:16.220: INFO/System.out(4837): 0.0 //Contents of i 2
07-13 16:01:16.220: INFO/System.out(4837): cube i = 3
07-13 16:01:16.230: INFO/System.out(4837): 0.0 //Contents of i 3
So, as you can see.. When I'm assigning the values they just.. don't get assigned to the indexes.. why? All indexes remain equal to 0.0