* Gets or creates an object3D of a given type. * * @param {string} type - Type of the object3D. * @param {string} Constructor - Constructor to use to create the object3D if needed. * @returns {object}
(type, Constructor)
| 172 | * @returns {object} |
| 173 | */ |
| 174 | getOrCreateObject3D (type, Constructor) { |
| 175 | var object3D = this.getObject3D(type); |
| 176 | if (!object3D && Constructor) { |
| 177 | object3D = new Constructor(); |
| 178 | this.setObject3D(type, object3D); |
| 179 | } |
| 180 | warn('`getOrCreateObject3D` has been deprecated. Use `setObject3D()` ' + |
| 181 | 'and `object3dset` event instead.'); |
| 182 | return object3D; |
| 183 | } |
| 184 | |
| 185 | /** |
| 186 | * Add child entity. |
nothing calls this directly
no test coverage detected