scope() allows to set the affected nodes for a given light. However, sometimes it's much easier to specify the nodes which are not affected: if the the excluded node is not a top level node, the parent hierarchy needs to be traversed in order to add all the other nodes to the scope. This ends up being a lot of work (both for the developer and the runtime) for a simple operation.
The implementation is also an ObservableList<Node> with the suggested name 'exclusionScope'.
If a node is added to one of the lists while it exists in the other, one of three things could happen:
1. The node is silently removed from one list and put in the other.
2. An exception is thrown.
3. One of the lists takes precedence over the other (the presence of the node in the deferring list is ignored).
Option 1 seems best.
Since a Parent in the scope/exclusionScope makes all the children inherit this scope implicitly, the rule to determine if a Shape3D is affected by the light is by traversing its hierarchy upwards until a node is found in one of the scopes. That is, children override their parents if they are explicitly set in a scope. An empty scope still behaves as if the root node is in scope, but nodes in the exclusionScope are excluded.
The implementation is also an ObservableList<Node> with the suggested name 'exclusionScope'.
If a node is added to one of the lists while it exists in the other, one of three things could happen:
1. The node is silently removed from one list and put in the other.
2. An exception is thrown.
3. One of the lists takes precedence over the other (the presence of the node in the deferring list is ignored).
Option 1 seems best.
Since a Parent in the scope/exclusionScope makes all the children inherit this scope implicitly, the rule to determine if a Shape3D is affected by the light is by traversing its hierarchy upwards until a node is found in one of the scopes. That is, children override their parents if they are explicitly set in a scope. An empty scope still behaves as if the root node is in scope, but nodes in the exclusionScope are excluded.
- csr for
-
JDK-8223352 Add exclusion scope for LightBase
-
- Closed
-