I’m picking my scenegraph from the rootnode onwards. Several Nodes in the tree are set to CullHint.Always. These Nodes are still processed by the picking though. Is this by design or by accident? If it’s by design, how can I work around this problem.
A possible solution is to commit the following change to Node:
public void findPick(Ray toTest, PickResults results, int requiredOnBits) {
if (children == null || getWorldBound() == null || !isCollidable(requiredOnBits) || !getWorldBound().intersects(toTest) ||cullHint == CullHint.Always) return;
// further checking needed.
for (int i = 0; i < getQuantity(); i++)
children.get(i).findPick(toTest, results, requiredOnBits);
}
instead of
public void findPick(Ray toTest, PickResults results, int requiredOnBits) {
if (children == null || getWorldBound() == null || !isCollidable(requiredOnBits) || !getWorldBound().intersects(toTest)) return;
// further checking needed.
for (int i = 0; i < getQuantity(); i++)
children.get(i).findPick(toTest, results, requiredOnBits);
}