Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve control over pickable object highlighting #503

Merged
merged 1 commit into from
Aug 18, 2023

Conversation

Malcolmnixon
Copy link
Collaborator

This pull request switches the pickable object highlighting methods from:

func increase_is_closest()
func decrease_is_closest()

to:

func highlight_request(from : Node, on : bool)

The old method used reference counting which was prone to dropping counts, and was intended only for proximity-triggering.

The new method saves tracks which nodes are asking for the highlight, so a node can safely set or clear its request any number of times without interfering with other requests. Additionally the highlighting could be for any reason not just proximity.

Finally this method now allows snap-zones to forward highlighting requests to objects in the snap zones. This makes it easier to see which object is ready to be pulled out of a snap-zone.

@jkankiewicz
Copy link
Contributor

jkankiewicz commented Aug 10, 2023

@Malcolm Nixon, thank you!
After installing this PR and fixing bug #505 (PR #506), an XRToolsPickable node attached to a XRToolsSnapZone node highlights when an XRController3D node is close to it just like it does when it's unattached.

@BastiaanOlij BastiaanOlij added the enhancement New feature or request label Aug 18, 2023
@BastiaanOlij BastiaanOlij added this to the 4.2.0 milestone Aug 18, 2023
Copy link
Member

@BastiaanOlij BastiaanOlij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have an entry in changes doc, other than that good to merge

Replace increase/decrease_is_closest methods with highlight_request method.
Modified XRToolsFunctionPickup to use highlight_request to request highlighting.
Modified XRToolsSnapZone to forward highlight_request to picked up object.
@Malcolmnixon Malcolmnixon merged commit 21cc97e into GodotVR:master Aug 18, 2023
2 checks passed
@Malcolmnixon Malcolmnixon deleted the highlight-request branch August 18, 2023 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants