mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-07-07 18:31:23 +08:00
Render all interior entitySets.
This commit is contained in:
parent
48fe9cee9b
commit
56f9378506
|
@ -1115,6 +1115,7 @@ namespace CodeWalker.GameFiles
|
||||||
public bool IsMlo { get; set; }
|
public bool IsMlo { get; set; }
|
||||||
public MloInstanceData MloInstance { get; set; }
|
public MloInstanceData MloInstance { get; set; }
|
||||||
public YmapEntityDef MloParent { get; set; }
|
public YmapEntityDef MloParent { get; set; }
|
||||||
|
public MCMloEntitySet MloEntitySet { get; set; }
|
||||||
public Vector3 MloRefPosition { get; set; }
|
public Vector3 MloRefPosition { get; set; }
|
||||||
public Quaternion MloRefOrientation { get; set; }
|
public Quaternion MloRefOrientation { get; set; }
|
||||||
public MetaWrapper[] Extensions { get; set; }
|
public MetaWrapper[] Extensions { get; set; }
|
||||||
|
|
|
@ -1962,7 +1962,7 @@ namespace CodeWalker.GameFiles
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return Name;
|
return Name + ": " + (Entities?.Length ?? 0).ToString() + " entities";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -212,31 +212,54 @@ namespace CodeWalker.GameFiles
|
||||||
if (owner == null) return;
|
if (owner == null) return;
|
||||||
if (mloa.entities == null) return;
|
if (mloa.entities == null) return;
|
||||||
var ec = mloa.entities.Length;
|
var ec = mloa.entities.Length;
|
||||||
Entities = new YmapEntityDef[ec];
|
|
||||||
|
var entlist = new List<YmapEntityDef>();
|
||||||
for (int i = 0; i < ec; i++)
|
for (int i = 0; i < ec; i++)
|
||||||
{
|
{
|
||||||
MCEntityDef ment = mloa.entities[i];
|
YmapEntityDef e = CreateYmapEntity(owner, mloa.entities[i], i);
|
||||||
YmapEntityDef e = new YmapEntityDef(null, i, ref ment._Data);
|
entlist.Add(e);
|
||||||
e.Extensions = ment.Extensions;
|
|
||||||
e.MloRefPosition = e.Position;
|
|
||||||
e.MloRefOrientation = e.Orientation;
|
|
||||||
e.MloParent = owner;
|
|
||||||
e.Position = owner.Position + owner.Orientation.Multiply(e.MloRefPosition);
|
|
||||||
e.Orientation = Quaternion.Multiply(owner.Orientation, e.MloRefOrientation);
|
|
||||||
e.UpdateWidgetPosition();
|
|
||||||
e.UpdateWidgetOrientation();
|
|
||||||
Entities[i] = e;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int lasti = ec;
|
||||||
|
|
||||||
var entitySets = mloa.entitySets;
|
var entitySets = mloa.entitySets;
|
||||||
if (entitySets != null)
|
if (entitySets != null)
|
||||||
{
|
{
|
||||||
//for (int i = 0; i < entitySets.Length; i++)
|
for (int i = 0; i < entitySets.Length; i++)
|
||||||
//{
|
{
|
||||||
// var entitySet = entitySets[i];
|
var entitySet = entitySets[i];
|
||||||
//}
|
if (entitySet.Entities != null)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < entitySet.Entities.Length; j++)
|
||||||
|
{
|
||||||
|
YmapEntityDef e = CreateYmapEntity(owner, entitySet.Entities[j], lasti);
|
||||||
|
e.MloEntitySet = entitySet;
|
||||||
|
entlist.Add(e);
|
||||||
|
lasti++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (defaultEntitySets != null)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Entities = entlist.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
private YmapEntityDef CreateYmapEntity(YmapEntityDef owner, MCEntityDef ment, int i)
|
||||||
|
{
|
||||||
|
YmapEntityDef e = new YmapEntityDef(null, i, ref ment._Data);
|
||||||
|
e.Extensions = ment.Extensions;
|
||||||
|
e.MloRefPosition = e.Position;
|
||||||
|
e.MloRefOrientation = e.Orientation;
|
||||||
|
e.MloParent = owner;
|
||||||
|
e.Position = owner.Position + owner.Orientation.Multiply(e.MloRefPosition);
|
||||||
|
e.Orientation = Quaternion.Multiply(owner.Orientation, e.MloRefOrientation);
|
||||||
|
e.UpdateWidgetPosition();
|
||||||
|
e.UpdateWidgetOrientation();
|
||||||
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user