|
Post by shadow008 on Aug 28, 2012 20:11:18 GMT -5
So I was considering making an OctTree class for general space partitioning of whatever I feel like using it for. But I got to thinking that any dynamic OctTree would be impossible without dynamic memory. The only ways I could think of making one would be: -Static resolution, dynamic number of objects. OR -Dynamic resolution, static number of objects per "box". The first one being I make a box, subdivide it a certain number of times (let's say twice, giving us 64 children boxes) and allocate the memory per child... Well, B4GL doesn't have dynamic memory (yet : , so that option is out of the question. The second one was the one I'd rather go with. So we have a box with 8 children, and each child has it's own same class of children. To look something maybe like this: type OCT_TREE_CHILD Children(7) as OCT_TREE_CHILD @@Other Stuff@@ end type
type OCT_TREE_CLASS Children(7) as OCT_TREE_CHILD end type ..Which can't work because you cant define an object in a type class as that same class... So if I'm not mistaken, there is no way to make DYNAMIC OctTrees without dynamic memory. Thought's on this?
|
|
|
Post by matthew on Aug 29, 2012 11:31:26 GMT -5
Hmm, over the years I've read many posts on the forum which have given me the impression that anything could be made possible in Basic4GL. I know that Tom regularly visits the forum so maybe he'll be able to find a solution.
|
|