@predy-js/render-interface 0.3.4-beta.5 → 0.3.4-beta.52
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.
- package/dist/index.js +35 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -10
- package/dist/index.mjs.map +1 -1
- package/dist/statistic.js +1 -1
- package/dist/types/Texture.d.ts +2 -0
- package/dist/types/native/GPUBufferInternal.d.ts +1 -0
- package/dist/types/native/PredyNativeInternal.d.ts +2 -0
- package/dist/types/native/index.d.ts +1 -0
- package/dist/types/native/motion.d.ts +15 -0
- package/package.json +1 -1
- package/types/Texture.ts +2 -0
- package/types/native/DataBlockInternal.ts +3 -0
- package/types/native/GPUBufferInternal.ts +1 -0
- package/types/native/PredyNativeInternal.ts +4 -0
- package/types/native/index.ts +1 -0
- package/types/native/motion.ts +21 -0
package/dist/statistic.js
CHANGED
package/dist/types/Texture.d.ts
CHANGED
@@ -147,6 +147,7 @@ export interface Texture2DSourceOptionsImageMipmaps extends TextureOptionsBase {
|
|
147
147
|
height: number;
|
148
148
|
}>;
|
149
149
|
target?: WebGLRenderingContext['TEXTURE_2D'];
|
150
|
+
generateMipmap?: boolean;
|
150
151
|
}
|
151
152
|
export interface Texture2DSourceOptionsCompressed extends TextureOptionsBase {
|
152
153
|
sourceType: TextureSourceType.compressed;
|
@@ -167,6 +168,7 @@ export interface TextureCubeSourceOptionsImageMipmaps extends TextureOptionsBase
|
|
167
168
|
sourceType: TextureSourceType.mipmaps;
|
168
169
|
mipmaps: Array<TextureSourceCubeData>;
|
169
170
|
target: WebGLRenderingContext['TEXTURE_CUBE_MAP'];
|
171
|
+
generateMipmap?: boolean;
|
170
172
|
}
|
171
173
|
export type TextureCubeSourceURLMap = [
|
172
174
|
TEXTURE_CUBE_MAP_POSITIVE_X: string,
|
@@ -6,6 +6,7 @@ import type { ImageBitmapInternal } from './ImageBitmapInternal';
|
|
6
6
|
import type { PredyVideoDecoder, PredyVideoDecoderConstructor } from './VideoDecoder';
|
7
7
|
import type { ResourcePlatform } from './ResourceInternal';
|
8
8
|
import type { PredyVideoCodec, PredyTextEncoding, PredyResourceCacheStatus } from '../constants';
|
9
|
+
import type { MotionOrientationManager } from './motion';
|
9
10
|
export interface PredyRequestOptions {
|
10
11
|
url: string;
|
11
12
|
disableCache?: boolean;
|
@@ -94,6 +95,7 @@ export interface PredyNativeInternal {
|
|
94
95
|
* @param codec
|
95
96
|
*/
|
96
97
|
supportVideoCodec(codec: PredyVideoCodec): boolean;
|
98
|
+
createOrientationManager(): MotionOrientationManager;
|
97
99
|
}
|
98
100
|
type renderSDFImageCallback = (img: SDFImage) => void;
|
99
101
|
export {};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import type { vec3 } from '../type';
|
2
|
+
export interface OrientationData {
|
3
|
+
timestamp: number;
|
4
|
+
orientation: Float32Array | vec3;
|
5
|
+
}
|
6
|
+
export interface MotionStartOptions {
|
7
|
+
fps?: number;
|
8
|
+
}
|
9
|
+
type MotionStartCallback = (success: boolean, error?: string) => void;
|
10
|
+
export declare abstract class MotionOrientationManager {
|
11
|
+
motionCallback?: (motion: OrientationData) => void;
|
12
|
+
abstract start(options: MotionStartOptions, callback?: MotionStartCallback): void;
|
13
|
+
abstract destroy(): void;
|
14
|
+
}
|
15
|
+
export {};
|
package/package.json
CHANGED
package/types/Texture.ts
CHANGED
@@ -183,6 +183,7 @@ export interface Texture2DSourceOptionsImageMipmaps extends TextureOptionsBase {
|
|
183
183
|
sourceType: TextureSourceType.mipmaps,
|
184
184
|
mipmaps: Array<ImageSource | { data: TypedArray, width: number, height: number }>,
|
185
185
|
target?: WebGLRenderingContext['TEXTURE_2D'],
|
186
|
+
generateMipmap?: boolean,
|
186
187
|
}
|
187
188
|
|
188
189
|
export interface Texture2DSourceOptionsCompressed extends TextureOptionsBase {
|
@@ -202,6 +203,7 @@ export interface TextureCubeSourceOptionsImageMipmaps extends TextureOptionsBase
|
|
202
203
|
sourceType: TextureSourceType.mipmaps,
|
203
204
|
mipmaps: Array<TextureSourceCubeData>,
|
204
205
|
target: WebGLRenderingContext['TEXTURE_CUBE_MAP'],
|
206
|
+
generateMipmap?: boolean,
|
205
207
|
}
|
206
208
|
|
207
209
|
export type TextureCubeSourceURLMap = [
|
@@ -21,6 +21,9 @@ export abstract class DataBlockInternal implements ResourceInternal {
|
|
21
21
|
|
22
22
|
protected constructor (options: DataBlockInternalOptions) {}
|
23
23
|
|
24
|
+
//todo
|
25
|
+
// setUniformValues (uniforms: Record<string, TypedArray>): void;
|
26
|
+
|
24
27
|
abstract destroy (): void;
|
25
28
|
|
26
29
|
/**
|
@@ -6,6 +6,7 @@ import type { ImageBitmapInternal } from './ImageBitmapInternal';
|
|
6
6
|
import type { PredyVideoDecoder, PredyVideoDecoderConstructor } from './VideoDecoder';
|
7
7
|
import type { ResourcePlatform } from './ResourceInternal';
|
8
8
|
import type { PredyVideoCodec, PredyTextEncoding, PredyResourceCacheStatus } from '../constants';
|
9
|
+
import type { MotionOrientationManager } from './motion';
|
9
10
|
|
10
11
|
export interface PredyRequestOptions {
|
11
12
|
url: string,
|
@@ -110,6 +111,9 @@ export interface PredyNativeInternal {
|
|
110
111
|
* @param codec
|
111
112
|
*/
|
112
113
|
supportVideoCodec(codec: PredyVideoCodec): boolean,
|
114
|
+
|
115
|
+
createOrientationManager(): MotionOrientationManager,
|
116
|
+
|
113
117
|
}
|
114
118
|
|
115
119
|
type renderSDFImageCallback = (img: SDFImage) => void;
|
package/types/native/index.ts
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
import type { vec3 } from '../type';
|
2
|
+
|
3
|
+
export interface OrientationData {
|
4
|
+
timestamp: number,
|
5
|
+
orientation: Float32Array | vec3,
|
6
|
+
}
|
7
|
+
|
8
|
+
export interface MotionStartOptions {
|
9
|
+
fps?: number,
|
10
|
+
}
|
11
|
+
|
12
|
+
type MotionStartCallback = (success: boolean, error?: string) => void;
|
13
|
+
|
14
|
+
export abstract class MotionOrientationManager {
|
15
|
+
// 设置数据监听的回调
|
16
|
+
motionCallback?: (motion: OrientationData) => void;
|
17
|
+
// start 之后开始监听事件
|
18
|
+
abstract start (options: MotionStartOptions, callback?: MotionStartCallback): void;
|
19
|
+
// 停止并销毁
|
20
|
+
abstract destroy (): void;
|
21
|
+
}
|