This refactor solves a number of issues ans subtle bugs that are
present in the current implementation. No breaking changes have
been made.
Usage of defaultGeometry: Previously a single defaultGeometry has
been used for all Meshes that didn't have a geometry set on them.
Since it was possible to retrieve and mutate the geometry, mutating
the geometry of one Mesh would have resulted into unexpected
results (since the geometry was shared among all Meshes).
Primitives inherit from Geometry: Although the methods were
documented as constructors, they actually instantiated a new
Geometry and returned it. This resulted into confusing
instanceof and constructor checks. The new keyword is still
optional, there this is not a breaking change.
Deprecate Mesh#setGeometry's geometry register: Accepting
geometries as strings is problematic, since it means that all
geometries will be required and included in the bundled file (as
pointed out on phabricator). Currently a console.warn is used for
printing the deprecation notice.
This refactor solves a number of issues ans subtle bugs that are present in the current implementation. No breaking changes have been made.
instanceof
andconstructor
checks. The new keyword is still optional, there this is not a breaking change.