Skip to content

Commit 3161088

Browse files
committed
Finish 0.9.12
2 parents 0c038fc + b751aa8 commit 3161088

File tree

27 files changed

+289
-390
lines changed

27 files changed

+289
-390
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# jMonkeyEngine 3 SpaceShift Editor 0.9.11 #
1+
# jMonkeyEngine 3 SpaceShift Editor 0.9.12 #
22
## License: Apache Version 2.0 ##
33

44
[![Join the chat at https://gitter.im/jME3-SpaceShift-Editor/Lobby](https://badges.gitter.im/jME3-SpaceShift-Editor/Lobby.svg)](https://gitter.im/jME3-SpaceShift-Editor/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
@@ -11,6 +11,11 @@
1111

1212
## [Video about this editor](https://youtu.be/h6azH-D28qk) ##
1313

14+
## ver. 0.9.12 ##
15+
* -Downgraded tonegod.emitter to java 7
16+
* -Added possibility to work with light probes in the Scene Editor.
17+
* -Fixed major problems with saving/loading app states/filters in a scene node.
18+
1419
## ver. 0.9.11 ##
1520
* -The project was migrated to gradle.
1621
* -Implemented a plugin system. Now you can develop your own plugin for the Editor.

app.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.9.11
1+
0.9.12

build-native.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<project name="jME SpaceShift Editor" default="do-deploy" basedir="native-build"
33
xmlns:fx="javafx:com.sun.javafx.tools.ant">
44

5-
<property name="editor.version" value="0.9.11"/>
5+
<property name="editor.version" value="0.9.12"/>
66
<property environment="env"/>
77

88
<condition property="gradle.executable" value="${env.GRADLE_HOME}/bin/gradle.bat"

build.gradle

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,46 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
}
5+
dependencies {
6+
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0-RC2'
7+
}
8+
}
9+
110
apply plugin: 'java'
211
apply plugin: 'maven'
12+
apply plugin: 'idea'
13+
apply plugin: 'org.junit.platform.gradle.plugin'
314

415
group = 'com.spaceshift'
5-
version = '0.9.11'
16+
version = '0.9.12'
617

718
sourceCompatibility = 1.8
819
targetCompatibility = 1.8
920

21+
compileTestJava {
22+
sourceCompatibility = 1.8
23+
targetCompatibility = 1.8
24+
options.compilerArgs += '-parameters'
25+
}
26+
1027
ext.jmeVersion = "3.2_branch-SNAPSHOT"
1128
ext.jme3_xbuf_version = '0.9.1'
1229
ext.lwjglVersion = "3.1.2"
30+
ext.junitPlatformVersion = "1.0.0-M5"
31+
ext.junitJupiterVersion = "5.0.0-M5"
32+
ext.log4jVersion = '2.6.2'
33+
34+
junitPlatform {
35+
filters {
36+
engines {
37+
}
38+
tags {
39+
}
40+
}
41+
logManager 'org.apache.logging.log4j.jul.LogManager'
42+
}
43+
1344

