Merge branch 'master' into PBRisComing

define_list_fix
Nehon 10 years ago
commit 97b3383127
  1. 2
      README.md
  2. 21
      jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionIK.java
  3. 6
      jme3-effects/src/main/resources/Common/MatDefs/Water/Water.frag
  4. 1
      jme3-effects/src/main/resources/Common/MatDefs/Water/Water.j3md
  5. 8
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/ComposerCameraController.java

@ -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:

@ -88,6 +88,8 @@ public class ConstraintDefinitionIK extends ConstraintDefinition {
if (angle != 0) {
Vector3d cross = currentDir.crossLocal(target).normalizeLocal();
q.fromAngleAxis(angle, cross);
if(bone.equals(this.getOwner())) {
if (boneContext.isLockX()) {
q.set(0, q.getY(), q.getZ(), q.getW());
}
@ -97,6 +99,7 @@ public class ConstraintDefinitionIK extends ConstraintDefinition {
if (boneContext.isLockZ()) {
q.set(q.getX(), q.getY(), 0, q.getW());
}
}
boneTransform.getRotation().set(q.multLocal(boneTransform.getRotation()));
constraintHelper.applyTransform(boneContext.getArmatureObjectOMA(), bone.getName(), Space.CONSTRAINT_SPACE_WORLD, boneTransform.toTransform());
@ -107,6 +110,8 @@ public class ConstraintDefinitionIK extends ConstraintDefinition {
}
}
List<Transform> bestSolution = new ArrayList<Transform>(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) {
@ -124,6 +129,7 @@ public class ConstraintDefinitionIK extends ConstraintDefinition {
Vector3d cross = currentDir.crossLocal(target).normalizeLocal();
q.fromAngleAxis(angle, cross);
if(bone.equals(this.getOwner())) {
if (boneContext.isLockX()) {
q.set(0, q.getY(), q.getZ(), q.getW());
}
@ -133,6 +139,7 @@ public class ConstraintDefinitionIK extends ConstraintDefinition {
if (boneContext.isLockZ()) {
q.set(q.getX(), q.getY(), 0, q.getW());
}
}
boneWorldTransform.getRotation().set(q.multLocal(boneWorldTransform.getRotation()));
constraintHelper.applyTransform(boneContext.getArmatureObjectOMA(), bone.getName(), Space.CONSTRAINT_SPACE_WORLD, boneWorldTransform.toTransform());
@ -145,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<bestSolution.size();++i) {
BoneContext boneContext = bones.get(i);
constraintHelper.applyTransform(boneContext.getArmatureObjectOMA(), boneContext.getBone().getName(), Space.CONSTRAINT_SPACE_WORLD, bestSolution.get(i));
}
}

@ -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);
}

@ -77,6 +77,7 @@ MaterialDef Advanced Water {
FragmentShader GLSL120 : Common/MatDefs/Water/Water.frag
WorldParameters {
ViewProjectionMatrixInverse
}
Defines {
ENABLE_RIPPLES : UseRipples

@ -79,28 +79,26 @@ public class ComposerCameraController extends AbstractCameraController {
@Override
public void checkClick(int button, boolean pressed) {
if (!forceCameraControls || !pressed) { // dont call toolController while forceCam but on button release (for UndoRedo)
if (button == 0) {
if (isEditButtonEnabled() && !forceCameraControls) {
toolController.doEditToolActivatedPrimary(new Vector2f(mouseX, mouseY), pressed, cam);
}
}
if (button == 1) {
if (isEditButtonEnabled() && !forceCameraControls) {
toolController.doEditToolActivatedSecondary(new Vector2f(mouseX, mouseY), pressed, cam);
}
}
}
@Override
protected void checkDragged(int button, boolean pressed) {
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);
}
}
}
@Override
protected void checkMoved() {

Loading…
Cancel
Save