Skip to content

Disable skid marks and braking sound when taking off - #79

Draft
lortschi wants to merge 3 commits into
pmndrs:mainfrom
lortschi:Disable-skid-marks-in-the-air-and-braking-sound
Draft

Disable skid marks and braking sound when taking off#79
lortschi wants to merge 3 commits into
pmndrs:mainfrom
lortschi:Disable-skid-marks-in-the-air-and-braking-sound

Conversation

@lortschi

@lortschi lortschi commented Jun 7, 2021

Copy link
Copy Markdown
Member

No description provided.

@vercel

vercel Bot commented Jun 7, 2021

Copy link
Copy Markdown

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

drcmda commented Jun 7, 2021

Copy link
Copy Markdown
Member

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

lortschi commented Jun 8, 2021

Copy link
Copy Markdown
Member Author

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
Comment thread src/models/vehicle/Vehicle.jsx Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@lortschi lortschi Jun 8, 2021

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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
Copy Markdown
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.

3 participants