mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-06-02 22:14:30 -05:00
fix CurveMapper. zero inputMaxValue
This commit is contained in:
parent
521cfa0901
commit
9ffebd5b87
|
|
@ -17,6 +17,9 @@ namespace VRM
|
|||
[Range(0, 90.0f)]
|
||||
public float CurveYRangeDegree;
|
||||
|
||||
// zero 除算などを回避する閾値
|
||||
public const float MIMIMUM_INPUT_MAX_VALUE = 1e-5f;
|
||||
|
||||
public CurveMapper(float xRange, float yRange)
|
||||
{
|
||||
CurveXRangeDegree = xRange;
|
||||
|
|
@ -61,6 +64,13 @@ namespace VRM
|
|||
|
||||
public float Map(float src)
|
||||
{
|
||||
if (CurveXRangeDegree < MIMIMUM_INPUT_MAX_VALUE)
|
||||
{
|
||||
// https://github.com/vrm-c/UniVRM/issues/2452
|
||||
return 0;
|
||||
// or CurveYRangeDegree ?
|
||||
}
|
||||
|
||||
if (src < 0)
|
||||
{
|
||||
src = 0;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ namespace UniVRM10
|
|||
[Range(0, 90.0f)]
|
||||
public float CurveYRangeDegree;
|
||||
|
||||
// zero 除算などを回避する閾値
|
||||
public const float MIMIMUM_INPUT_MAX_VALUE = 1e-5f;
|
||||
|
||||
public CurveMapper(float xRange, float yRange)
|
||||
{
|
||||
CurveXRangeDegree = xRange;
|
||||
|
|
@ -33,6 +36,13 @@ namespace UniVRM10
|
|||
|
||||
public float Map(float src)
|
||||
{
|
||||
if (CurveXRangeDegree < MIMIMUM_INPUT_MAX_VALUE)
|
||||
{
|
||||
// https://github.com/vrm-c/UniVRM/issues/2452
|
||||
return 0;
|
||||
// or CurveYRangeDegree ?
|
||||
}
|
||||
|
||||
if (src < 0)
|
||||
{
|
||||
src = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user