phy icon indicating copy to clipboard operation
phy copied to clipboard

de-coupling from three.js

Open trusktr opened this issue 5 months ago • 1 comments

Hello! The abstraction over multiple physics engine is wonderful. However, it is coupled to Three.js rendering.

It would be great if instead of that coupling, it could be only a physics engine abstraction and nothing more, so that it could be applied independently to any other renderer (Babylon, Three.js, PlayCanvas, Lume, react-three-fiber, a-frame, regl, Pixi3D, even custom renderers).

You could, optionally, provide separate higher-level renderers (f.e. ThreejsRenderer, PlaycanvasRenderer, etc) that can accept the Phy instance and render it based on the physics world. That would be a lot nicer because then anyone could adopt Phy's simplistic and standardized physics API and easily swap which underlying physics engine is used, without being strictly coupled to Three.js.

I would really love to use this physics abstraction, but I don't want to be strictly coupled to Three.js, depending on what I'm working on.

trusktr avatar Sep 17 '25 21:09 trusktr

yes so in fact physics engines side with worker is already totally separated from three. so is possible to create a new 'motor' side from any renderer.; but personally I'm not too interested in the other engine because for me three can do all I want

lo-th avatar Sep 18 '25 05:09 lo-th