public M2RenderInstance AddInstance(int uuid, Vector3 position, Vector3 rotation, Vector3 scaling) { M2RenderInstance inst; // ReSharper disable once InconsistentlySynchronizedField if (mFullInstances.TryGetValue(uuid, out inst)) { ++inst.NumReferences; return(inst); } var instance = new M2RenderInstance(uuid, position, rotation, scaling, this); lock (mFullInstances) { mFullInstances.Add(uuid, instance); if (!instance.IsVisible(WorldFrame.Instance.ActiveCamera)) { return(instance); } lock (VisibleInstances) VisibleInstances.Add(instance); return(instance); } }
public void PushMapReference(M2Instance instance) { var renderInstance = instance.RenderInstance; if (Model.HasBlendPass) { renderInstance.UpdateDepth(); } renderInstance.IsUpdated = true; lock (VisibleInstances) VisibleInstances.Add(renderInstance); }