@antv/g-lite 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import type { CanvasContext } from './dom';
2
2
  import { GlobalRuntime } from './global-runtime';
3
3
  import type { RenderingPlugin } from './services';
4
- import type { RendererConfig } from './types';
4
+ import { ClipSpaceNearZ, RendererConfig } from './types';
5
5
  export interface RendererPlugin {
6
6
  name: string;
7
7
  context: CanvasContext;
@@ -18,6 +18,11 @@ export declare abstract class AbstractRendererPlugin<T = any> implements Rendere
18
18
  abstract destroy(runtime: GlobalRuntime): void;
19
19
  }
20
20
  export interface IRenderer {
21
+ /**
22
+ * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],
23
+ * which matches WebGPU/Vulkan/DirectX/Metal's clip volume, while [-1, 1] matches WebGL/OpenGL's clip volume.
24
+ */
25
+ clipSpaceNearZ: ClipSpaceNearZ;
21
26
  getConfig: () => RendererConfig;
22
27
  /**
23
28
  * register plugin at runtime
@@ -37,6 +42,7 @@ export interface IRenderer {
37
42
  getPlugins: () => RendererPlugin[];
38
43
  }
39
44
  export declare class AbstractRenderer implements IRenderer {
45
+ clipSpaceNearZ: ClipSpaceNearZ;
40
46
  private plugins;
41
47
  private config;
42
48
  constructor(config?: Partial<RendererConfig>);
@@ -3,7 +3,7 @@ import type { vec2 } from 'gl-matrix';
3
3
  import { mat4, vec3 } from 'gl-matrix';
4
4
  import type { Canvas } from '../Canvas';
5
5
  import { Frustum } from '../shapes';
6
- import type { TypeEasingFunction } from '../types';
6
+ import { ClipSpaceNearZ, TypeEasingFunction } from '../types';
7
7
  import type { Landmark } from './Landmark';
8
8
  import type { ICamera } from './interfaces';
9
9
  import { CameraProjectionMode, CameraTrackingMode, CameraType } from './interfaces';
@@ -19,39 +19,41 @@ import { CameraProjectionMode, CameraTrackingMode, CameraType } from './interfac
19
19
  */
20
20
  export declare class Camera implements ICamera {
21
21
  canvas: Canvas;
22
+ /**
23
+ * Clip space near Z, default to range `[-1, 1]`
24
+ */
25
+ clipSpaceNearZ: ClipSpaceNearZ;
22
26
  eventEmitter: EventEmitter<string | symbol, any>;
23
27
  /**
24
- * 相机矩阵
28
+ * Matrix of camera
25
29
  */
26
30
  protected matrix: mat4;
27
31
  /**
28
- * u 轴
32
+ * u axis +X is right
29
33
  * @see http://learnwebgl.brown37.net/07_cameras/camera_introduction.html#a-camera-definition
30
34
  */
31
35
  protected right: vec3;
32
36
  /**
33
- * v 轴 +Y is down
37
+ * v axis +Y is up
34
38
  */
35
39
  protected up: vec3;
36
40
  /**
37
- * n 轴 +Z is inside
41
+ * n axis +Z is inside
38
42
  */
39
43
  protected forward: vec3;
40
44
  /**
41
- * 相机位置
45
+ * Position of camera.
42
46
  */
43
47
  protected position: vec3;
44
48
  /**
45
- * 视点位置
49
+ * Position of focal point.
46
50
  */
47
51
  protected focalPoint: vec3;
48
52
  /**
49
- * 视点到相机位置的向量
50
- * focalPoint - position
53
+ * vector from focalPoint to position
51
54
  */
52
55
  protected distanceVector: vec3;
53
56
  /**
54
- * 相机位置到视点距离
55
57
  * length(focalPoint - position)
56
58
  */
57
59
  protected distance: number;
@@ -1,5 +1,5 @@
1
1
  import type { CurveArray, PathArray } from '@antv/util';
2
- import type { DisplayObject, ParsedPathStyleProps } from '../../display-objects';
2
+ import type { ParsedPathStyleProps } from '../../display-objects';
3
3
  import type { IElement } from '../../dom';
4
- export declare function parsePath(path: string | PathArray, object?: DisplayObject): ParsedPathStyleProps['path'];
4
+ export declare function parsePath(path: string | PathArray): ParsedPathStyleProps['path'];
5
5
  export declare function mergePaths(left: ParsedPathStyleProps['path'], right: ParsedPathStyleProps['path'], object?: IElement): [CurveArray, CurveArray, (b: CurveArray) => CurveArray];
@@ -24,6 +24,7 @@ export interface PathStyleProps extends BaseStyleProps {
24
24
  * offset relative to original position
25
25
  */
26
26
  markerEndOffset?: number;
27
+ isBillboard?: boolean;
27
28
  }
28
29
  export interface PathSegmentBBox {
29
30
  x: number;
@@ -86,6 +87,7 @@ export interface ParsedPathStyleProps extends ParsedBaseStyleProps {
86
87
  markerEnd?: DisplayObject | null;
87
88
  markerStartOffset?: number;
88
89
  markerEndOffset?: number;
90
+ isBillboard?: boolean;
89
91
  }
90
92
  export declare class Path extends DisplayObject<PathStyleProps, ParsedPathStyleProps> {
91
93
  private markerStartAngle;