Hi. I have a utility method called rotateRandomly(TriMesh) that does exactly what it says:
public static void rotateRandomly(TriMesh obj) {
Quaternion quat = new Quaternion();
float x = randomFloat(-FastMath.PI/4f, FastMath.PI/4f);
float y = randomFloat(-FastMath.PI/4f, FastMath.PI/4f);
float z = randomFloat(-FastMath.PI/4f, FastMath.PI/4f);
quat.fromAngles(new float[] {x,y,z});
obj.setLocalRotation(quat);
}
After passing a Sphere type object to this, whose coordinates have been using the full constructor, the Sphere is rotated, but also moved. I tried to even explicitly set the local and even world translation after this method was called, but to no avail. Calling Sphere.getLocalTranslation() returns the expected values that I gave it, but in the game I can see clearly that the object is not where it should be (because I have several such spheres that should be on the same plane, yet some are higher than others).
Any ideas as to what's wrong?