Beispiel #1
0
        // Token: 0x06004171 RID: 16753 RVA: 0x0014A704 File Offset: 0x00148B04
        private int AddVertex(CSGVertex v0, List <Vector3> vertices, List <Vector3> normals, List <Vector2> uvs, Dictionary <int, int> cache, VertexHash hash)
        {
            int key = hash.Hash(v0);
            int result;

            if (cache.TryGetValue(key, out result))
            {
                return(result);
            }
            vertices.Add(v0.P);
            normals.Add(v0.N);
            uvs.Add(v0.UV);
            int num = vertices.Count - 1;

            cache.Add(key, num);
            return(num);
        }
Beispiel #2
0
        /// <summary>
        /// helper for caching duplicated vertices
        /// </summary>
        private int AddVertex(CSGVertex v0, List <Vector3> vertices, List <Vector3> normals, List <Vector2> uvs, Dictionary <int, int> cache, VertexHash hash)
        {
            var h = hash.Hash(v0);

            int value;

            if (cache.TryGetValue(h, out value))
            {
                return(value);
            }

            vertices.Add(v0.P);
            normals.Add(v0.N);
            uvs.Add(v0.UV);

            var id = vertices.Count - 1;

            cache.Add(h, id);

            return(id);
        }
Beispiel #3
0
        /// <summary>
        /// helper for caching duplicated vertices
        /// </summary>
        int AddVertex(CSGVertex v0, List<Vector3> vertices, List<Vector3> normals, List<Vector2> uvs, Dictionary<int, int> cache, VertexHash hash)
        {
            var h = hash.Hash(v0);

            int value;
            if (cache.TryGetValue(h, out value))
            {
                return value;
            }

            vertices.Add(v0.P);
            normals.Add(v0.N);
            uvs.Add(v0.UV);

            var id = vertices.Count - 1;

            cache.Add(h, id);

            return id;
        }