MCPcopy Create free account
hub / github.com/pmndrs/postprocessing / toggle

Method toggle

src/core/Selection.js:244–262  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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.

Callers 6

showEpilepsyWarningMethod · 0.80
handleEventMethod · 0.80
outline.jsFile · 0.80
bloom.jsFile · 0.80
index.jsFile · 0.80
handleSelectionMethod · 0.80

Calls 2

deleteMethod · 0.95
addMethod · 0.95

Tested by

no test coverage detected