@@ -31,43 +31,81 @@ import vertexShader from './shaders/vertex.glsl'
3131 * @expand
3232 */
3333export type GridProps = CommonComponentProps & {
34+ // which 2D plane to use for the grid (xz, xy or zy)
3435 plane : 'xz' | 'xy' | 'zy' ,
36+ // size of the grid plane in world units
3537 size : Vec2 ,
38+ // the size of a grid cell in world units
3639 cellSize ?: number ,
40+ // number of sub divisions of a grid cell
3741 subDivisions ?: number ,
42+ // world coordinates of the grid origin (origo)
3843 gridOrigin ?: Vec2 ,
44+ // scale determining axes values and direction along each axis
3945 gridScale ?: Vec2 ,
46+ // background color of the grid plane
4047 background ?: string | Color | number ,
48+ // opacity of the grid plane background color
4149 backgroundOpacity ?: number ,
50+ // opacity of the grid plane (including grid lines)
4251 opacity ?: number ,
52+ // the color of the major grid lines
4353 gridColorMajor ?: string | number | Color ,
54+ // the color of the minor/sub division grid lines
4455 gridColorMinor ?: string | number | Color ,
56+ // line width as a factor of the cell size
4557 gridLineWidth ?: number ,
58+ // show/hide axes including labels
4659 showAxes ?: boolean ,
60+ // show/hide axes labels if showAxes is true
4761 showAxesLabels ?: boolean ,
62+ // omit the first and last axis label if enabled
4863 trimAxesLabels ?: boolean ,
64+ // the relative offset of the axes in local coordinates
4965 axesOffset ?: Vec2 ,
66+ // axes color
5067 axesColor ?: string | number | Color ,
68+ // axes line width as a factor of cell size
5169 axesLineWidth ?: number ,
70+ // the axes tick size as a factor of cell size
5271 axesTickSize ?: number ,
72+ // the axes values at the specified origin (default 0,0)
5373 originValue ?: Vec2 ,
74+ // shows a radial grid if set to true
5475 radial ?: boolean ,
76+ // progressively adds new segments as distance from the center increases when using radial grid
5577 dynamicSegments ?: boolean ,
78+ // show rulers on the grid plane at the intersection point of the pointer
5679 showRulers ?: boolean ,
80+ // the color of the rulers
5781 rulerColor ?: string | number | Color ,
82+ // the ruler line width as a factor of the cell size
5883 rulerLineWidth ?: number ,
84+ // the ruler opacity
5985 rulerOpacity ?: number ,
86+ // offset along the axis perpendicular to the plane
6087 planeOffset ?: number ,
88+ // dynamically change cell size depending on camera distance (if set to true)
6189 dynamicCellSize ?: boolean ,
90+ // control thresholds and extremes when dynamic cell size is enabled
6291 cellSizeDistanceFactors ?: number [ ] [ ] ,
92+ // side to render
6393 side ?: 'front' | 'back' | 'both' ,
94+ // allow a texture to be added to the grid plane
6495 texture ?: Texture ,
96+ // mixing factor for blending texture (if present) with the grid plane (0..1)
6597 textureMix ?: number ,
98+ // if enabled, project a shade of the objects within range onto the grid plane, using an orthographic camera
6699 enableProjection ?: boolean ,
100+ // determines the range used for projecting objects onto the plane when enableProjection is set to true
67101 projectionDistance ?: number ,
102+ // the color of the projected shade when projection is enabled
68103 projectionColor ?: string | number | Color ,
104+ // the quality/size of the projection texture used when projection is enabled
69105 projectionResolution ?: number ,
106+ // the update frequency of the projected texture when projection is enabled (ms)
70107 projectionRefreshRate ?: number ,
108+ // callback function for retrieving the grid coordinates when grid rulers are enabled
71109 onRulerUpdate ?: ( ( coords : Vec2 | null ) => void ) | null ,
72110}
73111
0 commit comments