From 684c923632b1bedc740067bde125279cb1ad199c Mon Sep 17 00:00:00 2001 From: Maselbas Date: Sun, 12 Apr 2015 15:31:48 +0200 Subject: [PATCH 1/5] Fix issue #255 - scenecomposer : forcedCamera - Now you can't use scenecomposer tool while overiding the camera control - Fixed a tool modificaton not undo/redo able. --- .../ComposerCameraController.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/ComposerCameraController.java b/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/ComposerCameraController.java index c16933f80..c1689b833 100644 --- a/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/ComposerCameraController.java +++ b/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/ComposerCameraController.java @@ -79,26 +79,24 @@ public class ComposerCameraController extends AbstractCameraController { @Override public void checkClick(int button, boolean pressed) { - if (button == 0) { - if (isEditButtonEnabled() && !forceCameraControls) { + if (!forceCameraControls || !pressed) { // dont call toolController while forceCam but on button release (for UndoRedo) + if (button == 0) { toolController.doEditToolActivatedPrimary(new Vector2f(mouseX, mouseY), pressed, cam); } - } - if (button == 1) { - if (isEditButtonEnabled() && !forceCameraControls) { + if (button == 1) { toolController.doEditToolActivatedSecondary(new Vector2f(mouseX, mouseY), pressed, cam); } } - - } @Override protected void checkDragged(int button, boolean pressed) { - if (button == 0) { - toolController.doEditToolDraggedPrimary(new Vector2f(mouseX, mouseY), pressed, cam); - } else if (button == 1) { - toolController.doEditToolDraggedSecondary(new Vector2f(mouseX, mouseY), pressed, cam); + if (!forceCameraControls || !pressed) { + if (button == 0) { + toolController.doEditToolDraggedPrimary(new Vector2f(mouseX, mouseY), pressed, cam); + } else if (button == 1) { + toolController.doEditToolDraggedSecondary(new Vector2f(mouseX, mouseY), pressed, cam); + } } } From cd97741f9cba08a043a1834c5cbb5be5fb9ab6a2 Mon Sep 17 00:00:00 2001 From: jmekaelthas Date: Sun, 12 Apr 2015 17:39:18 +0200 Subject: [PATCH 2/5] Bugfix: fix for IK constraint: rotation locks are now applied only on boned woning the constraint and not to all that define it as it was before. --- .../definitions/ConstraintDefinitionIK.java | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionIK.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionIK.java index 1d6139e04..af1367e4a 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionIK.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionIK.java @@ -88,14 +88,17 @@ public class ConstraintDefinitionIK extends ConstraintDefinition { if (angle != 0) { Vector3d cross = currentDir.crossLocal(target).normalizeLocal(); q.fromAngleAxis(angle, cross); - if (boneContext.isLockX()) { - q.set(0, q.getY(), q.getZ(), q.getW()); - } - if (boneContext.isLockY()) { - q.set(q.getX(), 0, q.getZ(), q.getW()); - } - if (boneContext.isLockZ()) { - q.set(q.getX(), q.getY(), 0, q.getW()); + + if(bone.equals(this.getOwner())) { + if (boneContext.isLockX()) { + q.set(0, q.getY(), q.getZ(), q.getW()); + } + if (boneContext.isLockY()) { + q.set(q.getX(), 0, q.getZ(), q.getW()); + } + if (boneContext.isLockZ()) { + q.set(q.getX(), q.getY(), 0, q.getW()); + } } boneTransform.getRotation().set(q.multLocal(boneTransform.getRotation())); @@ -124,14 +127,16 @@ public class ConstraintDefinitionIK extends ConstraintDefinition { Vector3d cross = currentDir.crossLocal(target).normalizeLocal(); q.fromAngleAxis(angle, cross); - if (boneContext.isLockX()) { - q.set(0, q.getY(), q.getZ(), q.getW()); - } - if (boneContext.isLockY()) { - q.set(q.getX(), 0, q.getZ(), q.getW()); - } - if (boneContext.isLockZ()) { - q.set(q.getX(), q.getY(), 0, q.getW()); + if(bone.equals(this.getOwner())) { + if (boneContext.isLockX()) { + q.set(0, q.getY(), q.getZ(), q.getW()); + } + if (boneContext.isLockY()) { + q.set(q.getX(), 0, q.getZ(), q.getW()); + } + if (boneContext.isLockZ()) { + q.set(q.getX(), q.getY(), 0, q.getW()); + } } boneWorldTransform.getRotation().set(q.multLocal(boneWorldTransform.getRotation())); From d884ecb317a15cea5a765a9e4eecdec009368a93 Mon Sep 17 00:00:00 2001 From: Erlend Sogge Heggen Date: Mon, 13 Apr 2015 12:56:12 +0200 Subject: [PATCH 3/5] Update README.md No v3.1 in Q4 2014. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 69d2207bd..b3f993569 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ jMonkeyEngine ============= -jMonkeyEngine is a 3D game engine for adventurous Java developers. It’s open source, cross platform and cutting edge. And it is all beautifully documented. The 3.0 branch is the latest stable version of the jMonkeyEngine 3 SDK, a complete game development suite. We'll be frequently submitting stable 3.0.x updates until the major 3.1 version arrives in Q4 2014. +jMonkeyEngine is a 3D game engine for adventurous Java developers. It’s open source, cross platform and cutting edge. And it is all beautifully documented. The 3.0 branch is the latest stable version of the jMonkeyEngine 3 SDK, a complete game development suite. We'll be frequently submitting stable 3.0.x updates until the major 3.1 version arrives. The engine is used by several commercial game studios and computer-science courses. Here's a taste: From 20ea38e97e64105327708f3a73cc5be17e51a5df Mon Sep 17 00:00:00 2001 From: jmekaelthas Date: Thu, 16 Apr 2015 22:18:36 +0200 Subject: [PATCH 4/5] Bugfix: fixed some of the artifacts (unfortunately no all of them) that appeared after IK constraint computation; the algorithm now selects the best found solution among all iterations. --- .../definitions/ConstraintDefinitionIK.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionIK.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionIK.java index af1367e4a..35a4e5618 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionIK.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionIK.java @@ -110,6 +110,8 @@ public class ConstraintDefinitionIK extends ConstraintDefinition { } } + List bestSolution = new ArrayList(bones.size()); + double bestSolutionDistance = Double.MAX_VALUE; BoneContext topBone = bones.get(0); for (int i = 0; i < iterations && distanceFromTarget > MIN_DISTANCE; ++i) { for (BoneContext boneContext : bones) { @@ -150,6 +152,20 @@ public class ConstraintDefinitionIK extends ConstraintDefinition { DTransform topBoneTransform = new DTransform(constraintHelper.getTransform(topBone.getArmatureObjectOMA(), topBone.getBone().getName(), Space.CONSTRAINT_SPACE_WORLD)); Vector3d e = topBoneTransform.getTranslation().addLocal(topBoneTransform.getRotation().mult(Vector3d.UNIT_Y).multLocal(topBone.getLength()));// effector distanceFromTarget = e.distance(t); + + if(distanceFromTarget < bestSolutionDistance) { + bestSolutionDistance = distanceFromTarget; + bestSolution.clear(); + for(BoneContext boneContext : bones) { + bestSolution.add(constraintHelper.getTransform(boneContext.getArmatureObjectOMA(), boneContext.getBone().getName(), Space.CONSTRAINT_SPACE_WORLD)); + } + } + } + + // applying best solution + for(int i=0;i Date: Fri, 17 Apr 2015 16:06:51 +0200 Subject: [PATCH 5/5] Fixed water filter's glsl 100 shader --- .../src/main/resources/Common/MatDefs/Water/Water.frag | 6 +----- .../src/main/resources/Common/MatDefs/Water/Water.j3md | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/jme3-effects/src/main/resources/Common/MatDefs/Water/Water.frag b/jme3-effects/src/main/resources/Common/MatDefs/Water/Water.frag index 07a4c6429..cb393dbaa 100644 --- a/jme3-effects/src/main/resources/Common/MatDefs/Water/Water.frag +++ b/jme3-effects/src/main/resources/Common/MatDefs/Water/Water.frag @@ -413,10 +413,6 @@ void main(){ // to calculate the derivatives for all these pixels by using step()! // That way we won't get pixels around the edges of the terrain, // Where the derivatives are undefined - if(position.y > level){ - color = color2; - } - - gl_FragColor = vec4(color,1.0); + gl_FragColor = vec4(mix(color, color2, step(level, position.y)), 1.0); } \ No newline at end of file diff --git a/jme3-effects/src/main/resources/Common/MatDefs/Water/Water.j3md b/jme3-effects/src/main/resources/Common/MatDefs/Water/Water.j3md index 2f4b2b39c..2f188934b 100644 --- a/jme3-effects/src/main/resources/Common/MatDefs/Water/Water.j3md +++ b/jme3-effects/src/main/resources/Common/MatDefs/Water/Water.j3md @@ -77,6 +77,7 @@ MaterialDef Advanced Water { FragmentShader GLSL120 : Common/MatDefs/Water/Water.frag WorldParameters { + ViewProjectionMatrixInverse } Defines { ENABLE_RIPPLES : UseRipples