Example #1
0
        private void AddPlane(SharpDevice device, PlaneSector_000A planeSection, List <string> materialList)
        {
            if (planeSection.leftSection is AtomicSector_0009 al)
            {
                AddAtomic(device, al, materialList);
            }
            else if (planeSection.leftSection is PlaneSector_000A pl)
            {
                AddPlane(device, pl, materialList);
            }
            else
            {
                throw new Exception();
            }

            if (planeSection.rightSection is AtomicSector_0009 ar)
            {
                AddAtomic(device, ar, materialList);
            }
            else if (planeSection.rightSection is PlaneSector_000A pr)
            {
                AddPlane(device, pr, materialList);
            }
            else
            {
                throw new Exception();
            }
        }
Example #2
0
        void AddPlane(PlaneSector_000A planeSection)
        {
            if (planeSection.leftSection is AtomicSector_0009 al)
            {
                AddAtomic(al);
            }
            else if (planeSection.leftSection is PlaneSector_000A pl)
            {
                AddPlane(pl);
            }
            else
            {
                throw new Exception();
            }

            if (planeSection.rightSection is AtomicSector_0009 ar)
            {
                AddAtomic(ar);
            }
            else if (planeSection.rightSection is PlaneSector_000A pr)
            {
                AddPlane(pr);
            }
            else
            {
                throw new Exception();
            }
        }
        private void AddPlane(SharpDevice device, PlaneSector_000A planeSection)
        {
            if (planeSection.leftSection is AtomicSector_0009 al)
            {
                AddAtomic(device, al);
            }
            else if (planeSection.leftSection is PlaneSector_000A pl)
            {
                AddPlane(device, pl);
            }
            else
            {
                throw new Exception();
            }

            if (planeSection.rightSection is AtomicSector_0009 ar)
            {
                AddAtomic(device, ar);
            }
            else if (planeSection.rightSection is PlaneSector_000A pr)
            {
                AddPlane(device, pr);
            }
            else
            {
                throw new Exception();
            }
        }
        private static void GetPlaneTriangleList(StreamWriter OBJWriter, PlaneSector_000A planeSection, ref List <Triangle> triangleList, ref int totalVertexIndices, bool isCollision)
        {
            if (planeSection.leftSection is AtomicSector_0009 a1)
            {
                GetAtomicTriangleList(OBJWriter, a1, ref triangleList, ref totalVertexIndices, isCollision);
            }
            else if (planeSection.leftSection is PlaneSector_000A p1)
            {
                GetPlaneTriangleList(OBJWriter, p1, ref triangleList, ref totalVertexIndices, isCollision);
            }

            if (planeSection.rightSection is AtomicSector_0009 a2)
            {
                GetAtomicTriangleList(OBJWriter, a2, ref triangleList, ref totalVertexIndices, isCollision);
            }
            else if (planeSection.rightSection is PlaneSector_000A p2)
            {
                GetPlaneTriangleList(OBJWriter, p2, ref triangleList, ref totalVertexIndices, isCollision);
            }
        }
        private static void GetPlaneTriangleList(Scene scene, PlaneSector_000A planeSection, bool flipUVs)
        {
            if (planeSection.leftSection is AtomicSector_0009 a1)
            {
                GetAtomicTriangleList(scene, a1, flipUVs);
            }
            else if (planeSection.leftSection is PlaneSector_000A p1)
            {
                GetPlaneTriangleList(scene, p1, flipUVs);
            }

            if (planeSection.rightSection is AtomicSector_0009 a2)
            {
                GetAtomicTriangleList(scene, a2, flipUVs);
            }
            else if (planeSection.rightSection is PlaneSector_000A p2)
            {
                GetPlaneTriangleList(scene, p2, flipUVs);
            }
        }