|
@@ -20,6 +20,7 @@ class SmoothTarget extends Animation {
|
|
@:s public var target : Animation;
|
|
@:s public var target : Animation;
|
|
@:s public var blend : Float;
|
|
@:s public var blend : Float;
|
|
@:s var duration : Float;
|
|
@:s var duration : Float;
|
|
|
|
+ @:s public var ignoreTranslate = false;
|
|
|
|
|
|
public function new( target : h3d.anim.Animation, duration = 0.5 ) {
|
|
public function new( target : h3d.anim.Animation, duration = 0.5 ) {
|
|
super("SmoothTarget(" + target.name+")", target.frameCount, target.sampling);
|
|
super("SmoothTarget(" + target.name+")", target.frameCount, target.sampling);
|
|
@@ -149,9 +150,15 @@ class SmoothTarget extends Animation {
|
|
mout._32 *= sz;
|
|
mout._32 *= sz;
|
|
mout._33 *= sz;
|
|
mout._33 *= sz;
|
|
|
|
|
|
- mout.tx = lerp(o.tx, m.tx, blend);
|
|
|
|
- mout.ty = lerp(o.ty, m.ty, blend);
|
|
|
|
- mout.tz = lerp(o.tz, m.tz, blend);
|
|
|
|
|
|
+ if( ignoreTranslate ) {
|
|
|
|
+ mout.tx = m.tx;
|
|
|
|
+ mout.ty = m.ty;
|
|
|
|
+ mout.tz = m.tz;
|
|
|
|
+ } else {
|
|
|
|
+ mout.tx = lerp(o.tx, m.tx, blend);
|
|
|
|
+ mout.ty = lerp(o.ty, m.ty, blend);
|
|
|
|
+ mout.tz = lerp(o.tz, m.tz, blend);
|
|
|
|
+ }
|
|
|
|
|
|
@:privateAccess if( o.targetSkin != null ) o.targetSkin.currentRelPose[o.targetJoint] = mout else o.targetObject.defaultTransform = mout;
|
|
@:privateAccess if( o.targetSkin != null ) o.targetSkin.currentRelPose[o.targetJoint] = mout else o.targetObject.defaultTransform = mout;
|
|
}
|
|
}
|