Skip to content

Remove operation does not work while using BoundsOctree #12

Description

@ikpil

The code is as follows.

        [Fact]
        public void TestNotWorkingRemove()
        {
            var octree = new BoundsOctree<OctreeItem>(600.0f, Vector3.Zero, 8.0f, 1.4f);

            var testCenters = ImmutableArray.Create(
                new Vector3(562.5165f, 0.0f, 942.26f),
                new Vector3(4511.894f, 0.0f, 3130.14f)
            );

            var items = new List<OctreeItem>();
            for (int i = 0; i < testCenters.Length; ++i)
            {
                var item = new OctreeItem();
                item.Idx = i;
                item.Bound = new BoundingBox(testCenters[i], Vector3.One);
                items.Add(item);
            }

            foreach (var item in items)
            {
                octree.Add(item, item.Bound);
            }

            foreach (var item in items)
            {
                bool removed = octree.Remove(item, item.Bound);
                removed.ShouldBeTrue(); // <-------------------------- why!?
            }
        }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions