コード例 #1
0
ファイル: Collision.cs プロジェクト: Arys02/Underground
        public static void Initialize()
        {
            tree = new IntervalKDTree<string>(70000, 700);

            foreach (structOBJ obj in Program.Liste_OBJ)
            {
                if (obj.sera_affiche)
                {
                    foreach (structModel model in obj.data)
                    {
                        var vecPerBox = 2;

                        for (int i = 0; i <= model.Sommets.GetUpperBound(0) - vecPerBox; i = i + vecPerBox)
                        {
                            var tmp_vec = new List<Vector3>();

                            for (int j = 0; j < vecPerBox; j++)
                            {
                                tmp_vec.Add(
                                    (Vector3) Vector4.Transform(model.Sommets[i + j].Position, obj.Transformation));
                            }

                            PutFromPoints(tmp_vec.ToArray());
                        }
                    }
                }
            }
        }
コード例 #2
0
        public void CustomIntervalKDTreeTests()
        {
            IntervalKDTree <string> tree = new IntervalKDTree <string>(100, 10);

            tree.Put(-20, -20, -20, 20, 20, 20, "test");

            HashSet <string> values = new HashSet <string>();

            tree.GetValues(-1, -21, -1, 1, -19, 1, values);
            Assert.AreEqual(1, values.Count);
        }
コード例 #3
0
 public CloudCache(Guid localBubbleId, double bubblePerceptionRange, TimeSpan cacheObjectLifeSpan)
 {
     this.localBubbleId       = localBubbleId;
     this.objectKDTree        = new IntervalKDTree <Guid>(bubblePerceptionRange, 10);
     this.cacheObjectLifeSpan = cacheObjectLifeSpan;
 }