Bugfix: fixed a bug that caused the 'maintain volume' constraint to be badlu applied on objects.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/branches/gradle-restructure@11104 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
bea196baa2
commit
64c732451a
@ -1,5 +1,6 @@
|
|||||||
package com.jme3.scene.plugins.blender.constraints.definitions;
|
package com.jme3.scene.plugins.blender.constraints.definitions;
|
||||||
|
|
||||||
|
import com.jme3.animation.Bone;
|
||||||
import com.jme3.math.Transform;
|
import com.jme3.math.Transform;
|
||||||
import com.jme3.scene.plugins.blender.BlenderContext;
|
import com.jme3.scene.plugins.blender.BlenderContext;
|
||||||
import com.jme3.scene.plugins.blender.constraints.ConstraintHelper.Space;
|
import com.jme3.scene.plugins.blender.constraints.ConstraintHelper.Space;
|
||||||
@ -20,6 +21,9 @@ public class ConstraintDefinitionMaintainVolume extends ConstraintDefinition {
|
|||||||
@Override
|
@Override
|
||||||
public void bake(Space ownerSpace, Space targetSpace, Transform targetTransform, float influence) {
|
public void bake(Space ownerSpace, Space targetSpace, Transform targetTransform, float influence) {
|
||||||
if (volume != 1 && influence > 0) {
|
if (volume != 1 && influence > 0) {
|
||||||
|
// the maintain volume constraint is applied directly to object's scale, so no need to do it again
|
||||||
|
// but in case of bones we need to make computations
|
||||||
|
if (this.getOwner() instanceof Bone) {
|
||||||
Transform ownerTransform = this.getOwnerTransform(ownerSpace);
|
Transform ownerTransform = this.getOwnerTransform(ownerSpace);
|
||||||
switch (flag) {
|
switch (flag) {
|
||||||
case FLAG_MASK_X:
|
case FLAG_MASK_X:
|
||||||
@ -37,6 +41,7 @@ public class ConstraintDefinitionMaintainVolume extends ConstraintDefinition {
|
|||||||
this.applyOwnerTransform(ownerTransform, ownerSpace);
|
this.applyOwnerTransform(ownerTransform, ownerSpace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getConstraintTypeName() {
|
public String getConstraintTypeName() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user