This commit is contained in:
ousttrue 2021-02-19 20:15:04 +09:00
parent fbab0007f8
commit ff19712591
3 changed files with 15 additions and 2 deletions

View File

@ -106,6 +106,10 @@ namespace UniVRM10
public static Matrix4x4 RotateY180(this Matrix4x4 m)
{
// R, R, R, 0
// R, R, R, 0
// R, R, R, 0
// T, T, T, 1
var t = m.GetRow(3);
var tt = RotateY180(t);
m.SetRow(3, tt);

View File

@ -133,7 +133,10 @@ namespace VrmLib
if (m.IsOnlyTranslation())
{
var ret = m;
// M4x に移動が入っている
// R, R, R, 0
// R, R, R, 0
// R, R, R, 0
// T, T, T, 1
ret.M43 = -ret.M43;
return ret;
}
@ -149,7 +152,10 @@ namespace VrmLib
if (m.IsOnlyTranslation())
{
var ret = m;
// M4x に移動が入っている
// R, R, R, 0
// R, R, R, 0
// R, R, R, 0
// T, T, T, 1
ret.M41 = -ret.M41;
return ret;
}

View File

@ -438,6 +438,9 @@ namespace VrmLib
}},
{typeof(UnityEngine.Matrix4x4), new GetSet<UnityEngine.Matrix4x4>{
Getter = (array, start) =>
// UnityEngine.Matrix4x4
// * 列優先メモリレイアウト(col0, col1, col2, col3)
// * Constructor 引き数が行優先 new Matrix4x4(row0, row1, row2, row3);
new UnityEngine.Matrix4x4(
new UnityEngine.Vector4(BitConverter.ToSingle(array, start),
BitConverter.ToSingle(array, start + 16),