Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
controls.forEach((control, index) => {
// cannot rely on the control.name being present or unique
const key = name;
if (this.contolsManagerMap[key] === undefined) {
this.contolsManagerMap[key] = [];
}
if (this.contolsManagerMap[key].length !== controls.length) {
const attachMode =
control.orientation_mode ===
INTERACTIVE_MARKER_ORIENTATION_MODES.FIXED
? ANCHOR_MODE.FIXED
: ANCHOR_MODE.INHERIT;
const controlsManager = freeformControls.anchor(object, {
separationT: {
x: 0.4,
y: 0.4,
z: 0.4,
},
orientation: control.orientation,
mode: attachMode,
hideOtherHandlesOnSelect: this.hideOtherHandlesOnSelect,
hideOtherControlsInstancesOnSelect: this
.hideOtherControlsInstancesOnSelect,
showHelperPlane: true,
});
controlsManager.scale.set(scale, scale, scale);
controlsManager.visible = visible;