@realsee/five 5.0.0-alpha.53 → 5.0.0-alpha.54
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/docs/assets/js/search.js +1 -1
- package/docs/classes/five.AnimationFrameLoop.html +522 -0
- package/docs/classes/five.BVH.html +488 -0
- package/docs/classes/five.BVHNode.html +468 -0
- package/docs/classes/five.BVHVector3.html +525 -0
- package/docs/classes/five.Camera.html +17 -17
- package/docs/classes/five.Five.html +212 -168
- package/docs/classes/five.InternalWebGLRenderer.html +4 -4
- package/docs/classes/five.Model.html +23 -26
- package/docs/classes/five.NetworkSubscribe.html +9 -9
- package/docs/classes/five.PBMContainer.html +7 -7
- package/docs/classes/five.PBMGroup.html +7 -7
- package/docs/classes/five.PBMMaterial.html +34 -194
- package/docs/classes/five.PBMMesh.html +4 -4
- package/docs/classes/five.Scene.html +4 -4
- package/docs/classes/five.Subscribe.html +9 -9
- package/docs/classes/five.Work.html +348 -0
- package/docs/classes/gltf_loader.GLTFLoader.html +4 -4
- package/docs/classes/gltf_loader.GLTFObject.html +4 -4
- package/docs/classes/line.Line.html +4 -4
- package/docs/classes/line.LineGeometry.html +4 -4
- package/docs/classes/line.LineMaterial.html +4 -4
- package/docs/classes/line.LineSegmentsGeometry.html +4 -4
- package/docs/classes/line.THREE_Line2.html +4 -4
- package/docs/classes/line.THREE_LineSegments2.html +4 -4
- package/docs/classes/react.Store.html +4 -4
- package/docs/classes/server.BVH.html +587 -0
- package/docs/classes/server.BVHNode.html +567 -0
- package/docs/classes/server.BVHVector3.html +624 -0
- package/docs/classes/server.Model.html +30 -15
- package/docs/classes/server.PBMGroup.html +22 -7
- package/docs/classes/server.PBMMesh.html +22 -7
- package/docs/classes/sticker.Sticker.html +4 -4
- package/docs/index.html +4 -4
- package/docs/interfaces/five.AddableObject.html +4 -4
- package/docs/interfaces/five.AnimationFrame.html +243 -0
- package/docs/interfaces/five.BVHIntersect.html +204 -0
- package/docs/interfaces/five.CameraPose.html +232 -0
- package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +40 -15
- package/docs/interfaces/five.EventCallback.html +33 -30
- package/docs/interfaces/five.FiveInitArgs.html +4 -4
- package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +11 -11
- package/docs/interfaces/five.ImageOptions.html +11 -63
- package/docs/interfaces/five.ImageURLOptions.html +260 -0
- package/docs/interfaces/five.IntersectMeshInterface.html +4 -4
- package/docs/interfaces/five.Intersection.html +4 -4
- package/docs/interfaces/five.ModelControllerCustomInitArgs.html +13 -13
- package/docs/interfaces/five.ModelEventCallback.html +4 -4
- package/docs/interfaces/five.MovePanoOptions.html +4 -4
- package/docs/interfaces/five.PBMPanoPicture.html +219 -0
- package/docs/interfaces/five.PBMPanoVideo.html +238 -0
- package/docs/interfaces/five.PBMParameters.html +30 -182
- package/docs/interfaces/five.PanoCircleMeshInterface.html +83 -18
- package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +30 -16
- package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +13 -13
- package/docs/interfaces/five.Pose.html +4 -4
- package/docs/interfaces/five.Scissor.html +4 -4
- package/docs/interfaces/five.State.html +4 -4
- package/docs/interfaces/five.SubscribeMixinType.emit.html +5 -5
- package/docs/interfaces/five.SubscribeMixinType.hasListener.html +5 -5
- package/docs/interfaces/five.SubscribeMixinType.off.html +5 -5
- package/docs/interfaces/five.SubscribeMixinType.on.html +5 -5
- package/docs/interfaces/five.SubscribeMixinType.once.html +5 -5
- package/docs/interfaces/five.TextureOptions.html +296 -0
- package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +7 -7
- package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +30 -15
- package/docs/interfaces/five.WorkCubeImage.html +251 -0
- package/docs/interfaces/five.WorkImage.html +306 -0
- package/docs/interfaces/five.WorkInitial.html +273 -0
- package/docs/interfaces/five.WorkModel.html +239 -0
- package/docs/interfaces/five.WorkObserver.html +323 -0
- package/docs/interfaces/five.WorkTile.html +274 -0
- package/docs/interfaces/five.WorkVideo.html +211 -0
- package/docs/interfaces/gltf_loader.GLTF.html +4 -4
- package/docs/interfaces/react.FiveActionReactCallbacks.html +4 -4
- package/docs/interfaces/react.FiveInjectionTypes.html +8 -8
- package/docs/interfaces/react.PropTypeOfFiveFeatures.html +4 -4
- package/docs/interfaces/server.BVHIntersect.html +303 -0
- package/docs/interfaces/server.Intersection.html +22 -7
- package/docs/interfaces/server.ModelEventCallback.html +22 -7
- package/docs/interfaces/sticker.IntersectionLike.html +4 -4
- package/docs/modules/five.SubscribeMixinType.html +4 -4
- package/docs/modules/five.html +188 -369
- package/docs/modules/gltf_loader.html +4 -4
- package/docs/modules/line.html +4 -4
- package/docs/modules/react.html +13 -13
- package/docs/modules/server.html +47 -22
- package/docs/modules/sticker.html +4 -4
- package/docs/modules.html +4 -4
- package/five/index.d.ts +297 -235
- package/five/index.js +13 -107
- package/gltf-loader/index.js +2 -2
- package/line/index.js +2 -2
- package/package.json +1 -3
- package/react/index.js +3 -3
- package/server/index.d.ts +136 -20
- package/server/index.js +11 -11
- package/sticker/index.js +2 -2
- package/umd/five-react.js +1 -1
- package/umd/five.js +1 -1
- package/docs/classes/five.HashCubeTexture.html +0 -266
package/gltf-loader/index.js
CHANGED
package/line/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@realsee/five",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.54",
|
|
4
4
|
"description": "Realsee Renderer SDK",
|
|
5
5
|
"bin": {
|
|
6
6
|
"five-plugin-init": "./scripts/five-plugin-init.js",
|
|
@@ -24,12 +24,10 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@tweenjs/tween.js": "^18.6.4",
|
|
28
27
|
"archiver": "^5.3.0",
|
|
29
28
|
"commander": "^8.2.0",
|
|
30
29
|
"copyfiles": "^2.4.1",
|
|
31
30
|
"glob": "^7.1.6",
|
|
32
|
-
"json-hash": "^1.2.0",
|
|
33
31
|
"protobufjs": "^6.8.8",
|
|
34
32
|
"tslib": "^2.3.0"
|
|
35
33
|
},
|
package/react/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @realsee/five
|
|
3
3
|
*
|
|
4
|
-
* Generated: 2021-11-
|
|
5
|
-
* Version: 5.0.0-alpha.
|
|
4
|
+
* Generated: 2021-11-29
|
|
5
|
+
* Version: 5.0.0-alpha.54
|
|
6
6
|
*
|
|
7
7
|
* Terms:
|
|
8
8
|
* Realsee SDK License Agreement
|
|
@@ -257,4 +257,4 @@
|
|
|
257
257
|
* Agreement and all related documents shall be drafted in English.
|
|
258
258
|
*/
|
|
259
259
|
|
|
260
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react"),n=require("three"),r=require("@realsee/five");function o(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 u=o(t),i=o(n),a=[];var f=u.createContext(null);function s(){var e=u.useContext(f);if(!e)throw new Error("FiveProvider never found.");return e.five}function c(){var e=u.useContext(f);if(!e)throw new Error("FiveProvider never found.");return e.loadWork}var l={display:"inline-block",overflow:"hidden"};function d(e,t){var n=s(),r=[n];void 0!==t&&(r=r.concat(t)),u.useLayoutEffect((function(){return e(n.scene)}),r)}var v=d;function p(t){return e.__assign({},t.state)}function h(e){var t=e.camera.getWorldDirection(new i.Vector3);return new i.Raycaster(e.camera.position,t)}function m(e){return e.camera.getWorldDirection(new i.Vector3)}function y(e){return e.model.empty?"Empty":"Loaded"}function S(e,t){return t.indexOf(e)>=0}function g(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];void 0!==t[o]&&(e[o]=t[o])}}function C(e,t){if(S("loadWork",t))return e}function b(e,t){if(S("setState",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.setState.apply(e,t)}}function w(e,t){if(S("on",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.on.apply(e,t)}}function E(e,t){if(S("on",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.once.apply(e,t)}}function k(e,t){if(S("off",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.off.apply(e,t)}}function x(e,t){if(S("intersectRaycaster",t))return function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return(t=e.model).intersectRaycaster.apply(t,n)}}function L(e,t){if(S("project2d",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.project2d.apply(e,t)}}function F(e,t){if(S("updateCamera",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.updateCamera.apply(e,t)}}function _(e,t){if(S("initBasisLoader",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.initBasisLoader.apply(e,t)}}function P(e,t){if(S("getPixels",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.getPixels.apply(e,t)}}function R(e,t){if(S("render",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.render.apply(e,t)}}function V(e,t){if(S("needsRender",t))return function(){e.needsRender=!0}}function M(e,t){if(S("preloadPano",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.preloadPano.apply(e,t)}}function W(e,t){if(S("showFloor",t))return function(t){"number"==typeof t?e.model.show(t):e.model.show()}}function O(e,t){if(S("toggleHelperVisible",t))return function(t){e.helperVisible=t}}function j(e,t){for(var n={},r=t.length,o=-1;++o<r;){var u=t[o];u in e&&(n[u]=e[u])}return n}function N(e,t){for(var n=0;n<e.length;n++)for(var r=0;r<t.length;r++)if(e[n]===t[r])return!0;return!1}var A=function(){function t(e,t){this.values=e,this.listeners=[],this.onValuesChange=t}return t.prototype.on=function(e,t){var n=this,r=[e,t];return this.listeners.push(r),function(){var e=n.listeners.indexOf(r);e>=0&&n.listeners.splice(e,1)}},t.prototype.getValues=function(e){return j(this.values,e)},t.prototype.setValues=function(t,n){var r,o,u=[];for(var i in n)t.indexOf(i)>=0&&(r=n[i],o=this.values[i],!("number"==typeof r&&"number"==typeof o&&isNaN(r)&&isNaN(o)||r===o))&&u.push(i);if(0!==u.length){for(var a=e.__assign({},this.values),f=0,s=u;f<s.length;f++){var c=s[f];this.values[c]=n[c]}this.onValuesChange&&this.onValuesChange(this.values,a);for(var l=0,d=this.listeners;l<d.length;l++){var v=d[l],p=v[0],h=v[1];if(N(p,u)){var m=j(a,p);h(j(this.values,p),m)}}}},t}();exports.FiveCanvas=function(t){var n=t.width,r=t.height,o=s(),i=u.createRef(),a=e.__assign({width:n,height:r},l);return u.useLayoutEffect((function(){if(i.current&&o.renderer){if(null!==o.renderer.domElement.parentNode&&o.renderer.domElement.parentNode!==i.current)throw new Error("There are more than 2 fiveCanvas in this context.");o.renderer.domElement.parentNode!==i.current&&i.current.appendChild(o.renderer.domElement),o.camera.aspect=n/r,o.camera.updateProjectionMatrix(),o.renderer.setSize(n,r),o.needsRender=!0}}),[n,r,i.current]),u.createElement("div",{ref:i,style:a})},exports.INJECTION_PROPNAME="$five",exports.Store=A,exports.createFiveFeature=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e},exports.createFiveProvider=function(t){return void 0===t&&(t={}),function(n){function o(o){var u,f=n.call(this,o)||this,s=function(e){var t=void 0===e?{}:e,n=t.backgroundColor,r=void 0===n?1579548:n,o=t.backgroundAlpha,u=void 0===o?1:o,f=t.pixelRatio,s=void 0===f?1:f;if("undefined"!=typeof window){var c=a.shift();return c||((c=new i.WebGLRenderer({antialias:!1,alpha:!0})).outputEncoding=i.sRGBEncoding),c.setPixelRatio(s),c.setClearColor(r,u),c.autoClear=!0,c}}({pixelRatio:1===r.getViewportScale()?window.devicePixelRatio:1});return f.five=new r.Five(e.__assign({renderer:s},t)),(o.work||o.initialWork)&&f.five.load(o.work||o.initialWork,o.initialState,void 0,null===(u=o.initialUserAction)||void 0===u||u),f.five.on("load",(function(){var e;f.props.onWorkChange&&f.props.onWorkChange(null===(e=f.five)||void 0===e?void 0:e.work)})),f.five.on("stateChange",(function(e,t){f.props.onStateChange&&f.props.onStateChange(e,t)})),f.five.on("currentStateChange",(function(e,t){f.props.onCurrentStateChange&&f.props.onCurrentStateChange(e,t)})),f.five.on("error",(function(e){f.props.onError?f.props.onError(e):console.warn(e.message)})),f}return e.__extends(o,n),o.prototype.loadWork=function(e,t,n,r){if(void 0===r&&(r=!0),this.props.work)throw new Error("props 'work' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.");return this.five.load(e,t,n,r)},o.prototype.shouldComponentUpdate=function(e){var t,n;return e.work&&e.work!==(null===(t=this.five)||void 0===t?void 0:t.work)&&(null===(n=this.five)||void 0===n||n.load(e.work,e.initialState)),!0},o.prototype.componentWillUnmount=function(){var e;this.five&&(this.five.dispose(),(e=this.five.renderer)&&-1===a.indexOf(e)&&a.push(e),delete this.five)},o.prototype.render=function(){var e=this;return u.createElement(f.Provider,{value:{five:this.five,loadWork:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.loadWork.apply(e,t)}}},this.props.children)},o}(u.Component)},exports.createStore=function(t){var n=u.createContext(null);return{useStore:function(t){var r=u.useContext(n);if(null===r)throw new Error("StoreProvider never found.");var o=u.useRef(!0),i=u.useState(r.getValues(t)),a=i[0],f=i[1],s=e.__spreadArray([r],t,!0);return u.useLayoutEffect((function(){return o.current?o.current=!1:f(r.getValues(t)),r.on(t,(function(e){return f(e)}))}),s),[a,u.useCallback((function(e){return r.setValues(t,e)}),s)]},useStoreSetter:function(t){var r=u.useContext(n);if(null===r)throw new Error("StoreProvider never found.");return u.useCallback((function(e){return r.setValues(t,e)}),e.__spreadArray([r],t,!0))},watchStore:function(t,r,o){var i=u.useContext(n);if(null===i)throw new Error("StoreProvider never found.");var a=e.__spreadArray([i],t,!0);void 0!==o&&(a=a.concat(o)),u.useLayoutEffect((function(){return i.on(t,r)}),a)},useStoreAction:function(r){var o=u.useContext(n);if(null===o)throw new Error("StoreProvider never found.");return u.useCallback((function(){for(var n=[],u=0;u<arguments.length;u++)n[u]=arguments[u];var i=t[r],a=i[0],f=i.slice(1),s=function(){return o.getValues(f)},c=function(e){return o.setValues(f,e)};return a.apply(void 0,e.__spreadArray([s,c],n,!1))}),[])},StoreProvider:function(t){function r(e){var n=t.call(this,e)||this;return n.store=new A(e.initialValue,(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];n.props.onValuesChange&&(e=n.props).onValuesChange.apply(e,t)})),n}return e.__extends(r,t),r.prototype.shouldComponentUpdate=function(e){return e.children!==this.props.children},r.prototype.render=function(){return u.createElement(n.Provider,{value:this.store},this.props.children)},r}(u.Component)}},exports.unsafe__useFiveInstance=function(){return s()},exports.useFiveAction=function(){var e=s();return{updateCamera:u.useCallback((function(t,n){return e.updateCamera(t,n)}),[e]),initBasisLoader:u.useCallback((function(t){return e.initBasisLoader(t)}),[e]),getPixels:u.useCallback((function(t,n,r,o,u){return e.getPixels(t,n,r,o,u)}),[e]),render:u.useCallback((function(t){return e.render(t)}),[e]),needsRender:u.useCallback((function(){return e.needsRender=!0}),[e]),preloadPano:u.useCallback((function(t,n){return e.preloadPano(t,n)}),[e])}},exports.useFiveCameraDirection=function(){var e=s(),t=u.useState((function(){return m(e)})),n=t[0],r=t[1];return u.useLayoutEffect((function(){return e.on("cameraUpdate",(function(){return r(m(e))}))}),[e]),n},exports.useFiveCameraRaycaster=function(){var e=s(),t=u.useState((function(){return h(e)})),n=t[0],r=t[1];return u.useLayoutEffect((function(){return e.on("cameraUpdate",(function(){return r(h(e))}))}),[e]),n},exports.useFiveCurrentObserver=function(){var e=s(),t=u.useState((function(){return e.getCurrentState()})),n=t[0],r=t[1];return u.useLayoutEffect((function(){return e.on("currentStateChange",(function(){return r(e.getCurrentState())}))}),[e]),e.work?e.work.observers[n.panoIndex]:null},exports.useFiveCurrentState=function(){var e=s(),t=u.useState((function(){return e.getCurrentState()})),n=t[0],r=t[1],o=u.useCallback((function(t,n,r){void 0===n&&(n=!1),void 0===r&&(r=!0);var o="function"==typeof t?t(e.getCurrentState()):t;console.log(e.getCurrentState(),o),e.setState(o,n,r)}),[e]);return u.useLayoutEffect((function(){return e.on("currentStateChange",(function(){return r(e.getCurrentState())}))}),[e]),[n,o]},exports.useFiveEventCallback=function(e,t,n){var r=s(),o=[r,e];void 0!==n&&(o=o.concat(n)),u.useLayoutEffect((function(){return r.on(e,t)}),o)},exports.useFiveFloor=function(){var e=s(),t=u.useState(e.model.shownFloor),n=t[0],r=t[1],o=u.useState(e.model.floorLength),i=o[0],a=o[1],f=u.useCallback((function(t){"number"==typeof t?e.model.show(t):e.model.show()}),[e]);return u.useLayoutEffect((function(){var t=[];return t.push(e.on("modelShownFloorChange",(function(){return r(e.model.shownFloor)}))),t.push(e.on("modelLoaded",(function(){return a(e.model.floorLength)}))),function(){for(var e;e=t.shift();)e()}}),[e]),[n,i,f]},exports.useFiveHelper=function(){var e=s(),t=u.useState(e.helperVisible),n=t[0],r=t[1],o=u.useCallback((function(t){e.helperVisible=t}),[e]);return u.useLayoutEffect((function(){return e.on("helpersVisibleChange",(function(e){return r(e)}))}),[e]),[n,o]},exports.useFiveModelIntersectRaycaster=function(){var e=s();return u.useCallback((function(t){return e.model.intersectRaycaster(t)}),[e])},exports.useFiveModelReadyState=function(){var e=s(),t=u.useState((function(){return y(e)})),n=t[0],r=t[1];return u.useLayoutEffect((function(){return e.on("modelLoaded",(function(){return r(y(e))}))}),[e]),n},exports.useFiveProject2d=function(){var e=s(),t=u.useState((function(){return Symbol()}));t[0];var n=t[1];return u.useLayoutEffect((function(){return e.on("cameraUpdate",(function(){return n(Symbol())}))}),[e]),u.useCallback((function(t,n){return e.project2d(t,n)}),[e])},exports.useFiveScene=v,exports.useFiveSceneEffect=d,exports.useFiveState=function(){var e=s(),t=u.useState((function(){return p(e)})),n=t[0],r=t[1],o=u.useCallback((function(t,n,r){void 0===n&&(n=!1),void 0===r&&(r=!0);var o="function"==typeof t?t(e.getCurrentState()):t;e.setState(o,n,r)}),[e]);return u.useLayoutEffect((function(){return e.on("stateChange",(function(){return r(p(e))}))}),[e]),[n,o]},exports.useFiveWork=function(){var e=s(),t=c(),n=u.useState((function(){return e.work})),r=n[0],o=n[1];return u.useLayoutEffect((function(){return e.on("load",(function(){return o(e.work)}))}),[e]),[r,t]},exports.withFive=function(t){return function(n){return u.forwardRef((function(r,o){var a=s(),f=c(),l=function(e,t){return[S("unsafe__fiveInstance",t)?e:void 0]}(a,t)[0],d=function(t,n){var r=S("state",n),o=u.useState(Symbol()),i=o[0],a=o[1],f=u.useMemo((function(){if(r)return e.__assign({},t.state)}),[t,i]);return u.useLayoutEffect((function(){if(r)return t.on("stateChange",(function(){return a(Symbol())}))}),[t]),[f,i]}(a,t),v=d[0],p=d[1],h=function(e,t){var n=S("currentState",t),r=u.useState(Symbol()),o=r[0],i=r[1],a=u.useMemo((function(){if(n)return e.getCurrentState()}),[e,o]);return u.useLayoutEffect((function(){if(n)return e.on("currentStateChange",(function(){return i(Symbol())}))}),[e]),[a,o]}(a,t),m=h[0],y=h[1],j=function(e,t){var n=S("currentObserver",t),r=u.useState(Symbol()),o=r[0],i=r[1],a=u.useMemo((function(){if(n)return e.getCurrentState()}),[e,o]);return u.useLayoutEffect((function(){if(n)return e.on("currentStateChange",(function(){return i(Symbol())}))}),[e]),[a?e.work?e.work.observers[a.panoIndex]:null:void 0,o]}(a,t),N=j[0],A=j[1],U=function(e,t){var n=S("work",t),r=u.useState(Symbol()),o=r[0],i=r[1],a=u.useMemo((function(){if(n)return e.work}),[e,o]);return u.useLayoutEffect((function(){if(n)return e.on("load",(function(){return i(Symbol())}))}),[e]),[a,o]}(a,t),D=U[0],I=U[1],B=function(e,t){var n=S("model",t),r=u.useState(Symbol()),o=r[0],i=r[1],a=u.useMemo((function(){if(n)return e.model}),[e,o]);return u.useLayoutEffect((function(){if(n)return e.on("modelLoaded",(function(){return i(Symbol())}))}),[e]),[a,o]}(a,t),q=B[0],H=B[1],z=function(e,t){return[S("scene",t)?e.scene:void 0]}(a,t)[0],G=function(e,t){var n=S("cameraDirection",t),r=u.useState(Symbol()),o=r[0],a=r[1],f=u.useMemo((function(){if(n)return e.camera.getWorldDirection(new i.Vector3)}),[e,o]);return u.useLayoutEffect((function(){if(n)return e.on("cameraUpdate",(function(){return a(Symbol())}))}),[e]),[f,o]}(a,t),T=G[0],$=G[1],J=function(e,t){var n=S("cameraRaycaster",t),r=u.useState(Symbol()),o=r[0],a=r[1],f=u.useMemo((function(){if(n){var t=e.camera.getWorldDirection(new i.Vector3);return new i.Raycaster(e.camera.position,t)}}),[e,o]);return u.useLayoutEffect((function(){if(n)return e.on("cameraUpdate",(function(){return a(Symbol())}))}),[e]),[f,o]}(a,t),K=J[0],Q=J[1],X=function(e,t){var n=S("modelReadyState",t),r=u.useState(Symbol()),o=r[0],i=r[1],a=u.useMemo((function(){if(n)return e.model.empty?"Empty":"Loaded"}),[e,o]);return u.useLayoutEffect((function(){if(n)return e.on("modelLoaded",(function(){return i(Symbol())}))}),[e]),[a,o]}(a,t),Y=X[0],Z=X[1],ee=function(e,t){var n=S("shownFloor",t),r=u.useState(Symbol()),o=r[0],i=r[1],a=u.useMemo((function(){if(n)return e.model.shownFloor}),[e,o]);return u.useLayoutEffect((function(){if(n)return e.on("modelShownFloorChange",(function(){return i(Symbol())}))}),[e]),[a,o]}(a,t),te=ee[0],ne=ee[1],re=function(e,t){var n=S("totalFloorLength",t),r=u.useState(Symbol()),o=r[0],i=r[1],a=u.useMemo((function(){if(n)return e.model.hasFloors()}),[e,o]);return u.useLayoutEffect((function(){if(n)return e.on("modelLoaded",(function(){return i(Symbol())}))}),[e]),[a,o]}(a,t),oe=re[0],ue=re[1],ie=function(e,t){var n=S("helperVisible",t),r=u.useState(Symbol()),o=r[0],i=r[1],a=u.useMemo((function(){if(n)return e.helperVisible}),[e,o]);return u.useLayoutEffect((function(){if(n)return e.on("helpersVisibleChange",(function(){return i(Symbol())}))}),[e]),[a,o]}(a,t),ae=ie[0],fe=ie[1],se=u.useMemo((function(){var e={};return g(e,{setState:b(a,t),loadWork:C(f,t),on:w(a,t),once:E(a,t),off:k(a,t),intersectRaycaster:x(a,t),project2d:L(a,t),updateCamera:F(a,t),initBasisLoader:_(a,t),getPixels:P(a,t),render:R(a,t),needsRender:V(a,t),preloadPano:M(a,t),showFloor:W(a,t),toggleHelperVisible:O(a,t)}),e}),[a,f]),ce=u.useMemo((function(){var t=e.__assign({},se);return g(t,{unsafe__fiveInstance:l,state:v,currentState:m,currentObserver:N,work:D,model:q,scene:z,cameraDirection:T,cameraRaycaster:K,modelReadyState:Y,shownFloor:te,totalFloorLength:oe,helperVisible:ae}),t}),[a,se,p,y,A,I,H,$,Q,Z,ne,ue,fe]);return u.createElement(n,e.__assign({ref:o,$five:ce},r))}))}};
|
|
260
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react"),n=require("three"),r=require("@realsee/five");function o(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 u=o(t),i=o(n),a=[];var f=u.createContext(null);function s(){var e=u.useContext(f);if(!e)throw new Error("FiveProvider never found.");return e.five}function c(){var e=u.useContext(f);if(!e)throw new Error("FiveProvider never found.");return e.loadWork}var l={display:"inline-block",overflow:"hidden"};function d(e,t){var n=s(),r=[n];void 0!==t&&(r=r.concat(t)),u.useLayoutEffect((function(){return e(n.scene)}),r)}var v=d;function p(t){return e.__assign({},t.state)}function h(e){var t=e.camera.getWorldDirection(new i.Vector3);return new i.Raycaster(e.camera.position,t)}function m(e){return e.camera.getWorldDirection(new i.Vector3)}function y(e){return e.model.empty?"Empty":"Loaded"}function S(e,t){return t.indexOf(e)>=0}function g(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];void 0!==t[o]&&(e[o]=t[o])}}function C(e,t){if(S("loadWork",t))return e}function b(e,t){if(S("setState",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.setState.apply(e,t)}}function w(e,t){if(S("on",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.on.apply(e,t)}}function E(e,t){if(S("on",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.once.apply(e,t)}}function k(e,t){if(S("off",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.off.apply(e,t)}}function x(e,t){if(S("intersectRaycaster",t))return function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return(t=e.model).intersectRaycaster.apply(t,n)}}function L(e,t){if(S("project2d",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.project2d.apply(e,t)}}function F(e,t){if(S("updateCamera",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.updateCamera.apply(e,t)}}function _(e,t){if(S("initBasisLoader",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.initBasisLoader.apply(e,t)}}function P(e,t){if(S("getPixels",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.getPixels.apply(e,t)}}function R(e,t){if(S("render",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.render.apply(e,t)}}function V(e,t){if(S("needsRender",t))return function(){e.needsRender=!0}}function M(e,t){if(S("preloadPano",t))return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.preloadPano.apply(e,t)}}function W(e,t){if(S("showFloor",t))return function(t){"number"==typeof t?e.model.show(t):e.model.show()}}function O(e,t){if(S("toggleHelperVisible",t))return function(t){e.helperVisible=t}}function j(e,t){for(var n={},r=t.length,o=-1;++o<r;){var u=t[o];u in e&&(n[u]=e[u])}return n}function N(e,t){for(var n=0;n<e.length;n++)for(var r=0;r<t.length;r++)if(e[n]===t[r])return!0;return!1}var A=function(){function t(e,t){this.values=e,this.listeners=[],this.onValuesChange=t}return t.prototype.on=function(e,t){var n=this,r=[e,t];return this.listeners.push(r),function(){var e=n.listeners.indexOf(r);e>=0&&n.listeners.splice(e,1)}},t.prototype.getValues=function(e){return j(this.values,e)},t.prototype.setValues=function(t,n){var r,o,u=[];for(var i in n)t.indexOf(i)>=0&&(r=n[i],o=this.values[i],!("number"==typeof r&&"number"==typeof o&&isNaN(r)&&isNaN(o)||r===o))&&u.push(i);if(0!==u.length){for(var a=e.__assign({},this.values),f=0,s=u;f<s.length;f++){var c=s[f];this.values[c]=n[c]}this.onValuesChange&&this.onValuesChange(this.values,a);for(var l=0,d=this.listeners;l<d.length;l++){var v=d[l],p=v[0],h=v[1];if(N(p,u)){var m=j(a,p);h(j(this.values,p),m)}}}},t}();exports.FiveCanvas=function(t){var n=t.width,r=t.height,o=s(),i=u.createRef(),a=e.__assign({width:n,height:r},l);return u.useLayoutEffect((function(){if(i.current&&o.renderer){if(null!==o.renderer.domElement.parentNode&&o.renderer.domElement.parentNode!==i.current)throw new Error("There are more than 2 fiveCanvas in this context.");o.renderer.domElement.parentNode!==i.current&&i.current.appendChild(o.renderer.domElement),o.camera.aspect=n/r,o.camera.updateProjectionMatrix(),o.renderer.setSize(n,r),o.needsRender=!0}}),[n,r,i.current]),u.createElement("div",{ref:i,style:a})},exports.INJECTION_PROPNAME="$five",exports.Store=A,exports.createFiveFeature=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e},exports.createFiveProvider=function(t){return void 0===t&&(t={}),function(n){function o(o){var u,f=n.call(this,o)||this,s=function(e){var t=void 0===e?{}:e,n=t.backgroundColor,r=void 0===n?1579548:n,o=t.backgroundAlpha,u=void 0===o?1:o,f=t.pixelRatio,s=void 0===f?1:f;if("undefined"!=typeof window){var c=a.shift();return c||((c=new i.WebGLRenderer({antialias:!1,alpha:!0})).outputEncoding=i.sRGBEncoding),c.setPixelRatio(s),c.setClearColor(r,u),c.autoClear=!0,c}}({pixelRatio:1===r.getViewportScale()?window.devicePixelRatio:1});return f.five=new r.Five(e.__assign({renderer:s},t)),(o.work||o.initialWork)&&f.five.load(o.work||o.initialWork,o.initialState,void 0,null===(u=o.initialUserAction)||void 0===u||u),f.five.on("load",(function(){var e;f.props.onWorkChange&&f.props.onWorkChange(null===(e=f.five)||void 0===e?void 0:e.work)})),f.five.on("stateChange",(function(e,t){f.props.onStateChange&&f.props.onStateChange(e,t)})),f.five.on("currentStateChange",(function(e,t){f.props.onCurrentStateChange&&f.props.onCurrentStateChange(e,t)})),f.five.on("error",(function(e){f.props.onError?f.props.onError(e):console.warn(e.message)})),f}return e.__extends(o,n),o.prototype.loadWork=function(e,t,n,r){if(void 0===r&&(r=!0),this.props.work)throw new Error("props 'work' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.");return this.five.load(e,t,n,r)},o.prototype.shouldComponentUpdate=function(e){var t,n;return e.work&&e.work!==(null===(t=this.five)||void 0===t?void 0:t.work)&&(null===(n=this.five)||void 0===n||n.load(e.work,e.initialState)),!0},o.prototype.componentWillUnmount=function(){var e;this.five&&(this.five.dispose(),(e=this.five.renderer)&&-1===a.indexOf(e)&&a.push(e),delete this.five)},o.prototype.render=function(){var e=this;return u.createElement(f.Provider,{value:{five:this.five,loadWork:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.loadWork.apply(e,t)}}},this.props.children)},o}(u.Component)},exports.createStore=function(t){var n=u.createContext(null);return{useStore:function(t){var r=u.useContext(n);if(null===r)throw new Error("StoreProvider never found.");var o=u.useRef(!0),i=u.useState(r.getValues(t)),a=i[0],f=i[1],s=e.__spreadArray([r],t,!0);return u.useLayoutEffect((function(){return o.current?o.current=!1:f(r.getValues(t)),r.on(t,(function(e){return f(e)}))}),s),[a,u.useCallback((function(e){return r.setValues(t,e)}),s)]},useStoreSetter:function(t){var r=u.useContext(n);if(null===r)throw new Error("StoreProvider never found.");return u.useCallback((function(e){return r.setValues(t,e)}),e.__spreadArray([r],t,!0))},watchStore:function(t,r,o){var i=u.useContext(n);if(null===i)throw new Error("StoreProvider never found.");var a=e.__spreadArray([i],t,!0);void 0!==o&&(a=a.concat(o)),u.useLayoutEffect((function(){return i.on(t,r)}),a)},useStoreAction:function(r){var o=u.useContext(n);if(null===o)throw new Error("StoreProvider never found.");return u.useCallback((function(){for(var n=[],u=0;u<arguments.length;u++)n[u]=arguments[u];var i=t[r],a=i[0],f=i.slice(1),s=function(){return o.getValues(f)},c=function(e){return o.setValues(f,e)};return a.apply(void 0,e.__spreadArray([s,c],n,!1))}),[])},StoreProvider:function(t){function r(e){var n=t.call(this,e)||this;return n.store=new A(e.initialValue,(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];n.props.onValuesChange&&(e=n.props).onValuesChange.apply(e,t)})),n}return e.__extends(r,t),r.prototype.shouldComponentUpdate=function(e){return e.children!==this.props.children},r.prototype.render=function(){return u.createElement(n.Provider,{value:this.store},this.props.children)},r}(u.Component)}},exports.unsafe__useFiveInstance=function(){return s()},exports.useFiveAction=function(){var e=s();return{updateCamera:u.useCallback((function(t,n){return e.updateCamera(t,n)}),[e]),initBasisLoader:u.useCallback((function(t){return e.initBasisLoader(t)}),[e]),getPixels:u.useCallback((function(t,n,r,o,u){return e.getPixels(t,n,r,o,u)}),[e]),render:u.useCallback((function(t){return e.render(t)}),[e]),needsRender:u.useCallback((function(){return e.needsRender=!0}),[e]),preloadPano:u.useCallback((function(t,n){return e.preloadPano(t,n)}),[e])}},exports.useFiveCameraDirection=function(){var e=s(),t=u.useState((function(){return m(e)})),n=t[0],r=t[1];return u.useLayoutEffect((function(){return e.on("cameraUpdate",(function(){return r(m(e))}))}),[e]),n},exports.useFiveCameraRaycaster=function(){var e=s(),t=u.useState((function(){return h(e)})),n=t[0],r=t[1];return u.useLayoutEffect((function(){return e.on("cameraUpdate",(function(){return r(h(e))}))}),[e]),n},exports.useFiveCurrentObserver=function(){var e=s(),t=u.useState((function(){return e.getCurrentState()})),n=t[0],r=t[1];return u.useLayoutEffect((function(){return e.on("currentStateChange",(function(){return r(e.getCurrentState())}))}),[e]),e.work?e.work.observers[n.panoIndex]:null},exports.useFiveCurrentState=function(){var e=s(),t=u.useState((function(){return e.getCurrentState()})),n=t[0],r=t[1],o=u.useCallback((function(t,n,r){void 0===n&&(n=!1),void 0===r&&(r=!0);var o="function"==typeof t?t(e.getCurrentState()):t;e.setState(o,n,r)}),[e]);return u.useLayoutEffect((function(){return e.on("currentStateChange",(function(){return r(e.getCurrentState())}))}),[e]),[n,o]},exports.useFiveEventCallback=function(e,t,n){var r=s(),o=[r,e];void 0!==n&&(o=o.concat(n)),u.useLayoutEffect((function(){return r.on(e,t)}),o)},exports.useFiveFloor=function(){var e=s(),t=u.useState(e.model.shownFloor),n=t[0],r=t[1],o=u.useState(e.model.floorLength),i=o[0],a=o[1],f=u.useCallback((function(t){"number"==typeof t?e.model.show(t):e.model.show()}),[e]);return u.useLayoutEffect((function(){var t=[];return t.push(e.on("modelShownFloorChange",(function(){return r(e.model.shownFloor)}))),t.push(e.on("modelLoaded",(function(){return a(e.model.floorLength)}))),function(){for(var e;e=t.shift();)e()}}),[e]),[n,i,f]},exports.useFiveHelper=function(){var e=s(),t=u.useState(e.helperVisible),n=t[0],r=t[1],o=u.useCallback((function(t){e.helperVisible=t}),[e]);return u.useLayoutEffect((function(){return e.on("helpersVisibleChange",(function(e){return r(e)}))}),[e]),[n,o]},exports.useFiveModelIntersectRaycaster=function(){var e=s();return u.useCallback((function(t){return e.model.intersectRaycaster(t)}),[e])},exports.useFiveModelReadyState=function(){var e=s(),t=u.useState((function(){return y(e)})),n=t[0],r=t[1];return u.useLayoutEffect((function(){return e.on("modelLoaded",(function(){return r(y(e))}))}),[e]),n},exports.useFiveProject2d=function(){var e=s(),t=u.useState((function(){return Symbol()}));t[0];var n=t[1];return u.useLayoutEffect((function(){return e.on("cameraUpdate",(function(){return n(Symbol())}))}),[e]),u.useCallback((function(t,n){return e.project2d(t,n)}),[e])},exports.useFiveScene=v,exports.useFiveSceneEffect=d,exports.useFiveState=function(){var e=s(),t=u.useState((function(){return p(e)})),n=t[0],r=t[1],o=u.useCallback((function(t,n,r){void 0===n&&(n=!1),void 0===r&&(r=!0);var o="function"==typeof t?t(e.getCurrentState()):t;e.setState(o,n,r)}),[e]);return u.useLayoutEffect((function(){return e.on("stateChange",(function(){return r(p(e))}))}),[e]),[n,o]},exports.useFiveWork=function(){var e=s(),t=c(),n=u.useState((function(){return e.work})),r=n[0],o=n[1];return u.useLayoutEffect((function(){return e.on("load",(function(){return o(e.work)}))}),[e]),[r,t]},exports.withFive=function(t){return function(n){return u.forwardRef((function(r,o){var a=s(),f=c(),l=function(e,t){return[S("unsafe__fiveInstance",t)?e:void 0]}(a,t)[0],d=function(t,n){var r=S("state",n),o=u.useState(Symbol()),i=o[0],a=o[1],f=u.useMemo((function(){if(r)return e.__assign({},t.state)}),[t,i]);return u.useLayoutEffect((function(){if(r)return t.on("stateChange",(function(){return a(Symbol())}))}),[t]),[f,i]}(a,t),v=d[0],p=d[1],h=function(e,t){var n=S("currentState",t),r=u.useState(Symbol()),o=r[0],i=r[1],a=u.useMemo((function(){if(n)return e.getCurrentState()}),[e,o]);return u.useLayoutEffect((function(){if(n)return e.on("currentStateChange",(function(){return i(Symbol())}))}),[e]),[a,o]}(a,t),m=h[0],y=h[1],j=function(e,t){var n=S("currentObserver",t),r=u.useState(Symbol()),o=r[0],i=r[1],a=u.useMemo((function(){if(n)return e.getCurrentState()}),[e,o]);return u.useLayoutEffect((function(){if(n)return e.on("currentStateChange",(function(){return i(Symbol())}))}),[e]),[a?e.work?e.work.observers[a.panoIndex]:null:void 0,o]}(a,t),N=j[0],A=j[1],U=function(e,t){var n=S("work",t),r=u.useState(Symbol()),o=r[0],i=r[1],a=u.useMemo((function(){if(n)return e.work}),[e,o]);return u.useLayoutEffect((function(){if(n)return e.on("load",(function(){return i(Symbol())}))}),[e]),[a,o]}(a,t),D=U[0],I=U[1],B=function(e,t){var n=S("model",t),r=u.useState(Symbol()),o=r[0],i=r[1],a=u.useMemo((function(){if(n)return e.model}),[e,o]);return u.useLayoutEffect((function(){if(n)return e.on("modelLoaded",(function(){return i(Symbol())}))}),[e]),[a,o]}(a,t),q=B[0],H=B[1],z=function(e,t){return[S("scene",t)?e.scene:void 0]}(a,t)[0],G=function(e,t){var n=S("cameraDirection",t),r=u.useState(Symbol()),o=r[0],a=r[1],f=u.useMemo((function(){if(n)return e.camera.getWorldDirection(new i.Vector3)}),[e,o]);return u.useLayoutEffect((function(){if(n)return e.on("cameraUpdate",(function(){return a(Symbol())}))}),[e]),[f,o]}(a,t),T=G[0],$=G[1],J=function(e,t){var n=S("cameraRaycaster",t),r=u.useState(Symbol()),o=r[0],a=r[1],f=u.useMemo((function(){if(n){var t=e.camera.getWorldDirection(new i.Vector3);return new i.Raycaster(e.camera.position,t)}}),[e,o]);return u.useLayoutEffect((function(){if(n)return e.on("cameraUpdate",(function(){return a(Symbol())}))}),[e]),[f,o]}(a,t),K=J[0],Q=J[1],X=function(e,t){var n=S("modelReadyState",t),r=u.useState(Symbol()),o=r[0],i=r[1],a=u.useMemo((function(){if(n)return e.model.empty?"Empty":"Loaded"}),[e,o]);return u.useLayoutEffect((function(){if(n)return e.on("modelLoaded",(function(){return i(Symbol())}))}),[e]),[a,o]}(a,t),Y=X[0],Z=X[1],ee=function(e,t){var n=S("shownFloor",t),r=u.useState(Symbol()),o=r[0],i=r[1],a=u.useMemo((function(){if(n)return e.model.shownFloor}),[e,o]);return u.useLayoutEffect((function(){if(n)return e.on("modelShownFloorChange",(function(){return i(Symbol())}))}),[e]),[a,o]}(a,t),te=ee[0],ne=ee[1],re=function(e,t){var n=S("totalFloorLength",t),r=u.useState(Symbol()),o=r[0],i=r[1],a=u.useMemo((function(){if(n)return e.model.hasFloors()}),[e,o]);return u.useLayoutEffect((function(){if(n)return e.on("modelLoaded",(function(){return i(Symbol())}))}),[e]),[a,o]}(a,t),oe=re[0],ue=re[1],ie=function(e,t){var n=S("helperVisible",t),r=u.useState(Symbol()),o=r[0],i=r[1],a=u.useMemo((function(){if(n)return e.helperVisible}),[e,o]);return u.useLayoutEffect((function(){if(n)return e.on("helpersVisibleChange",(function(){return i(Symbol())}))}),[e]),[a,o]}(a,t),ae=ie[0],fe=ie[1],se=u.useMemo((function(){var e={};return g(e,{setState:b(a,t),loadWork:C(f,t),on:w(a,t),once:E(a,t),off:k(a,t),intersectRaycaster:x(a,t),project2d:L(a,t),updateCamera:F(a,t),initBasisLoader:_(a,t),getPixels:P(a,t),render:R(a,t),needsRender:V(a,t),preloadPano:M(a,t),showFloor:W(a,t),toggleHelperVisible:O(a,t)}),e}),[a,f]),ce=u.useMemo((function(){var t=e.__assign({},se);return g(t,{unsafe__fiveInstance:l,state:v,currentState:m,currentObserver:N,work:D,model:q,scene:z,cameraDirection:T,cameraRaycaster:K,modelReadyState:Y,shownFloor:te,totalFloorLength:oe,helperVisible:ae}),t}),[a,se,p,y,A,I,H,$,Q,Z,ne,ue,fe]);return u.createElement(n,e.__assign({ref:o,$five:ce},r))}))}};
|
package/server/index.d.ts
CHANGED
|
@@ -1,5 +1,97 @@
|
|
|
1
1
|
import * as THREE_2 from 'three';
|
|
2
2
|
|
|
3
|
+
export declare class BVH {
|
|
4
|
+
_trianglesArray: Float32Array;
|
|
5
|
+
_maxTrianglesPerNode: number;
|
|
6
|
+
_bboxArray: Float32Array;
|
|
7
|
+
_bboxHelper: Float32Array;
|
|
8
|
+
_rootNode: BVHNode | null;
|
|
9
|
+
_nodesToSplit: BVHNode[];
|
|
10
|
+
constructor(trianglesArray: Float32Array, maxTrianglesPerNode?: number);
|
|
11
|
+
private calcBoundingBoxes;
|
|
12
|
+
splitNode(): void;
|
|
13
|
+
private _splitNode;
|
|
14
|
+
/**
|
|
15
|
+
* 计算包围盒
|
|
16
|
+
* @param startIndex - 开始的三角形序号
|
|
17
|
+
* @param endIndex - 结束的三角形序号
|
|
18
|
+
* @param expandBy - 外面扩展
|
|
19
|
+
*/
|
|
20
|
+
private calcExtents;
|
|
21
|
+
/**
|
|
22
|
+
* 计算射线与三角形的碰撞
|
|
23
|
+
* @param rayOrigin - 射线的原点坐标
|
|
24
|
+
* @param rayDirection - 设想的方向向量
|
|
25
|
+
* @param backfaceCulling - 是否背面剔除
|
|
26
|
+
* @return 碰撞焦点数组
|
|
27
|
+
*/
|
|
28
|
+
intersectRay(rayOrigin: BVHVector3, rayDirection: BVHVector3, backfaceCulling: boolean): BVHIntersect[];
|
|
29
|
+
dispose(): void;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export declare interface BVHIntersect {
|
|
33
|
+
triangle: [BVHVector3, BVHVector3, BVHVector3];
|
|
34
|
+
triangleIndex: number;
|
|
35
|
+
intersectionPoint: BVHVector3;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A node in the BVH structure
|
|
40
|
+
* @param extentsMin - the min coords of this node's bounding box
|
|
41
|
+
* @param extentsMax - the max coords of this node's bounding box
|
|
42
|
+
* @param startIndex - an index in the bbox array, where the first element of this node is located
|
|
43
|
+
* @param endIndex - an index in the bbox array, where the last of this node is located, plus 1 (meaning that its non-inclusive).
|
|
44
|
+
* @param level - distance of this node from the root for the bvh tree. root node has level=0, its children have level=1 etc.
|
|
45
|
+
*/
|
|
46
|
+
export declare class BVHNode {
|
|
47
|
+
_extentsMin: {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
z: number;
|
|
51
|
+
};
|
|
52
|
+
_extentsMax: {
|
|
53
|
+
x: number;
|
|
54
|
+
y: number;
|
|
55
|
+
z: number;
|
|
56
|
+
};
|
|
57
|
+
_startIndex: number;
|
|
58
|
+
_endIndex: number;
|
|
59
|
+
_level: number;
|
|
60
|
+
_node0: BVHNode | null;
|
|
61
|
+
_node1: BVHNode | null;
|
|
62
|
+
elementCount: number;
|
|
63
|
+
center: number[];
|
|
64
|
+
size: number[];
|
|
65
|
+
order: number[];
|
|
66
|
+
constructor(extentsMin: {
|
|
67
|
+
x: number;
|
|
68
|
+
y: number;
|
|
69
|
+
z: number;
|
|
70
|
+
}, extentsMax: {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
z: number;
|
|
74
|
+
}, startIndex: number, endIndex: number, level: number);
|
|
75
|
+
clearShapes(): void;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export declare class BVHVector3 {
|
|
79
|
+
x: number;
|
|
80
|
+
y: number;
|
|
81
|
+
z: number;
|
|
82
|
+
constructor(x?: number, y?: number, z?: number);
|
|
83
|
+
copy(v: BVHVector3): this;
|
|
84
|
+
set(x: number, y: number, z: number): this;
|
|
85
|
+
fromArray(array: ArrayLike<number>, firstElementPos?: number): this;
|
|
86
|
+
add(v: BVHVector3): this;
|
|
87
|
+
multiplyScalar(scalar: number): this;
|
|
88
|
+
subVectors(a: BVHVector3, b: BVHVector3): this;
|
|
89
|
+
dot(v: BVHVector3): number;
|
|
90
|
+
cross(v: BVHVector3): this;
|
|
91
|
+
crossVectors(a: BVHVector3, b: BVHVector3): this;
|
|
92
|
+
clone(): BVHVector3;
|
|
93
|
+
}
|
|
94
|
+
|
|
3
95
|
/**
|
|
4
96
|
* Five 模型事件列表
|
|
5
97
|
* @description
|
|
@@ -106,7 +198,15 @@ export declare type LooseWorkPanorama = {
|
|
|
106
198
|
front: string;
|
|
107
199
|
back: string;
|
|
108
200
|
video?: LooseWorkVideo;
|
|
109
|
-
|
|
201
|
+
luminance?: {
|
|
202
|
+
up: string;
|
|
203
|
+
down: string;
|
|
204
|
+
right: string;
|
|
205
|
+
left: string;
|
|
206
|
+
front: string;
|
|
207
|
+
back: string;
|
|
208
|
+
};
|
|
209
|
+
tiles?: number[];
|
|
110
210
|
};
|
|
111
211
|
|
|
112
212
|
export declare type LooseWorkVideo = {
|
|
@@ -181,7 +281,7 @@ export declare class Model extends PBMGroup implements Subscribe<EventType> {
|
|
|
181
281
|
*/
|
|
182
282
|
emit: SubscribeMixinType.emit<EventType>;
|
|
183
283
|
/** bvh 树的计算结果 */
|
|
184
|
-
bvhs:
|
|
284
|
+
bvhs: BVH[] & {
|
|
185
285
|
loaded?: boolean;
|
|
186
286
|
};
|
|
187
287
|
constructor();
|
|
@@ -211,7 +311,7 @@ export declare class Model extends PBMGroup implements Subscribe<EventType> {
|
|
|
211
311
|
* @returns 返回碰撞
|
|
212
312
|
*/
|
|
213
313
|
intersectRaycaster(raycaster: THREE_2.Raycaster, floors?: number | number[]): Intersection[];
|
|
214
|
-
buildBVH():
|
|
314
|
+
buildBVH(): void;
|
|
215
315
|
/**
|
|
216
316
|
* 加载模型
|
|
217
317
|
* @param workModel - work 的 model 内容
|
|
@@ -296,8 +396,6 @@ export declare interface State extends Pose {
|
|
|
296
396
|
panoIndex: number;
|
|
297
397
|
}
|
|
298
398
|
|
|
299
|
-
export declare function stringifyWork(work: Work): string;
|
|
300
|
-
|
|
301
399
|
/**
|
|
302
400
|
* 监听者模式
|
|
303
401
|
* @template T - 预设的监听回调类型
|
|
@@ -376,48 +474,55 @@ export declare namespace SubscribeMixinType {
|
|
|
376
474
|
}
|
|
377
475
|
}
|
|
378
476
|
|
|
379
|
-
export declare
|
|
477
|
+
export declare class Work {
|
|
478
|
+
name: string;
|
|
380
479
|
workCode: string;
|
|
381
480
|
allowHosts: string[];
|
|
382
481
|
expire: Date;
|
|
383
|
-
uuid: string;
|
|
384
482
|
initial: WorkInitial;
|
|
385
483
|
model?: WorkModel;
|
|
386
484
|
observers: WorkObserver[];
|
|
387
485
|
issuer: string;
|
|
388
486
|
raw: any;
|
|
389
|
-
|
|
487
|
+
constructor();
|
|
488
|
+
toJSON(): any;
|
|
489
|
+
}
|
|
390
490
|
|
|
391
|
-
|
|
392
|
-
export declare type WorkImages = {
|
|
491
|
+
export declare interface WorkCubeImage {
|
|
393
492
|
up: string;
|
|
394
493
|
down: string;
|
|
395
494
|
right: string;
|
|
396
495
|
left: string;
|
|
397
496
|
front: string;
|
|
398
497
|
back: string;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/** 全景图 */
|
|
501
|
+
export declare interface WorkImage extends WorkCubeImage {
|
|
399
502
|
depth?: string;
|
|
400
|
-
|
|
401
|
-
|
|
503
|
+
luminance?: WorkCubeImage;
|
|
504
|
+
tiles?: WorkTile[];
|
|
505
|
+
}
|
|
402
506
|
|
|
403
507
|
/** 初始化位姿参数 */
|
|
404
|
-
export declare
|
|
508
|
+
export declare interface WorkInitial extends Omit<State, "offset"> {
|
|
509
|
+
}
|
|
405
510
|
|
|
406
511
|
/** 模型数据 */
|
|
407
|
-
export declare
|
|
512
|
+
export declare interface WorkModel {
|
|
408
513
|
file: string;
|
|
409
514
|
textures: string[];
|
|
410
515
|
textureBase: string;
|
|
411
516
|
bvh: boolean;
|
|
412
517
|
async: boolean;
|
|
413
|
-
}
|
|
518
|
+
}
|
|
414
519
|
|
|
415
520
|
/** 每个点位的数据 */
|
|
416
|
-
export declare
|
|
521
|
+
export declare interface WorkObserver {
|
|
417
522
|
panoIndex: number;
|
|
418
523
|
active: boolean;
|
|
419
524
|
loadable: boolean;
|
|
420
|
-
images:
|
|
525
|
+
images: WorkImage;
|
|
421
526
|
video?: WorkVideo;
|
|
422
527
|
visibleNodes: number[];
|
|
423
528
|
accessibleNodes: number[];
|
|
@@ -425,13 +530,24 @@ export declare type WorkObserver = {
|
|
|
425
530
|
standingPosition: THREE_2.Vector3;
|
|
426
531
|
position: THREE_2.Vector3;
|
|
427
532
|
floorIndex: number;
|
|
428
|
-
}
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
export declare interface WorkTile {
|
|
536
|
+
level: number;
|
|
537
|
+
size: number;
|
|
538
|
+
up: string;
|
|
539
|
+
down: string;
|
|
540
|
+
right: string;
|
|
541
|
+
left: string;
|
|
542
|
+
front: string;
|
|
543
|
+
back: string;
|
|
544
|
+
}
|
|
429
545
|
|
|
430
546
|
/** 全景视频贴片 */
|
|
431
|
-
export declare
|
|
547
|
+
export declare interface WorkVideo {
|
|
432
548
|
source: string;
|
|
433
549
|
matrix: THREE_2.Matrix4;
|
|
434
550
|
size: THREE_2.Vector2;
|
|
435
|
-
}
|
|
551
|
+
}
|
|
436
552
|
|
|
437
553
|
export { }
|