@iwsdk/core 0.2.2 → 0.3.1
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/README.md +94 -0
- package/dist/asset/loaders/hdr-texture-loader.d.ts +1 -1
- package/dist/asset/loaders/hdr-texture-loader.d.ts.map +1 -1
- package/dist/asset/loaders/hdr-texture-loader.js +4 -4
- package/dist/asset/loaders/hdr-texture-loader.js.map +1 -1
- package/dist/audio/audio-system.d.ts +6 -2
- package/dist/audio/audio-system.d.ts.map +1 -1
- package/dist/audio/audio-system.js +1 -0
- package/dist/audio/audio-system.js.map +1 -1
- package/dist/audio/audio.d.ts +3 -1
- package/dist/audio/audio.d.ts.map +1 -1
- package/dist/audio/audio.js +8 -2
- package/dist/audio/audio.js.map +1 -1
- package/dist/camera/camera-source.js +1 -0
- package/dist/camera/camera-source.js.map +1 -1
- package/dist/camera/camera-system.d.ts.map +1 -1
- package/dist/camera/camera-system.js +1 -0
- package/dist/camera/camera-system.js.map +1 -1
- package/dist/camera/camera-utils.d.ts.map +1 -1
- package/dist/camera/camera-utils.js.map +1 -1
- package/dist/depth/depth-occludable.d.ts +48 -0
- package/dist/depth/depth-occludable.d.ts.map +1 -0
- package/dist/depth/depth-occludable.js +48 -0
- package/dist/depth/depth-occludable.js.map +1 -0
- package/dist/depth/depth-sensing-system.d.ts +164 -0
- package/dist/depth/depth-sensing-system.d.ts.map +1 -0
- package/dist/depth/depth-sensing-system.js +453 -0
- package/dist/depth/depth-sensing-system.js.map +1 -0
- package/dist/depth/depth-textures.d.ts +53 -0
- package/dist/depth/depth-textures.d.ts.map +1 -0
- package/dist/depth/depth-textures.js +114 -0
- package/dist/depth/depth-textures.js.map +1 -0
- package/dist/depth/index.d.ts +10 -0
- package/dist/depth/index.d.ts.map +1 -0
- package/dist/depth/occlusion/preprocessing-pass.d.ts +52 -0
- package/dist/depth/occlusion/preprocessing-pass.d.ts.map +1 -0
- package/dist/depth/occlusion/preprocessing-pass.js +105 -0
- package/dist/depth/occlusion/preprocessing-pass.js.map +1 -0
- package/dist/depth/occlusion/preprocessing-shader.glsl.d.ts +22 -0
- package/dist/depth/occlusion/preprocessing-shader.glsl.d.ts.map +1 -0
- package/dist/depth/occlusion/preprocessing-shader.glsl.js +115 -0
- package/dist/depth/occlusion/preprocessing-shader.glsl.js.map +1 -0
- package/dist/ecs/entity.d.ts +17 -1
- package/dist/ecs/entity.d.ts.map +1 -1
- package/dist/ecs/entity.js +7 -1
- package/dist/ecs/entity.js.map +1 -1
- package/dist/ecs/world.d.ts +12 -0
- package/dist/ecs/world.d.ts.map +1 -1
- package/dist/ecs/world.js +47 -3
- package/dist/ecs/world.js.map +1 -1
- package/dist/environment/dome-gradient.js +1 -0
- package/dist/environment/dome-gradient.js.map +1 -1
- package/dist/environment/dome-texture.d.ts +3 -1
- package/dist/environment/dome-texture.d.ts.map +1 -1
- package/dist/environment/dome-texture.js +7 -1
- package/dist/environment/dome-texture.js.map +1 -1
- package/dist/environment/environment-system.d.ts +8 -0
- package/dist/environment/environment-system.d.ts.map +1 -1
- package/dist/environment/environment-system.js +78 -2
- package/dist/environment/environment-system.js.map +1 -1
- package/dist/environment/ibl-gradient.js +1 -0
- package/dist/environment/ibl-gradient.js.map +1 -1
- package/dist/environment/ibl-texture.d.ts +3 -1
- package/dist/environment/ibl-texture.d.ts.map +1 -1
- package/dist/environment/ibl-texture.js +7 -1
- package/dist/environment/ibl-texture.js.map +1 -1
- package/dist/environment-raycast/environment-raycast.d.ts +136 -0
- package/dist/environment-raycast/environment-raycast.d.ts.map +1 -0
- package/dist/environment-raycast/environment-raycast.js +333 -0
- package/dist/environment-raycast/environment-raycast.js.map +1 -0
- package/dist/environment-raycast/index.d.ts +9 -0
- package/dist/environment-raycast/index.d.ts.map +1 -0
- package/dist/environment-raycast/raycast-target.d.ts +114 -0
- package/dist/environment-raycast/raycast-target.d.ts.map +1 -0
- package/dist/environment-raycast/raycast-target.js +84 -0
- package/dist/environment-raycast/raycast-target.js.map +1 -0
- package/dist/grab/distance-grabbable.d.ts +27 -2
- package/dist/grab/distance-grabbable.d.ts.map +1 -1
- package/dist/grab/distance-grabbable.js +25 -2
- package/dist/grab/distance-grabbable.js.map +1 -1
- package/dist/grab/grab-system.d.ts +106 -61
- package/dist/grab/grab-system.d.ts.map +1 -1
- package/dist/grab/grab-system.js +61 -10
- package/dist/grab/grab-system.js.map +1 -1
- package/dist/grab/handles.d.ts +14 -4
- package/dist/grab/handles.d.ts.map +1 -1
- package/dist/grab/handles.js +45 -18
- package/dist/grab/handles.js.map +1 -1
- package/dist/grab/index.d.ts +0 -1
- package/dist/grab/index.d.ts.map +1 -1
- package/dist/grab/index.js +0 -2
- package/dist/grab/index.js.map +1 -1
- package/dist/grab/one-hand-grabbable.js +1 -0
- package/dist/grab/one-hand-grabbable.js.map +1 -1
- package/dist/grab/two-hands-grabbable.js +1 -0
- package/dist/grab/two-hands-grabbable.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/init/world-initializer.d.ts +13 -1
- package/dist/init/world-initializer.d.ts.map +1 -1
- package/dist/init/world-initializer.js +78 -18
- package/dist/init/world-initializer.js.map +1 -1
- package/dist/init/xr.d.ts +1 -0
- package/dist/init/xr.d.ts.map +1 -1
- package/dist/init/xr.js +6 -0
- package/dist/init/xr.js.map +1 -1
- package/dist/input/input-system.d.ts +409 -5
- package/dist/input/input-system.d.ts.map +1 -1
- package/dist/input/input-system.js +166 -32
- package/dist/input/input-system.js.map +1 -1
- package/dist/input/state-tags.d.ts +32 -15
- package/dist/input/state-tags.d.ts.map +1 -1
- package/dist/input/state-tags.js +34 -16
- package/dist/input/state-tags.js.map +1 -1
- package/dist/level/level-entity-creator.js +1 -0
- package/dist/level/level-entity-creator.js.map +1 -1
- package/dist/level/level-root.js +1 -0
- package/dist/level/level-root.js.map +1 -1
- package/dist/level/level-system.js +1 -0
- package/dist/level/level-system.js.map +1 -1
- package/dist/level/level-tag.js +1 -0
- package/dist/level/level-tag.js.map +1 -1
- package/dist/locomotion/locomotion.d.ts +10 -0
- package/dist/locomotion/locomotion.d.ts.map +1 -1
- package/dist/locomotion/locomotion.js +17 -1
- package/dist/locomotion/locomotion.js.map +1 -1
- package/dist/locomotion/slide.d.ts +10 -0
- package/dist/locomotion/slide.d.ts.map +1 -1
- package/dist/locomotion/slide.js +6 -2
- package/dist/locomotion/slide.js.map +1 -1
- package/dist/locomotion/teleport.js +1 -0
- package/dist/locomotion/teleport.js.map +1 -1
- package/dist/mcp/ecs-debug-tools.d.ts +167 -0
- package/dist/mcp/ecs-debug-tools.d.ts.map +1 -0
- package/dist/mcp/ecs-debug-tools.js +602 -0
- package/dist/mcp/ecs-debug-tools.js.map +1 -0
- package/dist/mcp/index.d.ts +10 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/mcp-runtime.d.ts +31 -0
- package/dist/mcp/mcp-runtime.d.ts.map +1 -0
- package/dist/mcp/mcp-runtime.js +85 -0
- package/dist/mcp/mcp-runtime.js.map +1 -0
- package/dist/mcp/scene-tools.d.ts +41 -0
- package/dist/mcp/scene-tools.d.ts.map +1 -0
- package/dist/mcp/scene-tools.js +95 -0
- package/dist/mcp/scene-tools.js.map +1 -0
- package/dist/physics/physics-system.d.ts +1 -1
- package/dist/physics/physics-system.d.ts.map +1 -1
- package/dist/physics/physics-system.js +9 -4
- package/dist/physics/physics-system.js.map +1 -1
- package/dist/physics/utils.d.ts.map +1 -1
- package/dist/physics/utils.js +1 -1
- package/dist/scene-understanding/anchor.js +1 -0
- package/dist/scene-understanding/anchor.js.map +1 -1
- package/dist/scene-understanding/mesh.js +1 -0
- package/dist/scene-understanding/mesh.js.map +1 -1
- package/dist/scene-understanding/plane.js +1 -0
- package/dist/scene-understanding/plane.js.map +1 -1
- package/dist/scene-understanding/scene-understanding-system.d.ts +0 -39
- package/dist/scene-understanding/scene-understanding-system.d.ts.map +1 -1
- package/dist/scene-understanding/scene-understanding-system.js +10 -2
- package/dist/scene-understanding/scene-understanding-system.js.map +1 -1
- package/dist/transform/index.d.ts +2 -0
- package/dist/transform/index.d.ts.map +1 -1
- package/dist/transform/synced-euler.d.ts +62 -0
- package/dist/transform/synced-euler.d.ts.map +1 -0
- package/dist/transform/synced-euler.js +212 -0
- package/dist/transform/synced-euler.js.map +1 -0
- package/dist/transform/synced-quaternion.d.ts +11 -0
- package/dist/transform/synced-quaternion.d.ts.map +1 -1
- package/dist/transform/synced-quaternion.js +29 -0
- package/dist/transform/synced-quaternion.js.map +1 -1
- package/dist/transform/transform-utils.d.ts +24 -0
- package/dist/transform/transform-utils.d.ts.map +1 -0
- package/dist/transform/transform-utils.js +53 -0
- package/dist/transform/transform-utils.js.map +1 -0
- package/dist/transform/transform.d.ts.map +1 -1
- package/dist/transform/transform.js +19 -2
- package/dist/transform/transform.js.map +1 -1
- package/dist/ui/follow.js +1 -0
- package/dist/ui/follow.js.map +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/screenspace.js +1 -0
- package/dist/ui/screenspace.js.map +1 -1
- package/dist/ui/ui.d.ts.map +1 -1
- package/dist/ui/ui.js +2 -8
- package/dist/ui/ui.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/visibility/visibility.d.ts.map +1 -1
- package/dist/visibility/visibility.js +4 -1
- package/dist/visibility/visibility.js.map +1 -1
- package/package.json +16 -9
- package/dist/node_modules/.pnpm/@pmndrs_uikitml@0.1.7_super-three@0.177.0/node_modules/@pmndrs/uikitml/dist/interpreter/html.js +0 -128
- package/dist/node_modules/.pnpm/@pmndrs_uikitml@0.1.7_super-three@0.177.0/node_modules/@pmndrs/uikitml/dist/interpreter/html.js.map +0 -1
- package/dist/node_modules/.pnpm/@pmndrs_uikitml@0.1.7_super-three@0.177.0/node_modules/@pmndrs/uikitml/dist/interpreter/index.js +0 -161
- package/dist/node_modules/.pnpm/@pmndrs_uikitml@0.1.7_super-three@0.177.0/node_modules/@pmndrs/uikitml/dist/interpreter/index.js.map +0 -1
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/error-codes.js +0 -66
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/error-codes.js.map +0 -1
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/foreign-content.js +0 -162
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/foreign-content.js.map +0 -1
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/html.js +0 -519
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/html.js.map +0 -1
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/token.js +0 -15
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/token.js.map +0 -1
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/unicode.js +0 -32
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/unicode.js.map +0 -1
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/formatting-element-list.js +0 -10
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/formatting-element-list.js.map +0 -1
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/index.js +0 -41
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/index.js.map +0 -1
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/open-element-stack.js +0 -35
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/open-element-stack.js.map +0 -1
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/serializer/index.js +0 -24
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/serializer/index.js.map +0 -1
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/tokenizer/index.js +0 -92
- package/dist/node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/tokenizer/index.js.map +0 -1
- package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/examples/jsm/libs/fflate.module.js +0 -382
- package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/examples/jsm/libs/fflate.module.js.map +0 -1
- package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/examples/jsm/loaders/EXRLoader.js +0 -2587
- package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/examples/jsm/loaders/EXRLoader.js.map +0 -1
- package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/examples/jsm/loaders/RGBELoader.js +0 -477
- package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/examples/jsm/loaders/RGBELoader.js.map +0 -1
- package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/src/math/MathUtils.js +0 -17
- package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/src/math/MathUtils.js.map +0 -1
|
@@ -1,477 +0,0 @@
|
|
|
1
|
-
import { DataTextureLoader, HalfFloatType, FloatType, DataUtils, LinearSRGBColorSpace, LinearFilter } from 'three';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A loader for the RGBE HDR texture format.
|
|
5
|
-
*
|
|
6
|
-
* ```js
|
|
7
|
-
* const loader = new RGBELoader();
|
|
8
|
-
* const envMap = await loader.loadAsync( 'textures/equirectangular/blouberg_sunrise_2_1k.hdr' );
|
|
9
|
-
* envMap.mapping = THREE.EquirectangularReflectionMapping;
|
|
10
|
-
*
|
|
11
|
-
* scene.environment = envMap;
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* @augments DataTextureLoader
|
|
15
|
-
* @three_import import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
|
|
16
|
-
*/
|
|
17
|
-
class RGBELoader extends DataTextureLoader {
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Constructs a new RGBE loader.
|
|
21
|
-
*
|
|
22
|
-
* @param {LoadingManager} [manager] - The loading manager.
|
|
23
|
-
*/
|
|
24
|
-
constructor( manager ) {
|
|
25
|
-
|
|
26
|
-
super( manager );
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* The texture type.
|
|
30
|
-
*
|
|
31
|
-
* @type {(HalfFloatType|FloatType)}
|
|
32
|
-
* @default HalfFloatType
|
|
33
|
-
*/
|
|
34
|
-
this.type = HalfFloatType;
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Parses the given RGBE texture data.
|
|
40
|
-
*
|
|
41
|
-
* @param {ArrayBuffer} buffer - The raw texture data.
|
|
42
|
-
* @return {DataTextureLoader~TexData} An object representing the parsed texture data.
|
|
43
|
-
*/
|
|
44
|
-
parse( buffer ) {
|
|
45
|
-
|
|
46
|
-
// adapted from http://www.graphics.cornell.edu/~bjw/rgbe.html
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
/* default error routine. change this to change error handling */
|
|
50
|
-
rgbe_read_error = 1,
|
|
51
|
-
rgbe_write_error = 2,
|
|
52
|
-
rgbe_format_error = 3,
|
|
53
|
-
rgbe_memory_error = 4,
|
|
54
|
-
rgbe_error = function ( rgbe_error_code, msg ) {
|
|
55
|
-
|
|
56
|
-
switch ( rgbe_error_code ) {
|
|
57
|
-
|
|
58
|
-
case rgbe_read_error: throw new Error( 'THREE.RGBELoader: Read Error: ' + ( msg || '' ) );
|
|
59
|
-
case rgbe_write_error: throw new Error( 'THREE.RGBELoader: Write Error: ' + ( msg || '' ) );
|
|
60
|
-
case rgbe_format_error: throw new Error( 'THREE.RGBELoader: Bad File Format: ' + ( msg || '' ) );
|
|
61
|
-
default:
|
|
62
|
-
case rgbe_memory_error: throw new Error( 'THREE.RGBELoader: Memory Error: ' + ( msg || '' ) );
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
/* offsets to red, green, and blue components in a data (float) pixel */
|
|
69
|
-
//RGBE_DATA_RED = 0,
|
|
70
|
-
//RGBE_DATA_GREEN = 1,
|
|
71
|
-
//RGBE_DATA_BLUE = 2,
|
|
72
|
-
|
|
73
|
-
/* number of floats per pixel, use 4 since stored in rgba image format */
|
|
74
|
-
//RGBE_DATA_SIZE = 4,
|
|
75
|
-
|
|
76
|
-
/* flags indicating which fields in an rgbe_header_info are valid */
|
|
77
|
-
RGBE_VALID_PROGRAMTYPE = 1,
|
|
78
|
-
RGBE_VALID_FORMAT = 2,
|
|
79
|
-
RGBE_VALID_DIMENSIONS = 4,
|
|
80
|
-
|
|
81
|
-
NEWLINE = '\n',
|
|
82
|
-
|
|
83
|
-
fgets = function ( buffer, lineLimit, consume ) {
|
|
84
|
-
|
|
85
|
-
const chunkSize = 128;
|
|
86
|
-
|
|
87
|
-
lineLimit = ! lineLimit ? 1024 : lineLimit;
|
|
88
|
-
let p = buffer.pos,
|
|
89
|
-
i = -1, len = 0, s = '',
|
|
90
|
-
chunk = String.fromCharCode.apply( null, new Uint16Array( buffer.subarray( p, p + chunkSize ) ) );
|
|
91
|
-
|
|
92
|
-
while ( ( 0 > ( i = chunk.indexOf( NEWLINE ) ) ) && ( len < lineLimit ) && ( p < buffer.byteLength ) ) {
|
|
93
|
-
|
|
94
|
-
s += chunk; len += chunk.length;
|
|
95
|
-
p += chunkSize;
|
|
96
|
-
chunk += String.fromCharCode.apply( null, new Uint16Array( buffer.subarray( p, p + chunkSize ) ) );
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
if ( -1 < i ) {
|
|
101
|
-
|
|
102
|
-
/*for (i=l-1; i>=0; i--) {
|
|
103
|
-
byteCode = m.charCodeAt(i);
|
|
104
|
-
if (byteCode > 0x7f && byteCode <= 0x7ff) byteLen++;
|
|
105
|
-
else if (byteCode > 0x7ff && byteCode <= 0xffff) byteLen += 2;
|
|
106
|
-
if (byteCode >= 0xDC00 && byteCode <= 0xDFFF) i--; //trail surrogate
|
|
107
|
-
}*/
|
|
108
|
-
buffer.pos += len + i + 1;
|
|
109
|
-
return s + chunk.slice( 0, i );
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return false;
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
/* minimal header reading. modify if you want to parse more information */
|
|
118
|
-
RGBE_ReadHeader = function ( buffer ) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
// regexes to parse header info fields
|
|
122
|
-
const magic_token_re = /^#\?(\S+)/,
|
|
123
|
-
gamma_re = /^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,
|
|
124
|
-
exposure_re = /^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,
|
|
125
|
-
format_re = /^\s*FORMAT=(\S+)\s*$/,
|
|
126
|
-
dimensions_re = /^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,
|
|
127
|
-
|
|
128
|
-
// RGBE format header struct
|
|
129
|
-
header = {
|
|
130
|
-
|
|
131
|
-
valid: 0, /* indicate which fields are valid */
|
|
132
|
-
|
|
133
|
-
string: '', /* the actual header string */
|
|
134
|
-
|
|
135
|
-
comments: '', /* comments found in header */
|
|
136
|
-
|
|
137
|
-
programtype: 'RGBE', /* listed at beginning of file to identify it after "#?". defaults to "RGBE" */
|
|
138
|
-
|
|
139
|
-
format: '', /* RGBE format, default 32-bit_rle_rgbe */
|
|
140
|
-
|
|
141
|
-
gamma: 1.0, /* image has already been gamma corrected with given gamma. defaults to 1.0 (no correction) */
|
|
142
|
-
|
|
143
|
-
exposure: 1.0, /* a value of 1.0 in an image corresponds to <exposure> watts/steradian/m^2. defaults to 1.0 */
|
|
144
|
-
|
|
145
|
-
width: 0, height: 0 /* image dimensions, width/height */
|
|
146
|
-
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
let line, match;
|
|
150
|
-
|
|
151
|
-
if ( buffer.pos >= buffer.byteLength || ! ( line = fgets( buffer ) ) ) {
|
|
152
|
-
|
|
153
|
-
rgbe_error( rgbe_read_error, 'no header found' );
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/* if you want to require the magic token then uncomment the next line */
|
|
158
|
-
if ( ! ( match = line.match( magic_token_re ) ) ) {
|
|
159
|
-
|
|
160
|
-
rgbe_error( rgbe_format_error, 'bad initial token' );
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
header.valid |= RGBE_VALID_PROGRAMTYPE;
|
|
165
|
-
header.programtype = match[ 1 ];
|
|
166
|
-
header.string += line + '\n';
|
|
167
|
-
|
|
168
|
-
while ( true ) {
|
|
169
|
-
|
|
170
|
-
line = fgets( buffer );
|
|
171
|
-
if ( false === line ) break;
|
|
172
|
-
header.string += line + '\n';
|
|
173
|
-
|
|
174
|
-
if ( '#' === line.charAt( 0 ) ) {
|
|
175
|
-
|
|
176
|
-
header.comments += line + '\n';
|
|
177
|
-
continue; // comment line
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
if ( match = line.match( gamma_re ) ) {
|
|
182
|
-
|
|
183
|
-
header.gamma = parseFloat( match[ 1 ] );
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
if ( match = line.match( exposure_re ) ) {
|
|
188
|
-
|
|
189
|
-
header.exposure = parseFloat( match[ 1 ] );
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
if ( match = line.match( format_re ) ) {
|
|
194
|
-
|
|
195
|
-
header.valid |= RGBE_VALID_FORMAT;
|
|
196
|
-
header.format = match[ 1 ];//'32-bit_rle_rgbe';
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
if ( match = line.match( dimensions_re ) ) {
|
|
201
|
-
|
|
202
|
-
header.valid |= RGBE_VALID_DIMENSIONS;
|
|
203
|
-
header.height = parseInt( match[ 1 ], 10 );
|
|
204
|
-
header.width = parseInt( match[ 2 ], 10 );
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
if ( ( header.valid & RGBE_VALID_FORMAT ) && ( header.valid & RGBE_VALID_DIMENSIONS ) ) break;
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
if ( ! ( header.valid & RGBE_VALID_FORMAT ) ) {
|
|
213
|
-
|
|
214
|
-
rgbe_error( rgbe_format_error, 'missing format specifier' );
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
if ( ! ( header.valid & RGBE_VALID_DIMENSIONS ) ) {
|
|
219
|
-
|
|
220
|
-
rgbe_error( rgbe_format_error, 'missing image size specifier' );
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
return header;
|
|
225
|
-
|
|
226
|
-
},
|
|
227
|
-
|
|
228
|
-
RGBE_ReadPixels_RLE = function ( buffer, w, h ) {
|
|
229
|
-
|
|
230
|
-
const scanline_width = w;
|
|
231
|
-
|
|
232
|
-
if (
|
|
233
|
-
// run length encoding is not allowed so read flat
|
|
234
|
-
( ( scanline_width < 8 ) || ( scanline_width > 0x7fff ) ) ||
|
|
235
|
-
// this file is not run length encoded
|
|
236
|
-
( ( 2 !== buffer[ 0 ] ) || ( 2 !== buffer[ 1 ] ) || ( buffer[ 2 ] & 0x80 ) )
|
|
237
|
-
) {
|
|
238
|
-
|
|
239
|
-
// return the flat buffer
|
|
240
|
-
return new Uint8Array( buffer );
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
if ( scanline_width !== ( ( buffer[ 2 ] << 8 ) | buffer[ 3 ] ) ) {
|
|
245
|
-
|
|
246
|
-
rgbe_error( rgbe_format_error, 'wrong scanline width' );
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
const data_rgba = new Uint8Array( 4 * w * h );
|
|
251
|
-
|
|
252
|
-
if ( ! data_rgba.length ) {
|
|
253
|
-
|
|
254
|
-
rgbe_error( rgbe_memory_error, 'unable to allocate buffer space' );
|
|
255
|
-
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
let offset = 0, pos = 0;
|
|
259
|
-
|
|
260
|
-
const ptr_end = 4 * scanline_width;
|
|
261
|
-
const rgbeStart = new Uint8Array( 4 );
|
|
262
|
-
const scanline_buffer = new Uint8Array( ptr_end );
|
|
263
|
-
let num_scanlines = h;
|
|
264
|
-
|
|
265
|
-
// read in each successive scanline
|
|
266
|
-
while ( ( num_scanlines > 0 ) && ( pos < buffer.byteLength ) ) {
|
|
267
|
-
|
|
268
|
-
if ( pos + 4 > buffer.byteLength ) {
|
|
269
|
-
|
|
270
|
-
rgbe_error( rgbe_read_error );
|
|
271
|
-
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
rgbeStart[ 0 ] = buffer[ pos ++ ];
|
|
275
|
-
rgbeStart[ 1 ] = buffer[ pos ++ ];
|
|
276
|
-
rgbeStart[ 2 ] = buffer[ pos ++ ];
|
|
277
|
-
rgbeStart[ 3 ] = buffer[ pos ++ ];
|
|
278
|
-
|
|
279
|
-
if ( ( 2 != rgbeStart[ 0 ] ) || ( 2 != rgbeStart[ 1 ] ) || ( ( ( rgbeStart[ 2 ] << 8 ) | rgbeStart[ 3 ] ) != scanline_width ) ) {
|
|
280
|
-
|
|
281
|
-
rgbe_error( rgbe_format_error, 'bad rgbe scanline format' );
|
|
282
|
-
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
// read each of the four channels for the scanline into the buffer
|
|
286
|
-
// first red, then green, then blue, then exponent
|
|
287
|
-
let ptr = 0, count;
|
|
288
|
-
|
|
289
|
-
while ( ( ptr < ptr_end ) && ( pos < buffer.byteLength ) ) {
|
|
290
|
-
|
|
291
|
-
count = buffer[ pos ++ ];
|
|
292
|
-
const isEncodedRun = count > 128;
|
|
293
|
-
if ( isEncodedRun ) count -= 128;
|
|
294
|
-
|
|
295
|
-
if ( ( 0 === count ) || ( ptr + count > ptr_end ) ) {
|
|
296
|
-
|
|
297
|
-
rgbe_error( rgbe_format_error, 'bad scanline data' );
|
|
298
|
-
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
if ( isEncodedRun ) {
|
|
302
|
-
|
|
303
|
-
// a (encoded) run of the same value
|
|
304
|
-
const byteValue = buffer[ pos ++ ];
|
|
305
|
-
for ( let i = 0; i < count; i ++ ) {
|
|
306
|
-
|
|
307
|
-
scanline_buffer[ ptr ++ ] = byteValue;
|
|
308
|
-
|
|
309
|
-
}
|
|
310
|
-
//ptr += count;
|
|
311
|
-
|
|
312
|
-
} else {
|
|
313
|
-
|
|
314
|
-
// a literal-run
|
|
315
|
-
scanline_buffer.set( buffer.subarray( pos, pos + count ), ptr );
|
|
316
|
-
ptr += count; pos += count;
|
|
317
|
-
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
// now convert data from buffer into rgba
|
|
324
|
-
// first red, then green, then blue, then exponent (alpha)
|
|
325
|
-
const l = scanline_width; //scanline_buffer.byteLength;
|
|
326
|
-
for ( let i = 0; i < l; i ++ ) {
|
|
327
|
-
|
|
328
|
-
let off = 0;
|
|
329
|
-
data_rgba[ offset ] = scanline_buffer[ i + off ];
|
|
330
|
-
off += scanline_width; //1;
|
|
331
|
-
data_rgba[ offset + 1 ] = scanline_buffer[ i + off ];
|
|
332
|
-
off += scanline_width; //1;
|
|
333
|
-
data_rgba[ offset + 2 ] = scanline_buffer[ i + off ];
|
|
334
|
-
off += scanline_width; //1;
|
|
335
|
-
data_rgba[ offset + 3 ] = scanline_buffer[ i + off ];
|
|
336
|
-
offset += 4;
|
|
337
|
-
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
num_scanlines --;
|
|
341
|
-
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
return data_rgba;
|
|
345
|
-
|
|
346
|
-
};
|
|
347
|
-
|
|
348
|
-
const RGBEByteToRGBFloat = function ( sourceArray, sourceOffset, destArray, destOffset ) {
|
|
349
|
-
|
|
350
|
-
const e = sourceArray[ sourceOffset + 3 ];
|
|
351
|
-
const scale = Math.pow( 2.0, e - 128.0 ) / 255.0;
|
|
352
|
-
|
|
353
|
-
destArray[ destOffset + 0 ] = sourceArray[ sourceOffset + 0 ] * scale;
|
|
354
|
-
destArray[ destOffset + 1 ] = sourceArray[ sourceOffset + 1 ] * scale;
|
|
355
|
-
destArray[ destOffset + 2 ] = sourceArray[ sourceOffset + 2 ] * scale;
|
|
356
|
-
destArray[ destOffset + 3 ] = 1;
|
|
357
|
-
|
|
358
|
-
};
|
|
359
|
-
|
|
360
|
-
const RGBEByteToRGBHalf = function ( sourceArray, sourceOffset, destArray, destOffset ) {
|
|
361
|
-
|
|
362
|
-
const e = sourceArray[ sourceOffset + 3 ];
|
|
363
|
-
const scale = Math.pow( 2.0, e - 128.0 ) / 255.0;
|
|
364
|
-
|
|
365
|
-
// clamping to 65504, the maximum representable value in float16
|
|
366
|
-
destArray[ destOffset + 0 ] = DataUtils.toHalfFloat( Math.min( sourceArray[ sourceOffset + 0 ] * scale, 65504 ) );
|
|
367
|
-
destArray[ destOffset + 1 ] = DataUtils.toHalfFloat( Math.min( sourceArray[ sourceOffset + 1 ] * scale, 65504 ) );
|
|
368
|
-
destArray[ destOffset + 2 ] = DataUtils.toHalfFloat( Math.min( sourceArray[ sourceOffset + 2 ] * scale, 65504 ) );
|
|
369
|
-
destArray[ destOffset + 3 ] = DataUtils.toHalfFloat( 1 );
|
|
370
|
-
|
|
371
|
-
};
|
|
372
|
-
|
|
373
|
-
const byteArray = new Uint8Array( buffer );
|
|
374
|
-
byteArray.pos = 0;
|
|
375
|
-
const rgbe_header_info = RGBE_ReadHeader( byteArray );
|
|
376
|
-
|
|
377
|
-
const w = rgbe_header_info.width,
|
|
378
|
-
h = rgbe_header_info.height,
|
|
379
|
-
image_rgba_data = RGBE_ReadPixels_RLE( byteArray.subarray( byteArray.pos ), w, h );
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
let data, type;
|
|
383
|
-
let numElements;
|
|
384
|
-
|
|
385
|
-
switch ( this.type ) {
|
|
386
|
-
|
|
387
|
-
case FloatType:
|
|
388
|
-
|
|
389
|
-
numElements = image_rgba_data.length / 4;
|
|
390
|
-
const floatArray = new Float32Array( numElements * 4 );
|
|
391
|
-
|
|
392
|
-
for ( let j = 0; j < numElements; j ++ ) {
|
|
393
|
-
|
|
394
|
-
RGBEByteToRGBFloat( image_rgba_data, j * 4, floatArray, j * 4 );
|
|
395
|
-
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
data = floatArray;
|
|
399
|
-
type = FloatType;
|
|
400
|
-
break;
|
|
401
|
-
|
|
402
|
-
case HalfFloatType:
|
|
403
|
-
|
|
404
|
-
numElements = image_rgba_data.length / 4;
|
|
405
|
-
const halfArray = new Uint16Array( numElements * 4 );
|
|
406
|
-
|
|
407
|
-
for ( let j = 0; j < numElements; j ++ ) {
|
|
408
|
-
|
|
409
|
-
RGBEByteToRGBHalf( image_rgba_data, j * 4, halfArray, j * 4 );
|
|
410
|
-
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
data = halfArray;
|
|
414
|
-
type = HalfFloatType;
|
|
415
|
-
break;
|
|
416
|
-
|
|
417
|
-
default:
|
|
418
|
-
|
|
419
|
-
throw new Error( 'THREE.RGBELoader: Unsupported type: ' + this.type );
|
|
420
|
-
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
return {
|
|
424
|
-
width: w, height: h,
|
|
425
|
-
data: data,
|
|
426
|
-
header: rgbe_header_info.string,
|
|
427
|
-
gamma: rgbe_header_info.gamma,
|
|
428
|
-
exposure: rgbe_header_info.exposure,
|
|
429
|
-
type: type
|
|
430
|
-
};
|
|
431
|
-
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
/**
|
|
435
|
-
* Sets the texture type.
|
|
436
|
-
*
|
|
437
|
-
* @param {(HalfFloatType|FloatType)} value - The texture type to set.
|
|
438
|
-
* @return {RGBELoader} A reference to this loader.
|
|
439
|
-
*/
|
|
440
|
-
setDataType( value ) {
|
|
441
|
-
|
|
442
|
-
this.type = value;
|
|
443
|
-
return this;
|
|
444
|
-
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
load( url, onLoad, onProgress, onError ) {
|
|
448
|
-
|
|
449
|
-
function onLoadCallback( texture, texData ) {
|
|
450
|
-
|
|
451
|
-
switch ( texture.type ) {
|
|
452
|
-
|
|
453
|
-
case FloatType:
|
|
454
|
-
case HalfFloatType:
|
|
455
|
-
|
|
456
|
-
texture.colorSpace = LinearSRGBColorSpace;
|
|
457
|
-
texture.minFilter = LinearFilter;
|
|
458
|
-
texture.magFilter = LinearFilter;
|
|
459
|
-
texture.generateMipmaps = false;
|
|
460
|
-
texture.flipY = true;
|
|
461
|
-
|
|
462
|
-
break;
|
|
463
|
-
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
if ( onLoad ) onLoad( texture, texData );
|
|
467
|
-
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
return super.load( url, onLoadCallback, onProgress, onError );
|
|
471
|
-
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
export { RGBELoader };
|
|
477
|
-
//# sourceMappingURL=RGBELoader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RGBELoader.js","sources":["../../../../../../../../../../../node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/examples/jsm/loaders/RGBELoader.js"],"sourcesContent":["import {\n\tDataTextureLoader,\n\tDataUtils,\n\tFloatType,\n\tHalfFloatType,\n\tLinearFilter,\n\tLinearSRGBColorSpace\n} from 'three';\n\n/**\n * A loader for the RGBE HDR texture format.\n *\n * ```js\n * const loader = new RGBELoader();\n * const envMap = await loader.loadAsync( 'textures/equirectangular/blouberg_sunrise_2_1k.hdr' );\n * envMap.mapping = THREE.EquirectangularReflectionMapping;\n *\n * scene.environment = envMap;\n * ```\n *\n * @augments DataTextureLoader\n * @three_import import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';\n */\nclass RGBELoader extends DataTextureLoader {\n\n\t/**\n\t * Constructs a new RGBE loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t\t/**\n\t\t * The texture type.\n\t\t *\n\t\t * @type {(HalfFloatType|FloatType)}\n\t\t * @default HalfFloatType\n\t\t */\n\t\tthis.type = HalfFloatType;\n\n\t}\n\n\t/**\n\t * Parses the given RGBE texture data.\n\t *\n\t * @param {ArrayBuffer} buffer - The raw texture data.\n\t * @return {DataTextureLoader~TexData} An object representing the parsed texture data.\n\t */\n\tparse( buffer ) {\n\n\t\t// adapted from http://www.graphics.cornell.edu/~bjw/rgbe.html\n\n\t\tconst\n\t\t\t/* default error routine. change this to change error handling */\n\t\t\trgbe_read_error = 1,\n\t\t\trgbe_write_error = 2,\n\t\t\trgbe_format_error = 3,\n\t\t\trgbe_memory_error = 4,\n\t\t\trgbe_error = function ( rgbe_error_code, msg ) {\n\n\t\t\t\tswitch ( rgbe_error_code ) {\n\n\t\t\t\t\tcase rgbe_read_error: throw new Error( 'THREE.RGBELoader: Read Error: ' + ( msg || '' ) );\n\t\t\t\t\tcase rgbe_write_error: throw new Error( 'THREE.RGBELoader: Write Error: ' + ( msg || '' ) );\n\t\t\t\t\tcase rgbe_format_error: throw new Error( 'THREE.RGBELoader: Bad File Format: ' + ( msg || '' ) );\n\t\t\t\t\tdefault:\n\t\t\t\t\tcase rgbe_memory_error: throw new Error( 'THREE.RGBELoader: Memory Error: ' + ( msg || '' ) );\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\t/* offsets to red, green, and blue components in a data (float) pixel */\n\t\t\t//RGBE_DATA_RED = 0,\n\t\t\t//RGBE_DATA_GREEN = 1,\n\t\t\t//RGBE_DATA_BLUE = 2,\n\n\t\t\t/* number of floats per pixel, use 4 since stored in rgba image format */\n\t\t\t//RGBE_DATA_SIZE = 4,\n\n\t\t\t/* flags indicating which fields in an rgbe_header_info are valid */\n\t\t\tRGBE_VALID_PROGRAMTYPE = 1,\n\t\t\tRGBE_VALID_FORMAT = 2,\n\t\t\tRGBE_VALID_DIMENSIONS = 4,\n\n\t\t\tNEWLINE = '\\n',\n\n\t\t\tfgets = function ( buffer, lineLimit, consume ) {\n\n\t\t\t\tconst chunkSize = 128;\n\n\t\t\t\tlineLimit = ! lineLimit ? 1024 : lineLimit;\n\t\t\t\tlet p = buffer.pos,\n\t\t\t\t\ti = - 1, len = 0, s = '',\n\t\t\t\t\tchunk = String.fromCharCode.apply( null, new Uint16Array( buffer.subarray( p, p + chunkSize ) ) );\n\n\t\t\t\twhile ( ( 0 > ( i = chunk.indexOf( NEWLINE ) ) ) && ( len < lineLimit ) && ( p < buffer.byteLength ) ) {\n\n\t\t\t\t\ts += chunk; len += chunk.length;\n\t\t\t\t\tp += chunkSize;\n\t\t\t\t\tchunk += String.fromCharCode.apply( null, new Uint16Array( buffer.subarray( p, p + chunkSize ) ) );\n\n\t\t\t\t}\n\n\t\t\t\tif ( - 1 < i ) {\n\n\t\t\t\t\t/*for (i=l-1; i>=0; i--) {\n\t\t\t\t\t\tbyteCode = m.charCodeAt(i);\n\t\t\t\t\t\tif (byteCode > 0x7f && byteCode <= 0x7ff) byteLen++;\n\t\t\t\t\t\telse if (byteCode > 0x7ff && byteCode <= 0xffff) byteLen += 2;\n\t\t\t\t\t\tif (byteCode >= 0xDC00 && byteCode <= 0xDFFF) i--; //trail surrogate\n\t\t\t\t\t}*/\n\t\t\t\t\tif ( false !== consume ) buffer.pos += len + i + 1;\n\t\t\t\t\treturn s + chunk.slice( 0, i );\n\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\n\t\t\t},\n\n\t\t\t/* minimal header reading. modify if you want to parse more information */\n\t\t\tRGBE_ReadHeader = function ( buffer ) {\n\n\n\t\t\t\t// regexes to parse header info fields\n\t\t\t\tconst magic_token_re = /^#\\?(\\S+)/,\n\t\t\t\t\tgamma_re = /^\\s*GAMMA\\s*=\\s*(\\d+(\\.\\d+)?)\\s*$/,\n\t\t\t\t\texposure_re = /^\\s*EXPOSURE\\s*=\\s*(\\d+(\\.\\d+)?)\\s*$/,\n\t\t\t\t\tformat_re = /^\\s*FORMAT=(\\S+)\\s*$/,\n\t\t\t\t\tdimensions_re = /^\\s*\\-Y\\s+(\\d+)\\s+\\+X\\s+(\\d+)\\s*$/,\n\n\t\t\t\t\t// RGBE format header struct\n\t\t\t\t\theader = {\n\n\t\t\t\t\t\tvalid: 0, /* indicate which fields are valid */\n\n\t\t\t\t\t\tstring: '', /* the actual header string */\n\n\t\t\t\t\t\tcomments: '', /* comments found in header */\n\n\t\t\t\t\t\tprogramtype: 'RGBE', /* listed at beginning of file to identify it after \"#?\". defaults to \"RGBE\" */\n\n\t\t\t\t\t\tformat: '', /* RGBE format, default 32-bit_rle_rgbe */\n\n\t\t\t\t\t\tgamma: 1.0, /* image has already been gamma corrected with given gamma. defaults to 1.0 (no correction) */\n\n\t\t\t\t\t\texposure: 1.0, /* a value of 1.0 in an image corresponds to <exposure> watts/steradian/m^2. defaults to 1.0 */\n\n\t\t\t\t\t\twidth: 0, height: 0 /* image dimensions, width/height */\n\n\t\t\t\t\t};\n\n\t\t\t\tlet line, match;\n\n\t\t\t\tif ( buffer.pos >= buffer.byteLength || ! ( line = fgets( buffer ) ) ) {\n\n\t\t\t\t\trgbe_error( rgbe_read_error, 'no header found' );\n\n\t\t\t\t}\n\n\t\t\t\t/* if you want to require the magic token then uncomment the next line */\n\t\t\t\tif ( ! ( match = line.match( magic_token_re ) ) ) {\n\n\t\t\t\t\trgbe_error( rgbe_format_error, 'bad initial token' );\n\n\t\t\t\t}\n\n\t\t\t\theader.valid |= RGBE_VALID_PROGRAMTYPE;\n\t\t\t\theader.programtype = match[ 1 ];\n\t\t\t\theader.string += line + '\\n';\n\n\t\t\t\twhile ( true ) {\n\n\t\t\t\t\tline = fgets( buffer );\n\t\t\t\t\tif ( false === line ) break;\n\t\t\t\t\theader.string += line + '\\n';\n\n\t\t\t\t\tif ( '#' === line.charAt( 0 ) ) {\n\n\t\t\t\t\t\theader.comments += line + '\\n';\n\t\t\t\t\t\tcontinue; // comment line\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( match = line.match( gamma_re ) ) {\n\n\t\t\t\t\t\theader.gamma = parseFloat( match[ 1 ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( match = line.match( exposure_re ) ) {\n\n\t\t\t\t\t\theader.exposure = parseFloat( match[ 1 ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( match = line.match( format_re ) ) {\n\n\t\t\t\t\t\theader.valid |= RGBE_VALID_FORMAT;\n\t\t\t\t\t\theader.format = match[ 1 ];//'32-bit_rle_rgbe';\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( match = line.match( dimensions_re ) ) {\n\n\t\t\t\t\t\theader.valid |= RGBE_VALID_DIMENSIONS;\n\t\t\t\t\t\theader.height = parseInt( match[ 1 ], 10 );\n\t\t\t\t\t\theader.width = parseInt( match[ 2 ], 10 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ( header.valid & RGBE_VALID_FORMAT ) && ( header.valid & RGBE_VALID_DIMENSIONS ) ) break;\n\n\t\t\t\t}\n\n\t\t\t\tif ( ! ( header.valid & RGBE_VALID_FORMAT ) ) {\n\n\t\t\t\t\trgbe_error( rgbe_format_error, 'missing format specifier' );\n\n\t\t\t\t}\n\n\t\t\t\tif ( ! ( header.valid & RGBE_VALID_DIMENSIONS ) ) {\n\n\t\t\t\t\trgbe_error( rgbe_format_error, 'missing image size specifier' );\n\n\t\t\t\t}\n\n\t\t\t\treturn header;\n\n\t\t\t},\n\n\t\t\tRGBE_ReadPixels_RLE = function ( buffer, w, h ) {\n\n\t\t\t\tconst scanline_width = w;\n\n\t\t\t\tif (\n\t\t\t\t\t// run length encoding is not allowed so read flat\n\t\t\t\t\t( ( scanline_width < 8 ) || ( scanline_width > 0x7fff ) ) ||\n\t\t\t\t\t// this file is not run length encoded\n\t\t\t\t\t( ( 2 !== buffer[ 0 ] ) || ( 2 !== buffer[ 1 ] ) || ( buffer[ 2 ] & 0x80 ) )\n\t\t\t\t) {\n\n\t\t\t\t\t// return the flat buffer\n\t\t\t\t\treturn new Uint8Array( buffer );\n\n\t\t\t\t}\n\n\t\t\t\tif ( scanline_width !== ( ( buffer[ 2 ] << 8 ) | buffer[ 3 ] ) ) {\n\n\t\t\t\t\trgbe_error( rgbe_format_error, 'wrong scanline width' );\n\n\t\t\t\t}\n\n\t\t\t\tconst data_rgba = new Uint8Array( 4 * w * h );\n\n\t\t\t\tif ( ! data_rgba.length ) {\n\n\t\t\t\t\trgbe_error( rgbe_memory_error, 'unable to allocate buffer space' );\n\n\t\t\t\t}\n\n\t\t\t\tlet offset = 0, pos = 0;\n\n\t\t\t\tconst ptr_end = 4 * scanline_width;\n\t\t\t\tconst rgbeStart = new Uint8Array( 4 );\n\t\t\t\tconst scanline_buffer = new Uint8Array( ptr_end );\n\t\t\t\tlet num_scanlines = h;\n\n\t\t\t\t// read in each successive scanline\n\t\t\t\twhile ( ( num_scanlines > 0 ) && ( pos < buffer.byteLength ) ) {\n\n\t\t\t\t\tif ( pos + 4 > buffer.byteLength ) {\n\n\t\t\t\t\t\trgbe_error( rgbe_read_error );\n\n\t\t\t\t\t}\n\n\t\t\t\t\trgbeStart[ 0 ] = buffer[ pos ++ ];\n\t\t\t\t\trgbeStart[ 1 ] = buffer[ pos ++ ];\n\t\t\t\t\trgbeStart[ 2 ] = buffer[ pos ++ ];\n\t\t\t\t\trgbeStart[ 3 ] = buffer[ pos ++ ];\n\n\t\t\t\t\tif ( ( 2 != rgbeStart[ 0 ] ) || ( 2 != rgbeStart[ 1 ] ) || ( ( ( rgbeStart[ 2 ] << 8 ) | rgbeStart[ 3 ] ) != scanline_width ) ) {\n\n\t\t\t\t\t\trgbe_error( rgbe_format_error, 'bad rgbe scanline format' );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// read each of the four channels for the scanline into the buffer\n\t\t\t\t\t// first red, then green, then blue, then exponent\n\t\t\t\t\tlet ptr = 0, count;\n\n\t\t\t\t\twhile ( ( ptr < ptr_end ) && ( pos < buffer.byteLength ) ) {\n\n\t\t\t\t\t\tcount = buffer[ pos ++ ];\n\t\t\t\t\t\tconst isEncodedRun = count > 128;\n\t\t\t\t\t\tif ( isEncodedRun ) count -= 128;\n\n\t\t\t\t\t\tif ( ( 0 === count ) || ( ptr + count > ptr_end ) ) {\n\n\t\t\t\t\t\t\trgbe_error( rgbe_format_error, 'bad scanline data' );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( isEncodedRun ) {\n\n\t\t\t\t\t\t\t// a (encoded) run of the same value\n\t\t\t\t\t\t\tconst byteValue = buffer[ pos ++ ];\n\t\t\t\t\t\t\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\t\t\t\t\t\t\tscanline_buffer[ ptr ++ ] = byteValue;\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//ptr += count;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// a literal-run\n\t\t\t\t\t\t\tscanline_buffer.set( buffer.subarray( pos, pos + count ), ptr );\n\t\t\t\t\t\t\tptr += count; pos += count;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\t// now convert data from buffer into rgba\n\t\t\t\t\t// first red, then green, then blue, then exponent (alpha)\n\t\t\t\t\tconst l = scanline_width; //scanline_buffer.byteLength;\n\t\t\t\t\tfor ( let i = 0; i < l; i ++ ) {\n\n\t\t\t\t\t\tlet off = 0;\n\t\t\t\t\t\tdata_rgba[ offset ] = scanline_buffer[ i + off ];\n\t\t\t\t\t\toff += scanline_width; //1;\n\t\t\t\t\t\tdata_rgba[ offset + 1 ] = scanline_buffer[ i + off ];\n\t\t\t\t\t\toff += scanline_width; //1;\n\t\t\t\t\t\tdata_rgba[ offset + 2 ] = scanline_buffer[ i + off ];\n\t\t\t\t\t\toff += scanline_width; //1;\n\t\t\t\t\t\tdata_rgba[ offset + 3 ] = scanline_buffer[ i + off ];\n\t\t\t\t\t\toffset += 4;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tnum_scanlines --;\n\n\t\t\t\t}\n\n\t\t\t\treturn data_rgba;\n\n\t\t\t};\n\n\t\tconst RGBEByteToRGBFloat = function ( sourceArray, sourceOffset, destArray, destOffset ) {\n\n\t\t\tconst e = sourceArray[ sourceOffset + 3 ];\n\t\t\tconst scale = Math.pow( 2.0, e - 128.0 ) / 255.0;\n\n\t\t\tdestArray[ destOffset + 0 ] = sourceArray[ sourceOffset + 0 ] * scale;\n\t\t\tdestArray[ destOffset + 1 ] = sourceArray[ sourceOffset + 1 ] * scale;\n\t\t\tdestArray[ destOffset + 2 ] = sourceArray[ sourceOffset + 2 ] * scale;\n\t\t\tdestArray[ destOffset + 3 ] = 1;\n\n\t\t};\n\n\t\tconst RGBEByteToRGBHalf = function ( sourceArray, sourceOffset, destArray, destOffset ) {\n\n\t\t\tconst e = sourceArray[ sourceOffset + 3 ];\n\t\t\tconst scale = Math.pow( 2.0, e - 128.0 ) / 255.0;\n\n\t\t\t// clamping to 65504, the maximum representable value in float16\n\t\t\tdestArray[ destOffset + 0 ] = DataUtils.toHalfFloat( Math.min( sourceArray[ sourceOffset + 0 ] * scale, 65504 ) );\n\t\t\tdestArray[ destOffset + 1 ] = DataUtils.toHalfFloat( Math.min( sourceArray[ sourceOffset + 1 ] * scale, 65504 ) );\n\t\t\tdestArray[ destOffset + 2 ] = DataUtils.toHalfFloat( Math.min( sourceArray[ sourceOffset + 2 ] * scale, 65504 ) );\n\t\t\tdestArray[ destOffset + 3 ] = DataUtils.toHalfFloat( 1 );\n\n\t\t};\n\n\t\tconst byteArray = new Uint8Array( buffer );\n\t\tbyteArray.pos = 0;\n\t\tconst rgbe_header_info = RGBE_ReadHeader( byteArray );\n\n\t\tconst w = rgbe_header_info.width,\n\t\t\th = rgbe_header_info.height,\n\t\t\timage_rgba_data = RGBE_ReadPixels_RLE( byteArray.subarray( byteArray.pos ), w, h );\n\n\n\t\tlet data, type;\n\t\tlet numElements;\n\n\t\tswitch ( this.type ) {\n\n\t\t\tcase FloatType:\n\n\t\t\t\tnumElements = image_rgba_data.length / 4;\n\t\t\t\tconst floatArray = new Float32Array( numElements * 4 );\n\n\t\t\t\tfor ( let j = 0; j < numElements; j ++ ) {\n\n\t\t\t\t\tRGBEByteToRGBFloat( image_rgba_data, j * 4, floatArray, j * 4 );\n\n\t\t\t\t}\n\n\t\t\t\tdata = floatArray;\n\t\t\t\ttype = FloatType;\n\t\t\t\tbreak;\n\n\t\t\tcase HalfFloatType:\n\n\t\t\t\tnumElements = image_rgba_data.length / 4;\n\t\t\t\tconst halfArray = new Uint16Array( numElements * 4 );\n\n\t\t\t\tfor ( let j = 0; j < numElements; j ++ ) {\n\n\t\t\t\t\tRGBEByteToRGBHalf( image_rgba_data, j * 4, halfArray, j * 4 );\n\n\t\t\t\t}\n\n\t\t\t\tdata = halfArray;\n\t\t\t\ttype = HalfFloatType;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tthrow new Error( 'THREE.RGBELoader: Unsupported type: ' + this.type );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\treturn {\n\t\t\twidth: w, height: h,\n\t\t\tdata: data,\n\t\t\theader: rgbe_header_info.string,\n\t\t\tgamma: rgbe_header_info.gamma,\n\t\t\texposure: rgbe_header_info.exposure,\n\t\t\ttype: type\n\t\t};\n\n\t}\n\n\t/**\n\t * Sets the texture type.\n\t *\n\t * @param {(HalfFloatType|FloatType)} value - The texture type to set.\n\t * @return {RGBELoader} A reference to this loader.\n\t */\n\tsetDataType( value ) {\n\n\t\tthis.type = value;\n\t\treturn this;\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tfunction onLoadCallback( texture, texData ) {\n\n\t\t\tswitch ( texture.type ) {\n\n\t\t\t\tcase FloatType:\n\t\t\t\tcase HalfFloatType:\n\n\t\t\t\t\ttexture.colorSpace = LinearSRGBColorSpace;\n\t\t\t\t\ttexture.minFilter = LinearFilter;\n\t\t\t\t\ttexture.magFilter = LinearFilter;\n\t\t\t\t\ttexture.generateMipmaps = false;\n\t\t\t\t\ttexture.flipY = true;\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tif ( onLoad ) onLoad( texture, texData );\n\n\t\t}\n\n\t\treturn super.load( url, onLoadCallback, onProgress, onError );\n\n\t}\n\n}\n\nexport { RGBELoader };\n"],"names":[],"mappings":";;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,UAAU,SAAS,iBAAiB,CAAC;;AAE3C;AACA;AACA;AACA;AACA;AACA,CAAC,WAAW,EAAE,OAAO,GAAG;;AAExB,EAAE,KAAK,EAAE,OAAO,EAAE;;AAElB;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,IAAI,CAAC,IAAI,GAAG,aAAa;;AAE3B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,KAAK,EAAE,MAAM,GAAG;;AAEjB;;AAEA,EAAE;AACF;AACA,GAAG,eAAe,GAAG,CAAC;AACtB,GAAG,gBAAgB,GAAG,CAAC;AACvB,GAAG,iBAAiB,GAAG,CAAC;AACxB,GAAG,iBAAiB,GAAG,CAAC;AACxB,GAAG,UAAU,GAAG,WAAW,eAAe,EAAE,GAAG,GAAG;;AAElD,IAAI,SAAS,eAAe;;AAE5B,KAAK,KAAK,eAAe,EAAE,MAAM,IAAI,KAAK,EAAE,gCAAgC,KAAK,GAAG,IAAI,EAAE,EAAE,EAAE;AAC9F,KAAK,KAAK,gBAAgB,EAAE,MAAM,IAAI,KAAK,EAAE,iCAAiC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GAAG,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;AACtB,GAAG,IAAI,EAAE,IAAI;AACb,GAAG,MAAM,EAAE,gBAAgB,CAAC,MAAM;AAClC,GAAG,KAAK,EAAE,gBAAgB,CAAC,KAAK;AAChC,GAAG,QAAQ,EAAE,gBAAgB,CAAC,QAAQ;AACtC,GAAG,IAAI,EAAE;AACT,GAAG;;AAEH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,WAAW,EAAE,KAAK,GAAG;;AAEtB,EAAE,IAAI,CAAC,IAAI,GAAG,KAAK;AACnB,EAAE,OAAO,IAAI;;AAEb,CAAC;;AAED,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAG;;AAE1C,EAAE,SAAS,cAAc,EAAE,OAAO,EAAE,OAAO,GAAG;;AAE9C,GAAG,SAAS,OAAO,CAAC,IAAI;;AAExB,IAAI,KAAK,SAAS;AAClB,IAAI,KAAK,aAAa;;AAEtB,KAAK,OAAO,CAAC,UAAU,GAAG,oBAAoB;AAC9C,KAAK,OAAO,CAAC,SAAS,GAAG,YAAY;AACrC,KAAK,OAAO,CAAC,SAAS,GAAG,YAAY;AACrC,KAAK,OAAO,CAAC,eAAe,GAAG,KAAK;AACpC,KAAK,OAAO,CAAC,KAAK,GAAG,IAAI;;AAEzB,KAAK;;AAEL;;AAEA,GAAG,KAAK,MAAM,GAAG,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE;;AAE3C,EAAE;;AAEF,EAAE,OAAO,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO,EAAE;;AAE/D,CAAC;;AAED;;;;","x_google_ignoreList":[0]}
|
package/dist/node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/src/math/MathUtils.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns a value linearly interpolated from two known points based on the given interval -
|
|
3
|
-
* `t = 0` will return `x` and `t = 1` will return `y`.
|
|
4
|
-
*
|
|
5
|
-
* @param {number} x - The start point
|
|
6
|
-
* @param {number} y - The end point.
|
|
7
|
-
* @param {number} t - The interpolation factor in the closed interval `[0, 1]`.
|
|
8
|
-
* @return {number} The interpolated value.
|
|
9
|
-
*/
|
|
10
|
-
function lerp( x, y, t ) {
|
|
11
|
-
|
|
12
|
-
return ( 1 - t ) * x + t * y;
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { lerp };
|
|
17
|
-
//# sourceMappingURL=MathUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MathUtils.js","sources":["../../../../../../../../../../node_modules/.pnpm/super-three@0.177.0/node_modules/super-three/src/math/MathUtils.js"],"sourcesContent":["const _lut = [ '00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '0a', '0b', '0c', '0d', '0e', '0f', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '1a', '1b', '1c', '1d', '1e', '1f', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '2a', '2b', '2c', '2d', '2e', '2f', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '3a', '3b', '3c', '3d', '3e', '3f', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '4a', '4b', '4c', '4d', '4e', '4f', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '5a', '5b', '5c', '5d', '5e', '5f', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '6a', '6b', '6c', '6d', '6e', '6f', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '7a', '7b', '7c', '7d', '7e', '7f', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '8a', '8b', '8c', '8d', '8e', '8f', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '9a', '9b', '9c', '9d', '9e', '9f', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'aa', 'ab', 'ac', 'ad', 'ae', 'af', 'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'b8', 'b9', 'ba', 'bb', 'bc', 'bd', 'be', 'bf', 'c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9', 'ca', 'cb', 'cc', 'cd', 'ce', 'cf', 'd0', 'd1', 'd2', 'd3', 'd4', 'd5', 'd6', 'd7', 'd8', 'd9', 'da', 'db', 'dc', 'dd', 'de', 'df', 'e0', 'e1', 'e2', 'e3', 'e4', 'e5', 'e6', 'e7', 'e8', 'e9', 'ea', 'eb', 'ec', 'ed', 'ee', 'ef', 'f0', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'fa', 'fb', 'fc', 'fd', 'fe', 'ff' ];\n\nlet _seed = 1234567;\n\n\nconst DEG2RAD = Math.PI / 180;\nconst RAD2DEG = 180 / Math.PI;\n\n/**\n * Generate a [UUID]{@link https://en.wikipedia.org/wiki/Universally_unique_identifier}\n * (universally unique identifier).\n *\n * @return {string} The UUID.\n */\nfunction generateUUID() {\n\n\t// http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136\n\n\tconst d0 = Math.random() * 0xffffffff | 0;\n\tconst d1 = Math.random() * 0xffffffff | 0;\n\tconst d2 = Math.random() * 0xffffffff | 0;\n\tconst d3 = Math.random() * 0xffffffff | 0;\n\tconst uuid = _lut[ d0 & 0xff ] + _lut[ d0 >> 8 & 0xff ] + _lut[ d0 >> 16 & 0xff ] + _lut[ d0 >> 24 & 0xff ] + '-' +\n\t\t\t_lut[ d1 & 0xff ] + _lut[ d1 >> 8 & 0xff ] + '-' + _lut[ d1 >> 16 & 0x0f | 0x40 ] + _lut[ d1 >> 24 & 0xff ] + '-' +\n\t\t\t_lut[ d2 & 0x3f | 0x80 ] + _lut[ d2 >> 8 & 0xff ] + '-' + _lut[ d2 >> 16 & 0xff ] + _lut[ d2 >> 24 & 0xff ] +\n\t\t\t_lut[ d3 & 0xff ] + _lut[ d3 >> 8 & 0xff ] + _lut[ d3 >> 16 & 0xff ] + _lut[ d3 >> 24 & 0xff ];\n\n\t// .toLowerCase() here flattens concatenated strings to save heap memory space.\n\treturn uuid.toLowerCase();\n\n}\n\n/**\n * Clamps the given value between min and max.\n *\n * @param {number} value - The value to clamp.\n * @param {number} min - The min value.\n * @param {number} max - The max value.\n * @return {number} The clamped value.\n */\nfunction clamp( value, min, max ) {\n\n\treturn Math.max( min, Math.min( max, value ) );\n\n}\n\n/**\n * Computes the Euclidean modulo of the given parameters that\n * is `( ( n % m ) + m ) % m`.\n *\n * @param {number} n - The first parameter.\n * @param {number} m - The second parameter.\n * @return {number} The Euclidean modulo.\n */\nfunction euclideanModulo( n, m ) {\n\n\t// https://en.wikipedia.org/wiki/Modulo_operation\n\n\treturn ( ( n % m ) + m ) % m;\n\n}\n\n/**\n * Performs a linear mapping from range `<a1, a2>` to range `<b1, b2>`\n * for the given value.\n *\n * @param {number} x - The value to be mapped.\n * @param {number} a1 - Minimum value for range A.\n * @param {number} a2 - Maximum value for range A.\n * @param {number} b1 - Minimum value for range B.\n * @param {number} b2 - Maximum value for range B.\n * @return {number} The mapped value.\n */\nfunction mapLinear( x, a1, a2, b1, b2 ) {\n\n\treturn b1 + ( x - a1 ) * ( b2 - b1 ) / ( a2 - a1 );\n\n}\n\n/**\n * Returns the percentage in the closed interval `[0, 1]` of the given value\n * between the start and end point.\n *\n * @param {number} x - The start point\n * @param {number} y - The end point.\n * @param {number} value - A value between start and end.\n * @return {number} The interpolation factor.\n */\nfunction inverseLerp( x, y, value ) {\n\n\t// https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/\n\n\tif ( x !== y ) {\n\n\t\treturn ( value - x ) / ( y - x );\n\n\t} else {\n\n\t\treturn 0;\n\n\t}\n\n}\n\n/**\n * Returns a value linearly interpolated from two known points based on the given interval -\n * `t = 0` will return `x` and `t = 1` will return `y`.\n *\n * @param {number} x - The start point\n * @param {number} y - The end point.\n * @param {number} t - The interpolation factor in the closed interval `[0, 1]`.\n * @return {number} The interpolated value.\n */\nfunction lerp( x, y, t ) {\n\n\treturn ( 1 - t ) * x + t * y;\n\n}\n\n/**\n * Smoothly interpolate a number from `x` to `y` in a spring-like manner using a delta\n * time to maintain frame rate independent movement. For details, see\n * [Frame rate independent damping using lerp]{@link http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/}.\n *\n * @param {number} x - The current point.\n * @param {number} y - The target point.\n * @param {number} lambda - A higher lambda value will make the movement more sudden,\n * and a lower value will make the movement more gradual.\n * @param {number} dt - Delta time in seconds.\n * @return {number} The interpolated value.\n */\nfunction damp( x, y, lambda, dt ) {\n\n\treturn lerp( x, y, 1 - Math.exp( - lambda * dt ) );\n\n}\n\n/**\n * Returns a value that alternates between `0` and the given `length` parameter.\n *\n * @param {number} x - The value to pingpong.\n * @param {number} [length=1] - The positive value the function will pingpong to.\n * @return {number} The alternated value.\n */\nfunction pingpong( x, length = 1 ) {\n\n\t// https://www.desmos.com/calculator/vcsjnyz7x4\n\n\treturn length - Math.abs( euclideanModulo( x, length * 2 ) - length );\n\n}\n\n/**\n * Returns a value in the range `[0,1]` that represents the percentage that `x` has\n * moved between `min` and `max`, but smoothed or slowed down the closer `x` is to\n * the `min` and `max`.\n *\n * See [Smoothstep]{@link http://en.wikipedia.org/wiki/Smoothstep} for more details.\n *\n * @param {number} x - The value to evaluate based on its position between min and max.\n * @param {number} min - The min value. Any x value below min will be `0`.\n * @param {number} max - The max value. Any x value above max will be `1`.\n * @return {number} The alternated value.\n */\nfunction smoothstep( x, min, max ) {\n\n\tif ( x <= min ) return 0;\n\tif ( x >= max ) return 1;\n\n\tx = ( x - min ) / ( max - min );\n\n\treturn x * x * ( 3 - 2 * x );\n\n}\n\n/**\n * A [variation on smoothstep]{@link https://en.wikipedia.org/wiki/Smoothstep#Variations}\n * that has zero 1st and 2nd order derivatives at x=0 and x=1.\n *\n * @param {number} x - The value to evaluate based on its position between min and max.\n * @param {number} min - The min value. Any x value below min will be `0`.\n * @param {number} max - The max value. Any x value above max will be `1`.\n * @return {number} The alternated value.\n */\nfunction smootherstep( x, min, max ) {\n\n\tif ( x <= min ) return 0;\n\tif ( x >= max ) return 1;\n\n\tx = ( x - min ) / ( max - min );\n\n\treturn x * x * x * ( x * ( x * 6 - 15 ) + 10 );\n\n}\n\n/**\n * Returns a random integer from `<low, high>` interval.\n *\n * @param {number} low - The lower value boundary.\n * @param {number} high - The upper value boundary\n * @return {number} A random integer.\n */\nfunction randInt( low, high ) {\n\n\treturn low + Math.floor( Math.random() * ( high - low + 1 ) );\n\n}\n\n/**\n * Returns a random float from `<low, high>` interval.\n *\n * @param {number} low - The lower value boundary.\n * @param {number} high - The upper value boundary\n * @return {number} A random float.\n */\nfunction randFloat( low, high ) {\n\n\treturn low + Math.random() * ( high - low );\n\n}\n\n/**\n * Returns a random integer from `<-range/2, range/2>` interval.\n *\n * @param {number} range - Defines the value range.\n * @return {number} A random float.\n */\nfunction randFloatSpread( range ) {\n\n\treturn range * ( 0.5 - Math.random() );\n\n}\n\n/**\n * Returns a deterministic pseudo-random float in the interval `[0, 1]`.\n *\n * @param {number} [s] - The integer seed.\n * @return {number} A random float.\n */\nfunction seededRandom( s ) {\n\n\tif ( s !== undefined ) _seed = s;\n\n\t// Mulberry32 generator\n\n\tlet t = _seed += 0x6D2B79F5;\n\n\tt = Math.imul( t ^ t >>> 15, t | 1 );\n\n\tt ^= t + Math.imul( t ^ t >>> 7, t | 61 );\n\n\treturn ( ( t ^ t >>> 14 ) >>> 0 ) / 4294967296;\n\n}\n\n/**\n * Converts degrees to radians.\n *\n * @param {number} degrees - A value in degrees.\n * @return {number} The converted value in radians.\n */\nfunction degToRad( degrees ) {\n\n\treturn degrees * DEG2RAD;\n\n}\n\n/**\n * Converts radians to degrees.\n *\n * @param {number} radians - A value in radians.\n * @return {number} The converted value in degrees.\n */\nfunction radToDeg( radians ) {\n\n\treturn radians * RAD2DEG;\n\n}\n\n/**\n * Returns `true` if the given number is a power of two.\n *\n * @param {number} value - The value to check.\n * @return {boolean} Whether the given number is a power of two or not.\n */\nfunction isPowerOfTwo( value ) {\n\n\treturn ( value & ( value - 1 ) ) === 0 && value !== 0;\n\n}\n\n/**\n * Returns the smallest power of two that is greater than or equal to the given number.\n *\n * @param {number} value - The value to find a POT for.\n * @return {number} The smallest power of two that is greater than or equal to the given number.\n */\nfunction ceilPowerOfTwo( value ) {\n\n\treturn Math.pow( 2, Math.ceil( Math.log( value ) / Math.LN2 ) );\n\n}\n\n/**\n * Returns the largest power of two that is less than or equal to the given number.\n *\n * @param {number} value - The value to find a POT for.\n * @return {number} The largest power of two that is less than or equal to the given number.\n */\nfunction floorPowerOfTwo( value ) {\n\n\treturn Math.pow( 2, Math.floor( Math.log( value ) / Math.LN2 ) );\n\n}\n\n/**\n * Sets the given quaternion from the [Intrinsic Proper Euler Angles]{@link https://en.wikipedia.org/wiki/Euler_angles}\n * defined by the given angles and order.\n *\n * Rotations are applied to the axes in the order specified by order:\n * rotation by angle `a` is applied first, then by angle `b`, then by angle `c`.\n *\n * @param {Quaternion} q - The quaternion to set.\n * @param {number} a - The rotation applied to the first axis, in radians.\n * @param {number} b - The rotation applied to the second axis, in radians.\n * @param {number} c - The rotation applied to the third axis, in radians.\n * @param {('XYX'|'XZX'|'YXY'|'YZY'|'ZXZ'|'ZYZ')} order - A string specifying the axes order.\n */\nfunction setQuaternionFromProperEuler( q, a, b, c, order ) {\n\n\tconst cos = Math.cos;\n\tconst sin = Math.sin;\n\n\tconst c2 = cos( b / 2 );\n\tconst s2 = sin( b / 2 );\n\n\tconst c13 = cos( ( a + c ) / 2 );\n\tconst s13 = sin( ( a + c ) / 2 );\n\n\tconst c1_3 = cos( ( a - c ) / 2 );\n\tconst s1_3 = sin( ( a - c ) / 2 );\n\n\tconst c3_1 = cos( ( c - a ) / 2 );\n\tconst s3_1 = sin( ( c - a ) / 2 );\n\n\tswitch ( order ) {\n\n\t\tcase 'XYX':\n\t\t\tq.set( c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'YZY':\n\t\t\tq.set( s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'ZXZ':\n\t\t\tq.set( s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'XZX':\n\t\t\tq.set( c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'YXY':\n\t\t\tq.set( s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'ZYZ':\n\t\t\tq.set( s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13 );\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tconsole.warn( 'THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + order );\n\n\t}\n\n}\n\n/**\n * Denormalizes the given value according to the given typed array.\n *\n * @param {number} value - The value to denormalize.\n * @param {TypedArray} array - The typed array that defines the data type of the value.\n * @return {number} The denormalize (float) value in the range `[0,1]`.\n */\nfunction denormalize( value, array ) {\n\n\tswitch ( array.constructor ) {\n\n\t\tcase Float32Array:\n\n\t\t\treturn value;\n\n\t\tcase Uint32Array:\n\n\t\t\treturn value / 4294967295.0;\n\n\t\tcase Uint16Array:\n\n\t\t\treturn value / 65535.0;\n\n\t\tcase Uint8Array:\n\n\t\t\treturn value / 255.0;\n\n\t\tcase Int32Array:\n\n\t\t\treturn Math.max( value / 2147483647.0, - 1.0 );\n\n\t\tcase Int16Array:\n\n\t\t\treturn Math.max( value / 32767.0, - 1.0 );\n\n\t\tcase Int8Array:\n\n\t\t\treturn Math.max( value / 127.0, - 1.0 );\n\n\t\tdefault:\n\n\t\t\tthrow new Error( 'Invalid component type.' );\n\n\t}\n\n}\n\n/**\n * Normalizes the given value according to the given typed array.\n *\n * @param {number} value - The float value in the range `[0,1]` to normalize.\n * @param {TypedArray} array - The typed array that defines the data type of the value.\n * @return {number} The normalize value.\n */\nfunction normalize( value, array ) {\n\n\tswitch ( array.constructor ) {\n\n\t\tcase Float32Array:\n\n\t\t\treturn value;\n\n\t\tcase Uint32Array:\n\n\t\t\treturn Math.round( value * 4294967295.0 );\n\n\t\tcase Uint16Array:\n\n\t\t\treturn Math.round( value * 65535.0 );\n\n\t\tcase Uint8Array:\n\n\t\t\treturn Math.round( value * 255.0 );\n\n\t\tcase Int32Array:\n\n\t\t\treturn Math.round( value * 2147483647.0 );\n\n\t\tcase Int16Array:\n\n\t\t\treturn Math.round( value * 32767.0 );\n\n\t\tcase Int8Array:\n\n\t\t\treturn Math.round( value * 127.0 );\n\n\t\tdefault:\n\n\t\t\tthrow new Error( 'Invalid component type.' );\n\n\t}\n\n}\n\n/**\n * @class\n * @classdesc A collection of math utility functions.\n * @hideconstructor\n */\nconst MathUtils = {\n\tDEG2RAD: DEG2RAD,\n\tRAD2DEG: RAD2DEG,\n\t/**\n\t * Generate a [UUID]{@link https://en.wikipedia.org/wiki/Universally_unique_identifier}\n\t * (universally unique identifier).\n\t *\n\t * @static\n\t * @method\n\t * @return {string} The UUID.\n\t */\n\tgenerateUUID: generateUUID,\n\t/**\n\t * Clamps the given value between min and max.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} value - The value to clamp.\n\t * @param {number} min - The min value.\n\t * @param {number} max - The max value.\n\t * @return {number} The clamped value.\n\t */\n\tclamp: clamp,\n\t/**\n\t * Computes the Euclidean modulo of the given parameters that\n\t * is `( ( n % m ) + m ) % m`.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} n - The first parameter.\n\t * @param {number} m - The second parameter.\n\t * @return {number} The Euclidean modulo.\n\t */\n\teuclideanModulo: euclideanModulo,\n\t/**\n\t * Performs a linear mapping from range `<a1, a2>` to range `<b1, b2>`\n\t * for the given value.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The value to be mapped.\n\t * @param {number} a1 - Minimum value for range A.\n\t * @param {number} a2 - Maximum value for range A.\n\t * @param {number} b1 - Minimum value for range B.\n\t * @param {number} b2 - Maximum value for range B.\n\t * @return {number} The mapped value.\n\t */\n\tmapLinear: mapLinear,\n\t/**\n\t * Returns the percentage in the closed interval `[0, 1]` of the given value\n\t * between the start and end point.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The start point\n\t * @param {number} y - The end point.\n\t * @param {number} value - A value between start and end.\n\t * @return {number} The interpolation factor.\n\t */\n\tinverseLerp: inverseLerp,\n\t/**\n\t * Returns a value linearly interpolated from two known points based on the given interval -\n\t * `t = 0` will return `x` and `t = 1` will return `y`.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The start point\n\t * @param {number} y - The end point.\n\t * @param {number} t - The interpolation factor in the closed interval `[0, 1]`.\n\t * @return {number} The interpolated value.\n\t */\n\tlerp: lerp,\n\t/**\n\t * Smoothly interpolate a number from `x` to `y` in a spring-like manner using a delta\n\t * time to maintain frame rate independent movement. For details, see\n\t * [Frame rate independent damping using lerp]{@link http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/}.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The current point.\n\t * @param {number} y - The target point.\n\t * @param {number} lambda - A higher lambda value will make the movement more sudden,\n\t * and a lower value will make the movement more gradual.\n\t * @param {number} dt - Delta time in seconds.\n\t * @return {number} The interpolated value.\n\t */\n\tdamp: damp,\n\t/**\n\t * Returns a value that alternates between `0` and the given `length` parameter.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The value to pingpong.\n\t * @param {number} [length=1] - The positive value the function will pingpong to.\n\t * @return {number} The alternated value.\n\t */\n\tpingpong: pingpong,\n\t/**\n\t * Returns a value in the range `[0,1]` that represents the percentage that `x` has\n\t * moved between `min` and `max`, but smoothed or slowed down the closer `x` is to\n\t * the `min` and `max`.\n\t *\n\t * See [Smoothstep]{@link http://en.wikipedia.org/wiki/Smoothstep} for more details.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The value to evaluate based on its position between min and max.\n\t * @param {number} min - The min value. Any x value below min will be `0`.\n\t * @param {number} max - The max value. Any x value above max will be `1`.\n\t * @return {number} The alternated value.\n\t */\n\tsmoothstep: smoothstep,\n\t/**\n\t * A [variation on smoothstep]{@link https://en.wikipedia.org/wiki/Smoothstep#Variations}\n\t * that has zero 1st and 2nd order derivatives at x=0 and x=1.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The value to evaluate based on its position between min and max.\n\t * @param {number} min - The min value. Any x value below min will be `0`.\n\t * @param {number} max - The max value. Any x value above max will be `1`.\n\t * @return {number} The alternated value.\n\t */\n\tsmootherstep: smootherstep,\n\t/**\n\t * Returns a random integer from `<low, high>` interval.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} low - The lower value boundary.\n\t * @param {number} high - The upper value boundary\n\t * @return {number} A random integer.\n\t */\n\trandInt: randInt,\n\t/**\n\t * Returns a random float from `<low, high>` interval.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} low - The lower value boundary.\n\t * @param {number} high - The upper value boundary\n\t * @return {number} A random float.\n\t */\n\trandFloat: randFloat,\n\t/**\n\t * Returns a random integer from `<-range/2, range/2>` interval.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} range - Defines the value range.\n\t * @return {number} A random float.\n\t */\n\trandFloatSpread: randFloatSpread,\n\t/**\n\t * Returns a deterministic pseudo-random float in the interval `[0, 1]`.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} [s] - The integer seed.\n\t * @return {number} A random float.\n\t */\n\tseededRandom: seededRandom,\n\t/**\n\t * Converts degrees to radians.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} degrees - A value in degrees.\n\t * @return {number} The converted value in radians.\n\t */\n\tdegToRad: degToRad,\n\t/**\n\t * Converts radians to degrees.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} radians - A value in radians.\n\t * @return {number} The converted value in degrees.\n\t */\n\tradToDeg: radToDeg,\n\t/**\n\t * Returns `true` if the given number is a power of two.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} value - The value to check.\n\t * @return {boolean} Whether the given number is a power of two or not.\n\t */\n\tisPowerOfTwo: isPowerOfTwo,\n\t/**\n\t * Returns the smallest power of two that is greater than or equal to the given number.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} value - The value to find a POT for.\n\t * @return {number} The smallest power of two that is greater than or equal to the given number.\n\t */\n\tceilPowerOfTwo: ceilPowerOfTwo,\n\t/**\n\t * Returns the largest power of two that is less than or equal to the given number.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} value - The value to find a POT for.\n\t * @return {number} The largest power of two that is less than or equal to the given number.\n\t */\n\tfloorPowerOfTwo: floorPowerOfTwo,\n\t/**\n\t * Sets the given quaternion from the [Intrinsic Proper Euler Angles]{@link https://en.wikipedia.org/wiki/Euler_angles}\n\t * defined by the given angles and order.\n\t *\n\t * Rotations are applied to the axes in the order specified by order:\n\t * rotation by angle `a` is applied first, then by angle `b`, then by angle `c`.\n\t *\n\t * @static\n\t * @method\n\t * @param {Quaternion} q - The quaternion to set.\n\t * @param {number} a - The rotation applied to the first axis, in radians.\n\t * @param {number} b - The rotation applied to the second axis, in radians.\n\t * @param {number} c - The rotation applied to the third axis, in radians.\n\t * @param {('XYX'|'XZX'|'YXY'|'YZY'|'ZXZ'|'ZYZ')} order - A string specifying the axes order.\n\t */\n\tsetQuaternionFromProperEuler: setQuaternionFromProperEuler,\n\t/**\n\t * Normalizes the given value according to the given typed array.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} value - The float value in the range `[0,1]` to normalize.\n\t * @param {TypedArray} array - The typed array that defines the data type of the value.\n\t * @return {number} The normalize value.\n\t */\n\tnormalize: normalize,\n\t/**\n\t * Denormalizes the given value according to the given typed array.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} value - The value to denormalize.\n\t * @param {TypedArray} array - The typed array that defines the data type of the value.\n\t * @return {number} The denormalize (float) value in the range `[0,1]`.\n\t */\n\tdenormalize: denormalize\n};\n\nexport {\n\tDEG2RAD,\n\tRAD2DEG,\n\tgenerateUUID,\n\tclamp,\n\teuclideanModulo,\n\tmapLinear,\n\tinverseLerp,\n\tlerp,\n\tdamp,\n\tpingpong,\n\tsmoothstep,\n\tsmootherstep,\n\trandInt,\n\trandFloat,\n\trandFloatSpread,\n\tseededRandom,\n\tdegToRad,\n\tradToDeg,\n\tisPowerOfTwo,\n\tceilPowerOfTwo,\n\tfloorPowerOfTwo,\n\tsetQuaternionFromProperEuler,\n\tnormalize,\n\tdenormalize,\n\tMathUtils\n};\n"],"names":[],"mappings":"AAwGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG;;AAEzB,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;;AAE7B;;;;","x_google_ignoreList":[0]}
|