schteppe / cannon.js

A lightweight 3D physics engine written in JavaScript.
http://schteppe.github.com/cannon.js
MIT License
4.67k stars 709 forks source link

Arcade racing game physics #314

Open ghost opened 7 years ago

ghost commented 7 years ago

I'm seeking for advice for making arcade-style racing game. I am aiming for smooth and easy car controls. I've tried using raycastVehicle and rigidVehicle, but controling it feels wrong. What if vehicle's body would be just one simple cube and it would "slide" on the terrain. Is there any way to make cube sliding instead of rolling on terrain? Or maybe there's better solution?

otse commented 7 years ago

Maybe we can together work on new cannon.js demo's, because I'm also with a lack of exemplified behavior of the API and its uses (quite limited).

Your question - I don't think you can slide a cube over a nonflat mesh,, no matter its contact-material. I hope people will respond with some good suggestions and cannon.js solutions, because some people here will ironically tell you: use bullet if you want this.

Op vr 18 nov. 2016 om 15:02 schreef Gugis notifications@github.com

I'm seeking for advice for making arcade-style racing game. I am aiming for smooth and easy car controls. I've tried using raycastVehicle and rigidVehicle, but controling it feels wrong. What if vehicle's body would be just one simple cube and it would "slide" on the terrain. Is there any way to make cube sliding instead of rolling on terrain? Or maybe there's better solution?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/schteppe/cannon.js/issues/314, or mute the thread https://github.com/notifications/unsubscribe-auth/ABEkImSlcWE8dRdb3_S57WvjthGvSQzjks5q_a_1gaJpZM4K2gpY .

Sent from Gmail Mobile

ghost commented 7 years ago

Hey @otse, thanks for your reply. Do you think it's possible only with rigid bodies?

Edit: I found this video https://www.youtube.com/watch?v=LG1CtlFRmpU and it looks really nice. I think I will try to implement this method with cannon.js

One more edit: I'f i'm correct the same method is implemented in this demo?

otse commented 7 years ago

You want to ask yourself if you're pushing technology by making sliding cubes for cars. Just kidding mate, not here to judge.

I'd say it's hardly possible, however, I've not much experience.

On 18 November 2016 at 18:27, Gugis notifications@github.com wrote:

So it's possible only with rigid bodies?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/schteppe/cannon.js/issues/314#issuecomment-261590243, or mute the thread https://github.com/notifications/unsubscribe-auth/ABEkImcK5RdSw3FINUXFgZybazvrRk-Vks5q_d_tgaJpZM4K2gpY .

ghost commented 7 years ago

@otse well video I posted above showed what I have in mind. Except cars are hovering :)

GuillaumeBouchetEpitech commented 7 years ago

is this issue still open or did you find the demo enough as it is?