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

Disable skid marks and braking sound when taking off #79

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

Conversation

lortschi
Copy link
Member

@lortschi lortschi commented Jun 7, 2021

No description provided.

@vercel
Copy link

vercel bot commented Jun 7, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pmndrs/racing-game/2XeGGsg3kY6eYS7THy9KXxZhqG2o
✅ Preview: https://racing-game-git-fork-lortschi-disable-skid-marks-in-t-80e32b.vercel.app

@drcmda
Copy link
Member

drcmda commented Jun 7, 2021

good idea, we need this! though cannon can tell you if wheels are in the air https://pmndrs.github.io/cannon-es/docs/classes/wheelinfo.html#isincontact it isnt exposed in use-cannon yet but i think that would be more flexible than testing position.y. i'll have a look tomorrow in the evening.

@lortschi
Copy link
Member Author

lortschi commented Jun 8, 2021

That would be awesome to have in use-cannon! I am not sure if the frictionSlip without the friction cooefficient data is working though properly. I think there is the contact material as well needed to get a nice drift possibility physics. But correct me if I am wrong :)

@bjornstar bjornstar mentioned this pull request Jun 8, 2021
@@ -111,7 +115,7 @@ function VehicleAudio() {
if (honk) {
if (!honkAudio.current.isPlaying) honkAudio.current.play()
} else honkAudio.current.isPlaying && honkAudio.current.stop()
if (brake && state.speed > 20) {
if (brake && state.speed > 20 && rightRearWheel.position.y < 0.29 && leftRearWheel.position.y < 0.29) {
Copy link
Member

Choose a reason for hiding this comment

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

can the hardcoded values be changed to constants

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Member

Choose a reason for hiding this comment

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

I meant the speed.. I don't think we are going to be using the wheel position like that since @drcmda commented about the isInContact prop:

good idea, we need this! though cannon can tell you if wheels are in the air https://pmndrs.github.io/cannon-es/docs/classes/wheelinfo.html#isincontact it isnt exposed in use-cannon yet but i think that would be more flexible than testing position.y. i'll have a look tomorrow in the evening.

Copy link
Member Author

@lortschi lortschi Jun 8, 2021

Choose a reason for hiding this comment

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

@njm222 ok I understand what you mean, let me change that

Copy link
Member

Choose a reason for hiding this comment

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

Shweet! Don't forget to bump the version of use-cannon

Copy link
Member

Choose a reason for hiding this comment

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

i dont think its yet possible, needs a quick fix so that nested props can be observed

@njm222 njm222 marked this pull request as draft June 9, 2021 08:42
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.

None yet

3 participants