-
Notifications
You must be signed in to change notification settings - Fork 169
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
base: main
Are you sure you want to change the base?
Disable skid marks and braking sound when taking off #79
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/pmndrs/racing-game/2XeGGsg3kY6eYS7THy9KXxZhqG2o |
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. |
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 :) |
src/models/vehicle/Vehicle.jsx
Outdated
@@ -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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
No description provided.