Example #1
0
        public BHash GetBHash(bool force)
        {
            if (force)
            {
                _hash = null;
            }

            if (_hash == null)
            {
                BHasher hasher = new BHasherMdjb2();

                vertexs.ForEach(vert => {
                    MeshInfo.VertexBHash(vert, hasher);
                });
                indices.ForEach(ind => {
                    hasher.Add(ind);
                });
                hasher.Add(faceCenter.X);
                hasher.Add(faceCenter.Y);
                hasher.Add(faceCenter.Z);
                hasher.Add(scale.X);
                hasher.Add(scale.Y);
                hasher.Add(scale.Z);

                _hash = hasher.Finish();
            }
            return(_hash);
        }
Example #2
0
        // I had a lot of trouble with problems with equality and GetHashCode of OMVR.Vertex
        //    so this implementation creates a proper hash for a Vertex so it can be used
        //    in a dictionary.
        public static BHash VertexBHash(OMVR.Vertex vert)
        {
            BHasher hasher = new BHasherMdjb2();

            MeshInfo.VertexBHash(vert, hasher);
            return(hasher.Finish());
        }