Exemple #1
0
        public bool FieldsMatchWith(BevelMesh mesh)
        {
            bool bevelEq     = fuzzyEq(Bevel, mesh.Bevel);
            bool buldgeEq    = fuzzyEq(Buldge, mesh.Buldge);
            bool roundnessEq = fuzzyEq(Roundness, mesh.Bevel_Roundness);

            return(bevelEq && buldgeEq && roundnessEq);
        }
Exemple #2
0
        public bool FieldsMatchWith(BevelMesh mesh)
        {
            Contract.Requires(mesh != null);

            bool bevelEq     = fuzzyEq(Bevel, mesh.Bevel);
            bool bulgeEq     = fuzzyEq(Bulge, mesh.Bulge);
            bool roundnessEq = fuzzyEq(Roundness, mesh.Bevel_Roundness);

            return(bevelEq && bulgeEq && roundnessEq);
        }
Exemple #3
0
        public static Asset ResolveHeadMeshAsset(DataModelMesh mesh)
        {
            Contract.Requires(mesh != null);
            string result = "Default";

            if (mesh is BevelMesh)
            {
                BevelMesh bevelMesh = mesh as BevelMesh;
                BevelType bevelType = BevelType.Unknown;

                if (mesh is BlockMesh)
                {
                    bevelType = BevelType.Block;
                }
                else if (mesh is CylinderMesh)
                {
                    bevelType = BevelType.Cylinder;
                }

                Head match = Lookup.Keys
                             .Where((head) => bevelType == head.BevelType)
                             .Where((head) => head.FieldsMatchWith(bevelMesh))
                             .First();

                if (match != null)
                {
                    result = Lookup[match];
                }

                mesh.Scale = new Vector3(1, 1, 1);
            }

            else if (mesh is SpecialMesh)
            {
                SpecialMesh specialMesh = mesh as SpecialMesh;

                if (specialMesh.MeshType == MeshType.Sphere)
                {
                    result            = "Perfection";
                    specialMesh.Scale = new Vector3(1, 1, 1);
                }
            }

            if (result == "Default")
            {
                mesh.Scale /= new Vector3(1.25f, 1.25f, 1.25f);
            }

            return(Asset.FromResource("Meshes/Heads/" + result + ".mesh"));
        }
Exemple #4
0
 public bool paramsMatchWith(BevelMesh mesh)
 {
     return(fuzzyEq(mesh.Bevel, Bevel) &&
            fuzzyEq(mesh.Bevel_Roundness, Roundness) &&
            fuzzyEq(mesh.Buldge, Buldge));
 }