@realsee/five 5.0.0-alpha.100

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.
Files changed (173) hide show
  1. package/README.md +362 -0
  2. package/TERMS.txt +56 -0
  3. package/docs/.nojekyll +1 -0
  4. package/docs/assets/highlight.css +134 -0
  5. package/docs/assets/icons.css +1043 -0
  6. package/docs/assets/icons.png +0 -0
  7. package/docs/assets/icons@2x.png +0 -0
  8. package/docs/assets/main.js +52 -0
  9. package/docs/assets/search.js +1 -0
  10. package/docs/assets/style.css +1388 -0
  11. package/docs/assets/widgets.png +0 -0
  12. package/docs/assets/widgets@2x.png +0 -0
  13. package/docs/classes/five.AnimationFrameLoop.html +15 -0
  14. package/docs/classes/five.BVH.html +10 -0
  15. package/docs/classes/five.BVHIntersect.html +1 -0
  16. package/docs/classes/five.BVHNode.html +7 -0
  17. package/docs/classes/five.BVHVector3.html +1 -0
  18. package/docs/classes/five.Camera.html +11 -0
  19. package/docs/classes/five.Five.html +303 -0
  20. package/docs/classes/five.InternalWebGLRenderer.html +1 -0
  21. package/docs/classes/five.IntersectMesh.html +1 -0
  22. package/docs/classes/five.LegacyPanoCircleMesh.html +5 -0
  23. package/docs/classes/five.Model.html +77 -0
  24. package/docs/classes/five.NetworkSubscribe.html +50 -0
  25. package/docs/classes/five.PBMContainer.html +17 -0
  26. package/docs/classes/five.PBMGroup.html +19 -0
  27. package/docs/classes/five.PBMMaterial.html +15 -0
  28. package/docs/classes/five.PBMMesh.html +7 -0
  29. package/docs/classes/five.PanoCircleMesh.html +7 -0
  30. package/docs/classes/five.Scene.html +3 -0
  31. package/docs/classes/five.Subscribe.html +56 -0
  32. package/docs/classes/five.Work.html +30 -0
  33. package/docs/classes/gltf_loader.GLTFLoader.html +17 -0
  34. package/docs/classes/gltf_loader.GLTFObject.html +7 -0
  35. package/docs/classes/line.Line.html +1 -0
  36. package/docs/classes/line.LineGeometry.html +1 -0
  37. package/docs/classes/line.LineMaterial.html +1 -0
  38. package/docs/classes/line.LineSegmentsGeometry.html +1 -0
  39. package/docs/classes/line.THREE_Line2.html +1 -0
  40. package/docs/classes/line.THREE_LineSegments2.html +1 -0
  41. package/docs/classes/react.Store.html +29 -0
  42. package/docs/classes/server.BVH.html +10 -0
  43. package/docs/classes/server.BVHIntersect.html +1 -0
  44. package/docs/classes/server.BVHNode.html +7 -0
  45. package/docs/classes/server.BVHVector3.html +1 -0
  46. package/docs/classes/server.Model.html +63 -0
  47. package/docs/classes/server.PBMGroup.html +9 -0
  48. package/docs/classes/server.PBMMesh.html +7 -0
  49. package/docs/classes/sticker.Sticker.html +32 -0
  50. package/docs/index.html +182 -0
  51. package/docs/interfaces/five.AddableObject.html +1 -0
  52. package/docs/interfaces/five.AnimationFrame.html +1 -0
  53. package/docs/interfaces/five.CameraPose.html +1 -0
  54. package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +28 -0
  55. package/docs/interfaces/five.EventCallback.html +391 -0
  56. package/docs/interfaces/five.FiveInitArgs.html +96 -0
  57. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +15 -0
  58. package/docs/interfaces/five.ImageOptions.html +16 -0
  59. package/docs/interfaces/five.ImageURLOptions.html +1 -0
  60. package/docs/interfaces/five.IntersectMeshInterface.html +3 -0
  61. package/docs/interfaces/five.Intersection.html +7 -0
  62. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +20 -0
  63. package/docs/interfaces/five.ModelEventCallback.html +22 -0
  64. package/docs/interfaces/five.MovePanoOptions.html +39 -0
  65. package/docs/interfaces/five.PBMPanoPicture.html +7 -0
  66. package/docs/interfaces/five.PBMParameters.html +15 -0
  67. package/docs/interfaces/five.PanoCircleMeshInterface.html +19 -0
  68. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +28 -0
  69. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +20 -0
  70. package/docs/interfaces/five.Pose.html +35 -0
  71. package/docs/interfaces/five.Scissor.html +14 -0
  72. package/docs/interfaces/five.State.html +19 -0
  73. package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -0
  74. package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -0
  75. package/docs/interfaces/five.SubscribeMixinType.off.html +1 -0
  76. package/docs/interfaces/five.SubscribeMixinType.on.html +1 -0
  77. package/docs/interfaces/five.SubscribeMixinType.once.html +1 -0
  78. package/docs/interfaces/five.TextureOptions.html +18 -0
  79. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +7 -0
  80. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +24 -0
  81. package/docs/interfaces/five.WorkCubeImage.html +13 -0
  82. package/docs/interfaces/five.WorkImage.html +21 -0
  83. package/docs/interfaces/five.WorkInitial.html +13 -0
  84. package/docs/interfaces/five.WorkModel.html +11 -0
  85. package/docs/interfaces/five.WorkObserver.html +25 -0
  86. package/docs/interfaces/five.WorkTile.html +1 -0
  87. package/docs/interfaces/five.WorkVideo.html +9 -0
  88. package/docs/interfaces/gltf_loader.GLTF.html +7 -0
  89. package/docs/interfaces/react.FiveActionReactCallbacks.html +62 -0
  90. package/docs/interfaces/react.FiveInjectionTypes.html +191 -0
  91. package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -0
  92. package/docs/interfaces/server.Intersection.html +7 -0
  93. package/docs/interfaces/server.ModelEventCallback.html +18 -0
  94. package/docs/interfaces/sticker.IntersectionLike.html +8 -0
  95. package/docs/media/coordinate.jpg +0 -0
  96. package/docs/media/topview.jpg +0 -0
  97. package/docs/media/typescript.jpg +0 -0
  98. package/docs/modules/five.SubscribeMixinType.html +1 -0
  99. package/docs/modules/five.html +481 -0
  100. package/docs/modules/gltf_loader.html +1 -0
  101. package/docs/modules/line.html +1 -0
  102. package/docs/modules/react.html +130 -0
  103. package/docs/modules/server.html +18 -0
  104. package/docs/modules/sticker.html +1 -0
  105. package/docs/modules.html +1 -0
  106. package/exporters/staticify.js +203 -0
  107. package/five/index.d.ts +2061 -0
  108. package/five/index.js +372 -0
  109. package/gltf-loader/index.d.ts +75 -0
  110. package/gltf-loader/index.js +260 -0
  111. package/line/index.d.ts +68 -0
  112. package/line/index.js +260 -0
  113. package/package.json +36 -0
  114. package/react/index.d.ts +812 -0
  115. package/react/index.js +260 -0
  116. package/resource/basis/basis_transcoder.js +22 -0
  117. package/resource/basis/basis_transcoder.wasm +0 -0
  118. package/resource/gltf/draco_decoder.js +31 -0
  119. package/resource/gltf/draco_decoder.wasm +0 -0
  120. package/resource/gltf/draco_wasm_wrapper.js +119 -0
  121. package/scripts/five-plugin-init.js +83 -0
  122. package/scripts/five-quick-start-init.js +80 -0
  123. package/scripts/five-react-component-init.js +83 -0
  124. package/scripts/five-staticify.js +21 -0
  125. package/server/index.d.ts +568 -0
  126. package/server/index.js +367 -0
  127. package/sticker/index.d.ts +70 -0
  128. package/sticker/index.js +260 -0
  129. package/templates/plugin/README.md +38 -0
  130. package/templates/plugin/devtools/external-five.js +5 -0
  131. package/templates/plugin/devtools/external-three.js +5 -0
  132. package/templates/plugin/devtools/tsconfig.build.json +18 -0
  133. package/templates/plugin/devtools/webpack.bundle.js +44 -0
  134. package/templates/plugin/devtools/webpack.example.js +39 -0
  135. package/templates/plugin/docs/.gitkeep +0 -0
  136. package/templates/plugin/examples/data.json +507 -0
  137. package/templates/plugin/examples/index.html +28 -0
  138. package/templates/plugin/examples/index.ts +12 -0
  139. package/templates/plugin/lib/index.ts +30 -0
  140. package/templates/plugin/package.json +32 -0
  141. package/templates/plugin/tsconfig.json +26 -0
  142. package/templates/quick-start/README.md +47 -0
  143. package/templates/quick-start/assets/work.json +507 -0
  144. package/templates/quick-start/index.html +54 -0
  145. package/templates/quick-start/index.tsx +123 -0
  146. package/templates/quick-start/package.json +25 -0
  147. package/templates/quick-start/tsconfig.json +27 -0
  148. package/templates/quick-start/webpack.config.js +45 -0
  149. package/templates/quick-start/webpack.production.js +42 -0
  150. package/templates/react-component/README.md +32 -0
  151. package/templates/react-component/devtools/external-five.js +5 -0
  152. package/templates/react-component/devtools/external-react.js +5 -0
  153. package/templates/react-component/devtools/external-three.js +5 -0
  154. package/templates/react-component/devtools/tsconfig.build.json +19 -0
  155. package/templates/react-component/devtools/webpack.bundle.js +44 -0
  156. package/templates/react-component/devtools/webpack.example.js +39 -0
  157. package/templates/react-component/docs/.gitkeep +0 -0
  158. package/templates/react-component/examples/data.json +507 -0
  159. package/templates/react-component/examples/index.html +17 -0
  160. package/templates/react-component/examples/index.tsx +62 -0
  161. package/templates/react-component/lib/index.tsx +157 -0
  162. package/templates/react-component/package.json +38 -0
  163. package/templates/react-component/tsconfig.json +27 -0
  164. package/umd/five-gltf-loader.js +2 -0
  165. package/umd/five-gltf-loader.js.LICENSE.txt +14 -0
  166. package/umd/five-line.js +2 -0
  167. package/umd/five-line.js.LICENSE.txt +14 -0
  168. package/umd/five-react.js +2 -0
  169. package/umd/five-react.js.LICENSE.txt +14 -0
  170. package/umd/five-sticker.js +2 -0
  171. package/umd/five-sticker.js.LICENSE.txt +14 -0
  172. package/umd/five.js +2 -0
  173. package/umd/five.js.LICENSE.txt +116 -0
