@hology/core 0.0.118 → 0.0.119

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.
@@ -1,4 +1,4 @@
1
- import{__decorate as e}from"tslib";import{Service as t}from"typedi";import{inject as s}from"../";import{ViewController as i}from"../services/render.js";let n=class{constructor(){this.view=s(i),this.inputs=new Map,this.deltaCallbacks=new Map,this.toggleCallbacks=new Map,this.keybinds=new Map,this.mousebinds=new Map,this.touchmoveBinds=new Map,this.wheelbinds=new Map,this.onKeyDown=e=>{this.keybinds.forEach(((t,s)=>{for(const i of t)if(i.test(e))if(this.inputs.has(s))this.inputs.get(s)(!0);else if(this.toggleCallbacks.has(s)){this.toggleCallbacks.get(s)(!0);this.activeToggleCallbacks.findIndex((e=>e.keybind===i&&e.toggle===this.toggleCallbacks.get(s)))<0&&this.activeToggleCallbacks.push({keybind:i,toggle:this.toggleCallbacks.get(s)})}else console.warn("No input callback for registered for key bind "+i.display())}))},this.activeToggleCallbacks=[],this.onKeyUp=e=>{this.keybinds.forEach(((t,s)=>{for(const i of t)if(i.test(e))if(this.inputs.has(s))this.inputs.get(s)(!1);else if(this.toggleCallbacks.has(s)){this.toggleCallbacks.get(s)(!1);const e=this.activeToggleCallbacks.findIndex((e=>e.keybind===i&&e.toggle===this.toggleCallbacks.get(s)));e>=0&&this.activeToggleCallbacks.splice(e,1);for(const e of this.activeToggleCallbacks)e.toggle(!0)}else console.warn("No input callback for registered for key bind "+i.display())}))},this.onMouseMove=e=>{(null!=document.pointerLockElement||null!=document.mozPointerLockElement)&&this.mousebinds.forEach(((t,s)=>{const i=this.inputs.get(s)??this.deltaCallbacks.get(s);if(null!=i)switch(t.axis){case"x":i(e.movementX*t.multiplier);break;case"y":i(e.movementY*t.multiplier)}else console.warn("No input callback for registered for mouse bind "+t.axis)}))},this.onTouchStart=e=>{for(let t=0;t<=e.touches.length;t++){const s=e.touches[t];if(s.target instanceof HTMLCanvasElement)return void(this.prevTouchEvent=s)}e.preventDefault()},this.onTouchMove=e=>{let t=null;for(let s=0;s<=e.touches.length;s++){const i=e.touches[s];i&&i.target instanceof HTMLCanvasElement&&i.identifier===this.prevTouchEvent.identifier&&(t=i)}this.debug.innerText=t.clientX-this.prevTouchEvent.clientX+"",this.touchmoveBinds.forEach(((e,s)=>{const i=this.inputs.get(s)??this.deltaCallbacks.get(s);if(null!=i)switch(e.axis){case"x":i((t.clientX-this.prevTouchEvent.clientX)*e.multiplier);break;case"y":i((t.clientY-this.prevTouchEvent.clientY)*e.multiplier)}else console.warn("No input callback for registered for mouse bind "+e.axis)})),this.prevTouchEvent=t,e.preventDefault()},this.onTouchEnd=e=>{this.prevTouchEvent=null,e.preventDefault()},this.onWheel=e=>{this.wheelbinds.forEach(((t,s)=>{const i=this.inputs.get(s)??this.deltaCallbacks.get(s);null!=i?i(e.deltaY*t.multiplier):console.warn("No input callback for registered for wheel bind")}))},this.debug=document.createElement("div")}start(){document.addEventListener("keydown",this.onKeyDown),document.addEventListener("mousedown",this.onKeyDown),document.addEventListener("mouseup",this.onKeyUp),document.addEventListener("keyup",this.onKeyUp),document.addEventListener("mousemove",this.onMouseMove),this.view.htmlElement.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.view.htmlElement.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.view.htmlElement.addEventListener("touchend",this.onTouchEnd,{passive:!1}),document.addEventListener("wheel",this.onWheel),this.debug.style.top="40%",this.debug.style.position="absolute",this.debug.style.color="black"}stop(){document.removeEventListener("keydown",this.onKeyDown),document.removeEventListener("mousedown",this.onKeyDown),document.removeEventListener("mouseup",this.onKeyUp),document.removeEventListener("keyup",this.onKeyUp),document.removeEventListener("mousemove",this.onMouseMove),this.view.htmlElement.removeEventListener("touchstart",this.onTouchStart),this.view.htmlElement.removeEventListener("touchmove",this.onTouchMove),this.view.htmlElement.removeEventListener("touchend",this.onTouchEnd),document.removeEventListener("wheel",this.onWheel)}bind(e,t){this.inputs.set(e,t)}bindToggle(e,t){this.toggleCallbacks.set(e,t)}bindDelta(e,t){this.deltaCallbacks.set(e,t)}unbind(e){this.inputs.delete(e),this.toggleCallbacks.delete(e),this.deltaCallbacks.delete(e)}setKeybind(e,t){this.keybinds.has(e)||this.keybinds.set(e,[]),this.keybinds.get(e).push(t)}setMousebind(e,t){this.mousebinds.set(e,t)}setTouchMoveBind(e,t){this.touchmoveBinds.set(e,t)}setWheelbind(e,t){this.wheelbinds.set(e,t)}removeKeybind(e){this.keybinds.delete(e)}removeMousebind(e){this.mousebinds.delete(e)}removeWheelbind(e){this.wheelbinds.delete(e)}};n=e([t()],n);export{n as InputService};/*
1
+ import{__decorate as e}from"tslib";import{Service as t}from"typedi";import{inject as s}from"../inject.js";import{ViewController as i}from"../services/render.js";let n=class{constructor(){this.view=s(i),this.inputs=new Map,this.deltaCallbacks=new Map,this.toggleCallbacks=new Map,this.keybinds=new Map,this.mousebinds=new Map,this.touchmoveBinds=new Map,this.wheelbinds=new Map,this.onKeyDown=e=>{this.keybinds.forEach(((t,s)=>{for(const i of t)if(i.test(e))if(this.inputs.has(s))this.inputs.get(s)(!0);else if(this.toggleCallbacks.has(s)){this.toggleCallbacks.get(s)(!0);this.activeToggleCallbacks.findIndex((e=>e.keybind===i&&e.toggle===this.toggleCallbacks.get(s)))<0&&this.activeToggleCallbacks.push({keybind:i,toggle:this.toggleCallbacks.get(s)})}else console.warn("No input callback for registered for key bind "+i.display())}))},this.activeToggleCallbacks=[],this.onKeyUp=e=>{this.keybinds.forEach(((t,s)=>{for(const i of t)if(i.test(e))if(this.inputs.has(s))this.inputs.get(s)(!1);else if(this.toggleCallbacks.has(s)){this.toggleCallbacks.get(s)(!1);const e=this.activeToggleCallbacks.findIndex((e=>e.keybind===i&&e.toggle===this.toggleCallbacks.get(s)));e>=0&&this.activeToggleCallbacks.splice(e,1);for(const e of this.activeToggleCallbacks)e.toggle(!0)}else console.warn("No input callback for registered for key bind "+i.display())}))},this.onMouseMove=e=>{(null!=document.pointerLockElement||null!=document.mozPointerLockElement)&&this.mousebinds.forEach(((t,s)=>{const i=this.inputs.get(s)??this.deltaCallbacks.get(s);if(null!=i)switch(t.axis){case"x":i(e.movementX*t.multiplier);break;case"y":i(e.movementY*t.multiplier)}else console.warn("No input callback for registered for mouse bind "+t.axis)}))},this.onTouchStart=e=>{for(let t=0;t<=e.touches.length;t++){const s=e.touches[t];if(s.target instanceof HTMLCanvasElement)return void(this.prevTouchEvent=s)}e.preventDefault()},this.onTouchMove=e=>{let t=null;for(let s=0;s<=e.touches.length;s++){const i=e.touches[s];i&&i.target instanceof HTMLCanvasElement&&i.identifier===this.prevTouchEvent.identifier&&(t=i)}this.debug.innerText=t.clientX-this.prevTouchEvent.clientX+"",this.touchmoveBinds.forEach(((e,s)=>{const i=this.inputs.get(s)??this.deltaCallbacks.get(s);if(null!=i)switch(e.axis){case"x":i((t.clientX-this.prevTouchEvent.clientX)*e.multiplier);break;case"y":i((t.clientY-this.prevTouchEvent.clientY)*e.multiplier)}else console.warn("No input callback for registered for mouse bind "+e.axis)})),this.prevTouchEvent=t,e.preventDefault()},this.onTouchEnd=e=>{this.prevTouchEvent=null,e.preventDefault()},this.onWheel=e=>{this.wheelbinds.forEach(((t,s)=>{const i=this.inputs.get(s)??this.deltaCallbacks.get(s);null!=i?i(e.deltaY*t.multiplier):console.warn("No input callback for registered for wheel bind")}))},this.debug=document.createElement("div")}start(){document.addEventListener("keydown",this.onKeyDown),document.addEventListener("mousedown",this.onKeyDown),document.addEventListener("mouseup",this.onKeyUp),document.addEventListener("keyup",this.onKeyUp),document.addEventListener("mousemove",this.onMouseMove),this.view.htmlElement.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.view.htmlElement.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.view.htmlElement.addEventListener("touchend",this.onTouchEnd,{passive:!1}),document.addEventListener("wheel",this.onWheel),this.debug.style.top="40%",this.debug.style.position="absolute",this.debug.style.color="black"}stop(){document.removeEventListener("keydown",this.onKeyDown),document.removeEventListener("mousedown",this.onKeyDown),document.removeEventListener("mouseup",this.onKeyUp),document.removeEventListener("keyup",this.onKeyUp),document.removeEventListener("mousemove",this.onMouseMove),this.view.htmlElement.removeEventListener("touchstart",this.onTouchStart),this.view.htmlElement.removeEventListener("touchmove",this.onTouchMove),this.view.htmlElement.removeEventListener("touchend",this.onTouchEnd),document.removeEventListener("wheel",this.onWheel)}bind(e,t){this.inputs.set(e,t)}bindToggle(e,t){this.toggleCallbacks.set(e,t)}bindDelta(e,t){this.deltaCallbacks.set(e,t)}unbind(e){this.inputs.delete(e),this.toggleCallbacks.delete(e),this.deltaCallbacks.delete(e)}setKeybind(e,t){this.keybinds.has(e)||this.keybinds.set(e,[]),this.keybinds.get(e).push(t)}setMousebind(e,t){this.mousebinds.set(e,t)}setTouchMoveBind(e,t){this.touchmoveBinds.set(e,t)}setWheelbind(e,t){this.wheelbinds.set(e,t)}removeKeybind(e){this.keybinds.delete(e)}removeMousebind(e){this.mousebinds.delete(e)}removeWheelbind(e){this.wheelbinds.delete(e)}};n=e([t()],n);export{n as InputService};/*
2
2
  * Copyright (©) 2023. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,5 +1,5 @@
1
- import { ShaderPass } from 'three-stdlib';
2
1
  import { Color } from 'three';
2
+ import { ShaderPass } from 'three-stdlib';
3
3
  export declare class ColorPass extends ShaderPass {
4
4
  private defines;
5
5
  set vignetteEnabled(value: boolean);
@@ -1 +1 @@
1
- {"version":3,"file":"color-pass.d.ts","sourceRoot":"","sources":["../../src/rendering/color-pass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,EAAE,KAAK,EAA6B,MAAM,OAAO,CAAA;AAExD,qBAAa,SAAU,SAAQ,UAAU;IAEvC,OAAO,CAAC,OAAO,CAEd;IAED,IAAI,eAAe,CAAC,KAAK,EAAE,OAAO,EAEjC;IACD,IAAI,eAAe,IAHQ,OAAO,CAKjC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4 @@
1
- import{ShaderPass as t}from"three-stdlib";import{clamp as e,distance as i,float as n,ifDefApply as r,log as s,mix as u,NodeShaderMaterial as o,pow as l,select as a,smoothstep as m,uniformFloat as c,uniformSampler2d as p,uniformVec3 as f,varyingAttributes as v,vec2 as d,vec3 as T}from"../shader-nodes";import{Color as g,Texture as y,Vector3 as h}from"three";export class ColorPass extends t{set vignetteEnabled(t){this.defines.USE_VIGNETTE=!!t}get vignetteEnabled(){return!!this.defines.USE_VIGNETTE}set vignetteIntensity(t){null!=this.material.uniforms.vignetteIntensity?this.material.uniforms.vignetteIntensity={value:t}:this.material.uniforms.vignetteIntensity.value=t}get vignetteIntensity(){return this.material.uniforms.vignetteIntensity?.value}set colorTint(t){this.uniforms.colorTint.value=t}get colorTint(){const t=this.uniforms.colorTint.value;return t instanceof g?t:(new g).setFromVector3(t)}set colorTintIntensity(t){this.uniforms.colorTintIntensity.value=t}get colorTintIntensity(){return this.uniforms.colorTintIntensity?.value}set temperature(t){this.uniforms.temperature&&(this.uniforms.temperature.value=t)}get temperature(){return this.uniforms.temperature?.value}set temperatureTint(t){this.uniforms.temperatureTint&&(this.uniforms.temperatureTint.value=t)}get temperatureTint(){return this.uniforms.temperatureTint?.value}constructor(){let t=p("tDiffuse",new y).sample(v.uv);const g=f("colorTint",new h(1,1,1)),I=c("colorTintIntensity",1);t=u(t.rgb,t.rgb.multiply(g),I).rgba(1);const E=c("temperature",6500),b=c("temperatureTint",0);t=function(t,i,r){function u(t){const i=t.divide(100),r=a(i.lte(66),n(1),e(n(1.292936186062745).multiply(l(i.subtract(60),-.1332047592)),0,1)),u=a(i.lte(66),e(n(.3900815787690196).multiply(s(i)).subtract(.6318414437886275),0,1),e(n(1.1298908608952942).multiply(l(i.subtract(60),-.0755148492)),0,1)),o=a(i.gte(66),n(1),a(i.lte(19),n(0),e(n(.543206789110196).multiply(s(i.subtract(10))).subtract(1.19625408914),0,1)));return T(r,u,o)}const o=u(e(i,1e3,4e4)),m=e(r,-1,1),c=T(1,n(1).add(m.multiply(.2)),1),p=o.multiply(c),f=p.divideScalar(p.y);return e(t.divide(f),T(0,0,0),T(1,1,1))}(t.rgb,E,b).rgba(1);const S=c("vignetteIntensity",.5),U=d(.5),V=i(v.uv,U),w=t.multiplyScalar(m(.8,.2*.799,V.multiply(S.add(.2))));t=r("USE_VIGNETTE",t,(()=>w));const G=new o({fog:!1,outputEncoding:!1,color:t});super(G),this.defines={USE_VIGNETTE:!1},G.defines=this.defines,G.needsUpdate=!0}}/*
1
+ import{Color as t,Texture as e,Vector3 as i}from"three";import{ShaderPass as n}from"three-stdlib";import{clamp as r,distance as s,float as u,ifDefApply as o,log as l,mix as a,NodeShaderMaterial as m,pow as c,select as p,smoothstep as f,uniformFloat as d,uniformSampler2d as v,uniformVec3 as T,varyingAttributes as g,vec2 as y,vec3 as h}from"../shader-nodes/index.js";export class ColorPass extends n{set vignetteEnabled(t){this.defines.USE_VIGNETTE=!!t}get vignetteEnabled(){return!!this.defines.USE_VIGNETTE}set vignetteIntensity(t){null!=this.material.uniforms.vignetteIntensity?this.material.uniforms.vignetteIntensity={value:t}:this.material.uniforms.vignetteIntensity.value=t}get vignetteIntensity(){return this.material.uniforms.vignetteIntensity?.value}set colorTint(t){this.uniforms.colorTint.value=t}get colorTint(){const e=this.uniforms.colorTint.value;return e instanceof t?e:(new t).setFromVector3(e)}set colorTintIntensity(t){this.uniforms.colorTintIntensity.value=t}get colorTintIntensity(){return this.uniforms.colorTintIntensity?.value}set temperature(t){this.uniforms.temperature&&(this.uniforms.temperature.value=t)}get temperature(){return this.uniforms.temperature?.value}set temperatureTint(t){this.uniforms.temperatureTint&&(this.uniforms.temperatureTint.value=t)}get temperatureTint(){return this.uniforms.temperatureTint?.value}constructor(){let t=v("tDiffuse",new e).sample(g.uv);const n=T("colorTint",new i(1,1,1)),I=d("colorTintIntensity",1);t=a(t.rgb,t.rgb.multiply(n),I).rgba(1);const E=d("temperature",6500),b=d("temperatureTint",0);t=function(t,e,i){function n(t){const e=t.divide(100),i=p(e.lte(66),u(1),r(u(1.292936186062745).multiply(c(e.subtract(60),-.1332047592)),0,1)),n=p(e.lte(66),r(u(.3900815787690196).multiply(l(e)).subtract(.6318414437886275),0,1),r(u(1.1298908608952942).multiply(c(e.subtract(60),-.0755148492)),0,1)),s=p(e.gte(66),u(1),p(e.lte(19),u(0),r(u(.543206789110196).multiply(l(e.subtract(10))).subtract(1.19625408914),0,1)));return h(i,n,s)}const s=n(r(e,1e3,4e4)),o=r(i,-1,1),a=h(1,u(1).add(o.multiply(.2)),1),m=s.multiply(a),f=m.divideScalar(m.y);return r(t.divide(f),h(0,0,0),h(1,1,1))}(t.rgb,E,b).rgba(1);const S=d("vignetteIntensity",.5),U=y(.5),V=s(g.uv,U),w=t.multiplyScalar(f(.8,.2*.799,V.multiply(S.add(.2))));t=o("USE_VIGNETTE",t,(()=>w));const G=new m({fog:!1,outputEncoding:!1,color:t});super(G),this.defines={USE_VIGNETTE:!1},G.defines=this.defines,G.needsUpdate=!0}}/*
2
2
  * Copyright (©) 2023. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -22,6 +22,44 @@ export declare class CollisionShape {
22
22
  restitution?: number;
23
23
  collisionGroup?: number;
24
24
  source?: CollisionShapeSource;
25
+ /**
26
+ * Collision groups are used to control which objects in a physics simulation can collide with each other.
27
+ * Each collision shape can be assigned to one or more groups, and collision filters are used to specify
28
+ * which groups are allowed to interact. This mechanism allows for fine-grained control over collision
29
+ * detection, enabling scenarios such as ignoring collisions between certain types of objects (e.g.,
30
+ * player characters not colliding with each other, or projectiles ignoring their owner).
31
+ *
32
+ * In practice, a collision group is represented as a bitmask (an integer where each bit
33
+ * represents membership in a group). Collision filters then use bitwise operations to determine if
34
+ * two shapes should be tested for collision:
35
+ * - Each shape has a "membership" mask (which groups it belongs to)
36
+ * - Each shape has a "filter" mask (which groups it can collide with)
37
+ * - Two shapes will only collide if:
38
+ * (A.filter & B.membership) !== 0 && (B.filter & A.membership) !== 0
39
+ *
40
+ * Collision groups and filters are combined into a single 32-bit integer called the "collision group".
41
+ * This integer encodes both the group memberships and the filter mask for a collider.
42
+ *
43
+ * The 32 bits are split into two 16-bit sections:
44
+ * - The lower 16 bits (bits 0-15) represent the "memberships" mask: which groups this collider belongs to.
45
+ * - The upper 16 bits (bits 16-31) represent the "filter" mask: which groups this collider can collide with.
46
+ *
47
+ * To construct a collision group integer:
48
+ * collisionGroup = (filterMask << 16) | membershipMask
49
+ *
50
+ * When two colliders interact, Rapier checks:
51
+ * (A.filterMask & B.membershipMask) !== 0 && (B.filterMask & A.membershipMask) !== 0
52
+ *
53
+ * For example, if you want a collider to:
54
+ * - belong to groups 0 and 2 (membershipMask = 0b0000_0000_0000_0101 = 0x0005)
55
+ * - collide with group 1 only (filterMask = 0b0000_0000_0000_0010 = 0x0002)
56
+ * Then, collisionGroup = (0x0002 << 16) | 0x0005 = 0x00020005
57
+ *
58
+ * This allows you to specify both which groups a collider is part of and which groups it can interact with,
59
+ * all in a single integer value.
60
+ *
61
+ */
62
+ withCollisionGroup(collisionGroup: number): this;
25
63
  withRestitution(restitution: number): this;
