Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const chevron = this.state.isExpanded ? :
return (
<div>
<div>
<div>
{this.props.label}
</div>
<div>
{
!this.props.useEuler &&
`X: ${this.state.value.x.toFixed(2)}, Y: ${this.state.value.y.toFixed(2)}, Z: ${this.state.value.z.toFixed(2)}`
}
{
this.props.useEuler &&
`X: ${Tools.ToDegrees(this.state.value.x).toFixed(2)}, Y: ${Tools.ToDegrees(this.state.value.y).toFixed(2)}, Z: ${Tools.ToDegrees(this.state.value.z).toFixed(2)}`
}
</div>
<div> this.switchExpandState()} title="Expand">
{chevron}
</div>
</div>
{
this.state.isExpanded && !this.props.useEuler &&
<div>
this.updateStateX(value)} />
this.updateStateY(value)} />
this.updateStateZ(value)} />
</div>
}
{
this.state.isExpanded && this.props.useEuler &&
</div>
{chevron}
{
this.state.isExpanded && !this.props.useEuler &&
<div>
this.updateStateX(value)} />
this.updateStateY(value)} />
this.updateStateZ(value)} />
this.updateStateW(value)} />
</div>
}
{
this.state.isExpanded && this.props.useEuler &&
<div>
this.updateStateEulerX(value)} />
this.updateStateEulerY(value)} />
this.updateStateEulerZ(value)} />
</div>
}
);
}
}
promises.push(this._loadEmitterAsync(`${extensionContext}/emitters/${emitter.index}`, emitter).then(() => {
for (const sound of emitter._babylonSounds) {
sound.attachToMesh(babylonMesh);
if (emitter.innerAngle != undefined || emitter.outerAngle != undefined) {
sound.setLocalDirectionToMesh(Vector3.Forward());
sound.setDirectionalCone(
2 * Tools.ToDegrees(emitter.innerAngle == undefined ? Math.PI : emitter.innerAngle),
2 * Tools.ToDegrees(emitter.outerAngle == undefined ? Math.PI : emitter.outerAngle),
0);
}
}
}));
}
const promise = Promise.all(clipPromises).then(() => {
const weights = emitter.clips.map((clip) => { return clip.weight || 1; });
const weightedSound = new WeightedSound(emitter.loop || false, emitter._babylonSounds, weights);
if (emitter.innerAngle) { weightedSound.directionalConeInnerAngle = 2 * Tools.ToDegrees(emitter.innerAngle); }
if (emitter.outerAngle) { weightedSound.directionalConeOuterAngle = 2 * Tools.ToDegrees(emitter.outerAngle); }
if (emitter.volume) { weightedSound.volume = emitter.volume; }
emitter._babylonData!.sound = weightedSound;
});
const promise = Promise.all(clipPromises).then(() => {
const weights = emitter.clips.map((clip) => { return clip.weight || 1; });
const weightedSound = new WeightedSound(emitter.loop || false, emitter._babylonSounds, weights);
if (emitter.innerAngle) { weightedSound.directionalConeInnerAngle = 2 * Tools.ToDegrees(emitter.innerAngle); }
if (emitter.outerAngle) { weightedSound.directionalConeOuterAngle = 2 * Tools.ToDegrees(emitter.outerAngle); }
if (emitter.volume) { weightedSound.volume = emitter.volume; }
emitter._babylonData!.sound = weightedSound;
});
{
this.state.isExpanded && !this.props.useEuler &&
<div>
this.updateStateX(value)} />
this.updateStateY(value)} />
this.updateStateZ(value)} />
</div>
}
{
this.state.isExpanded && this.props.useEuler &&
<div>
this.updateStateX(Tools.ToRadians(value))} />
this.updateStateY(Tools.ToRadians(value))} />
this.updateStateZ(Tools.ToRadians(value))} />
</div>
}
);
}
}
prepareDataToRead(value: number) {
if (this.props.useEuler) {
return Tools.ToDegrees(value);
}
return value;
}
let euler = this.state.eulerValue;
return (
<div>
<div>
<div>
{this.props.label}
</div>
<div>
{
!this.props.useEuler &&
`X: ${quat.x.toFixed(1)}, Y: ${quat.y.toFixed(1)}, Z: ${quat.z.toFixed(1)}, W: ${quat.w.toFixed(1)}`
}
{
this.props.useEuler &&
`X: ${Tools.ToDegrees(euler.x).toFixed(2)}, Y: ${Tools.ToDegrees(euler.y).toFixed(2)}, Z: ${Tools.ToDegrees(euler.z).toFixed(2)}`
}
</div>
<div> this.switchExpandState()}>
{chevron}
</div>
</div>
{
this.state.isExpanded && !this.props.useEuler &&
<div>
this.updateStateX(value)} />
this.updateStateY(value)} />
this.updateStateZ(value)} />
this.updateStateW(value)} />
</div>
}
{
</div>