Exemple #1
0
        public void SetNode(int nodeId, TubeNode node)
        {
            var mapping = idToMemMap[nodeId];
            //var endNodeFlag = nodeId == cummNodeCount[mapping.]

            fillContent(mapping.BufferId, mapping.Offset, node, mapping.EndNode || mapping.StartNode, 0);

            if (mapping.Dublicated)
            {
                fillContent(mapping.BufferId - 1, idToMemMap[nodeId - 1].Offset + nodeElementCount, node, mapping.EndNode || mapping.StartNode, 0);
            }
        }
Exemple #2
0
        public void fillContent(int bufferId, int offset, TubeNode node, bool endNodeFlag, int baseLayerId)
        {
            var content = tubesBufferContent[bufferId];

            content.Fill(offset + 0, 0, node.Pos);
            content.Fill(offset + 0, 3, node.Rad);

            content.Fill(offset + 1, 0, node.PTan);
            content.Fill(offset + 1, 3, node.RTan);

            content.Fill(offset + 2, 0, node.Col);
            content.Fill(offset + 2, 3, baseLayerId);

            content.Fill(offset + 3, 0, node.CTan);
            content.Fill(offset + 3, 3, endNodeFlag ? 1.0f : 0.0f);
        }