@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,70 @@
1
+ import * as THREE_2 from 'three';
2
+
3
+ /**
4
+ * 焦点
5
+ * @description
6
+ * 可以传入 THREE.Intersection 可以是 Five 的 Intersection
7
+ */
8
+ export declare interface IntersectionLike {
9
+ /** 焦点坐标 */
10
+ point: THREE_2.Vector3;
11
+ /** 焦点面片 */
12
+ face?: {
13
+ normal: THREE_2.Vector3;
14
+ } | null;
15
+ }
16
+
17
+ /**
18
+ * 贴纸
19
+ */
20
+ export declare class Sticker extends THREE_2.Mesh<THREE_2.BufferGeometry, THREE_2.MeshBasicMaterial> {
21
+ private _needsRender;
22
+ /**
23
+ * 贴纸
24
+ * @description
25
+ * 默认加载时, 透明图根据图片类型,如果是 png 默认透明,其他为不透明,且不支持 gif 动画。
26
+ * @param width - 贴纸长
27
+ * @param height - 贴纸宽
28
+ * @param resource - 贴纸图片地址 或者 image / canvas / video 标签
29
+ *
30
+ * @example
31
+ * ```
32
+ * const resource = "http://vrlab-public.ljcdn.com/release/static/image/release/five/demo/sticker/kagami.jpg";
33
+ * five.on("wantsTapGesture", raycaster => {
34
+ * const [intersection] = five.model.intersectRaycaster(raycaster);
35
+ * if (intersection) {
36
+ * const sticker = new Sticker(1, 1, resource);
37
+ * five.scene.add(sticker);
38
+ * sticker.locationWithIntersection(intersection);
39
+ * }
40
+ * return false;
41
+ * });
42
+ * ```
43
+ */
44
+ constructor(width: number, height: number, resource: string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement);
45
+ get needsRender(): boolean;
46
+ set needsRender(value: boolean);
47
+ /**
48
+ * 设置贴纸大小
49
+ * @param width - 贴纸长
50
+ * @param height - 贴纸宽
51
+ */
52
+ setSize(width: number, height: number): void;
53
+ /**
54
+ * 设置贴纸背景是否透明
55
+ * @param transparent - 是否透明
56
+ */
57
+ setTransparent(transparent: boolean): void;
58
+ /**
59
+ * 通过焦点快捷设置贴纸位置
60
+ * @param intersection - 焦点
61
+ * @param offset - 位置值(已通过焦点面的法线位移一定值,防止重叠)
62
+ */
63
+ locationWithIntersection(intersection: IntersectionLike, offset?: number): void;
64
+ /**
65
+ * 资源回收
66
+ */
67
+ dispose(): void;
68
+ }
69
+
70
+ export { }
@@ -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 e=require("tslib");function t(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var n=t(require("three")),r=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),i=new Float32Array([0,0,1,0,0,1,1,1]),a=new Uint8Array([0,1,2,1,3,2]),o=new n.BufferGeometry;o.setAttribute("position",new n.BufferAttribute(r,3)),o.setAttribute("uv",new n.BufferAttribute(i,2)),o.setIndex(new n.BufferAttribute(a,1));var s=window,u=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame||function(e){return setTimeout(e,16)},d="undefined"!=typeof performance&&void 0!==performance.timing?performance.timing.navigationStart:Date.now(),p="undefined"!=typeof performance?function(){return d+performance.now()}:function(){return Date.now()};function c(e,t){var n=e.dispose;e.dispose=function(){t(),n.call(e)}}var f=function(t){function r(e,r,i){var a,s,d,f,m,l,v=this,g=new n.MeshBasicMaterial;if((v=t.call(this,o,g)||this)._needsRender=!1,v.scale.set(e,r,1),"string"==typeof i){g.transparent=/\.png$/.test(i);var h=new Image;h.src=i,h.crossOrigin="",i=h}if(i instanceof HTMLImageElement){var w=g.map=new n.Texture;w.wrapS=n.ClampToEdgeWrapping,w.wrapT=n.ClampToEdgeWrapping,w.minFilter=n.LinearFilter,w.encoding=n.sRGBEncoding,c(w,function(e,t){e.naturalWidth>0&&u((function(){return t()}));var n=function(){return t()};return e.addEventListener("load",n,!1),function(){return e.removeEventListener("load",n,!1)}}(i,(function(){w.image=i,w.needsUpdate=!0,v._needsRender=!0})))}else if(i instanceof HTMLCanvasElement)g.map=new n.CanvasTexture(i);else if(i instanceof HTMLVideoElement){var y=g.map=new n.VideoTexture(i);y.wrapS=n.ClampToEdgeWrapping,y.wrapT=n.ClampToEdgeWrapping,y.minFilter=n.LinearFilter,y.encoding=n.sRGBEncoding,c(y,(a=i,s=function(){v._needsRender=!0},d=p(),f=!1,m=function(){f=!0,s(),p()-d<3e3?u(m):f=!1},l=function(){d=p(),!1===f&&m()},a.addEventListener("timeupdate",l,!1),function(){a.removeEventListener("timeupdate",l,!1),f=!1}))}return v}return e.__extends(r,t),Object.defineProperty(r.prototype,"needsRender",{get:function(){return this._needsRender},set:function(e){this._needsRender=e,!0===e&&this.material.map&&(this.material.map.needsUpdate=!0)},enumerable:!1,configurable:!0}),r.prototype.setSize=function(e,t){this.scale.set(e,t,1),this._needsRender=!0},r.prototype.setTransparent=function(e){this.material.transparent=e,this._needsRender=!0},r.prototype.locationWithIntersection=function(e,t){void 0===t&&(t=.005);var n=e.point,r=e.face;this.position.copy(n),r&&(this.position.add(r.normal.clone().setLength(t)),this.lookAt(n.clone().add(r.normal))),this._needsRender=!0},r.prototype.dispose=function(){var e;null===(e=this.material.map)||void 0===e||e.dispose(),this.material.dispose()},r}(n.Mesh);exports.Sticker=f;
@@ -0,0 +1,38 @@
1
+ # Five React 组件: a-five-react-component
2
+
3
+ > 这是一个 Five 的组件。
4
+ > 这个插件的用途是什么。
5
+ > 能干什么。为什么要使用这组件。
6
+
7
+ ## 参数 / 返回
8
+
9
+ 参数:
10
+ ```typescript
11
+ type ParameterType = {
12
+ parameter1: number,
13
+ parameter2: string,
14
+ };
15
+ ```
16
+
17
+ 返回:
18
+ ```typescript
19
+ type ExportType = void;
20
+ ```
21
+
22
+
23
+ ## 如何使用
24
+
25
+ ```typescript
26
+ import { Five } from "@realse/five";
27
+ import { AFivePlugin, FivePluginInit } from "a-five-plugin";
28
+
29
+ const five = new Five({
30
+ plugins: [
31
+ [AFivePlugin, null, {
32
+ parameter1: 123,
33
+ parameter2: "abc",
34
+ parameter3: [new THREE.Vector3(1, 2, 3)],
35
+ }] as FivePluginInit<typeof AFivePlugin>,
36
+ ]
37
+ });
38
+ ```
@@ -0,0 +1,5 @@
1
+ if (!('Five' in window)) {
2
+ throw new Error( '"Five" is not available. Please include "five.js" into your HTML.' );
3
+ }
4
+
5
+ module.exports = window.Five;
@@ -0,0 +1,5 @@
1
+ if (!('THREE' in window)) {
2
+ throw new Error( '"THREE" is not available. "Five" requires it. Please include "THREE.js" into your HTML.' );
3
+ }
4
+
5
+ module.exports = window.THREE;
@@ -0,0 +1,18 @@
1
+ {
2
+ "include": [
3
+ "../lib/**/*.ts"
4
+ ],
5
+ "compilerOptions": {
6
+ "target": "ES5",
7
+ "module": "CommonJS",
8
+ "declaration": true,
9
+ "allowSyntheticDefaultImports": true,
10
+ "esModuleInterop": true,
11
+ "moduleResolution": "node",
12
+ "sourceMap": true,
13
+ "allowJs": true,
14
+ "rootDir": "../lib",
15
+ "outDir": "../build",
16
+ "skipLibCheck": true
17
+ }
18
+ }
@@ -0,0 +1,44 @@
1
+ const path = require("path");
2
+ const { NormalModuleReplacementPlugin } = require("webpack");
3
+
4
+ const name = require("../package.json").name.split("/").pop();
5
+ const libraryName = name.replace(/(^|\-)\w/g, char => char[char.length - 1].toUpperCase());
6
+
7
+ module.exports = {
8
+ context: path.join(__dirname, "lib"),
9
+ entry: {
10
+ [name]: path.join(__dirname, '../lib/index.ts'),
11
+ },
12
+ output: {
13
+ path: path.join(__dirname, "../bundles"),
14
+ filename: "[name].js",
15
+ library: libraryName,
16
+ libraryTarget: "umd",
17
+ libraryExport: libraryName
18
+ },
19
+ mode: "production",
20
+ devtool: "source-map",
21
+ module: {
22
+ rules: [{
23
+ test: /\.ts$/i,
24
+ exclude: /node_modules/,
25
+ use: [{
26
+ loader: "ts-loader",
27
+ options: {
28
+ configFile: path.join(__dirname, "tsconfig.build.json"),
29
+ compilerOptions: {
30
+ "declaration": false,
31
+ "sourceMap": true,
32
+ }
33
+ },
34
+ }]
35
+ }],
36
+ },
37
+ plugins: [
38
+ new NormalModuleReplacementPlugin(/^three$/, path.join(__dirname, 'external-three.js')),
39
+ new NormalModuleReplacementPlugin(/^\@realsee\/five$/, path.join(__dirname, 'external-five.js')),
40
+ ],
41
+ resolve: {
42
+ extensions: [".js", ".jsx", ".ts", ".json"],
43
+ }
44
+ }
@@ -0,0 +1,39 @@
1
+ const path = require("path");
2
+ const glob = require("glob");
3
+
4
+ module.exports = {
5
+ context: path.join(__dirname, "../examples"),
6
+ entry: () => {
7
+ const list = glob.sync("**/index.ts", { cwd: path.join(__dirname, "../examples") });
8
+ const entry = {}
9
+ list.map(filename => {
10
+ const name = filename.replace(/\.ts$/i, '');
11
+ entry[name] = './' + filename;
12
+ })
13
+ return entry;
14
+ },
15
+ output: {
16
+ path: path.join(__dirname, "../examples"),
17
+ filename: "[name].bundle.js"
18
+ },
19
+ mode: "development",
20
+ devtool: "eval-cheap-source-map",
21
+ module: {
22
+ rules: [{
23
+ test: /\.ts$/i,
24
+ exclude: /node_modules/,
25
+ use: [{
26
+ loader: "ts-loader",
27
+ options: {
28
+ compilerOptions: {
29
+ "declaration": false,
30
+ "sourceMap": true,
31
+ }
32
+ },
33
+ }]
34
+ }]
35
+ },
36
+ resolve: {
37
+ extensions: [".js", ".jsx", ".ts", ".json"],
38
+ }
39
+ };
File without changes