Exemplo n.º 1
0
        public void TestIndexOfMaxComponent()
        {
            var indexOfMaxComponent2Job = IndexOfMaxComponent2Job.Init();

            indexOfMaxComponent2Job.Run();
            indexOfMaxComponent2Job.Dispose();

            var indexOfMaxComponent3Job = IndexOfMaxComponent3Job.Init();

            indexOfMaxComponent3Job.Run();
            indexOfMaxComponent3Job.Dispose();

            var indexOfMaxComponent4Job = IndexOfMaxComponent4Job.Init();

            indexOfMaxComponent4Job.Run();
            indexOfMaxComponent4Job.Dispose();
        }
Exemplo n.º 2
0
            public static IndexOfMaxComponent4Job Init()
            {
                var length = 5;
                var job    = new IndexOfMaxComponent4Job
                {
                    In  = new NativeArray <float4>(length, Allocator.TempJob),
                    Out = new NativeArray <int>(length, Allocator.TempJob)
                };

                job.In[0] = new float4(-1, -1, -1, 1);
                job.In[1] = new float4(1, -1, -1, -1);
                job.In[2] = new float4(-1, 1, -1, -1);
                job.In[3] = new float4(-1, -1, 1, -1);
                job.In[4] = new float4(float.NaN, float.PositiveInfinity, float.NegativeInfinity, -float.NaN);

                return(job);
            }