Am 30.12.2008, 19:39 Uhr, schrieb Christopher Barker
<[email protected]>:

> hmm. I wonder if that's the best approach, or if I should create a Null
> bounding box object....

I faced the same problem in fc2 and my temporary solution is to disable
the use of empty groups (that is, no children) by raising an exception.
Nodes with no bounding boxes need special treatments in different places,
e.g. if you're currently doing something like node.boundingBox.center + (
10, 0 ) you will run into an error with the proposed new NoBoundingBox
class. You cannot return (0,0) for noBoundingBox.center, because if you
merge a bounding box with center (0,0) and size (0,0) with another
bounding box, the resulting bounding box will now probably be enlarged and
contains (0,0).
Since objects with no bounding box need different treatment in a variety
of situations I just disabled them for now instead of writing the
NoBoundingBox class (or removing the boundingBox property from such nodes
altogether).
In fc2 all nodes classes are subclasses of from NodeWithBounds which
specifically assumes that a node has bounds. I think nodes without bounds
should have a different superclass. Then the rendering/culling/... other
code that specifically relies on the node to have a valid bounding box ...
can work only on the nodes which actually have a bounding box.
While all this can be done it didn't seem to justify the extra complexity
in implementation and testing for the time being. Objects with no bounding
box are not really useful (except during their construction; fc2 allows
for empty groups and only barks when such objects are used in rendering or
culling ).

-Matthias
_______________________________________________
FloatCanvas mailing list
[email protected]
http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to