public void Evaluate(int spreadMax)
        {
            FBlobOut.SliceCount =  spreadMax;

            for (var i = 0; i < spreadMax; i++)
            {
                FBlobOut[i] = new Blob {Id = FIdIn[i], Position = FPosIn[i], HitId = FHitIdIn[i], IsNew = false};
            }
        }
Example #2
0
        public static void SetIsNew(ISpread<Blob> blobs, ISpread<Blob> pBlobs)
        {
            if (pBlobs.SliceCount == 0)
            {
                for (var i = 0; i < blobs.SliceCount; i++)
                {
                    blobs[i] = new Blob{Position = blobs[i].Position, HitId = blobs[i].HitId, Id = blobs[i].Id, IsNew = true};
                }
            }
            else
            {
                for (var i = 0; i < blobs.SliceCount; i++)
                {
                    //TODO: Proper new blob detection
                    blobs[i] = new Blob { Position = blobs[i].Position, HitId = blobs[i].HitId, Id = blobs[i].Id, IsNew = pBlobs.All(blob => blob.Id != blobs[i].Id)};
                }
            }

            pBlobs.SliceCount = blobs.SliceCount;
            pBlobs.AssignFrom(blobs);
        }
Example #3
0
 public static double FindAngle(Blob firstBlob, Blob secondBlob)
 {
     var angle = Math.Atan2(secondBlob.Position.y - firstBlob.Position.y,
                            secondBlob.Position.x - firstBlob.Position.x);
     return Frac(angle * VMath.RadToCyc);
 }