-
Notifications
You must be signed in to change notification settings - Fork 54
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
Will there be support on Next.js in the future? #88
Comments
same problem here |
Same issue as well |
would be cool to see this gain support on NextJS as well. not sure if it works on remix but i will run a test on my end to see if it can work. |
A workaround is to put your scene contents into a dynamic import e.g. const Content = dynamic(async () => {
const content = await import('./path-to-content');
return content.Content;
}, {
ssr: false,
}); Then it will work only on client side which seems to work well for me. |
nice! That's a pretty smart workaround. Another option is to
use @react-three/cannon which i believe is the same underlying packages
under the hood, but cannon renders purely client side as far as i know!
cannon is working pretty well on nextjs check out
https://kilo-geo.netlify.app do see a working physics scene. code is at
https://www.github.com/merveillevaneck/geo
…On Mon, Sep 26, 2022 at 9:37 AM firtoz ***@***.***> wrote:
A workaround is to put your scene contents into a dynamic import e.g.
const Content = dynamic(async () => {
const content = await import('./path-to-content');
return content.Content;}, {
ssr: false,});
Then it will work only on client side which seems to work well for me.
—
Reply to this email directly, view it on GitHub
<#88 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD43LPD5IVB57CMM5CBVF7TWAFHB5ANCNFSM6AAAAAAQNIDOOM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
use-cannon uses an entirely different physics engine (cannon). |
Alright, interesting. Do you know maybe why there are multiple?
…On Mon, 26 Sep 2022 at 11:36, Hendrik Mans ***@***.***> wrote:
use @react-three/cannon
use-cannon uses an entirely different physics engine (cannon).
—
Reply to this email directly, view it on GitHub
<#88 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD43LPCA3WG6NN7CTX7CBM3WAFVBJANCNFSM6AAAAAAQNIDOOM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I'm not sure I understand the question. Are you asking why multiple physics engines exist? |
Almost. I’m essentially asking what the different intentions are between
the two and also why two different dependencies were created and managed in
the context of @react-three.
…On Mon, 26 Sep 2022 at 11:42, Hendrik Mans ***@***.***> wrote:
Alright, interesting. Do you know maybe why there are multiple?
I'm not sure I understand the question. Are you asking why multiple
physics engines exist?
—
Reply to this email directly, view it on GitHub
<#88 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD43LPA323VH5LQQLTF26B3WAFVWPANCNFSM6AAAAAAQNIDOOM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
To indulge and answer @merveillevaneck's question: @react-three/cannon was created first. The cannon physics engine is written in JavaScript, and while it's impressive and works for many projects, it has limitations around performance, accuracy, and support for complex shapes (namely limited support for trimeshes). @react-three/rapier was created recently, and uses the rapier physics engine, which is written in rust. Rapier has much better performance, accuracy, and is more feature complete. The only real gotcha is it has a larger bundle than rt/cannon. As rt/rapier matures, it will be (and maybe already is) the obvious choice for most projects. There will still be a place for rt/cannon in some projects that only need very simple physics and a small bundle size. It's also possible that the bundle size for rapier will be reduced in future. TL;DR rt/cannon is older and has less robust physics, rt/rapier is newer and is more robust + performant. |
Tried to import anything from rapier, ocurrs error:
Error: Cannot find module '/repo/node_modules/three/examples/jsm/utils/BufferGeometryUtils'
I thinks rapier was trying to get example stuff from three which npm three don't have, hence the error.
Can I tricks rapier to get examples from three-stdlib?
I was running in the latest Next.js, r3f and three.
The text was updated successfully, but these errors were encountered: