* Fixed issue where scene graphs with non-uniform scales would give incorrect result
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7291 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
bfe772dd71
commit
a06ce4ebcd
@ -237,7 +237,6 @@ public final class Bone implements Savable {
|
|||||||
*/
|
*/
|
||||||
public final void updateWorldVectors() {
|
public final void updateWorldVectors() {
|
||||||
if (parent != null) {
|
if (parent != null) {
|
||||||
|
|
||||||
//rotation
|
//rotation
|
||||||
parent.worldRot.mult(localRot, worldRot);
|
parent.worldRot.mult(localRot, worldRot);
|
||||||
|
|
||||||
@ -251,9 +250,6 @@ public final class Bone implements Savable {
|
|||||||
parent.worldRot.mult(localPos, worldPos);
|
parent.worldRot.mult(localPos, worldPos);
|
||||||
worldPos.multLocal(parent.worldScale);
|
worldPos.multLocal(parent.worldScale);
|
||||||
worldPos.addLocal(parent.worldPos);
|
worldPos.addLocal(parent.worldPos);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
worldRot.set(localRot);
|
worldRot.set(localRot);
|
||||||
worldPos.set(localPos);
|
worldPos.set(localPos);
|
||||||
|
@ -201,10 +201,17 @@ public final class Transform implements Savable, Cloneable {
|
|||||||
// rot.multLocal(parent.rot);
|
// rot.multLocal(parent.rot);
|
||||||
parent.rot.mult(rot, rot);
|
parent.rot.mult(rot, rot);
|
||||||
|
|
||||||
|
// This here, is evil code
|
||||||
|
// parent
|
||||||
|
// .rot
|
||||||
|
// .multLocal(translation)
|
||||||
|
// .multLocal(parent.scale)
|
||||||
|
// .addLocal(parent.translation);
|
||||||
|
|
||||||
|
translation.multLocal(parent.scale);
|
||||||
parent
|
parent
|
||||||
.rot
|
.rot
|
||||||
.multLocal(translation)
|
.multLocal(translation)
|
||||||
.multLocal(parent.scale)
|
|
||||||
.addLocal(parent.translation);
|
.addLocal(parent.translation);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -262,8 +269,9 @@ public final class Transform implements Savable, Cloneable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString(){
|
public String toString(){
|
||||||
return getClass().getSimpleName() + "[ "+translation.x + ", "+ translation.y + ", "+translation.z+"]\n"+
|
return getClass().getSimpleName() + "[ " + translation.x + ", " + translation.y + ", " + translation.z + "]\n"
|
||||||
"[ "+rot.x + ", " + rot.y + ", " + rot.z + ", " + rot.w + "]";
|
+ "[ " + rot.x + ", " + rot.y + ", " + rot.z + ", " + rot.w + "]\n"
|
||||||
|
+ "[ " + scale.x + " , " + scale.y + ", " + scale.z + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user