Skip to content

Commit 4955f9b

Browse files
committed
updated the camera in editors
1 parent 4b6c902 commit 4955f9b

File tree

7 files changed

+16
-14
lines changed

7 files changed

+16
-14
lines changed

build-native.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
name="jME3-SpaceShift-Editor"
118118
mainClass="com.ss.editor.Starter"
119119
toolkit="fx"
120-
version="0.7.1"
120+
version="0.7.2"
121121
/>
122122

123123
<mkdir dir="build/classes/META-INF"/>
@@ -130,7 +130,7 @@
130130
<manifest>
131131
<attribute name="Implementation-Vendor" value="spaceshift.ru"/>
132132
<attribute name="Implementation-Title" value="jME3 SpaceShift Editor"/>
133-
<attribute name="Implementation-Version" value="0.7.1"/>
133+
<attribute name="Implementation-Version" value="0.7.2"/>
134134
</manifest>
135135
</fx:jar>
136136

build/package/linux/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: jme3-spaceshift-editor
2-
Version: 0.7.1
2+
Version: 0.7.2
33
Section: tool
44
Maintainer: spaceshift.ru <[email protected]>
55
Priority: optional

src/com/ss/editor/Editor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public void simpleInitApp() {
254254
audioRenderer.setEnvironment(new Environment(Environment.Garage));
255255

256256
viewPort.setBackgroundColor(new ColorRGBA(50 / 255F, 50 / 255F, 50 / 255F, 1F));
257-
cam.setFrustumPerspective(55, (float) cam.getWidth() / cam.getHeight(), 1f, 1000);
257+
cam.setFrustumPerspective(55, (float) cam.getWidth() / cam.getHeight(), 1f, 10000);
258258

259259
final Node guiNode = getGuiNode();
260260
guiNode.detachAllChildren();

src/com/ss/editor/config/Config.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public abstract class Config {
2020
public static final String CONFIG_RESOURCE_PATH = "/com/ss/editor/config/config.xml";
2121

2222
public static final String TITLE = "jME3 SpaceShift Editor";
23-
public static final String VERSION = "v.0.7.1";
23+
public static final String VERSION = "v.0.7.2";
2424

2525
public static final String SS_FOLDER_IN_USER_HOME = ".jme3-spaceshift-editor";
2626

src/com/ss/editor/model/EditorCamera.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,10 @@ protected void rotateCamera(float value) {
271271
targetRotation += value * rotationSpeed;
272272
}
273273

274+
public float getTargetDistance() {
275+
return targetDistance;
276+
}
277+
274278
//move the camera toward or away the target
275279
protected void zoomCamera(float value) {
276280

@@ -279,7 +283,7 @@ protected void zoomCamera(float value) {
279283
}
280284

281285
zooming = true;
282-
targetDistance += value * zoomSensitivity;
286+
targetDistance += value * zoomSensitivity * Math.sqrt(targetDistance);
283287

284288
if (targetDistance > maxDistance) {
285289
targetDistance = maxDistance;

src/com/ss/editor/state/editor/impl/AbstractEditorState.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,24 +152,25 @@ protected void onAnalogImpl(final String name, final float value, final float tp
152152

153153
protected void moveXCamera(final float value) {
154154

155+
final EditorCamera editorCamera = getEditorCamera();
155156
final Camera camera = EDITOR.getCamera();
156157
final Node nodeForCamera = getNodeForCamera();
157158

158159
final Vector3f left = camera.getLeft();
159-
left.multLocal(value);
160+
left.multLocal(value * (float) Math.sqrt(editorCamera.getTargetDistance()));
160161
left.addLocal(nodeForCamera.getLocalTranslation());
161162

162163
nodeForCamera.setLocalTranslation(left);
163-
final EditorCamera editorCamera = getEditorCamera();
164164
}
165165

166166
protected void moveYCamera(final float value) {
167167

168+
final EditorCamera editorCamera = getEditorCamera();
168169
final Camera camera = EDITOR.getCamera();
169170
final Node nodeForCamera = getNodeForCamera();
170171

171172
final Vector3f up = camera.getUp();
172-
up.multLocal(value);
173+
up.multLocal(value * (float) Math.sqrt(editorCamera.getTargetDistance()));
173174
up.addLocal(nodeForCamera.getLocalTranslation());
174175

175176
nodeForCamera.setLocalTranslation(up);
@@ -448,10 +449,10 @@ protected EditorCamera createEditorCamera() {
448449

449450
final EditorCamera editorCamera = new EditorCamera(camera, getNodeForCamera());
450451
editorCamera.setMinVerticalRotation(-FastMath.HALF_PI);
451-
editorCamera.setMaxDistance(1000);
452+
editorCamera.setMaxDistance(10000);
452453
editorCamera.setSmoothMotion(false);
453454
editorCamera.setRotationSensitivity(1);
454-
editorCamera.setZoomSensitivity(1);
455+
editorCamera.setZoomSensitivity(0.5F);
455456
editorCamera.setDownRotateOnCloseViewOnly(false);
456457

457458
return editorCamera;

src/com/ss/editor/ui/control/material/IntegerMaterialParamControl.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import com.jme3.material.MatParam;
44
import com.jme3.material.Material;
5-
import com.ss.editor.manager.ExecutorManager;
65
import com.ss.editor.model.undo.EditorOperation;
76
import com.ss.editor.ui.control.material.operation.IntegerMaterialParamOperation;
87
import com.ss.editor.ui.css.CSSClasses;
@@ -27,8 +26,6 @@ public class IntegerMaterialParamControl extends MaterialParamControl {
2726

2827
public static final Insets ELEMENT_OFFSET = new Insets(0, 0, 0, 3);
2928

30-
private static final ExecutorManager EXECUTOR_MANAGER = ExecutorManager.getInstance();
31-
3229
/**
3330
* Контрол для установки целочисленного значения.
3431
*/

0 commit comments

Comments
 (0)