I'd like to be able to pick quads that are not rendered and only render them when they are picked.
Suggestions?
Never mind, this always happens… I find it as soon as I post.
quad.setCullMode( SceneElement.CULL_ALWAYS);
quad.setCullMode( SceneElement.CULL_NEVER);
You could also have the following layout:
+
+
| Complete Scene |
+
+
| | |
| | +
+
| | |
| +
+ |
| | |
+
+ +
+ +
+
| Displayed Scene | | Invisible Item 1 | | Invisible Item 2 |
+
+ +
+ +
+
| |
| +
+
| |
+
+ +
+
| Visible Item 1 | | Visible Item 2 |
+
+ +
+
Where your quad would be one of the invisible items. You could then pick on the complete scene, but only render the displayed scene.
Good point. The question is, which way is faster to switch back and forth?
Based on what I see in the code, setting the cull mode simply keeps something from rendering, and it's a switch on the node. There'd be no reason to call updateGeometry.
Switching the node to another heirarchy may be slower?
On the other hand, if I leave the node in the 'visible' tree with just the mode being set then it will still be attempted to be rendered. If most of my nodes are (all but the one being picked) are not visible then having them in an non-rendered tree might be faster.
I guess it depends on how often I'll be rebuilding the tree.
Further thoughts?
guurk said:
I guess it depends on how often I'll be rebuilding the tree.
I think it won't matter much, because when completely rebuilding the tree, you'd just create one additional node. But you'd save the time for setting (possibly many) cull modes.