How to use the babylonjs/Misc/tools.Tools.ToDegrees function in babylonjs

To help you get started, we’ve selected a few babylonjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BabylonJS / Babylon.js / inspector / src / components / actionTabs / lines / vector3LineComponent.tsx View on Github external
const chevron = this.state.isExpanded ?  : 

        return (
            <div>
                <div>
                    <div>
                        {this.props.label}
                    </div>
                    <div>
                        {
                            !this.props.useEuler &amp;&amp;
                            `X: ${this.state.value.x.toFixed(2)}, Y: ${this.state.value.y.toFixed(2)}, Z: ${this.state.value.z.toFixed(2)}`
                        }
                        {
                            this.props.useEuler &amp;&amp;
                            `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"&gt;
                        {chevron}
                    </div>
                </div>
                {
                    this.state.isExpanded &amp;&amp; !this.props.useEuler &amp;&amp;
                    <div>
                         this.updateStateX(value)} /&gt;
                         this.updateStateY(value)} /&gt;
                         this.updateStateZ(value)} /&gt;
                    </div>
                }
                {
                    this.state.isExpanded &amp;&amp; this.props.useEuler &amp;&amp;
</div>
github BabylonJS / Babylon.js / inspector / src / components / actionTabs / lines / quaternionLineComponent.tsx View on Github external
{chevron}
                    
                
                {
                    this.state.isExpanded &amp;&amp; !this.props.useEuler &amp;&amp;
                    <div>
                         this.updateStateX(value)} /&gt;
                         this.updateStateY(value)} /&gt;
                         this.updateStateZ(value)} /&gt;
                         this.updateStateW(value)} /&gt;
                    </div>
                }
                {
                    this.state.isExpanded &amp;&amp; this.props.useEuler &amp;&amp;
                    <div>
                         this.updateStateEulerX(value)} /&gt;
                         this.updateStateEulerY(value)} /&gt;
                         this.updateStateEulerZ(value)} /&gt;
                    </div>
                }
            
        );
    }
}
github BabylonJS / Babylon.js / loaders / src / glTF / 2.0 / Extensions / MSFT_audio_emitter.ts View on Github external
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);
                            }
                        }
                    }));
                }
github BabylonJS / Babylon.js / loaders / src / glTF / 2.0 / Extensions / MSFT_audio_emitter.ts View on Github external
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;
            });
github BabylonJS / Babylon.js / loaders / src / glTF / 2.0 / Extensions / MSFT_audio_emitter.ts View on Github external
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;
            });
github BabylonJS / Babylon.js / inspector / src / components / actionTabs / lines / vector3LineComponent.tsx View on Github external
{
                    this.state.isExpanded &amp;&amp; !this.props.useEuler &amp;&amp;
                    <div>
                         this.updateStateX(value)} /&gt;
                         this.updateStateY(value)} /&gt;
                         this.updateStateZ(value)} /&gt;
                    </div>
                }
                {
                    this.state.isExpanded &amp;&amp; this.props.useEuler &amp;&amp;
                    <div>
                         this.updateStateX(Tools.ToRadians(value))} /&gt;
                         this.updateStateY(Tools.ToRadians(value))} /&gt;
                         this.updateStateZ(Tools.ToRadians(value))} /&gt;
                    </div>
                }
            
        );
    }
}
github BabylonJS / Babylon.js / inspector / src / components / actionTabs / lines / sliderLineComponent.tsx View on Github external
prepareDataToRead(value: number) {
        if (this.props.useEuler) {
            return Tools.ToDegrees(value);
        }

        return value;
    }
github BabylonJS / Babylon.js / inspector / src / components / actionTabs / lines / quaternionLineComponent.tsx View on Github external
let euler = this.state.eulerValue;

        return (
            <div>
                <div>
                    <div>
                        {this.props.label}
                    </div>
                    <div>
                        {
                            !this.props.useEuler &amp;&amp;
                            `X: ${quat.x.toFixed(1)}, Y: ${quat.y.toFixed(1)}, Z: ${quat.z.toFixed(1)}, W: ${quat.w.toFixed(1)}`
                        }
                        {
                            this.props.useEuler &amp;&amp;
                            `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()}&gt;
                        {chevron}
                    </div>
                </div>
                {
                    this.state.isExpanded &amp;&amp; !this.props.useEuler &amp;&amp;
                    <div>
                         this.updateStateX(value)} /&gt;
                         this.updateStateY(value)} /&gt;
                         this.updateStateZ(value)} /&gt;
                         this.updateStateW(value)} /&gt;
                    </div>
                }
                {
</div>