findPick ignores cullHint

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:



[java]

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);

}

[/java]



instead of

[java]

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);

}

[/java]

The cull hint is only for rendering, detach the geometry to avoid picking results or check the cullhint when picking.