Commit b03a443a authored by legoc's avatar legoc
Browse files

Removed normalization of the direction vector

parent 543c5077
......@@ -295,6 +295,7 @@ public class EditorMenuBar extends MenuBar {
// Rotation direction
ObservableList<Axis.RotationDirection> rotationDirections = FXCollections.observableArrayList(Axis.RotationDirection.CCW, Axis.RotationDirection.CW);
ComboBox<Axis.RotationDirection> rotationDirectionBox = new ComboBox<>(rotationDirections);
rotationDirectionBox.setVisible(selectedAxis.getType() == Axis.Type.ROTATION);
rotationDirectionBox.getSelectionModel().select(selectedAxis.getRotationDirection());
rotationDirectionBox.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Axis.RotationDirection>() {
@Override
......@@ -303,13 +304,10 @@ public class EditorMenuBar extends MenuBar {
// Set the rotation direction.
Nomad3DEditor.getInstance().getAxisBuilder().getAxis().setRotationDirection(newValue);
// Get the axis.
Axis axis = Nomad3DEditor.getInstance().getAxisBuilder().getAxis();
// Set the direction fields.
xDirField.setText(String.format("%.3f", axis.getDirection().getX()));
yDirField.setText(String.format("%.3f", axis.getDirection().getY()));
zDirField.setText(String.format("%.3f", axis.getDirection().getZ()));
xDirField.setText(String.format("%.3f", selectedAxis.getDirection().getX()));
yDirField.setText(String.format("%.3f", selectedAxis.getDirection().getY()));
zDirField.setText(String.format("%.3f", selectedAxis.getDirection().getZ()));
}
});
......@@ -509,11 +507,7 @@ public class EditorMenuBar extends MenuBar {
if (!selectedAxis.equals(initialAxis)) {
System.out.println("Axis modified");
// Normalize here the direction, because the norm has an impact on the
// translation.
selectedAxis.setDirection(selectedAxis.getDirection().normalize());
// Stop the build.
Nomad3DEditor.getInstance().getAxisBuilder().stop(selectedComponent);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment