Giter Site home page Giter Site logo

Comments (3)

 avatar commented on August 20, 2024 1

Actually, seeing this use case makes me think that writing your own wrapper will most likely save you time in the long run since Physijs was not really intended to be run inside a React application in the first place (it probably would work if you embedded it inside the webview with your three.js code for your 3D objects - I really don’t know, never used React nor React Native before).

Also, I’m pretty sure that you’ll need your own wrapper anyways if you go with an OpenGL view / Unity view since Physijs is JavaScript and in that case your rendering framework is native code, right?

The wrapper doesn’t have to be as complicated as the one for Physijs though - all you need to do is create a “physics model” replica for each 3D object, then sync position / rotation / etc with your 3D objects in your render loop.

from physijs.

 avatar commented on August 20, 2024

Off the top of my head, the only thing which has a Physijs-like integration is Whitestorm.js, but it's more of a complete framework rather than just being a small plugin. It is based on three.js though, so it might be what you're looking for. Although I haven't seen much activity, it should still work.

That aside, the only alternative at this point is to roll out your own Physijs interface for your project which calls some JavaScript physics engine, such as ammo.js (lots of features included, even has softbodies), cannon.js (small size) or Oimo.js (fairly fast). You could even take this repo's code as a starting point, as I'm pretty sure the worker code will work without many modifications, if any.

from physijs.

foxnoodles avatar foxnoodles commented on August 20, 2024

I'm aiming to use React Native Desktop (Windows an MacOS forks) as a base an use a webview to interact with 3D objects(I don't know if there's any other way to it besides cramping in the Unity view which is too hacky afaik and has licensing problems) Something like a native openGL view would be nice but I have no idea how's that done.

So basically I'll have to write my own wrapper around the physics engine of choice? That sounds terrifying :D

from physijs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.