- use degrees for quaternion properties

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7725 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 14 years ago
parent 41017fdacf
commit 090e57b224
  1. 4
      sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/properties/QuaternionPropertyEditor.java

@ -74,7 +74,7 @@ public class QuaternionPropertyEditor implements PropertyEditor {
public String getAsText() { public String getAsText() {
float[] angles=quaternion.toAngles(new float[3]); float[] angles=quaternion.toAngles(new float[3]);
return "[" + angles[0] + ", " + angles[1] + ", " + angles[2] + "]"; return "[" + (float)Math.toDegrees(angles[0]) + ", " + (float)Math.toDegrees(angles[1]) + ", " + (float)Math.toDegrees(angles[2]) + "]";
} }
public void setAsText(String text) throws IllegalArgumentException { public void setAsText(String text) throws IllegalArgumentException {
@ -87,7 +87,7 @@ public class QuaternionPropertyEditor implements PropertyEditor {
float[] floats = new float[3]; float[] floats = new float[3];
for (int i = 0; i < values.length; i++) { for (int i = 0; i < values.length; i++) {
String string = values[i]; String string = values[i];
floats[i] = Float.parseFloat(string); floats[i] = (float)Math.toRadians(Float.parseFloat(string));
} }
Quaternion old=new Quaternion(); Quaternion old=new Quaternion();
old.set(quaternion); old.set(quaternion);

Loading…
Cancel
Save