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

feat(app): 105 Collision event #134

Merged
merged 4 commits into from
Oct 7, 2024
Merged

Conversation

JaimeTorrealba
Copy link
Member

@JaimeTorrealba JaimeTorrealba commented Oct 2, 2024

closes #105

This is the draft version my friend, if you want you can start to check it out.

Currently, docs are missing, I need to clean some types, and figure out how to handle the collision groups.

I took some design decision about this API:

  1. I add an optional prop activeCollision to the colliders and rigidBody components in order to set the Collision event (necessary step for all the process). But I got some considerations, what about other events?, should this be true by default? is this props unnecessary
  2. I'm using emits in order to send the events to the user (I loved this because is a Vuesh feature) but this mean the event is only trigger when the collision appears (not in the renderLoop, of course this could be handled by the user)
  3. The event queue is always true in the physic component, I think this is the right thing to do, since other events are needed but for now if you don't use the collision is useless.

@JaimeTorrealba JaimeTorrealba added the p3-significant High-priority enhancement (priority) label Oct 2, 2024
@JaimeTorrealba JaimeTorrealba self-assigned this Oct 2, 2024
src/types/rigid-body.ts Outdated Show resolved Hide resolved
@JaimeTorrealba JaimeTorrealba marked this pull request as ready for review October 4, 2024 10:55
playground/src/pages/basics/CollisionDemo.vue Outdated Show resolved Hide resolved
src/components/Physics.vue Outdated Show resolved Hide resolved
src/utils/collisions.ts Outdated Show resolved Hide resolved
src/utils/collisions.ts Outdated Show resolved Hide resolved
src/utils/collisions.ts Outdated Show resolved Hide resolved
src/utils/collisions.ts Outdated Show resolved Hide resolved
@Neosoulink
Copy link
Sponsor Collaborator

Neosoulink commented Oct 7, 2024

This integration is way cleaner than the R3F one!

Kudos! ✨

@JaimeTorrealba JaimeTorrealba changed the title feat(app): 105 First stage of Collision event feat(app): 105 Collision event Oct 7, 2024
@Neosoulink
Copy link
Sponsor Collaborator

Hey @JaimeTorrealba, because the sensor is also based on the Rapier EventQueue, I'm going to wait for this PR to be merged and continue on my side

@JaimeTorrealba
Copy link
Member Author

Hey @JaimeTorrealba, because the sensor is also based on the Rapier EventQueue, I'm going to wait for this PR to be merged and continue on my side

Makes sense this is almost finish I think

Copy link
Sponsor Collaborator

@Neosoulink Neosoulink left a comment

Choose a reason for hiding this comment

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

Looks good to me 🎉✅️

@JaimeTorrealba JaimeTorrealba merged commit 18abcb0 into main Oct 7, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-significant High-priority enhancement (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Collision Events
2 participants