-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Closed
Labels
Description
Some generically named properties like speed and rotating and paused etc. don't really belong directly in existing classes IMO. I'd like a .custom property (a simple hash) that I can assign such properties to. Not in extensions of existing classes, but in their objects:
var block = new THREE.Mesh(geo, material);
block.custom.speed = 1; // instead of block.speed = 1
block.speed is not very safe, forward compatibility wise, especially with the lib being in dev.
Assigning my own .custom to the prototype won't work however, because then all objects share 1 custom hash:
THREE.Object3D.prototype.custom = {};
It's a feature request, but very simple: add this.custom = {}; to the Object3D constructor.