-
Notifications
You must be signed in to change notification settings - Fork 137
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
replace some constants with configurable properties for raycast-vehicle #65
replace some constants with configurable properties for raycast-vehicle #65
Conversation
It would, absolutely, I just didn't want to alter the current behaviour,
but maybe that's not a big deal.
swift502 <[email protected]> ezt írta (időpont: 2021. jan. 13., Sze,
13:10):
… ***@***.**** commented on this pull request.
------------------------------
In src/objects/WheelInfo.ts
<#65 (comment)>:
> @@ -128,6 +132,8 @@ export class WheelInfo {
dampingCompression: 10,
dampingRelaxation: 10,
frictionSlip: 10000,
Wouldn't it also make sense to make this value more realistic by default?
Something in the range of 0.5 - 2?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#65 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AENRJP4ZQUGU7GWWB7CUAOTSZWERXANCNFSM4WAUUCDQ>
.
|
@tomo0613 yeah sorry I deleted that comment because I realised it's something different than just exposing parameters. Maybe that's for a different PR. Your current changes should (I believe) definitely be merged though. |
Thanks a lot 👍
swift502 <[email protected]> ezt írta (időpont: 2021. jan. 13., Sze
21:25):
… @tomo0613 <https://github.com/tomo0613> yeah sorry I deleted that comment
because I realised it's something different than just exposing parameters.
Maybe that's for a different PR.
Your current changes should (I believe) definitely be merged though.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#65 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AENRJP2WSRPGCIFI4R3ZBG3SZX6UDANCNFSM4WAUUCDQ>
.
|
@tomo0613 Nice! I agree they would make the vehicle configuration better. We should expose them. I don't think we should expose the variables this way though. They come from bullet, and probably there is a reason for them to have that value. Instead we should do it like this: const x = wheel.forwardImpulse * fwdFactor / wheel.forwardAcceleration
const y = wheel.sideImpulse * sideFactor / wheel.sideAcceleration
Could you update your PR with this?
True, it actually feels better 👍, keep the friction at 1.4. Don't change the |
I have updated the branch based on the suggestions. |
@marcofugaro I proposed changing the default frictionSlip value in the WheelInfo class to something smaller (In Sketchbook I use 0.8, and I gather @tomo0613 uses 1.4?). A value of 10000 seems excessively unrealistic and I believe it's what makes a lot of vehicle demos online feel very unnatural. I don't really know why @schteppe made 10000 the default. As for 2970232, yeah I noticed. 🙂 I planned on switching from cannon to cannon-es in Sketchbook, but never got around to it for some reason. |
@marcofugaro Good idea to compare with Bullet. Even 10.5 would imo serve as a much better default value. |
I'm happy to see the changes in live, thank you all! |
Greetings!
I'd like to use some constants from the RaycastVehicle class [especially fwdFactor] as configurable properties, in the WheelInfo class.
Tweaking that value makes it possible to achieve more realistic handling for a raycast-vehicle.
I really like the vehicle behaviour in Sketchbook, and I want to improve my project as well without using a custom cannon lib.
I also slightly modified the example, imho the original demo feels a bit weird when braking [press B] (but it could be reverted)