1
- import { NgtMaterial } from 'angular-three' ;
1
+ import { NgtThreeElement } from 'angular-three' ;
2
2
import { getVersion } from 'angular-three-soba/misc' ;
3
3
import { shaderMaterial } from 'angular-three-soba/vanilla-exports' ;
4
- import { Color , ColorRepresentation , Side , Vector3 } from 'three' ;
4
+ import * as THREE from 'three' ;
5
5
6
6
export interface GridMaterialOptions {
7
7
/** Cell size, default: 0.5 */
8
8
cellSize : number ;
9
9
/** Cell thickness, default: 0.5 */
10
10
cellThickness : number ;
11
11
/** Cell color, default: black */
12
- cellColor : ColorRepresentation ;
12
+ cellColor : THREE . ColorRepresentation ;
13
13
/** Section size, default: 1 */
14
14
sectionSize : number ;
15
15
/** Section thickness, default: 1 */
16
16
sectionThickness : number ;
17
17
/** Section color, default: #2080ff */
18
- sectionColor : ColorRepresentation ;
18
+ sectionColor : THREE . ColorRepresentation ;
19
19
/** Follow camera, default: false */
20
20
followCamera : boolean ;
21
21
/** Display the grid infinitely, default: false */
@@ -27,7 +27,7 @@ export interface GridMaterialOptions {
27
27
/** Fade from camera (1) or origin (0), or somewhere in between, default: camera */
28
28
fadeFrom : number ;
29
29
/** Material side, default: THREE.BackSide */
30
- side : Side ;
30
+ side : THREE . Side ;
31
31
}
32
32
33
33
export const GridMaterial = shaderMaterial (
@@ -39,12 +39,12 @@ export const GridMaterial = shaderMaterial(
39
39
fadeFrom : 1 ,
40
40
cellThickness : 0.5 ,
41
41
sectionThickness : 1 ,
42
- cellColor : new Color ( ) ,
43
- sectionColor : new Color ( ) ,
42
+ cellColor : new THREE . Color ( ) ,
43
+ sectionColor : new THREE . Color ( ) ,
44
44
infiniteGrid : false ,
45
45
followCamera : false ,
46
- worldCamProjPosition : new Vector3 ( ) ,
47
- worldPlanePosition : new Vector3 ( ) ,
46
+ worldCamProjPosition : new THREE . Vector3 ( ) ,
47
+ worldPlanePosition : new THREE . Vector3 ( ) ,
48
48
} ,
49
49
/* language=glsl glsl */ `
50
50
varying vec3 localPosition;
@@ -110,7 +110,7 @@ export const GridMaterial = shaderMaterial(
110
110
` ,
111
111
) ;
112
112
113
- export type NgtGridMaterial = NgtMaterial < InstanceType < typeof GridMaterial > , [ GridMaterialOptions ] > ;
113
+ export type NgtGridMaterial = NgtThreeElement < typeof GridMaterial > ;
114
114
115
115
declare global {
116
116
interface HTMLElementTagNameMap {
0 commit comments