@hology/core 0.0.110 → 0.0.112

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.
@@ -25,6 +25,20 @@ export declare class ViewController {
25
25
  pauseRendering(): void;
26
26
  unpauseRendering(): void;
27
27
  dispose(): void;
28
+ /**
29
+ * Find a point in 2D screen space based onf a 3D position in the scene.
30
+ * Returns Null if the position is not in the viewable frustum.
31
+ *
32
+ * The x and y values are the number of pixels from the top left
33
+ * of the screen.
34
+ * An HTML element could be positioned using the following
35
+ *
36
+ * left: target.x + 'px'
37
+ * top: target.y + 'px
38
+ *
39
+ * @param position The point in the camera frustum
40
+ * @param target The returned screen position
41
+ */
28
42
  /**
29
43
  * Find a point in 2D screen space based onf a 3D position in the scene.
30
44
  * Returns Null if the position is not in the viewable frustum.
@@ -1 +1 @@
1
- {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/gameplay/services/render.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAsB,MAAM,MAAM,CAAA;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAA;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD,qBACa,cAAc;IAKb,OAAO,CAAC,IAAI;IAJxB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAwB;IAC7C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwB;IACjD,SAAgB,aAAa,sBAA4B;gBAErC,IAAI,EAAE,aAAa;IASvC,IAAI,MAAM,CAAC,GAAG,EAAE,MAAM,EAErB;IAED,IAAI,MAAM,IAJM,MAAM,CAMrB;IAED,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AI,MAAM,CAAC,GAAG,EAAE,MAAM,EAErB;IAED,IAAI,MAAM,IAJM,MAAM,CAMrB;IAED,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,EAE3B;IACD,IAAI,SAAS,IAHQ,OAAO,CAK3B;IAED,oBAAoB,CAAC,MAAM,EAAE,iBAAiB;IAI9C,uBAAuB,CAAC,MAAM,EAAE,iBAAiB;IAIjD,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC;IAO/C,YAAY,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC;IAOnD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAC,WAAW;IAQpC,SAAS,IAAI,MAAM;IAInB,IAAI,WAAW,gBAEd;IAED,cAAc;IAId,gBAAgB;IAIhB,OAAO;IAKP;;;;;;;;;;;;;OAaG;IAyCH;;;;;;;;;;;;;OAaG;IACH,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,EAAE,MAAM,GAAE,KAAK,CAAC,OAA8B,GAAG,KAAK,CAAC,OAAO,GAAC,IAAI;CAuB7G"}
@@ -1,4 +1,4 @@
1
- import{__decorate as e,__metadata as t}from"tslib";import{Service as i}from"typedi";import{Camera as s}from"three";import{RenderingView as o}from"../../rendering.js";import{Subject as r,takeUntil as n}from"rxjs";import*as a from"three";let h=class{constructor(e){this.view=e,this.tick=new r,this.lateTick=new r,this.audioListener=new a.AudioListener,e.onLoop((e=>{this.tick.next(e),this.lateTick.next(e)})),e.camera.add(this.audioListener),window.hology_view=this}set fpsCap(e){this.view.fpsCap=e}get fpsCap(){return this.view.fpsCap}set showStats(e){this.view.showStats=e}get showStats(){return this.view.showStats}addPostProcessVolume(e){this.view.addPostProcessVolume(e)}removePostProcessVolume(e){this.view.removePostProcessVolume(e)}onUpdate(e){return null!=e&&this.tick.pipe(n(e.disposed)),this.tick}onLateUpdate(e){return null!=e&&this.lateTick.pipe(n(e.disposed)),this.lateTick}setCamera(e){const t=e instanceof s?e:e.camera.instance;this.view.setCamera(t),t.add(this.audioListener)}getCamera(){return this.view.camera}get htmlElement(){return this.view.container}pauseRendering(){this.view.paused=!0}unpauseRendering(){this.view.paused=!1}dispose(){this.view.stop(),this.audioListener.removeFromParent()}getScreenPosition(e,t=p){const i=this.getCamera();if(i instanceof a.PerspectiveCamera&&(c.setFromProjectionMatrix(i.projectionMatrix),!c.containsPoint(e)))return null;const s=this.view.container.offsetWidth/2,o=this.view.container.offsetHeight/2;return t.copy(e),t.project(this.getCamera()),t.x=t.x*s+s,t.y=-t.y*o+o,t}};h=e([i(),t("design:paramtypes",[o])],h);export{h as ViewController};const p=new a.Vector3,c=new a.Frustum;/*
1
+ import{__decorate as e,__metadata as t}from"tslib";import{Service as i}from"typedi";import{Camera as s}from"three";import{RenderingView as r}from"../../rendering.js";import{Subject as o,takeUntil as n}from"rxjs";import*as a from"three";let h=class{constructor(e){this.view=e,this.tick=new o,this.lateTick=new o,this.audioListener=new a.AudioListener,e.onLoop((e=>{this.tick.next(e),this.lateTick.next(e)})),e.camera.add(this.audioListener),window.hology_view=this}set fpsCap(e){this.view.fpsCap=e}get fpsCap(){return this.view.fpsCap}set showStats(e){this.view.showStats=e}get showStats(){return this.view.showStats}addPostProcessVolume(e){this.view.addPostProcessVolume(e)}removePostProcessVolume(e){this.view.removePostProcessVolume(e)}onUpdate(e){return null!=e&&this.tick.pipe(n(e.disposed)),this.tick}onLateUpdate(e){return null!=e&&this.lateTick.pipe(n(e.disposed)),this.lateTick}setCamera(e){const t=e instanceof s?e:e.camera.instance;this.view.setCamera(t),t.add(this.audioListener)}getCamera(){return this.view.camera}get htmlElement(){return this.view.container}pauseRendering(){this.view.paused=!0}unpauseRendering(){this.view.paused=!1}dispose(){this.view.stop(),this.audioListener.removeFromParent()}getScreenPosition(e,t=p){const i=this.getCamera();return i.updateMatrixWorld(),m.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),i instanceof a.PerspectiveCamera&&(c.setFromProjectionMatrix(m),!c.containsPoint(e))?null:(t.copy(e),t.project(i),t.x=(t.x+1)/2*this.htmlElement.clientWidth,t.y=(1-t.y)/2*this.htmlElement.clientHeight,t)}};h=e([i(),t("design:paramtypes",[r])],h);export{h as ViewController};const m=new a.Matrix4,p=new a.Vector3,c=new a.Frustum;/*
2
2
  * Copyright (©) 2023. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hology/core",
3
- "version": "0.0.110",
3
+ "version": "0.0.112",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -168,7 +168,7 @@
168
168
  "dependencies": {
169
169
  "@babel/runtime": "^7.24.8",
170
170
  "@dimforge/rapier3d-compat": "^0.14.0",
171
- "@hology/nebula": "^0.0.110",
171
+ "@hology/nebula": "^0.0.112",
172
172
  "@plumier/reflect": "^1.1.0",
173
173
  "@recast-navigation/three": "^0.35.2",
174
174
  "recast-navigation": "^0.35.2",