Example #1
0
        // Token: 0x06000060 RID: 96 RVA: 0x00003630 File Offset: 0x00001830
        private static TriangleMesh.Normal Rotate(AffineTransform3 rotation, TriangleMesh.Normal normal)
        {
            Vector3 input  = new Vector3((double)normal.X, (double)normal.Y, (double)normal.Z);
            Vector3 vector = rotation.Transform(input);

            return(new TriangleMesh.Normal((float)vector.X, (float)vector.Y, (float)vector.Z));
        }
Example #2
0
        // Token: 0x0600005E RID: 94 RVA: 0x00003568 File Offset: 0x00001768
        private static void AddHalfEdge(ushort v0, ushort v1, ushort normalId, IList <TriangleMesh.Normal> normals, Dictionary <uint, ushort> halfEdges, List <TriangleMesh.EdgeLine> edgeLines, List <TriangleMesh.SurfaceLine> surfaceLines)
        {
            uint   key = TriangleMesh.MakeKey(v0, v1);
            ushort num;

            if (!halfEdges.TryGetValue(key, out num))
            {
                halfEdges.Add(key, normalId);
                return;
            }
            halfEdges.Remove(key);
            TriangleMesh.Normal normal  = normals[(int)normalId];
            TriangleMesh.Normal normal2 = normals[(int)num];
            float num2 = normal.X * normal2.X + normal.Y * normal2.Y + normal.Z * normal2.Z;

            if ((double)num2 < 0.999)
            {
                if ((double)num2 > 0.3)
                {
                    surfaceLines.Add(new TriangleMesh.SurfaceLine(normalId, v0, num, v1));
                    return;
                }
                edgeLines.Add(new TriangleMesh.EdgeLine(normalId, v0, num, v1));
            }
        }