Wondering if we could add the following method to com.jme.util.geom.BufferUtils
/**
* Create a new float[] array and populate it with the given FloatBuffer's
* contents.
*
* @param buff
* the FloatBuffer to read from
* @return a new float array populated from the FloatBuffer
*/
public static float[] getFloatArray(FloatBuffer buff) {
if (buff == null) return null;
buff.clear();
float[] inds = new float[buff.limit()];
for (int x = 0; x < inds.length; x++) {
inds[x] = buff.get();
}
return inds;
}
It is a very small change (which matches almost identically with getIntArray), but would be ncie for my project. It is easier than creating a method in a utility class solely for my project.
Yeah - it would be better to be able to just call the '.array()' method on the buffer…but its not always guaranteed to work.
I understand why its not always supported…but it still seems to me like they should have put a method like this in the base FloatBuffer class in the cases where it wasn't 'supported'. I somehow doubt that I could get them to change that behavior though
Yes. As described in the last news-item, you need to send an e-mail to info@jmonkeyengine.com and request SVN access. You also need to specify your gmail address as that will be your username to the jMe 2.0 googlecode repo.