@@ -0,0 +1,68 @@
1
+ import * as THREE_2 from 'three';
2
+
3
+ export declare class Line extends THREE_2.Object3D {
4
+ line: THREE_Line2;
5
+ points: THREE_2.Points<THREE_2.BufferGeometry>;
6
+ needsRender: boolean;
7
+ constructor(vector0?: THREE_2.Vector3, vector1?: THREE_2.Vector3);
8
+ setPoints(vector0: THREE_2.Vector3, vector1: THREE_2.Vector3): void;
9
+ getPoints(): THREE_2.Vector3[];
10
+ setMaterial(map: ConstructorParameters<typeof LineMaterial>[0]): void;
11
+ setResolution(width: number, height: number): void;
12
+ }
13
+
14
+ export declare class LineGeometry extends LineSegmentsGeometry {
15
+ constructor();
16
+ setPositions(array: ArrayLike<number>): this;
17
+ setColors(array: ArrayLike<number>): this;
18
+ fromLine(line: THREE_2.Line): this;
19
+ copy(): this;
20
+ }
21
+
22
+ export declare class LineMaterial extends THREE_2.ShaderMaterial {
23
+ color: number | THREE_2.Vector3;
24
+ dashed: boolean;
25
+ dashScale: number;
26
+ dashSize: number;
27
+ gapSize: number;
28
+ resolution: THREE_2.Vector2;
29
+ constructor(parameters: LineMaterialParameters);
30
+ }
31
+
32
+ export declare type LineMaterialParameters = {
33
+ color?: number | THREE_2.Vector3;
34
+ linewidth?: number;
35
+ dashed?: boolean;
36
+ dashScale?: number;
37
+ dashSize?: number;
38
+ gapSize?: number;
39
+ resolution?: THREE_2.Vector2;
40
+ };
41
+
42
+ export declare class LineSegmentsGeometry extends THREE_2.InstancedBufferGeometry {
43
+ constructor();
44
+ applyMatrix4(matrix: THREE_2.Matrix4): this;
45
+ setPositions(array: ArrayLike<number> | number[]): this;
46
+ setColors(array: Float32Array | number[]): this;
47
+ fromWireframeGeometry(geometry: THREE_2.WireframeGeometry): this;
48
+ fromEdgesGeometry(geometry: THREE_2.EdgesGeometry): this;
49
+ fromMesh(mesh: THREE_2.Mesh): this;
50
+ fromLineSegments(lineSegments: THREE_2.LineSegments): this;
51
+ computeBoundingBox(): void;
52
+ computeBoundingSphere(): void;
53
+ toJSON(): void;
54
+ }
55
+
56
+ export declare class THREE_Line2 extends THREE_LineSegments2 {
57
+ constructor(geometry: LineGeometry, material: LineMaterial);
58
+ }
59
+
60
+ export declare class THREE_LineSegments2 extends THREE_2.Mesh<LineSegmentsGeometry, LineMaterial> {
61
+ constructor(geometry: LineSegmentsGeometry, material: LineMaterial);
62
+ computeLineDistances(): this;
63
+ raycast(raycaster: THREE_2.Raycaster, intersects: (THREE_2.Intersection & {
64
+ pointOnLine: THREE_2.Vector3;
65
+ })[]): void;
66
+ }
67
+
68
+ export { }
package/line/index.js ADDED
@@ -0,0 +1,260 @@
1
+ /**
2
+ * @realsee/five
3
+ *
4
+ * Generated: 2022-02-22
5
+ * Version: 5.0.0-alpha.100
6
+ *
7
+ * Terms:
8
+ * Realsee SDK License Agreement
9
+ *
10
+ * Update: July 28, 2021
11
+ *
12
+ * THIS LICENSE AGREEMENT BETWEEN YOU AND 【BEIKE REALSEE TECHNOLOGY (HK)
13
+ * LIMITED】(“Realsee”) FORMS A LEGALLY BINDING CONTRACT BETWEEN YOU AND REALSEE IN
14
+ * RELATION TO YOUR USE OF THE SDK. This License Agreement accompanies the Realsee
15
+ * Software Development Kit(s) for the software and related explanatory materials
16
+ * (the "SDK") and includes any upgrades, modified versions, updates, additions,
17
+ * and copies of the SDK licensed to You by Realsee.
18
+ * BY DOWNLOADING, INSTALLING, OR OTHERWISE ACCESSING OR USING THE SDK, YOU AGREE
19
+ * THAT YOU HAVE READ, UNDERSTOOD, AND AGREE TO BE BOUND BY THIS AGREEMENT. YOU ARE
20
+ * AGREEING ON YOUR OWN BEHALF AND/OR ON BEHALF OF YOUR COMPANY OR ORGANIZATION TO
21
+ * THE TERMS AND CONDITIONS STATED BELOW.
22
+ * This Agreement applies to Your use of the SDK in the country in which You
23
+ * legally install it (“Territory”) and is subject to the laws of such Territory
24
+ * and further subject to Section 12 below. Different terms, conditions, and
25
+ * limitations may apply to the use of the SDK in any additional countries.
26
+ * 1. DEFINITIONS.
27
+ * “Agreement” means this Realsee SDK License Agreement.
28
+ * “Developer”, “You” and “Your” means the person(s) or entity acquiring or using
29
+ * the SDK or otherwise exercising rights under the terms of this Agreement.
30
+ * “Documentation” means the technical or other specifications or documentation
31
+ * that Realsee may provide to You for use in connection with the SDK.
32
+ * “Integrated Product” means any software, website, or on-line service developed
33
+ * by You based on or using the SDK (collectively, the “Integrated Product”).
34
+ * “Intellectual Property” means any patents, patent rights, trademarks, service
35
+ * marks, registered and unregistered designs, applications for any of the
36
+ * foregoing, copyright, and any other similar protected rights in any country and
37
+ * to the extent recognised by any relevant jurisdiction as intellectual property,
38
+ * trade secrets, know-how and confidential information. Realsee reserves all
39
+ * rights not expressly granted to You.
40
+ * “Realsee” means [Beike Realsee Technology (HK) Limited, a company incorporated
41
+ * and validly existing under the laws of Hong Kong].
42
+ * “SDK” means the Realsee-proprietary Software Development Kits (SDK) provided
43
+ * hereunder, includes all development tools (including any compiler and debugger),
44
+ * application programming interfaces (“APIs”), libraries, binary utilities, header
45
+ * files, Documentation, content, data, code samples, and other materials provided
46
+ * to You in connection with this Agreement, whether delivered through a download,
47
+ * or any other media or form, and is licensed, not sold, to You by Realsee for use
48
+ * only under the terms of this Agreement. The terms of this Agreement will govern
49
+ * any updates provided by Realsee that replace and/or supplement the original SDK
50
+ * delivered to You, unless such update is accompanied by a separate license, in
51
+ * which case the terms of such license will govern.
52
+ * 2. LICENSED USES AND RESTRICTIONS.
53
+ * 2.1 Subject to the restrictions contained in this Section 2, Realsee grants to
54
+ * You during the term, a limited, non-exclusive, revocable, non-sublicensable,
55
+ * non-transferable license to install and use the SDK within the Territory only
56
+ * for the purpose of internal development.
57
+ * 2.2 Restrictions. You acknowledge and agree that, You shall not, and shall
58
+ * ensure that Your affiliates, employees, agents, representatives, officers,
59
+ * representatives, and subcontractors do not (directly or indirectly):
60
+ * 2.2.1 decompile, reverse engineer, disassemble or attempt to derive the source
61
+ * code of, those components of the SDK provided in object code form, or any part
62
+ * thereof;
63
+ * 2.2.2 remove, alter, or obscure any copyright notice or other proprietary rights
64
+ * notice on any part of the SDK;
65
+ * 2.2.3 sell, assign, pledge, rent, lease, lend, upload to or host on any website
66
+ * or server for use by any third party except You, redistribute, or sublicense the
67
+ * SDK (or any part thereof), or operate the SDK (or any part thereof) in the
68
+ * capacity of a service bureau or other hosted services provider, in whole or in
69
+ * part, nor may You enable others to do so;
70
+ * 2.2.4 or alter, modify, customize or improve the SDK, or any part thereof;
71
+ * 2.2.5 use the SDK (or any part thereof) for any illegal purpose, in any manner
72
+ * that is inconsistent with the terms of this Agreement, or to engage in any
73
+ * illegal activity;
74
+ * 2.2.6 use the SDK (or any part thereof) in any manner that may damage the
75
+ * operation of Realsee’s products or services; or
76
+ * 2.2.7 use the SDK or any information contained therein or otherwise provided by
77
+ * Realsee for the purpose of developing, or having developed, any product
78
+ * competitive with any Realsee product or service, as determined by Realsee in its
79
+ * sole discretion;
80
+ * 2.2.8 include any portion of the SDK in Your Developer products.
81
+ * 2.3 Realsee has the right to impose reasonable conditions such as a reasonable
82
+ * fee for use of the SDK in Integrated Product in the future.
83
+ * 2.4 You may make a limited number of copies of the SDK to be used by Your
84
+ * employees or consultants as provided herein, and not for general business
85
+ * purposes, and such employees or consultants shall be subject to the obligations
86
+ * and restrictions in this Agreement.
87
+ * 2.5 All licenses not expressly granted in this Agreement are reserved and no
88
+ * other licenses, immunity, or rights, express or implied, are granted by Realsee,
89
+ * by implication, estoppel, or otherwise.
90
+ * 3. CONFIDENTIALITY.
91
+ * The SDK and all source code, Documentation, specifications, engineering details,
92
+ * and related information pertaining to the SDK, whether in oral, written,
93
+ * graphic, or electronic form, are and shall remain the confidential and
94
+ * proprietary information of Realsee or its licensors (collectively, the
95
+ * “Confidential Information”). You shall (i) disclose Confidential Information to
96
+ * only those directors and employees (collectively, “Affiliates”) whose duties
97
+ * justify their need to know such information and who have been clearly informed
98
+ * of their obligation to maintain the confidential, proprietary, and/or trade
99
+ * secret status of such Confidential Information; and (ii) use Confidential
100
+ * Information solely in accordance with the license granted hereunder. In any
101
+ * event, You and Your Affiliates shall treat Confidential Information as strictly
102
+ * confidential and shall use the same care to prevent disclosure of such
103
+ * information as You use with respect to Your own similar confidential and/or
104
+ * proprietary information, which shall not be less than the care a reasonable
105
+ * person would use under similar circumstances. All Confidential Information, and
106
+ * any copies thereof, shall be returned promptly to Realsee upon request. You
107
+ * shall ensure that Your Affiliates comply with the provisions of this Section 3,
108
+ * and You shall be liable for any breach of this Section 3 resulting from the act
109
+ * or omission of any of Your Affiliates. You shall not disclose Confidential
110
+ * Information to any third party, including, without limitation, any of Your
111
+ * subcontractors.
112
+ * 4. PROPRIETARY RIGHTS.
113
+ * 4.1 As between You and Realsee, Realsee and/or its licensors retain ownership of
114
+ * all right, title, and interest in, to, and under the SDK, including, without
115
+ * limitation, all patents, copyrights, trade secrets, trademarks and other
116
+ * intellectual property and other proprietary rights therein, and reserve all
117
+ * rights not expressly granted to You.
118
+ * 4.2 The items contained in the SDK are the intellectual property of Realsee and
119
+ * its licensors and are protected by PRC copyright and patent law, international
120
+ * treaty provisions and applicable laws of the country in which it is being used.
121
+ * You agree to protect all copyright and other ownership interests of Realsee
122
+ * and/or its licensors in all items in the SDK supplied under this License
123
+ * Agreement. You agree that all copies of the items in the SDK, reproduced for any
124
+ * reason by You, contain the same copyright notices, and other proprietary notices
125
+ * as appropriate, as appear on or in the original items delivered by Realsee in
126
+ * the SDK. Realsee and/or its licensors retain title and ownership of the items in
127
+ * the SDK, the media on which it is loaded, and all subsequent copies, regardless
128
+ * of the form or media in or on which the original and other copies may exist.
129
+ * Except as stated above, this Agreement does not grant You any rights to patents,
130
+ * copyrights, trade secrets, trademarks or any other rights in respect to the
131
+ * items in the SDK.
132
+ * 5. TERM AND TERMINATION.
133
+ * 5.1 This Agreement is effective until terminated. Realsee has the right to
134
+ * terminate this Agreement immediately, without judicial intervention, if You fail
135
+ * to comply with any term herein. Upon any such termination You must remove all
136
+ * full and partial copies of the items in the SDK from Your computer and
137
+ * discontinue the use of the items in the SDK.
138
+ * 5.2 Realsee may at any time, terminate the Agreement with You if: (A) You have
139
+ * breached any provision of the Agreement; or (B) Realsee is required to do so by
140
+ * law; or (C) Realsee decides to no longer provide the SDK or certain parts of the
141
+ * SDK to users in the country in which You are resident or from which You use the
142
+ * service, or the provision of the SDK or certain SDK services to You by Realsee
143
+ * is, in Realsee's sole discretion, no longer legally or commercially viable.
144
+ * 5.3 When the Agreement comes to an end, all of the legal rights, obligations and
145
+ * liabilities that You and Realsee have benefited from, been subject to (or which
146
+ * have accrued over time whilst the Agreement has been in force) or which are
147
+ * expressed to continue indefinitely, shall be unaffected by this cessation, and
148
+ * the provisions of Section 3, 4, 6, 7 and 8 shall continue to apply to such
149
+ * rights, obligations and liabilities indefinitely.
150
+ * 6. DISCLAIMER OF WARRANTY.
151
+ * YOU EXPRESSLY ACKNOWLEDGE AND AGREE THAT, TO THE EXTENT PERMITTED BY APPLICABLE
152
+ * LAW, USE OF THE SDK (OR ANY PART THEREOF) IS AT YOUR SOLE RISK AND THAT THE
153
+ * ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS
154
+ * WITH YOU. REALSEE LICENSES THE SDK TO YOU ONLY ON AN "AS-IS" BASIS. REALSEE
155
+ * MAKES NO REPRESENTATION WITH RESPECT TO THE ADEQUACY OF ANY ITEMS IN THE SDK,
156
+ * WHETHER OR NOT USED BY YOU IN THE DEVELOPMENT OF INTEGRATED PRODUCT, FOR ANY
157
+ * PARTICULAR PURPOSE OR WITH RESPECT TO THEIR ADEQUACY TO PRODUCE ANY PARTICULAR
158
+ * RESULT. REALSEE AND ITS LICENSORS SHALL NOT BE LIABLE FOR LOSS OR DAMAGE ARISING
159
+ * OUT OF THIS AGREEMENT OR FROM THE DISTRIBUTION OR USE OF INTEGRATED PRODUCT
160
+ * CONTAINING PORTIONS OF THE SDK. REALSEE AND ITS LICENSORS DISCLAIM ALL
161
+ * WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED
162
+ * CONDITIONS OR WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
163
+ * OR NONINFRINGEMENT OF ANY THIRD PARTY RIGHT IN RESPECT OF THE ITEMS IN THE SDK
164
+ * OR ANY SERVICES RELATED TO THE SDK.
165
+ * REALSEE IS UNDER NO OBLIGATION TO PROVIDE ANY SUPPORT UNDER THIS LICENSE
166
+ * AGREEMENT, INCLUDING UPGRADES OR FUTURE VERSIONS OF THE SDK OR ANY PORTIONS
167
+ * THEREOF, TO YOU, END USER OR TO ANY OTHER PARTY.
168
+ * 7. LIMITATION OF LIABILITY.
169
+ * TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW, IN NO EVENT WILL REALSEE OR ITS
170
+ * LICENSORS BE LIABLE FOR ANY DIRECT, INCIDENTAL, SPECIAL, INDIRECT, OR
171
+ * CONSEQUENTIAL DAMAGES, INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF USE,
172
+ * LOSS OF BUSINESS, REVENUE, OR PROFITS, LOSS OF OPPORTUNITY (WHETHER DIRECT OR
173
+ * INDIRECT), CORRUPTION OR LOSS OF DATA, LOSS OF REPUTATION OR SAVINGS, DOWNTIME,
174
+ * OR DAMAGE TO, LOSS OF OR REPLACEMENT OF DATA OR TRANSACTIONS, COST OF
175
+ * PROCUREMENT OF SUBSTITUTE SERVICES, BUSINESS INTERRUPTION, OR ANY OTHER
176
+ * COMMERCIAL DAMAGES OR LOSSES, ARISING OUT OF OR RELATED TO YOUR USE OR INABILITY
177
+ * TO USE THE SDK (OR ANY PART THEREOF), ANY INTEGRATED PRODUCT, OR ANY THIRD PARTY
178
+ * SOFTWARE, APPLICATIONS, OR SERVICES IN CONJUNCTION WITH THE SDK (OR ANY PART
179
+ * THEREOF), HOWEVER CAUSED, REGARDLESS OF THE THEORY OF LIABILITY (CONTRACT, TORT,
180
+ * OR OTHERWISE) AND EVEN IF REALSEE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
181
+ * DAMAGES. IN NO EVENT WILL REALSEE’S TOTAL LIABILITY TO YOU FOR ALL DAMAGES
182
+ * EXCEED ONE HUNDRED DOLLARS ($100.00). THE FOREGOING LIMITATIONS WILL APPLY EVEN
183
+ * IF THE ABOVE STATED REMEDY FAILS OF ITS ESSENTIAL PURPOSE. THE LIMITATIONS
184
+ * CONTAINED IN SECTIONS 6 AND THIS SECTION 7 ARE A FUNDAMENTAL PART OF THE BASIS
185
+ * OF REALSEE’S BARGAIN HEREUNDER, AND REALSEE WOULD NOT ENTER INTO THIS AGREEMENT
186
+ * OR PROVIDE YOU WITH ACCESS TO THE SDK ABSENT SUCH LIMITATIONS.
187
+ * 8. INDEMNIFICATION.
188
+ * To the extent permitted by applicable law, You agree to indemnify, defend and
189
+ * hold harmless Realsee, its affiliates and each of their directors, officers,
190
+ * employees, independent contractors, and agents (each a “Realsee Indemnified
191
+ * Party”) from any and all claims, losses, liabilities, damages, expenses, and
192
+ * costs (including without limitation attorneys’ fees and court costs) incurred by
193
+ * a Realsee Indemnified Party as a result of: (i) Your non-compliance with any
194
+ * terms of this Agreement; (ii) Your use of the SDK (or any part thereof); or
195
+ * (iii) Your use of any Integrated Product, including any claim that Integrated
196
+ * Product infringes the copyright, trademark, trade secret or other intellectual
197
+ * property right of a third party.
198
+ * 9. ACKNOWLEDGEMENTS.
199
+ * Portions of the SDK may utilize or include third party software and other
200
+ * copyrighted material. Acknowledgments, licensing terms, and disclaimers for such
201
+ * material are contained in Documentation for the SDK or may otherwise accompany
202
+ * such material, and Your use of such materials governed by their respective
203
+ * terms. In the event of conflict between the terms of this Agreement and an
204
+ * applicable open source or third party agreement, the open source or third party
205
+ * agreement will control solely with respect to the open source software or third
206
+ * party software. Moreover, You shall not subject any items (including not limited
207
+ * to source code, object code, and any software) included in the SDK to any open
208
+ * source license.
209
+ * 10. NON-BLOCKING OF REALSEE DEVELOPMENT.
210
+ * You acknowledge that Realsee is currently developing or may develop technologies
211
+ * and products in the future that have or may have design and/or functionality
212
+ * similar to Integrated Product that You may develop based on Your license herein.
213
+ * Nothing in this Agreement shall impair, limit or curtail Realsee's right to
214
+ * continue with its development, maintenance and/or distribution of Realsee's
215
+ * technology or products.
216
+ * 11. GENERAL.
217
+ * 11.1 Export Control. You may not use or otherwise export or re-export the SDK
218
+ * (or any part thereof) except as authorized by United States law and the laws of
219
+ * the jurisdiction(s) in which the SDK (or any part thereof) was obtained. In
220
+ * particular, but without limitation, the SDK may not be exported or re-exported
221
+ * (i) into any U.S. embargoed countries or (ii) to anyone on the U.S. Treasury
222
+ * Department's list of Specially Designated Nationals or the U.S. Department of
223
+ * Commerce Denied Person's List or Entity List. By using the SDK (or any part
224
+ * thereof), You represent and warrant that You are not located in any such country
225
+ * or on any such list.
226
+ * 11.2 Governing Law. This Agreement and the rights of the parties hereunder shall
227
+ * be governed by and construed in accordance with the laws of People’s Republic of
228
+ * China (for purpose of this Agreement, excluding Hong Kong, Taiwan, and Macau),
229
+ * without reference to its conflict of laws principles. Any dispute, controversy
230
+ * or claim arising from or in connection with this Agreement, or the breach,
231
+ * termination or invalidity thereof, shall be submitted to China International
232
+ * Economic and Trade Arbitration Commission (“CIETAC”) for arbitration in Beijing
233
+ * which shall be conducted in accordance with the CIETAC's arbitration rules in
234
+ * effect at the time of applying for arbitration. The arbitral award is final and
235
+ * binding upon both parties.
236
+ * 11.3 Severability. If any provision of this Agreement is held by a court of
237
+ * competent jurisdiction to be unenforceable for any reason, the remaining
238
+ * provisions hereof will be unaffected and remain in full force and effect.
239
+ * 11.4. Modifications. Realsee reserves the right, from time to time, with or
240
+ * without notice to You, to make revisions to this Agreement in our sole and
241
+ * absolute discretion. The most current version of this Agreement will supersede
242
+ * all previous versions and shall be made available on the website where the SDK
243
+ * is made available, or by such other means as Realsee may determine in its
244
+ * discretion. Any modified versions of this Agreement hereto shall take effect
245
+ * from the time that it is made available. You shall be responsible for regularly
246
+ * checking for notice of any such modifications. You agree that Your continued use
247
+ * of the SDK constitutes Your agreement to the modified Agreement.
248
+ * 11.5 Relationship of the Parties. This Agreement will not be construed as
249
+ * creating an agency, partnership, joint venture, fiduciary duty, or any other
250
+ * form of legal association between You and Realsee, and You will not represent to
251
+ * the contrary, whether expressly, by implication, appearance, or otherwise.
252
+ * 11.6 Entire Agreement; Governing Language. This Agreement constitutes the entire
253
+ * agreement between You and Realsee with respect to the use of the SDK licensed
254
+ * hereunder and supersedes all prior understandings regarding such subject matter.
255
+ * No amendment to or modification of this Agreement will be binding unless in
256
+ * writing and signed by Realsee. You and Realsee hereto confirm that this
257
+ * Agreement and all related documents shall be drafted in English.
258
+ */
259
+
260
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib");function e(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var n=e(require("three")),i=function(e){function i(){var t=e.call(this)||this;t.type="LineSegmentsGeometry";return t.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),t.setAttribute("position",new n.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),t.setAttribute("uv",new n.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2)),t}return t.__extends(i,e),i.prototype.applyMatrix4=function(t){var e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==e&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},i.prototype.setPositions=function(t){var e;e=t instanceof Float32Array?t:Array.isArray(t)?new Float32Array(t):new Float32Array;var i=new n.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceStart",new n.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new n.InterleavedBufferAttribute(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},i.prototype.setColors=function(t){var e;e=t instanceof Float32Array?t:Array.isArray(t)?new Float32Array(t):new Float32Array;var i=new n.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceColorStart",new n.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceColorEnd",new n.InterleavedBufferAttribute(i,3,3)),this},i.prototype.fromWireframeGeometry=function(t){return this.setPositions(t.attributes.position.array),this},i.prototype.fromEdgesGeometry=function(t){return this.setPositions(t.attributes.position.array),this},i.prototype.fromMesh=function(t){return this.fromWireframeGeometry(new n.WireframeGeometry(t.geometry)),this},i.prototype.fromLineSegments=function(t){var e=t.geometry;if(e instanceof n.Geometry){var i=(new n.BufferGeometry).fromGeometry(e);this.setPositions(i.attributes.position.array)}else e instanceof n.BufferGeometry&&this.setPositions(e.attributes.position.array);return this},i.prototype.computeBoundingBox=function(){null===this.boundingBox&&(this.boundingBox=new n.Box3);var t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){var i=new n.Box3;this.boundingBox.setFromBufferAttribute(t),i.setFromBufferAttribute(e),this.boundingBox.union(i)}},i.prototype.computeBoundingSphere=function(){null===this.boundingSphere&&(this.boundingSphere=new n.Sphere),null===this.boundingBox&&this.computeBoundingBox();var t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){var i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var r=0,o=new n.Vector3,a=0,s=t.count;a<s;a++)o.fromBufferAttribute(t,a),r=Math.max(r,i.distanceToSquared(o)),o.fromBufferAttribute(e,a),r=Math.max(r,i.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},i.prototype.toJSON=function(){},i}(n.InstancedBufferGeometry);Object.assign(i.prototype,{isLineSegmentsGeometry:!0});var r={uniforms:n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new n.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"},o=function(e){function i(t){var i=e.call(this,{uniforms:n.UniformsUtils.clone(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,clipping:!0})||this;return i.type="LineMaterial",i.dashed=!1,Object.defineProperties(i,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}}}),i.setValues(t),i}return t.__extends(i,e),i}(n.ShaderMaterial);Object.assign(o.prototype,{isLineMaterial:!0});var a=function(e){function r(t,n){var r=e.call(this)||this;return r.type="LineSegments2",r.geometry=void 0!==t?t:new i,r.material=void 0!==n?n:new o({color:16777215*Math.random()}),r}return t.__extends(r,e),r.prototype.computeLineDistances=function(){for(var t=this.geometry,e=t.attributes.instanceStart,i=t.attributes.instanceEnd,r=new Float32Array(2*e.count),o=new n.Vector3,a=new n.Vector3,s=0,u=0,c=e.count;s<c;s++,u+=2)o.fromBufferAttribute(e,s),a.fromBufferAttribute(i,s),r[u]=0===u?0:r[u-1],r[u+1]=r[u]+o.distanceTo(a);var l=new n.InstancedInterleavedBuffer(r,2,1);return t.setAttribute("instanceDistanceStart",new n.InterleavedBufferAttribute(l,1,0)),t.setAttribute("instanceDistanceEnd",new n.InterleavedBufferAttribute(l,1,1)),this},r.prototype.raycast=function(t,e){null===t.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var i=t.ray,r=t.camera,o=r.projectionMatrix,a=this.geometry,s=this.material,u=s.resolution,c=s.linewidth,l=a.attributes.instanceStart,f=a.attributes.instanceEnd,d=new n.Vector4,p=new n.Vector4,m=new n.Vector4,h=new n.Vector3,v=new n.Matrix4,y=new n.Line3,A=new n.Vector3;i.at(1,m),m.w=1,m.applyMatrix4(r.matrixWorldInverse),m.applyMatrix4(o),m.multiplyScalar(1/m.w),m.x*=u.x/2,m.y*=u.y/2,m.z=0,h.copy(m);var g=this.matrixWorld;v.multiplyMatrices(r.matrixWorldInverse,g);for(var b=0,S=l.count;b<S;b++){d.fromBufferAttribute(l,b),p.fromBufferAttribute(f,b),d.w=1,p.w=1,d.applyMatrix4(v),p.applyMatrix4(v),d.applyMatrix4(o),p.applyMatrix4(o),d.multiplyScalar(1/d.w),p.multiplyScalar(1/p.w);var w=d.z<-1&&p.z<-1,x=d.z>1&&p.z>1;if(!w&&!x){d.x*=u.x/2,d.y*=u.y/2,p.x*=u.x/2,p.y*=u.y/2,y.start.copy(d),y.start.z=0,y.end.copy(p),y.end.z=0;var B=y.closestPointToPointParameter(h,!0);y.at(B,A);var E=n.MathUtils.lerp(d.z,p.z,B),z=E>=-1&&E<=1,M=h.distanceTo(A)<.5*c;if(z&&M){y.start.fromBufferAttribute(l,b),y.end.fromBufferAttribute(f,b),y.start.applyMatrix4(g),y.end.applyMatrix4(g);var C=new n.Vector3,L=new n.Vector3;i.distanceSqToSegment(y.start,y.end,L,C),e.push({point:L,pointOnLine:C,distance:i.origin.distanceTo(L),object:this,faceIndex:b})}}}},r}(n.Mesh);Object.assign(a.prototype,{isLineSegments2:!0});var s=function(e){function n(t,n){var i=e.call(this,t,n)||this;return i.type="Line2",i}return t.__extends(n,e),n}(a);Object.assign(s.prototype,{isLine2:!0});var u=function(e){function i(){var t=e.call(this)||this;return t.type="LineGeometry",t}return t.__extends(i,e),i.prototype.setPositions=function(t){for(var n=t.length-3,i=new Float32Array(2*n),r=0;r<n;r+=3)i[2*r]=t[r],i[2*r+1]=t[r+1],i[2*r+2]=t[r+2],i[2*r+3]=t[r+3],i[2*r+4]=t[r+4],i[2*r+5]=t[r+5];return e.prototype.setPositions.call(this,i),this},i.prototype.setColors=function(t){for(var n=t.length-3,i=new Float32Array(2*n),r=0;r<n;r+=3)i[2*r]=t[r],i[2*r+1]=t[r+1],i[2*r+2]=t[r+2],i[2*r+3]=t[r+3],i[2*r+4]=t[r+4],i[2*r+5]=t[r+5];return e.prototype.setColors.call(this,i),this},i.prototype.fromLine=function(t){var e=t.geometry;if(e instanceof n.Geometry){var i=(new n.BufferGeometry).fromGeometry(e);this.setPositions(i.attributes.position.array)}else e instanceof n.BufferGeometry&&this.setPositions(e.attributes.position.array);return this},i.prototype.copy=function(){return this},i}(i);Object.assign(u.prototype,{isLineGeometry:!0});var c=null,l=function(e){function i(t,i){void 0===t&&(t=new n.Vector3),void 0===i&&(i=new n.Vector3);var r=e.call(this)||this;r.type="FiveLine",r.needsRender=!0;var a=new u,l=new o({color:14467195,linewidth:2,dashScale:20,dashed:!1});r.line=new s(a,l);var f=new n.BufferGeometry,d=new n.PointsMaterial({color:14467195,size:8,map:c||(c=(new n.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==")),sizeAttenuation:!1,transparent:!0});return r.points=new n.Points(f,d),r.points.renderOrder=11,r.points.frustumCulled=!1,r.setPoints(t,i),r.add(r.line,r.points),r}return t.__extends(i,e),i.prototype.setPoints=function(t,e){var i=[].concat(t.toArray(),e.toArray());this.points.geometry.setAttribute("position",new n.BufferAttribute(new Float32Array(i),3)),this.line.geometry.setPositions(i),this.line.computeLineDistances(),this.needsRender=!0},i.prototype.getPoints=function(){var t=this.points.geometry.attributes.position.array;return[new n.Vector3(t[0],t[1],t[2]),new n.Vector3(t[3],t[4],t[5])]},i.prototype.setMaterial=function(t){var e=this.line.material;for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];"dashed"===n?(e.dashed=i,i?e.defines.USE_DASH="":delete e.defines.USE_DASH,e.needsUpdate=!0):e[n]=t[n]}this.needsRender=!0},i.prototype.setResolution=function(t,e){var n=this.line.material.resolution;n.x===t&&n.y===e||(n.set(t,e),this.needsRender=!0)},i}(n.Object3D);Object.assign(l.prototype,{isFiveLine:!0}),exports.Line=l,exports.LineGeometry=u,exports.LineMaterial=o,exports.LineSegmentsGeometry=i,exports.THREE_Line2=s,exports.THREE_LineSegments2=a;
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@realsee/five",
3
+ "version": "5.0.0-alpha.100",
4
+ "description": "Realsee Renderer SDK",
5
+ "bin": {
6
+ "five-plugin-init": "./scripts/five-plugin-init.js",
7
+ "five-react-component-init": "./scripts/five-react-component-init.js",
8
+ "five-quick-start-init": "./scripts/five-quick-start-init.js",
9
+ "five-staticify": "./scripts/five-staticify.js"
10
+ },
11
+ "author": "BEIKE REALSEE TECHNOLOGY (HK) LIMITED",
12
+ "license": "SEE LICENSE IN TERMS.txt",
13
+ "peerDependencies": {
14
+ "@types/react": "^16.0.0",
15
+ "react": "^16.0.0",
16
+ "three": "^0.117.1"
17
+ },
18
+ "peerDependenciesMeta": {
19
+ "react": {
20
+ "optional": true
21
+ },
22
+ "@types/react": {
23
+ "optional": true
24
+ }
25
+ },
26
+ "dependencies": {
27
+ "archiver": "^5.3.0",
28
+ "commander": "^8.2.0",
29
+ "copyfiles": "^2.4.1",
30
+ "glob": "^7.1.6",
31
+ "protobufjs": "^6.8.8",
32
+ "tslib": "^2.3.0"
33
+ },
34
+ "main": "five/index.js",
35
+ "types": "five/index.d.ts"
36
+ }