* Removes an existing object from the selection. If the object doesn't exist it's added instead. * * @param {Object3D} object - The object. * @return {Boolean} Returns true if the object is added, false otherwise.
(object)
| 242 | */ |
| 243 | |
| 244 | toggle(object) { |
| 245 | |
| 246 | let result; |
| 247 | |
| 248 | if(this.has(object)) { |
| 249 | |
| 250 | this.delete(object); |
| 251 | result = false; |
| 252 | |
| 253 | } else { |
| 254 | |
| 255 | this.add(object); |
| 256 | result = true; |
| 257 | |
| 258 | } |
| 259 | |
| 260 | return result; |
| 261 | |
| 262 | } |
| 263 | |
| 264 | /** |
| 265 | * Sets the visibility of all selected objects. |
no test coverage detected