CreateSimpleMesh() public static method

public static CreateSimpleMesh ( int dimension, Vector3 bounds ) : PlaneFinding.MeshData
dimension int
bounds Vector3
return PlaneFinding.MeshData
Ejemplo n.º 1
0
        private static void TestSimplePlane(int dimension, Vector3 bounds, Matrix4x4 vertDataTransform, Matrix4x4 meshTransform)
        {
            List <PlaneFinding.MeshData> meshes = new List <PlaneFinding.MeshData>();

            meshes.Add(Util.CreateSimpleMesh(dimension, bounds, vertDataTransform, meshTransform));

            BoundedPlane[] planes = PlaneFinding.FindPlanes(meshes, 0.0f, 0.0f);
            Assert.AreEqual(1, planes.Length);
            AssertExpectedPlane(planes[0], bounds, vertDataTransform, meshTransform);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            List <PlaneFinding.MeshData> meshes = new List <PlaneFinding.MeshData>();

            meshes.Add(Util.CreateSimpleMesh(10, new Vector3(5, 5, 0)));

            BoundedPlane[] planes = PlaneFinding.FindPlanes(meshes, 0.0f, 0.0f);

            Console.WriteLine("Found {0} meshes", planes.Length);
            for (int i = 0; i < planes.Length; ++i)
            {
                Console.WriteLine("{0}:", i);
                Console.WriteLine("   Area:    {0}", planes[i].Area.ToString("0.000"));
                Console.WriteLine("   Center:  {0}", planes[i].Bounds.Center.ToString("0.000"));
                Console.WriteLine("   Extents: {0}", planes[i].Bounds.Extents.ToString("0.000"));
                Console.WriteLine("   Normal:  {0}", planes[i].Plane.normal.ToString("0.000"));
                Console.WriteLine();
            }
        }
Ejemplo n.º 3
0
        static void Main()
        {
            List <PlaneFinding.MeshData> meshes = new List <PlaneFinding.MeshData>
            {
                Util.CreateSimpleMesh(10, new Vector3(5, 5, 0))
            };

            BoundedPlane[] planes = PlaneFinding.FindPlanes(meshes, 0.0f, 0.0f);

            Console.WriteLine($"Found {planes.Length} plane{(planes.Length != 1 ? "s" : "")}");
            for (int i = 0; i < planes.Length; ++i)
            {
                Console.WriteLine("{0}:", i);
                Console.WriteLine("   Area:    {0}", planes[i].Area.ToString("0.000"));
                Console.WriteLine("   Center:  {0}", planes[i].Bounds.Center.ToString("0.000"));
                Console.WriteLine("   Extents: {0}", planes[i].Bounds.Extents.ToString("0.000"));
                Console.WriteLine("   Normal:  {0}", planes[i].Plane.normal.ToString("0.000"));
                Console.WriteLine();
            }
            Console.ReadKey();
        }