Skip to content

Conversation

HussainAther
Copy link

What?

Extracted validatePhysicsParams() into a reusable utility function for validating physics configuration values like mass, type, and gravity.

Why?

To remove repeated validation code and make it easier to apply consistent validation across components like body-helper, ragdoll, etc.

Examples

  • Logs warnings if physics params are malformed
  • Auto-corrects invalid mass, type, or gravity values

How to test

  1. Open a scene in Spoke or Hubs with bad physics params (e.g. mass: "foo")
  2. Observe warnings in the dev console
  3. Confirm behavior is graceful and scene still works

Documentation of functionality

No user-facing docs affected. Dev-only improvement.

Limitations

Only mass, type, and gravity are validated (for now).

Alternatives considered

Inline validation logic in each component — harder to maintain.

Open questions

  • Should this utility cover animation params next?
  • Should there be a global logWarning() helper for consistent format?

Additional details or related context

Supports recent validation work in body-helper (see #6551)

@DougReeder DougReeder changed the base branch from master to addons June 4, 2025 05:56
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.

2 participants