Merge branch 'master' into PBRisComing

define_list_fix
Nehon 10 years ago
commit 97b3383127
  1. 2
      README.md
  2. 53
      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. 20
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/ComposerCameraController.java

@ -1,7 +1,7 @@
jMonkeyEngine 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: The engine is used by several commercial game studios and computer-science courses. Here's a taste:

@ -88,14 +88,17 @@ public class ConstraintDefinitionIK extends ConstraintDefinition {
if (angle != 0) { if (angle != 0) {
Vector3d cross = currentDir.crossLocal(target).normalizeLocal(); Vector3d cross = currentDir.crossLocal(target).normalizeLocal();
q.fromAngleAxis(angle, cross); q.fromAngleAxis(angle, cross);
if (boneContext.isLockX()) {
q.set(0, q.getY(), q.getZ(), q.getW()); if(bone.equals(this.getOwner())) {
} if (boneContext.isLockX()) {
if (boneContext.isLockY()) { q.set(0, q.getY(), q.getZ(), q.getW());
q.set(q.getX(), 0, q.getZ(), q.getW()); }
} if (boneContext.isLockY()) {
if (boneContext.isLockZ()) { q.set(q.getX(), 0, q.getZ(), q.getW());
q.set(q.getX(), q.getY(), 0, q.getW()); }
if (boneContext.isLockZ()) {
q.set(q.getX(), q.getY(), 0, q.getW());
}
} }
boneTransform.getRotation().set(q.multLocal(boneTransform.getRotation())); boneTransform.getRotation().set(q.multLocal(boneTransform.getRotation()));
@ -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); BoneContext topBone = bones.get(0);
for (int i = 0; i < iterations && distanceFromTarget > MIN_DISTANCE; ++i) { for (int i = 0; i < iterations && distanceFromTarget > MIN_DISTANCE; ++i) {
for (BoneContext boneContext : bones) { for (BoneContext boneContext : bones) {
@ -124,14 +129,16 @@ public class ConstraintDefinitionIK extends ConstraintDefinition {
Vector3d cross = currentDir.crossLocal(target).normalizeLocal(); Vector3d cross = currentDir.crossLocal(target).normalizeLocal();
q.fromAngleAxis(angle, cross); q.fromAngleAxis(angle, cross);
if (boneContext.isLockX()) { if(bone.equals(this.getOwner())) {
q.set(0, q.getY(), q.getZ(), q.getW()); 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.isLockY()) {
} q.set(q.getX(), 0, q.getZ(), q.getW());
if (boneContext.isLockZ()) { }
q.set(q.getX(), q.getY(), 0, q.getW()); if (boneContext.isLockZ()) {
q.set(q.getX(), q.getY(), 0, q.getW());
}
} }
boneWorldTransform.getRotation().set(q.multLocal(boneWorldTransform.getRotation())); boneWorldTransform.getRotation().set(q.multLocal(boneWorldTransform.getRotation()));
@ -145,6 +152,20 @@ public class ConstraintDefinitionIK extends ConstraintDefinition {
DTransform topBoneTransform = new DTransform(constraintHelper.getTransform(topBone.getArmatureObjectOMA(), topBone.getBone().getName(), Space.CONSTRAINT_SPACE_WORLD)); 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 Vector3d e = topBoneTransform.getTranslation().addLocal(topBoneTransform.getRotation().mult(Vector3d.UNIT_Y).multLocal(topBone.getLength()));// effector
distanceFromTarget = e.distance(t); 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()! // to calculate the derivatives for all these pixels by using step()!
// That way we won't get pixels around the edges of the terrain, // That way we won't get pixels around the edges of the terrain,
// Where the derivatives are undefined // Where the derivatives are undefined
if(position.y > level){ gl_FragColor = vec4(mix(color, color2, step(level, position.y)), 1.0);
color = color2;
}
gl_FragColor = vec4(color,1.0);
} }

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

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

Loading…
Cancel
Save