Lusito / box2d.ts

Full blown Box2D Ecosystem for the web, written in TypeScript
https://lusito.github.io/box2d.ts
60 stars 6 forks source link

Evaluate possibilities for further *Def simplifications #17

Open Lusito opened 3 years ago

Lusito commented 3 years ago

In flyovers port, all *Def ports had one interface and one class defined. In some cases, I was able to make this just an interface, making creation of objects even simpler by just passing an object rather than creating it and adjust its settings. b2FixtureDef is one of those.

There are however other places, where this has not been done yet. Partially, because in some of these cases, inheritance is part of the equation.

Evaluate what can be done to further improve this.

An added benefit might be that we could allow third-party joints if we only required an interface for the JointDef.