26
64
  withOffset(vector: Vector3): this;
27
65
  withRotation(rotation: Euler): this;
@@ -1 +1 @@
1
- {"version":3,"file":"collision-shape.d.ts","sourceRoot":"","sources":["../../../src/scene/collision/collision-shape.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAA;AACxE,OAAO,EAAe,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAGnF,oBAAY,oBAAoB;IAC9B;;;;MAIE;IACF,MAAM,IAAA;IACN;;;OAGG;IACH,QAAQ,IAAA;CACT;AACD,qBAAa,cAAc;IAClB,MAAM,EAAE,OAAO,CAAgB;IAC/B,QAAQ,EAAE,KAAK,CAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,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;aAE9C,IAAI,EAAE,IAAI,GAAC,cAAc;gBAAzB,IAAI,EAAE,IAAI,GAAC,cAAc;CAI5C;AAED,qBAAa,qBAAsB,SAAQ,cAAc;aAErC,QAAQ,EAAE,cAAc;gBAAxB,QAAQ,EAAE,cAAc;CAK3C;AAED,qBAAa,kBAAmB,SAAQ,cAAc;aAElC,QAAQ,EAAE,cAAc;gBAAxB,QAAQ,EAAE,cAAc;CAI3C;AAGD,qBAAa,qBAAsB,SAAQ,cAAc;IAE9C,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,MAAM;gBADd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM;CAIxB;AAGD,qBAAa,iBAAkB,SAAQ,IAAI;IAKhC,cAAc,EAAE,cAAc;IAC9B,OAAO,CAAC,EAAE,0BAA0B;IAL7C,mBAAmB,UAAO;gBAExB,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,QAAQ,EACX,cAAc,EAAE,cAAc,EAC9B,OAAO,CAAC,EAAE,0BAA0B;CAI9C"}
@@ -1,4 +1,4 @@
1
- import{Euler as s,Mesh as e,Vector3 as t}from"three";export var CollisionShapeSource;!function(s){s[s.custom=0]="custom",s[s.rendered=1]="rendered"}(CollisionShapeSource||(CollisionShapeSource={}));export class CollisionShape{constructor(){this.offset=new t,this.rotation=new s}withRestitution(s){return this.restitution=s,this}withOffset(s){return this.offset.copy(s),this}withRotation(s){return this.rotation.copy(s),this}withDensity(s){return this.density=s,this}withMass(s){return this.mass=s,this}withFriction(s){return this.friction=s,this}static box(s){return new BoxCollisionShape(s)}static plane(s,e){return new PlaneCollisionShape(s,e)}static sphere(s){return new SphereCollisionShape(s)}static cylinder(s,e,t,i,o){return new CylinderCollisionShape(s,e,t,i,o)}static cone(s,e){return new ConeCollisionShape(s,e)}static convexPolyhedron(s){return new ConvexPolyhedronCollisionShape(s)}static trimesh(s){return new TrimeshCollisionShape(s)}static mesh(s){return new MeshCollisionShape(s)}static capsule(s,e){return new CapsuleCollisionShape(s,e)}}export class BoxCollisionShape extends CollisionShape{constructor(s){super(),this.dimensions=s}}export class PlaneCollisionShape extends CollisionShape{constructor(s,e){super(),this.width=s,this.height=e}}export class SphereCollisionShape extends CollisionShape{constructor(s){super(),this.radius=s}}export class CylinderCollisionShape extends CollisionShape{constructor(s,e,t,i,o){super(),this.radiusTop=s,this.radiusBottom=e,this.height=t,this.segments=i,this.orentation=o}}export class ConeCollisionShape extends CollisionShape{constructor(s,e){super(),this.radiusBottom=s,this.height=e}}export class ConvexPolyhedronCollisionShape extends CollisionShape{constructor(s){super(),this.mesh=s}}export class TrimeshCollisionShape extends CollisionShape{constructor(s){super(),this.geometry=s}}export class MeshCollisionShape extends CollisionShape{constructor(s){super(),this.geometry=s}}export class CapsuleCollisionShape extends CollisionShape{constructor(s,e){super(),this.length=s,this.radius=e}}export class PhysicalShapeMesh extends e{constructor(s,e,t,i){super(s,e),this.collisionShape=t,this.physics=i,this.isPhysicalShapeMesh=!0}}/*
1
+ import{Euler as s,Mesh as e,Vector3 as t}from"three";export var CollisionShapeSource;!function(s){s[s.custom=0]="custom",s[s.rendered=1]="rendered"}(CollisionShapeSource||(CollisionShapeSource={}));export class CollisionShape{constructor(){this.offset=new t,this.rotation=new s}withCollisionGroup(s){return this.collisionGroup=s,this}withRestitution(s){return this.restitution=s,this}withOffset(s){return this.offset.copy(s),this}withRotation(s){return this.rotation.copy(s),this}withDensity(s){return this.density=s,this}withMass(s){return this.mass=s,this}withFriction(s){return this.friction=s,this}static box(s){return new BoxCollisionShape(s)}static plane(s,e){return new PlaneCollisionShape(s,e)}static sphere(s){return new SphereCollisionShape(s)}static cylinder(s,e,t,i,o){return new CylinderCollisionShape(s,e,t,i,o)}static cone(s,e){return new ConeCollisionShape(s,e)}static convexPolyhedron(s){return new ConvexPolyhedronCollisionShape(s)}static trimesh(s){return new TrimeshCollisionShape(s)}static mesh(s){return new MeshCollisionShape(s)}static capsule(s,e){return new CapsuleCollisionShape(s,e)}}export class BoxCollisionShape extends CollisionShape{constructor(s){super(),this.dimensions=s}}export class PlaneCollisionShape extends CollisionShape{constructor(s,e){super(),this.width=s,this.height=e}}export class SphereCollisionShape extends CollisionShape{constructor(s){super(),this.radius=s}}export class CylinderCollisionShape extends CollisionShape{constructor(s,e,t,i,o){super(),this.radiusTop=s,this.radiusBottom=e,this.height=t,this.segments=i,this.orentation=o}}export class ConeCollisionShape extends CollisionShape{constructor(s,e){super(),this.radiusBottom=s,this.height=e}}export class ConvexPolyhedronCollisionShape extends CollisionShape{constructor(s){super(),this.mesh=s}}export class TrimeshCollisionShape extends CollisionShape{constructor(s){super(),this.geometry=s}}export class MeshCollisionShape extends CollisionShape{constructor(s){super(),this.geometry=s}}export class CapsuleCollisionShape extends CollisionShape{constructor(s,e){super(),this.length=s,this.radius=e}}export class PhysicalShapeMesh extends e{constructor(s,e,t,i){super(s,e),this.collisionShape=t,this.physics=i,this.isPhysicalShapeMesh=!0}}/*
2
2
  * Copyright (©) 2023. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
- import{abs as t,inverse as r,min as o,smoothstep as e,uniforms as a,varying as c,vec4 as l}from"three-shader-graph";import{depthNormal as p,depthWorldPosition as x}from"./depth";const d=c(r(a.instanceMatrix.multiply(a.modelMatrix))),i=d.multiplyVec(l(x,1)).xyz;export const decalNormal=d.multiplyVec(l(p,0)).xyz;export const decalDiscard=t(i.x).gt(.5).or(t(i.y).gt(.5)).or(t(i.z).gt(.5));export const decalUV=i.xz.addScalar(.5);export const decalAlpha=o(e(.5,.4,t(i.x)),o(e(.5,.4,t(i.y)),e(.5,.4,t(i.z))));/*
1
+ import{abs as t,inverse as r,min as o,smoothstep as e,uniforms as a,varying as c,vec4 as l}from"three-shader-graph";import{depthNormal as p,depthWorldPosition as x}from"./depth.js";const d=c(r(a.instanceMatrix.multiply(a.modelMatrix))),i=d.multiplyVec(l(x,1)).xyz;export const decalNormal=d.multiplyVec(l(p,0)).xyz;export const decalDiscard=t(i.x).gt(.5).or(t(i.y).gt(.5)).or(t(i.z).gt(.5));export const decalUV=i.xz.addScalar(.5);export const decalAlpha=o(e(.5,.4,t(i.x)),o(e(.5,.4,t(i.y)),e(.5,.4,t(i.z))));/*
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.118",
3
+ "version": "0.0.119",
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.118",
171
+ "@hology/nebula": "^0.0.119",
172
172
  "@plumier/reflect": "^1.1.0",
173
173
  "@recast-navigation/three": "^0.35.2",
174
174
  "recast-navigation": "^0.35.2",