@hology/core 0.0.168 → 0.0.170
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/dist/effects/vfx/vfx-actor.js +1 -1
- package/dist/effects/vfx/vfx-materializer.d.ts +2 -1
- package/dist/effects/vfx/vfx-param.d.ts +1 -1
- package/dist/effects/vfx/vfx-param.js +1 -1
- package/dist/effects/vfx/vfx-service.d.ts +3 -2
- package/dist/effects/vfx/vfx-service.js +1 -1
- package/dist/gameplay/actors/builtin/components/index.d.ts +11 -0
- package/dist/gameplay/actors/builtin/components/index.js +1 -1
- package/dist/gameplay/actors/builtin/trigger-volume.js +1 -1
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate as t}from"tslib";import*as s from"three";import{Rate as e}from"@hology/nebula";import{Actor as i,BaseActor as r}from"../../gameplay/actors/actor.js";import{inject as o}from"../../gameplay/inject.js";import{AssetLoader as a}from"../../gameplay/services/asset-loader.js";import{ViewController as h}from"../../gameplay/services/render.js";import{World as m}from"../../gameplay/services/world.js";import{DelayRate as l}from"./rates.js";import{materializeVfx as d}from"./vfx-materializer.js";import{PhysicsSystem as
|
|
1
|
+
import{__decorate as t}from"tslib";import*as s from"three";import{Rate as e}from"@hology/nebula";import{Actor as i,BaseActor as r}from"../../gameplay/actors/actor.js";import{inject as o}from"../../gameplay/inject.js";import{AssetLoader as a}from"../../gameplay/services/asset-loader.js";import{ViewController as h}from"../../gameplay/services/render.js";import{World as m}from"../../gameplay/services/world.js";import{DelayRate as l}from"./rates.js";import{materializeVfx as d}from"./vfx-materializer.js";import{PhysicsSystem as p}from"../../gameplay/services/physics/physics-system.js";import{ShaderProvider as n}from"../../gameplay/services/shader-provider.js";let c=class extends r{constructor(){super(...arguments),this.timescale=1,this.paused=!0,this.assetLoader=o(a),this.world=o(m),this.view=o(h),this.physics=o(p),this.shaderProvider=o(n),this._worldPos=new s.Vector3,this._worldRot=new s.Quaternion,this._worldEul=new s.Euler,this.max=0}async fromAsset(t){if("vfx"!==t.type)throw"Asset must be a VFX asset but is "+t.type;null!=this.system&&(this.system.destroy(),this.system.emitters.forEach(t=>t.reset())),this.sourceAsset=t,this.disposeSystem&&this.disposeSystem(),this.world.scene.add(this.object);const{system:s,dispose:e,container:i}=await d(this.sourceAsset,this.object,{getAsset:t=>this.assetLoader.getAsset(t),getMaterial:t=>this.assetLoader.getMaterialByAssetId(t),getTexture:t=>this.assetLoader.getTextureByAssetId(t),getMesh:t=>this.assetLoader.getModelByAssetId(t).then(t=>t.scene)},this.view,this.physics,this.shaderProvider);this.system=s,this.disposeSystem=e,this.particleSystemContainer=i,this.object.visible=!1,this.object.matrixAutoUpdate=!1,this.object.matrixWorldAutoUpdate=!1,this.particleSystemContainer.matrixAutoUpdate=!1,this.particleSystemContainer.matrixWorldAutoUpdate=!1}play(){null==this.particleSystemContainer.parent&&this.world.scene.add(this.particleSystemContainer),this.object.matrixAutoUpdate=!0,this.object.matrixWorldAutoUpdate=!0,this.particleSystemContainer.matrixAutoUpdate=!0,this.particleSystemContainer.matrixWorldAutoUpdate=!0,this.object.visible=!0,this.paused=!1;this.system.emitters.every(t=>t.dead)&&this.restart()}pause(){this.paused=!0}stop(){this.system.emitters.forEach(t=>{const s=t.rate;s instanceof e&&(s.nextTime=1/0)})}restart(){if(null!=this.system&&null!=this.system.emitters)for(const t of this.system.emitters){const s=t.rate;s instanceof l?s.restart():s.nextTime=0,t.removeAllParticles()}}onUpdate(t){this.paused||(this.object.getWorldPosition(this._worldPos),this.object.getWorldQuaternion(this._worldRot),this._worldEul.setFromQuaternion(this._worldRot),this.system?.emitters.forEach(t=>{"world"===t._space&&(t.setPosition(this._worldPos),t.setRotation(this._worldEul))}),this.system?.update(t*this.timescale))}getParticleCount(){return this.system?.getCount()??0}onEndPlay(){this.stop(),null!=this.disposeSystem&&this.disposeSystem()}};c=t([i()],c);export{c as VfxActor};/*
|
|
2
2
|
* Copyright (©) 2025 Hology Interactive AB. All rights reserved.
|
|
3
3
|
* See the LICENSE.md file for details.
|
|
4
4
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import System from "@hology/nebula";
|
|
2
2
|
import * as THREE from 'three';
|
|
3
3
|
import { Object3D } from "three";
|
|
4
|
-
import { PhysicsSystem
|
|
4
|
+
import { PhysicsSystem } from '../../gameplay/services/physics/physics-system.js';
|
|
5
|
+
import { ViewController } from '../../gameplay/services/render.js';
|
|
5
6
|
import { Asset, VfxAsset } from '../../scene/model.js';
|
|
6
7
|
import { ShaderProvider } from "../../gameplay/services/shader-provider.js";
|
|
7
8
|
export type VfxAssetProvider = {
|
|
@@ -2,7 +2,7 @@ import { VfxActor } from './vfx-actor.js';
|
|
|
2
2
|
import { ActorProvider } from "../../scene/materializer.js";
|
|
3
3
|
import { VfxAsset } from "../../scene/model.js";
|
|
4
4
|
import { Object3D } from 'three';
|
|
5
|
-
import { BaseActor } from '../../gameplay/
|
|
5
|
+
import { BaseActor } from '../../gameplay/actors/actor.js';
|
|
6
6
|
export declare class VisualEffect {
|
|
7
7
|
private actorProvider;
|
|
8
8
|
private asset;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{VfxActor as t}from"./vfx-actor.js";import{BaseActor as s}from"../../gameplay/
|
|
1
|
+
import{VfxActor as t}from"./vfx-actor.js";import{BaseActor as s}from"../../gameplay/actors/actor.js";export class VisualEffect{constructor(t,s){this.actorProvider=t,this.asset=s}async create(e){const a=await this.actorProvider.create(t);return e instanceof s?e.object.add(a.object):e.add(a.object),await a.fromAsset(this.asset),a}createPool(t){return new VfxPool(()=>this.create(t))}}export class VfxPool{constructor(t){this.creator=t,this.instances=[]}async get(){0==this.instances.length&&this.instances.push(await this.creator());const t=this.instances.shift();return t.restart(),t}release(t){t.stop(),this.instances.push(t)}dispose(){this.instances.length=0}}/*
|
|
2
2
|
* Copyright (©) 2025 Hology Interactive AB. All rights reserved.
|
|
3
3
|
* See the LICENSE.md file for details.
|
|
4
4
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Object3D } from 'three';
|
|
2
|
-
import { BaseActor
|
|
3
|
-
import {
|
|
2
|
+
import { BaseActor } from '../../gameplay/actors/actor.js';
|
|
3
|
+
import { VfxActor } from './vfx-actor.js';
|
|
4
|
+
import { Asset, AssetId } from '../../scene/model.js';
|
|
4
5
|
import { VfxPool } from './vfx-param';
|
|
5
6
|
export declare class VfxService {
|
|
6
7
|
private pools;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate as t}from"tslib";import{ActorFactory as s
|
|
1
|
+
import{__decorate as t}from"tslib";import{ActorFactory as s}from"../../gameplay/actors/factory.js";import{AssetLoader as e}from"../../gameplay/services/asset-loader.js";import{BaseActor as r}from"../../gameplay/actors/actor.js";import{inject as o}from"../../gameplay/inject.js";import{Service as a}from"typedi";import{World as c}from"../../gameplay/services/world.js";import{VfxActor as i}from"./vfx-actor.js";import{VfxPool as m}from"./vfx-param";let l=class{constructor(){this.pools=new Map,this.actorFactory=o(s),this.assetService=o(e),this.world=o(c)}async createFromAssetId(t,s=this.world.scene){const e=await this.assetService.getAsset(t);return this.createFromAsset(e,s)}async createFromAsset(t,s=this.world.scene){const e=await this.actorFactory.create(i);return s instanceof r?s.object.add(e.object):s.add(e.object),await e.fromAsset(t),e}async createPoolFromAssetId(t,s=this.world.scene){const e=await this.assetService.getAsset(t);return this.createPoolFromAsset(e,s)}async createPoolFromAsset(t,s=this.world.scene){let e;return this.pools.has(t.id)||(e=new m(()=>this.createFromAsset(t,s)),this.pools.set(t.id,e)),e}};l=t([a()],l);export{l as VfxService};/*
|
|
2
2
|
* Copyright (©) 2025 Hology Interactive AB. All rights reserved.
|
|
3
3
|
* See the LICENSE.md file for details.
|
|
4
4
|
*/
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { MeshComponent } from './mesh-component.js';
|
|
2
|
+
import { CharacterMovementComponent } from './character/character-movement.js';
|
|
3
|
+
import { CharacterAnimationComponent } from './character/character-animation.js';
|
|
2
4
|
import { TweenComponent } from './tween-component.js';
|
|
5
|
+
import { TriggerVolumeComponent } from '../trigger-volume.js';
|
|
6
|
+
import { PositionalAudioComponent } from '../positional-audio-actor.js';
|
|
7
|
+
import { CameraComponent, ThirdPersonCameraComponent } from '../../../../gameplay/actors/index.js';
|
|
3
8
|
export declare const builtInComponents: {
|
|
4
9
|
MeshComponent: typeof MeshComponent;
|
|
5
10
|
TweenComponent: typeof TweenComponent;
|
|
11
|
+
CharacterMovementComponent: typeof CharacterMovementComponent;
|
|
12
|
+
CharacterAnimationComponent: typeof CharacterAnimationComponent;
|
|
13
|
+
TriggerVolumeComponent: typeof TriggerVolumeComponent;
|
|
14
|
+
PositionalAudioComponent: typeof PositionalAudioComponent;
|
|
15
|
+
CameraComponent: typeof CameraComponent;
|
|
16
|
+
ThirdPersonCameraComponent: typeof ThirdPersonCameraComponent;
|
|
6
17
|
};
|
|
7
18
|
export default builtInComponents;
|
|
8
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{MeshComponent as o}from"./mesh-component.js";import{TweenComponent as n}from"./tween-component.js";export const builtInComponents={MeshComponent:o,TweenComponent:n};export default builtInComponents;/*
|
|
1
|
+
import{MeshComponent as o}from"./mesh-component.js";import{CharacterMovementComponent as t}from"./character/character-movement.js";import{CharacterAnimationComponent as e}from"./character/character-animation.js";import{TweenComponent as n}from"./tween-component.js";import{TriggerVolumeComponent as r}from"../trigger-volume.js";import{PositionalAudioComponent as m}from"../positional-audio-actor.js";import{CameraComponent as a,ThirdPersonCameraComponent as i}from"../../../../gameplay/actors/index.js";export const builtInComponents={MeshComponent:o,TweenComponent:n,CharacterMovementComponent:t,CharacterAnimationComponent:e,TriggerVolumeComponent:r,PositionalAudioComponent:m,CameraComponent:a,ThirdPersonCameraComponent:i};export default builtInComponents;/*
|
|
2
2
|
* Copyright (©) 2025 Hology Interactive AB. All rights reserved.
|
|
3
3
|
* See the LICENSE.md file for details.
|
|
4
4
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate as t,__metadata as s}from"tslib";import{EdgesGeometry as i,LineSegments as e,LineBasicMaterial as o,Vector3 as r,BoxGeometry as n,Mesh as h,MeshBasicMaterial as c,Group as p,Color as m}from"three";import{Actor as
|
|
1
|
+
import{__decorate as t,__metadata as s}from"tslib";import{EdgesGeometry as i,LineSegments as e,LineBasicMaterial as o,Vector3 as r,BoxGeometry as n,Mesh as h,MeshBasicMaterial as c,Group as p,Color as m}from"three";import{Actor as d,BaseActor as a}from"../actor.js";import{Component as y,ActorComponent as l,attach as f}from"../component.js";import{PhysicsSystem as v}from"../../services/physics/physics-system.js";import{BoxCollisionShape as w}from"../../../scene/collision/collision-shape.js";import{Parameter as g}from"../../../shader/parameter.js";import{firstValueFrom as O}from"rxjs";let u=class extends l{constructor(){super(...arguments),this.color=new m(16777215),this.dimensions=new r(1,1,1)}onInit(){const t=new n(this.dimensions.x,this.dimensions.y,this.dimensions.z),s=new i(t),r=new e(s,new o({color:this.color})),m=(new h(t,new c({color:this.color,transparent:!0,opacity:.3,visible:!1})),new p);m.add(r),this.actor.object.add(m)}};t([g(),s("design:type",m)],u.prototype,"color",void 0),t([g(),s("design:type",r)],u.prototype,"dimensions",void 0),u=t([y({inEditor:!0,editorOnly:!0})],u);export{u as TriggerVolumeMesh};let A=class extends l{constructor(t){super(),this.physicsSystem=t,this.dimensions=new r(1,1,1),this.offset=new r(0,0,0),this.editorMesh=f(u)}onInit(){this.physicsSystem.addActor(this.actor,[new w(this.dimensions).withOffset(this.offset)],{isTrigger:!0}),O(this.disposed).then(()=>{this.physicsSystem.removeActor(this.actor)})}onBeginOverlapWithActor(t){return this.physicsSystem.onBeginOverlapWithActor(this.actor,t)}onEndOverlapWithActor(t){return this.physicsSystem.onEndOverlapWithActor(this.actor,t)}onBeginOverlapWithActorType(t){return this.physicsSystem.onBeginOverlapWithActorType(this.actor,t)}onEndOverlapWithActorType(t){return this.physicsSystem.onEndOverlapWithActorType(this.actor,t)}};A=t([y({inEditor:!0,editorOnly:!1}),s("design:paramtypes",[v])],A);export{A as TriggerVolumeComponent};let x=class extends a{constructor(){super(...arguments),this.trigger=f(A)}};x=t([d()],x);export{x as TriggerVolume};/*
|
|
2
2
|
* Copyright (©) 2025 Hology Interactive AB. All rights reserved.
|
|
3
3
|
* See the LICENSE.md file for details.
|
|
4
4
|
*/
|