mrdoob/three.js — pull request #5291 by dmtaub (2014-09-10 19:24:39+00:00)
Title: Object3D modifications to allow custom inherited types

With these hooks in place, one could derive classes and trust that they are serialized and deserialized properly, as long as they are put in the THREE.CustomTypes hash and they implement .customData() for serialization and .parse() for deserialization.

A better solution would be a framework modification where each object is responsible for it's own part of the toJSON() function, such that one could call toJSON recursively for any properties which are three.js types, as well as for derived classes (invoking the super method). That would eliminate the need for "customData."