jPCT-AE - a 3d engine for Android > Support
array of SimpleVectors
(1/1)
Thomas.:
Why is here error? Length of array is 3, but I can not read or write ...
--- Code: ---SimpleVector[] positions = new SimpleVector[positionst.countTokens() / 3];
int positionsnumb = 0;
float x = Float.parseFloat(positionst.nextToken());
float y = Float.parseFloat(positionst.nextToken());
float z = Float.parseFloat(positionst.nextToken());
positions[positionsnumb].set(x, y, z);
--- End code ---
EgonOlsen:
Nobody fills that array with actual instances of SimpleVector...
paulscode:
Yeh, try changing that last line to:
--- Code: ---positions[positionsnumb] = new SimpleVector(x, y, z);
--- End code ---
Thomas.:
Thanks :)
Navigation
[0] Message Index
Go to full version