support optimized transform hierarchy

This commit is contained in:
Perfare
2018-09-09 17:32:12 +08:00
parent 18af0a8856
commit 2d0278db87
4 changed files with 137 additions and 12 deletions

View File

@@ -362,5 +362,10 @@ namespace AssetStudio
}
return null;
}
public string FindBonePath(uint hash)
{
return m_TOS.Find(pair => pair.Key == hash).Value;
}
}
}

View File

@@ -1,4 +1,5 @@
using System;
using SharpDX;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -7,12 +8,19 @@ namespace AssetStudio
{
public class Transform
{
public PPtr m_GameObject = new PPtr();
public PPtr m_GameObject;
public float[] m_LocalRotation;
public float[] m_LocalPosition;
public float[] m_LocalScale;
public List<PPtr> m_Children = new List<PPtr>();
public PPtr m_Father = new PPtr();//can be transform or type 224 (as seen in Minions)
public List<PPtr> m_Children;
public PPtr m_Father;
public Transform(Vector3 t, Quaternion q, Vector3 s)
{
m_LocalPosition = new[] { t.X, t.Y, t.Z };
m_LocalRotation = new[] { q.X, q.Y, q.Z, q.W };
m_LocalScale = new[] { s.X, s.Y, s.Z };
}
public Transform(AssetPreloadData preloadData)
{
@@ -24,6 +32,7 @@ namespace AssetStudio
m_LocalPosition = new[] { reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle() };
m_LocalScale = new[] { reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle() };
int m_ChildrenCount = reader.ReadInt32();
m_Children = new List<PPtr>(m_ChildrenCount);
for (int j = 0; j < m_ChildrenCount; j++)
{
m_Children.Add(sourceFile.ReadPPtr());