您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
32 行
705 B
32 行
705 B
using System;
|
|
using UnityEngine;
|
|
|
|
namespace Unity.DemoTeam.DigitalHuman
|
|
{
|
|
public static class SnappersHeadDefinitionMath
|
|
{
|
|
public static float min(float a, float b)
|
|
{
|
|
return Math.Min(a, b);
|
|
}
|
|
|
|
public static float max(float a, float b)
|
|
{
|
|
return Math.Max(a, b);
|
|
}
|
|
|
|
public static float hermite(float p0, float p1, float r0, float r1, float t)
|
|
{
|
|
var t2 = t * t;
|
|
var t3 = t2 * t;
|
|
var _3t2 = 3.0f * t2;
|
|
var _2t3 = 2.0f * t3;
|
|
return (p0 * (_2t3 - _3t2 + 1.0f) + p1 * (-_2t3 + _3t2) + r0 * (t3 - 2.0f * t2 + t) + r1 * (t3 - t2));
|
|
}
|
|
|
|
public static float linstep(float start, float end, float parameter)
|
|
{
|
|
return Mathf.InverseLerp(start, end, parameter);
|
|
}
|
|
}
|
|
}
|