Exemple #1
0
        private static void StoreVertex(byte[] Buffer, ref Vertex128 value, int Offset)
        {
            Block128 b = (Block128)value;

            Buffer[Offset + 0]  = b.A;
            Buffer[Offset + 1]  = b.B;
            Buffer[Offset + 2]  = b.C;
            Buffer[Offset + 3]  = b.D;
            Buffer[Offset + 4]  = b.E;
            Buffer[Offset + 5]  = b.F;
            Buffer[Offset + 6]  = b.G;
            Buffer[Offset + 7]  = b.H;
            Buffer[Offset + 8]  = b.I;
            Buffer[Offset + 9]  = b.J;
            Buffer[Offset + 10] = b.K;
            Buffer[Offset + 11] = b.L;
            Buffer[Offset + 12] = b.M;
            Buffer[Offset + 13] = b.N;
            Buffer[Offset + 14] = b.O;
            Buffer[Offset + 15] = b.P;
        }
Exemple #2
0
        internal void AddVertex(Scripts.TempMesh mesh_non_node, ref Vertex128 vertex)
        {
            if (!Building)
            {
                return;
            }

            TempMesh128 iter;
            uint        iter_pos;
            var         equator = Scripts.TempMesh.Equator;

            // note that this starts at last on purpose. the nodes are a ring.
            for (iter = TempMeshes.last, iter_pos = TempMeshes.count; 0 != iter_pos; iter = iter.next, --iter_pos)
            {
                if (iter.hashCode == mesh_non_node.hashCode &&
                    equator.Equals(ref iter.value, ref mesh_non_node.value))
                {
                    break;
                }
            }

            if (0 == iter_pos)
            {
                // need a new mesh.
                var references = new TempMesh128References
                {
                    bmp = mesh_non_node.references.bmp,
                };
                TempMesh128.Add(ref TempMeshes, ref mesh_non_node.value, ref references);
                iter = TempMeshes.last;
            }
            else if (iter_pos != TempMeshes.count)
            {
                // spin it around a bit to optimize following vertices.
                TempMeshes.first = iter.next;
                TempMeshes.last  = iter;
            }
            TempVertex128.Add(ref iter.references.list, ref vertex);
        }