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

Minor code cleanup in xr_nodes #70240

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

quentinguidee
Copy link
Contributor

@quentinguidee quentinguidee commented Dec 18, 2022

Clean xr_nodes

  • Reference parameters
  • Add const where possible
  • Remove semicolon at the end of some method implementation
  • vp_he -> viewport_half_extents
  • Simplify some if else logic
  • Remove some useless break
  • Remove already explicit comments "get our XRServer"

@quentinguidee quentinguidee requested a review from a team as a code owner December 18, 2022 03:18
* Reference parameters
* Add const where possible
* Remove semicolon at the end of some method implementation
* `vp_he` -> `viewport_half_extents`
* Simplify some if else logic
* Remove some useless break
* Remove already explicit comments "get our XRServer"

Signed-off-by: Quentin Guidée <quentin.guidee@gmail.com>
}

void XRNode3D::trigger_haptic_pulse(const String &p_action_name, double p_frequency, double p_amplitude, double p_duration_sec, double p_delay_sec) {
void XRNode3D::trigger_haptic_pulse(const String &p_action_name, double p_frequency, double p_amplitude, double p_duration_sec, double p_delay_sec) const {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not entirely sure if it makes sense to make this const. Haptics do change internal state even if this is offloaded to the XR interface, unless it's trigger_haptic_pulse is also const (which it shouldn't be)

@BastiaanOlij
Copy link
Contributor

I'm not against these changes, some are nice cleanups others are just semantics. Especially passing some of the parameters as references is probably a good idea.

@YuriSizov YuriSizov modified the milestones: 4.0, 4.1 Feb 10, 2023
@akien-mga akien-mga changed the title Refactor: xr_nodes Minor code cleanup in xr_nodes Jun 16, 2023
@akien-mga akien-mga modified the milestones: 4.1, 4.x Jun 16, 2023
@akien-mga
Copy link
Member

Needs a rebase as well as addressing the review comments.
@quentinguidee Do you still intend to work on this?

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

Successfully merging this pull request may close these issues.

5 participants