Skip to content

Commit

Permalink
fix: remove console.logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Greenemeier committed Jan 20, 2021
1 parent 116e1a1 commit fd63390
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/components/lights/PointLight.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
sceneCtx.scene.add(light);
onDestroy(() => {
console.log('removing light');
sceneCtx.scene.remove(light);
});
</script>
26 changes: 26 additions & 0 deletions src/components/materials/StandardMaterial.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script>
import { MeshStandardMaterial } from 'three';
import { setContext } from 'svelte';
import { writable } from 'svelte/store';
export let metalness = 0.8;
export let roughness = 0.2;
export let color = Math.random() * 0xffffff;
const material = new MeshStandardMaterial({
metalness,
roughness,
color,
...$$props,
});
setContext('material', material);
$: Object.entries($$props, ([key, val]) => {
update((mat) => {
mat[key] = val;
return mat;
});
});
</script>

<slot />
3 changes: 3 additions & 0 deletions src/components/materials/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import StandardMaterial from './StandardMaterial.svelte';

export { StandardMaterial };
1 change: 0 additions & 1 deletion src/documentation/pages/Cloner.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
spaceBetween =
medianSpaceBetween + Math.sin($time / 600) * spaceBetweenVariance;
}
$: console.log(spaceBetween);
</script>

<Scene {width} height={450} bind:time background="#67727e">
Expand Down

0 comments on commit fd63390

Please sign in to comment.