-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff57fcd
commit a9b30c1
Showing
24 changed files
with
328 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Copyright(c) Live2D Inc. All rights reserved. | ||
* | ||
* Use of this source code is governed by the Live2D Open Software license | ||
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html. | ||
*/ | ||
|
||
|
||
using UnityEngine; | ||
|
||
|
||
namespace Live2D.Cubism.Framework.Utils | ||
{ | ||
public class CubismMath : MonoBehaviour | ||
{ | ||
/// <summary> | ||
/// Returns the remainder of the division of two numbers. | ||
/// If invalid dividend or divisor is passed, it returns <see cref="float.NaN"/>. | ||
/// </summary> | ||
/// <param name="dividend"><see cref="Mathf.Infinity"/>, <see cref="Mathf.NegativeInfinity"/> and <see cref="float.NaN"/> are not allowed.</param> | ||
/// <param name="divisor"><see cref="float.NaN"/> and Zero is not allowed.</param> | ||
/// <returns></returns> | ||
public static float ModF(float dividend, float divisor) | ||
{ | ||
if (!float.IsFinite(dividend) || Mathf.Approximately(divisor, 0) | ||
|| float.IsNaN(dividend) || float.IsNaN(divisor)) | ||
{ | ||
Debug.LogWarning($"Invalid dividend or divisor. divided: {dividend}, divisor: {divisor} Mod() returns 'NaN'."); | ||
return float.NaN; | ||
} | ||
|
||
// Calculate the remainder of the division. | ||
return dividend % divisor; | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...Editor/CubismWebGLPluginProcessor.cs.meta → ...Cubism/Framework/Utils/CubismMath.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 0 additions & 89 deletions
89
Assets/Live2D/Cubism/Plugins/Editor/CubismWebGLPluginProcessor.cs
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
Assets/Live2D/Cubism/Plugins/Experimental/Emscripten/1_38_48/Live2DCubismCore.bc.meta
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.