1445
repositories {
1546
mavenCentral()
@@ -94,17 +125,30 @@ dependencies {
94125
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.3'
95126

96127
// extensions
97-
compile ('com.github.JavaSaBr:jme3-spaceshift-extension:1.4.2') {
128+
compile ('com.github.JavaSaBr:jme3-spaceshift-extension:1.5.0') {
98129
exclude group: 'org.jmonkeyengine'
99130
}
100-
compile ('com.github.JavaSaBr:tonegodemitter:2.2.4') {
131+
compile ('com.github.JavaSaBr:tonegodemitter:2.3.0') {
101132
exclude group: 'org.jmonkeyengine'
102133
}
103134

104135
compile "org.xbuf.jme3_xbuf:jme3_xbuf_loader:${jme3_xbuf_version}"
105136

106137
// https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-all
107138
compile group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.5.0-beta-1'
139+
140+
// TESTS
141+
testCompile "org.junit.platform:junit-platform-commons:$junitPlatformVersion"
142+
testRuntime "org.junit.platform:junit-platform-engine:$junitPlatformVersion"
143+
144+
testCompile "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion"
145+
testRuntime "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion"
146+
147+
testRuntime "org.apache.logging.log4j:log4j-core:$log4jVersion"
148+
testRuntime "org.apache.logging.log4j:log4j-jul:$log4jVersion"
149+
150+
// Only needed to run tests in an (IntelliJ) IDE(A) that bundles an older version
151+
testCompile "org.junit.platform:junit-platform-launcher:$junitPlatformVersion"
108152
}
109153

110154
task copyToLib(type: Copy) {

src/main/java/com/ss/editor/Editor.java

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import com.jme3.environment.LightProbeFactory;
1414
import com.jme3.environment.generation.JobProgressAdapter;
1515
import com.jme3.font.BitmapFont;
16+
import com.jme3.light.LightList;
1617
import com.jme3.light.LightProbe;
1718
import com.jme3.material.Material;
1819
import com.jme3.material.TechniqueDef;
@@ -258,7 +259,7 @@ public Camera getCamera() {
258259
@Override
259260
public void simpleInitApp() {
260261
renderManager.setPreferredLightMode(TechniqueDef.LightMode.SinglePass);
261-
renderManager.setSinglePassLightBatchSize(5);
262+
renderManager.setSinglePassLightBatchSize(15);
262263

263264
assetManager.registerLoader(XbufLoader.class, FileExtensions.MODEL_XBUF);
264265

@@ -325,7 +326,7 @@ public void simpleInitApp() {
325326
stateManager.attach(previewEnvironmentCamera);
326327
}
327328

328-
createProbe();
329+
createLightProbes();
329330

330331
new EditorThread(new ThreadGroup("JavaFX"), JFXApplication::start, "JavaFX Launch").start();
331332
}
@@ -430,9 +431,9 @@ public FilterPostProcessor getPostProcessor() {
430431
}
431432

432433
/**
433-
* Create the light probe for the PBR render.
434+
* Create the light probes for the PBR render.
434435
*/
435-
private void createProbe() {
436+
private void createLightProbes() {
436437

437438
final EnvironmentCamera environmentCamera = getEnvironmentCamera();
438439
final EnvironmentCamera previewEnvironmentCamera = getPreviewEnvironmentCamera();
@@ -443,7 +444,7 @@ private void createProbe() {
443444

444445
if (environmentCamera.getApplication() == null) {
445446
final JMEThreadExecutor gameThreadExecutor = JMEThreadExecutor.getInstance();
446-
gameThreadExecutor.addToExecute(this::createProbe);
447+
gameThreadExecutor.addToExecute(this::createLightProbes);
447448
return;
448449
}
449450

@@ -465,7 +466,7 @@ private void createProbe() {
465466
*
466467
* @param progressAdapter the progress adapter
467468
*/
468-
public void updateProbe(@NotNull final JobProgressAdapter<LightProbe> progressAdapter) {
469+
public void updateLightProbe(@NotNull final JobProgressAdapter<LightProbe> progressAdapter) {
469470

470471
final LightProbe lightProbe = getLightProbe();
471472
final EnvironmentCamera environmentCamera = getEnvironmentCamera();
@@ -478,12 +479,46 @@ public void updateProbe(@NotNull final JobProgressAdapter<LightProbe> progressAd
478479
LightProbeFactory.updateProbe(lightProbe, environmentCamera, rootNode, progressAdapter);
479480
}
480481

482+
/**
483+
* Disable PBR Light probe.
484+
*/
485+
public void disableLightProbe() {
486+
487+
final LightProbe lightProbe = getLightProbe();
488+
489+
if (lightProbe != null) {
490+
rootNode.removeLight(lightProbe);
491+
}
492+
}
493+
494+
/**
495+
* Enable PBR Light probe.
496+
*/
497+
public void enableLightProbe() {
498+
499+
final LightProbe lightProbe = getLightProbe();
500+
501+
if (lightProbe == null) {
502+
return;
503+
}
504+
505+
final LightList lightList = rootNode.getLocalLightList();
506+
507+
for (int i = 0; i < lightList.size(); i++) {
508+
if (lightList.get(i) == lightProbe) {
509+
return;
510+
}
511+
}
512+
513+
rootNode.addLight(lightProbe);
514+
}
515+
481516
/**
482517
* Update the light probe.
483518
*
484519
* @param progressAdapter the progress adapter
485520
*/
486-
public void updatePreviewProbe(@NotNull final JobProgressAdapter<LightProbe> progressAdapter) {
521+
public void updatePreviewLightProbe(@NotNull final JobProgressAdapter<LightProbe> progressAdapter) {
487522

488523
final LightProbe lightProbe = getPreviewLightProbe();
489524
final EnvironmentCamera environmentCamera = getPreviewEnvironmentCamera();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public abstract class Config {
3636
* The constant APP_VERSION.
3737
*/
3838
@NotNull
39-
public static final Version APP_VERSION = new Version("0.9.11");
39+
public static final Version APP_VERSION = new Version("0.9.12");
4040

4141
/**
4242
* The constant STRING_VERSION.

src/main/java/com/ss/editor/manager/JMEFilePreviewManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ protected void controlUpdate(final float tpf) {
191191

192192
if (frame == 2) {
193193
final Editor editor = Editor.getInstance();
194-
editor.updatePreviewProbe(probeHandler);
194+
editor.updatePreviewLightProbe(probeHandler);
195195
}
196196

197197
frame++;

src/main/java/com/ss/editor/model/node/Toneg0dParticleInfluencers.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package com.ss.editor.model.node;
22

33
import org.jetbrains.annotations.NotNull;
4-
5-
import com.ss.rlib.util.array.Array;
64
import tonegod.emitter.ParticleEmitterNode;
75
import tonegod.emitter.influencers.ParticleInfluencer;
86

7+
import java.util.List;
8+
99
/**
1010
* The type Particle influencers.
1111
*
@@ -44,7 +44,7 @@ public ParticleEmitterNode getEmitterNode() {
4444
* @return the array of influencers.
4545
*/
4646
@NotNull
47-
public Array<ParticleInfluencer> getInfluencers() {
47+
public List<ParticleInfluencer> getInfluencers() {
4848
return emitterNode.getInfluencers();
4949
}
5050

src/main/java/com/ss/editor/state/editor/impl/material/MaterialEditor3DState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ private void updateLightEnabledImpl(boolean enabled) {
409409
public void update(float tpf) {
410410
super.update(tpf);
411411

412-
if (frame == 2) EDITOR.updateProbe(probeHandler);
412+
if (frame == 2) EDITOR.updateLightProbe(probeHandler);
413413

414414
final Geometry testQuad = getTestQuad();
415415

src/main/java/com/ss/editor/state/editor/impl/model/ModelEditor3DState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public void update(final float tpf) {
165165
final Array<Spatial> customSky = getCustomSky();
166166
customSky.forEach(spatial -> customSkyNode.attachChild(spatial.clone(false)));
167167

168-
EDITOR.updateProbe(probeHandler);
168+
EDITOR.updateLightProbe(probeHandler);
169169
}
170170

171171
frame++;

0 commit comments

Comments
 (0)