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

one-way-platform issue #603

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

one-way-platform issue #603

wants to merge 2 commits into from

Conversation

driescroons
Copy link

@driescroons driescroons commented Jan 29, 2024

Description

PR for #597

We can get one-way-platforms to work by passing an additional hooks param to world.step(eventQueue, hooks) of type PhysicsHooks.

In order for us to get access to this in components, I added filterContactPairHooks and filterIntersectionPairHooks to useRapier.

This allows us to register a hook in our OneWayPlatform.jsx demo that we can push to filterContactPairHooks. We also need to make sure we set setActiveHooks to one for either our ball or platform.

This works, but when I try to get access to body's linvel or translation in the hook, from either the ref, or the params I get the above error. How am I able to access the body in that hook?

Run locally

  • yarn
  • cd demo
  • yarn dev
  • click to let the ball jump

Type of change

  • 🐛 Bug fix
  • ✨ New feature
  • 📦 Other (tests, refactoring, docs, etc.)

Checklist:

  • 🔍 I have performed a self-review of my code
  • 💬 I have commented my code, particularly in hard-to-understand areas
  • 📗 I have made corresponding changes to the documentation
  • ⭐️ My changes generate no new warnings
  • 🧪 I have added tests
  • 🟢 All new and existing unit tests pass

Copy link

changeset-bot bot commented Jan 29, 2024

⚠️ No Changeset found

Latest commit: 45087bf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

2 participants