﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KKMono1.Search3D
{
    public class FacetRef
    {
        public KModel Model;
        public int faId;
    }

    public static class ModelSearch
    {
        public static void AddModel(Search3DBase<FacetRef> search, KModel model)
        {
            for (int facetIndex = 0; facetIndex < model.Facets.Count; facetIndex++)
            {
                var facet = model.Facets[facetIndex];

                search.AddTriangle(new FacetRef() { Model = model, faId = facetIndex },
                    model.Vertices[facet.Ve0].Pt, model.Vertices[facet.Ve1].Pt, model.Vertices[facet.Ve2].Pt);
            }
        }
    }
}
