Skip to content

Add pick layer to SoPickStyle for ordered on-top picking - #623

Merged
veelo merged 1 commit into
coin3d:masterfrom
kadet1090:add-pick-layer
Jun 18, 2026
Merged

Add pick layer to SoPickStyle for ordered on-top picking#623
veelo merged 1 commit into
coin3d:masterfrom
kadet1090:add-pick-layer

Conversation

@kadet1090

Copy link
Copy Markdown
Contributor

This will let picked points be ordered across the scene graph independent of depth. SoPickStyle gains a layer field (default 0), carried through traversal by the new SoPickLayerElement. SoRayPickAction sorts picked points by layer (descending) and then by distance (ascending), so a higher layer always picks in front while true depth order is preserved within a layer.

The existing *_ON_TOP styles are unchanged: they ignore the layer and still sort frontmost. This replaces the previous behaviour where on-top picks collapsed their distance to 0 as the only way to bias picking to the front.

Fixes: #546

This will let picked points be ordered across the scene graph independent
of depth. SoPickStyle gains a `layer` field (default 0), carried through
traversal by the new SoPickLayerElement. SoRayPickAction sorts picked
points by layer (descending) and then by distance (ascending), so a higher
layer always picks in front while true depth order is preserved within a
layer.

The existing *_ON_TOP styles are unchanged: they ignore the layer and still
sort frontmost. This replaces the previous behaviour where on-top picks
collapsed their distance to 0 as the only way to bias picking to the front.
@VolkerEnderlein

Copy link
Copy Markdown
Member

Thank your for your valuable extension of Coin. It is highly appreciated. Can you rebase the PR on the HEAD, as I already merged two other PRs (including one that fixed the building issue on Windows OS) . Once the PR is ready to merge we need to bump the main version number as a new member variable is added to the existing class SoPickStyle and this breaks ABI interface.

@veelo
veelo merged commit da0b6e9 into coin3d:master Jun 18, 2026
4 of 5 checks passed
@veelo

veelo commented Jun 18, 2026

Copy link
Copy Markdown
Member

Sorry for interfering. I saw the rebase button, and forgetting that I wanted a minor release first, I had clicked the merge button...

@veelo

veelo commented Jun 20, 2026

Copy link
Copy Markdown
Member

@kadet1090 let me know if you want me to take care of rebasing and opening a new PR with your commit; it was me who messed up.

@kadet1090

Copy link
Copy Markdown
Contributor Author

@veelo I was a bit busy and without access to computer to push it - but I've created #633 already. Thanks for the offer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rendering and picking nodes on top with correct depth support

3 participants