本文整理汇总了C#中Transform.Lerp方法的典型用法代码示例。如果您正苦于以下问题:C# Transform.Lerp方法的具体用法?C# Transform.Lerp怎么用?C# Transform.Lerp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transform
的用法示例。
在下文中一共展示了Transform.Lerp方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Lerp
public Transform Lerp(Transform other, float t)
{
if (this.Generality < other.Generality) {
return other.Lerp(this, -t); // TODO: is this correct?
}
AffineTransform ot = (other is AffineTransform) ?
(AffineTransform)other : new AffineTransform(other);
return new AffineTransform(
m00 + t*(ot.m00 - m00), m01 + t*(ot.m01 - m01),
m10 + t*(ot.m10 - m10), m11 + t*(ot.m11 - m11),
Tx + t*(ot.Tx - Tx ), Ty + t*(ot.Ty - Ty ));
}
示例2: Ease
public static void Ease(TYPE type, float normalized_time, TransformValue start_value, TransformValue end_value, ref Transform value)
{
float factor = Ease(type, normalized_time, 0.0f, 1.0f);
value.Lerp(start_value, end_value, factor);
}
示例3: Lerp
public Transform Lerp(Transform other, float t)
{
if (this.Generality < other.Generality) {
return other.Lerp(this, -t); // TODO: is this correct?
}
float ntx = MathUtil.Lerpa(this.Tx, other.Tx, t);
float nty = MathUtil.Lerpa(this.Ty, other.Ty, t);
float nrotation = MathUtil.Lerpa(this.Rotation, other.Rotation, t);
float nscaleX = MathUtil.Lerp(this.ScaleX, other.ScaleX, t);
float nscaleY = MathUtil.Lerp(this.ScaleY, other.ScaleY, t);
return new NonUniformTransform(nscaleX, nscaleY, nrotation, ntx, nty);
}