Ejemplo n.º 1
0
        /**
         * Initialize a CSG_Model with the mesh of a gameObject.
         */
        public CSG_Model(GameObject go)
        {
            var mesh      = go.GetComponent <MeshFilter>().sharedMesh;
            var transform = go.GetComponent <Transform>();

            vertices = CSG_VertexUtility.GetVertices(mesh).Select(x => transform.TransformVertex(x)).ToList();
            indexes  = new List <int>(mesh.triangles);
        }
 public CSG_Model(Mesh mesh)
 {
     vertices = CSG_VertexUtility.GetVertices(mesh).ToList();
     indexes  = new List <int>(mesh.triangles);
 }