Skip to content

Commit

Permalink
Finish 1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JavaSaBr committed Feb 20, 2018
2 parents 609aca8 + 3e1b5e0 commit 3952539
Show file tree
Hide file tree
Showing 229 changed files with 5,604 additions and 1,939 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# jMonkeyBuilder 1.6.1 #
# jMonkeyBuilder 1.7.0 #
### It's 3D Editor to prepare/work/create graphics content for jMonkeyEngine 3.2 ###

[![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)
Expand Down
2 changes: 1 addition & 1 deletion app.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.1
1.7.0
2 changes: 1 addition & 1 deletion build-native.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@

<fx:platform>
<fx:jvmarg value="-XX:+UseParallelGC"/>
<!--<fx:jvmarg value="-agentlib:jdwp=transport=dt_socket,server=n,address=javasabr-NB:6005,suspend=y"/>-->
<!--<fx:jvmarg value="-agentlib:jdwp=transport=dt_socket,server=n,address=localhost:6005,suspend=y"/>-->
</fx:platform>

<preferences shortcut="true" menu="true" install="false"/>
Expand Down
13 changes: 7 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ apply plugin: 'idea'
apply plugin: 'org.junit.platform.gradle.plugin'

group = 'com.spaceshift'
version = '1.6.1'
version = '1.7.0'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand All @@ -28,7 +28,7 @@ ext.applicationMainClass = "com.ss.editor.JfxApplication"
ext.applicationVendor = "javasabr@gmail.com"
ext.applicationTitle = "jMonkeyBuilder"
ext.jmeVersion = "v3.3.dev-SNAPSHOT"
ext.jmbExtVersion = "1.9.8"
ext.jmbExtVersion = "2.1.1"
ext.jme3_xbuf_version = '0.9.1'
ext.junitPlatformVersion = "1.0.0"
ext.junitJupiterVersion = "5.0.0"
Expand Down Expand Up @@ -61,8 +61,10 @@ dependencies {
compile 'org.controlsfx:controlsfx:8.40.14'

compile 'com.github.JavaSaBr:RlibFX:4.1.3'
compile 'com.github.JavaSaBr:RLib:6.7.4'
compile "com.github.JavaSaBr:JME3-JFX:1.7.3"
compile 'com.github.JavaSaBr:RLib:6.7.7'
compile ("com.github.JavaSaBr:JME3-JFX:1.7.4") {
exclude group: 'org.jmonkeyengine'
}

// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.6'
Expand All @@ -88,7 +90,6 @@ dependencies {
compile "com.github.JavaSaBr.jmonkeyengine:jme3-desktop:$jmeVersion"
compile "com.github.JavaSaBr.jmonkeyengine:jme3-terrain:$jmeVersion"
compile "com.github.JavaSaBr.jmonkeyengine:jme3-plugins:$jmeVersion"
compile "com.github.JavaSaBr.jmonkeyengine:jme3-effects:$jmeVersion"
compile "com.github.JavaSaBr.jmonkeyengine:jme3-blender:$jmeVersion"
compile "com.github.JavaSaBr.jmonkeyengine:jme3-jogg:$jmeVersion"
compile ("com.github.JavaSaBr.jmonkeyengine:jme3-testdata:$jmeVersion") {
Expand Down Expand Up @@ -163,7 +164,7 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
}

task wrapper(type: Wrapper) {
gradleVersion = '4.4'
gradleVersion = '4.5.1'
}

artifacts {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Wed Jan 24 08:56:01 MSK 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-bin.zip
132 changes: 132 additions & 0 deletions src/main/java/com/jme3/bullet/util/DebugShapeFactory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
/*
* Copyright (c) 2009-2017 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.jme3.bullet.util;

import com.jme3.bullet.collision.shapes.CollisionShape;
import com.jme3.bullet.collision.shapes.CompoundCollisionShape;
import com.jme3.bullet.collision.shapes.infos.ChildCollisionShape;
import com.jme3.math.Matrix3f;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.Mesh;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.scene.VertexBuffer.Type;
import com.jme3.util.TempVars;
import java.util.Iterator;
import java.util.List;

/**
*
* @author CJ Hare, normenhansen
*/
public class DebugShapeFactory {

/** The maximum corner for the aabb used for triangles to include in ConcaveShape processing.*/
// private static final Vector3f aabbMax = new Vector3f(1e30f, 1e30f, 1e30f);
/** The minimum corner for the aabb used for triangles to include in ConcaveShape processing.*/
// private static final Vector3f aabbMin = new Vector3f(-1e30f, -1e30f, -1e30f);

/**
* Creates a debug shape from the given collision shape. This is mostly used internally.<br>
* To attach a debug shape to a physics object, call <code>attachDebugShape(AssetManager manager);</code> on it.
* @param collisionShape
* @return
*/
public static Spatial getDebugShape(CollisionShape collisionShape) {
if (collisionShape == null) {
return null;
}
Spatial debugShape;
if (collisionShape instanceof CompoundCollisionShape) {
CompoundCollisionShape shape = (CompoundCollisionShape) collisionShape;
List<ChildCollisionShape> children = shape.getChildren();
Node node = new Node("DebugShapeNode");
for (Iterator<ChildCollisionShape> it = children.iterator(); it.hasNext();) {
ChildCollisionShape childCollisionShape = it.next();
CollisionShape ccollisionShape = childCollisionShape.shape;
Geometry geometry = createDebugShape(ccollisionShape);

// apply translation
geometry.setLocalTranslation(childCollisionShape.location);

// apply rotation
TempVars vars = TempVars.get();
Matrix3f tempRot = vars.tempMat3;

tempRot.set(geometry.getLocalRotation());
childCollisionShape.rotation.mult(tempRot, tempRot);
geometry.setLocalRotation(tempRot);
geometry.setLocalScale(ccollisionShape.getScale());

vars.release();

node.attachChild(geometry);
}
debugShape = node;
} else {
debugShape = createDebugShape(collisionShape);
}
if (debugShape == null) {
return null;
}
debugShape.updateGeometricState();
return debugShape;
}

private static Geometry createDebugShape(CollisionShape shape) {
Geometry geom = new Geometry();
geom.setMesh(DebugShapeFactory.getDebugMesh(shape));
// geom.setLocalScale(shape.getScale());
geom.updateModelBound();
return geom;
}

public static Mesh getDebugMesh(CollisionShape shape) {
Mesh mesh = new Mesh();
DebugMeshCallback callback = new DebugMeshCallback();
/*
* Populate the mesh based on an unscaled shape;
* the shape's scale will be applied later, to the geometry.
*/
Vector3f savedScale = shape.getScale().clone();
shape.setScale(Vector3f.UNIT_XYZ);
getVertices(shape.getObjectId(), callback);
shape.setScale(savedScale);

mesh.setBuffer(Type.Position, 3, callback.getVertices());
mesh.getFloatBuffer(Type.Position).clear();
return mesh;
}

private static native void getVertices(long shapeId, DebugMeshCallback buffer);
}
38 changes: 38 additions & 0 deletions src/main/java/com/ss/editor/JfxApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import static com.ss.editor.config.DefaultSettingsProvider.Defaults.PREF_DEFAULT_STOP_RENDER_ON_LOST_FOCUS;
import static com.ss.editor.config.DefaultSettingsProvider.Preferences.*;
import static com.ss.rlib.util.ObjectUtils.notNull;
import static com.ss.rlib.util.Utils.run;
import static java.nio.file.Files.createDirectories;
import static java.nio.file.Files.newOutputStream;
import com.jme3.renderer.Renderer;
import com.jme3.system.JmeContext;
Expand Down Expand Up @@ -40,7 +42,9 @@
import com.ss.editor.util.OpenGLVersion;
import com.ss.editor.util.svg.SvgImageLoaderFactory;
import com.ss.rlib.logging.Logger;
import com.ss.rlib.logging.LoggerLevel;
import com.ss.rlib.logging.LoggerManager;
import com.ss.rlib.logging.impl.FolderFileListener;
import com.ss.rlib.manager.InitializeManager;
import com.ss.rlib.util.ArrayUtils;
import com.ss.rlib.util.array.Array;
Expand All @@ -50,6 +54,7 @@
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.collections.ObservableList;
import javafx.scene.control.ComboBoxBase;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
Expand All @@ -61,8 +66,11 @@
import javax.imageio.ImageIO;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collection;
import java.util.logging.Level;

/**
* The starter of the JavaFX application.
Expand Down Expand Up @@ -95,6 +103,7 @@ public class JfxApplication extends Application {
* @throws IOException the io exception
*/
public static void main(final String[] args) {
configureLogger();

// need to disable to work on macos
Configuration.GLFW_CHECK_THREAD0.set(false);
Expand Down Expand Up @@ -154,6 +163,31 @@ public static void main(final String[] args) {
() -> startJmeApplication(application), "LWJGL Render").start();
}

@FxThread
private static void configureLogger() {

// disable the standard logger
if (Config.DEV_DEBUG) {
java.util.logging.Logger.getLogger("").setLevel(Level.WARNING);
}

// configure our logger
LoggerLevel.DEBUG.setEnabled(Config.DEV_DEBUG);
LoggerLevel.INFO.setEnabled(true);
LoggerLevel.ERROR.setEnabled(true);
LoggerLevel.WARNING.setEnabled(true);

final Path logFolder = Config.getFolderForLog();

if (!Files.exists(logFolder)) {
run(() -> createDirectories(logFolder));
}

if (!LoggerLevel.DEBUG.isEnabled()) {
LoggerManager.addListener(new FolderFileListener(logFolder));
}
}

/**
* Start the new jME application.
*
Expand Down Expand Up @@ -306,6 +340,9 @@ public void start(final Stage stage) throws Exception {
addWindow(stage);
try {

// initialize javaFX events in javaFX thread.
ArrayFactory.asArray(ComboBoxBase.ON_SHOWN);

final ResourceManager resourceManager = ResourceManager.getInstance();
resourceManager.reload();

Expand Down Expand Up @@ -340,6 +377,7 @@ public void start(final Stage stage) throws Exception {
stage.setTitle(Config.TITLE);
stage.show();


if (!stage.isMaximized()) {
stage.centerOnScreen();
}
Expand Down
Loading

0 comments on commit 3952539

Please sign in to comment.