@combos-fun/plugin-renderer-3d-model 0.0.8 → 0.0.10

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/agent-skill.md CHANGED
@@ -9,10 +9,10 @@ Read for any 3D character / prop / scenery model: loading GLB / GLTF files, choo
9
9
  ## Public API
10
10
 
11
11
  ```ts
12
- import { Model3D, GLBSystem, type Model3DParams } from '@combos-fun/plugin-renderer-3d-model';
12
+ import { Model3D, Model3DSystem, type Model3DParams } from '@combos-fun/plugin-renderer-3d-model';
13
13
  ```
14
14
 
15
- `componentName = 'Model3D'`, `systemName = 'GLBSystem'`.
15
+ `componentName = 'Model3D'`, `systemName = 'Model3DSystem'`. Currently only loads `.glb` / `.gltf` (Three.js `GLTFLoader`); other formats (FBX/OBJ/STL/DAE) are not supported.
16
16
 
17
17
  ### `Model3DParams`
18
18
 
@@ -30,7 +30,7 @@ Changing `animationIndex` or `speed` restarts the animation cleanly.
30
30
 
31
31
  ## Required setup
32
32
 
33
- `Renderer3DSystem` then `GLBSystem`. URL must be CORS-accessible and return valid binary GLB / JSON GLTF.
33
+ `Renderer3DSystem` then `Model3DSystem`. URL must be CORS-accessible and return valid binary GLB / JSON GLTF.
34
34
 
35
35
  ## Runtime behaviour
36
36
 
@@ -7,5 +7,5 @@
7
7
  "keywords": ["3d", "model", "glb", "gltf", "animation", "mesh"],
8
8
  "agentSkill": "./agent-skill.md",
9
9
  "requires": ["@combos-fun/engine", "@combos-fun/plugin-renderer-3d"],
10
- "exports": ["Model3D", "GLBSystem"]
10
+ "exports": ["Model3D", "Model3DSystem"]
11
11
  }
@@ -78,12 +78,12 @@ tslib.__decorate([
78
78
  inspectorDecorator.step(0.1)
79
79
  ], Model3D.prototype, "scaleZ", void 0);
80
80
 
81
- let GLBSystem = class GLBSystem extends pluginRenderer3d.Renderer3D {
81
+ let Model3DSystem = class Model3DSystem extends pluginRenderer3d.Renderer3D {
82
82
  constructor() {
83
83
  super(...arguments);
84
- this.name = 'GLBSystem';
84
+ this.name = 'Model3DSystem';
85
85
  }
86
- static { this.systemName = 'GLBSystem'; }
86
+ static { this.systemName = 'Model3DSystem'; }
87
87
  init() {
88
88
  const renderer3DSystem = this.game.getSystem(pluginRenderer3d.Renderer3DSystem);
89
89
  renderer3DSystem.rendererManager.register(this);
@@ -145,7 +145,7 @@ let GLBSystem = class GLBSystem extends pluginRenderer3d.Renderer3D {
145
145
  }
146
146
  }
147
147
  };
148
- GLBSystem = tslib.__decorate([
148
+ Model3DSystem = tslib.__decorate([
149
149
  engine.decorators.componentObserver({
150
150
  Model3D: [
151
151
  'resource',
@@ -155,9 +155,9 @@ GLBSystem = tslib.__decorate([
155
155
  'speed', 'animationIndex',
156
156
  ],
157
157
  })
158
- ], GLBSystem);
159
- var GLBSystem_default = GLBSystem;
158
+ ], Model3DSystem);
159
+ var Model3DSystem_default = Model3DSystem;
160
160
 
161
- exports.GLBSystem = GLBSystem_default;
162
161
  exports.Model3D = Model3D;
162
+ exports.Model3DSystem = Model3DSystem_default;
163
163
  //# sourceMappingURL=plugin-renderer-3d-model.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-renderer-3d-model.cjs.js","sources":["../lib/component.ts","../lib/system.ts"],"sourcesContent":["import { Component } from '@combos-fun/engine';\nimport { type, step } from '@combos-fun/inspector-decorator';\n\nexport interface Model3DParams {\n resource?: string;\n autoPlay?: boolean;\n animationIndex?: number;\n speed?: number;\n positionX?: number;\n positionY?: number;\n positionZ?: number;\n rotationX?: number;\n rotationY?: number;\n rotationZ?: number;\n scaleX?: number;\n scaleY?: number;\n scaleZ?: number;\n}\n\nexport default class Model3D extends Component<Model3DParams> {\n static componentName: string = 'Model3D';\n\n @type('string') resource: string = '';\n @type('boolean') autoPlay: boolean = true;\n @type('number') animationIndex: number = 0;\n @type('number') @step(0.1) speed: number = 1;\n @type('number') @step(0.1) positionX: number = 0;\n @type('number') @step(0.1) positionY: number = 0;\n @type('number') @step(0.1) positionZ: number = 0;\n @type('number') @step(0.01) rotationX: number = 0;\n @type('number') @step(0.01) rotationY: number = 0;\n @type('number') @step(0.01) rotationZ: number = 0;\n @type('number') @step(0.1) scaleX: number = 1;\n @type('number') @step(0.1) scaleY: number = 1;\n @type('number') @step(0.1) scaleZ: number = 1;\n\n init(obj?: Model3DParams) {\n if (obj) Object.assign(this, obj);\n }\n}\n","import { decorators, ComponentChanged, OBSERVER_TYPE, GameObject } from '@combos-fun/engine';\nimport { Renderer3D, Renderer3DSystem } from '@combos-fun/plugin-renderer-3d';\nimport Model3D from './component';\n\n@decorators.componentObserver({\n Model3D: [\n 'resource',\n 'positionX', 'positionY', 'positionZ',\n 'rotationX', 'rotationY', 'rotationZ',\n 'scaleX', 'scaleY', 'scaleZ',\n 'speed', 'animationIndex',\n ],\n})\nexport default class GLBSystem extends Renderer3D {\n static systemName = 'GLBSystem';\n name: string = 'GLBSystem';\n\n init() {\n const renderer3DSystem = this.game.getSystem(Renderer3DSystem) as Renderer3DSystem;\n renderer3DSystem.rendererManager.register(this);\n }\n\n componentChanged(changed: ComponentChanged) {\n if (changed.componentName !== 'Model3D') return;\n\n const component = changed.component as Model3D;\n\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.handleAdd(changed.gameObject, component);\n } else if (changed.type === OBSERVER_TYPE.CHANGE) {\n this.handleChange(changed);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.increaseAsyncId(changed.gameObject.id);\n this.threeContext.removeModel(changed.gameObject.id);\n }\n }\n\n rendererUpdate(gameObject: GameObject) {\n const component = gameObject.getComponent(Model3D) as Model3D;\n if (!component) return;\n\n const model = this.threeContext.models.get(gameObject.id);\n if (!model) return;\n\n model.position.set(component.positionX, component.positionY, component.positionZ);\n model.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n model.scale.set(component.scaleX, component.scaleY, component.scaleZ);\n }\n\n private async handleAdd(gameObject: GameObject, component: Model3D) {\n if (!component.resource) return;\n\n const asyncId = this.increaseAsyncId(gameObject.id);\n await this.threeContext.loadGLB(gameObject.id, component.resource);\n if (!this.validateAsyncId(gameObject.id, asyncId)) return;\n\n if (component.autoPlay) {\n this.threeContext.playAnimation(\n gameObject.id,\n component.animationIndex,\n component.speed,\n );\n }\n }\n\n private async handleChange(changed: ComponentChanged) {\n const component = changed.component as Model3D;\n const changedProp = changed.prop?.prop?.[0];\n\n if (changedProp === 'resource') {\n this.threeContext.removeModel(changed.gameObject.id);\n if (!component.resource) return;\n\n const asyncId = this.increaseAsyncId(changed.gameObject.id);\n await this.threeContext.loadGLB(changed.gameObject.id, component.resource);\n if (!this.validateAsyncId(changed.gameObject.id, asyncId)) return;\n\n if (component.autoPlay) {\n this.threeContext.playAnimation(\n changed.gameObject.id,\n component.animationIndex,\n component.speed,\n );\n }\n }\n\n if (changedProp === 'speed' || changedProp === 'animationIndex') {\n this.threeContext.playAnimation(\n changed.gameObject.id,\n component.animationIndex,\n component.speed,\n );\n }\n }\n}\n"],"names":["Component","__decorate","type","step","Renderer3D","Renderer3DSystem","OBSERVER_TYPE","decorators"],"mappings":";;;;;;;AAmBc,MAAO,OAAQ,SAAQA,gBAAwB,CAAA;AAA7D,IAAA,WAAA,GAAA;;QAGkB,IAAA,CAAA,QAAQ,GAAW,EAAE;QACpB,IAAA,CAAA,QAAQ,GAAY,IAAI;QACzB,IAAA,CAAA,cAAc,GAAW,CAAC;QACf,IAAA,CAAA,KAAK,GAAW,CAAC;QACjB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACpB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACtB,IAAA,CAAA,MAAM,GAAW,CAAC;QAClB,IAAA,CAAA,MAAM,GAAW,CAAC;QAClB,IAAA,CAAA,MAAM,GAAW,CAAC;IAK/C;aAnBS,IAA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AAC,cAAc,EACxB,SAAS,CAAC,KAAK,CAChB;YACH;QACF;QAEA,IAAI,WAAW,KAAK,OAAO,IAAI,WAAW,KAAK,gBAAgB,EAAE;AAC/D,YAAA,IAAI,CAAC,YAAY,CAAC,aAAa,CAC7B,OAAO,CAAC,UAAU,CAAC,EAAE,EACrB,SAAS,CAAC,cAAc,EACxB,SAAS,CAAC,KAAK,CAChB;QACH;IACF;;AAhFmB,SAAS,GAAAL,gBAAA,CAAA;IAT7BM,iBAAU,CAAC,iBAAiB,CAAC;AAC5B,QAAA,OAAO,EAAE;YACP,UAAU;YACV,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,QAAQ,EAAE,QAAQ,EAAE,QAAQ;AAC5B,YAAA,OAAO,EAAE,gBAAgB;AAC1B,SAAA;KACF;AACoB,CAAA,EAAA,SAAS,CAiF7B;wBAjFoB,SAAS;;;;;"}
1
+ {"version":3,"file":"plugin-renderer-3d-model.cjs.js","sources":["../lib/component.ts","../lib/system.ts"],"sourcesContent":["import { Component } from '@combos-fun/engine';\nimport { type, step } from '@combos-fun/inspector-decorator';\n\nexport interface Model3DParams {\n resource?: string;\n autoPlay?: boolean;\n animationIndex?: number;\n speed?: number;\n positionX?: number;\n positionY?: number;\n positionZ?: number;\n rotationX?: number;\n rotationY?: number;\n rotationZ?: number;\n scaleX?: number;\n scaleY?: number;\n scaleZ?: number;\n}\n\nexport default class Model3D extends Component<Model3DParams> {\n static componentName: string = 'Model3D';\n\n @type('string') resource: string = '';\n @type('boolean') autoPlay: boolean = true;\n @type('number') animationIndex: number = 0;\n @type('number') @step(0.1) speed: number = 1;\n @type('number') @step(0.1) positionX: number = 0;\n @type('number') @step(0.1) positionY: number = 0;\n @type('number') @step(0.1) positionZ: number = 0;\n @type('number') @step(0.01) rotationX: number = 0;\n @type('number') @step(0.01) rotationY: number = 0;\n @type('number') @step(0.01) rotationZ: number = 0;\n @type('number') @step(0.1) scaleX: number = 1;\n @type('number') @step(0.1) scaleY: number = 1;\n @type('number') @step(0.1) scaleZ: number = 1;\n\n init(obj?: Model3DParams) {\n if (obj) Object.assign(this, obj);\n }\n}\n","import { decorators, ComponentChanged, OBSERVER_TYPE, GameObject } from '@combos-fun/engine';\nimport { Renderer3D, Renderer3DSystem } from '@combos-fun/plugin-renderer-3d';\nimport Model3D from './component';\n\n@decorators.componentObserver({\n Model3D: [\n 'resource',\n 'positionX', 'positionY', 'positionZ',\n 'rotationX', 'rotationY', 'rotationZ',\n 'scaleX', 'scaleY', 'scaleZ',\n 'speed', 'animationIndex',\n ],\n})\nexport default class Model3DSystem extends Renderer3D {\n static systemName = 'Model3DSystem';\n name: string = 'Model3DSystem';\n\n init() {\n const renderer3DSystem = this.game.getSystem(Renderer3DSystem) as Renderer3DSystem;\n renderer3DSystem.rendererManager.register(this);\n }\n\n componentChanged(changed: ComponentChanged) {\n if (changed.componentName !== 'Model3D') return;\n\n const component = changed.component as Model3D;\n\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.handleAdd(changed.gameObject, component);\n } else if (changed.type === OBSERVER_TYPE.CHANGE) {\n this.handleChange(changed);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.increaseAsyncId(changed.gameObject.id);\n this.threeContext.removeModel(changed.gameObject.id);\n }\n }\n\n rendererUpdate(gameObject: GameObject) {\n const component = gameObject.getComponent(Model3D) as Model3D;\n if (!component) return;\n\n const model = this.threeContext.models.get(gameObject.id);\n if (!model) return;\n\n model.position.set(component.positionX, component.positionY, component.positionZ);\n model.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n model.scale.set(component.scaleX, component.scaleY, component.scaleZ);\n }\n\n private async handleAdd(gameObject: GameObject, component: Model3D) {\n if (!component.resource) return;\n\n const asyncId = this.increaseAsyncId(gameObject.id);\n await this.threeContext.loadGLB(gameObject.id, component.resource);\n if (!this.validateAsyncId(gameObject.id, asyncId)) return;\n\n if (component.autoPlay) {\n this.threeContext.playAnimation(\n gameObject.id,\n component.animationIndex,\n component.speed,\n );\n }\n }\n\n private async handleChange(changed: ComponentChanged) {\n const component = changed.component as Model3D;\n const changedProp = changed.prop?.prop?.[0];\n\n if (changedProp === 'resource') {\n this.threeContext.removeModel(changed.gameObject.id);\n if (!component.resource) return;\n\n const asyncId = this.increaseAsyncId(changed.gameObject.id);\n await this.threeContext.loadGLB(changed.gameObject.id, component.resource);\n if (!this.validateAsyncId(changed.gameObject.id, asyncId)) return;\n\n if (component.autoPlay) {\n this.threeContext.playAnimation(\n changed.gameObject.id,\n component.animationIndex,\n component.speed,\n );\n }\n }\n\n if (changedProp === 'speed' || changedProp === 'animationIndex') {\n this.threeContext.playAnimation(\n changed.gameObject.id,\n component.animationIndex,\n component.speed,\n );\n }\n }\n}\n"],"names":["Component","__decorate","type","step","Renderer3D","Renderer3DSystem","OBSERVER_TYPE","decorators"],"mappings":";;;;;;;AAmBc,MAAO,OAAQ,SAAQA,gBAAwB,CAAA;AAA7D,IAAA,WAAA,GAAA;;QAGkB,IAAA,CAAA,QAAQ,GAAW,EAAE;QACpB,IAAA,CAAA,QAAQ,GAAY,IAAI;QACzB,IAAA,CAAA,cAAc,GAAW,CAAC;QACf,IAAA,CAAA,KAAK,GAAW,CAAC;QACjB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACpB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACtB,IAAA,CAAA,MAAM,GAAW,CAAC;QAClB,IAAA,CAAA,MAAM,GAAW,CAAC;QAClB,IAAA,CAAA,MAAM,GAAW,CAAC;IAK/C;aAnBS,IAAA,CAAA,aAAa,GAAW,SAAX,CAAqB;AAgBzC,IAAA,IAAI,CAAC,GAAmB,EAAA;AACtB,QAAA,IAAI,GAAG;AAAE,YAAA,MAAM,CAA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/D,YAAA,IAAI,CAAC,YAAY,CAAC,aAAa,CAC7B,OAAO,CAAC,UAAU,CAAC,EAAE,EACrB,SAAS,CAAC,cAAc,EACxB,SAAS,CAAC,KAAK,CAChB;QACH;IACF;;AAhFmB,aAAa,GAAAL,gBAAA,CAAA;IATjCM,iBAAU,CAAC,iBAAiB,CAAC;AAC5B,QAAA,OAAO,EAAE;YACP,UAAU;YACV,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,QAAQ,EAAE,QAAQ,EAAE,QAAQ;AAC5B,YAAA,OAAO,EAAE,gBAAgB;AAC1B,SAAA;KACF;AACoB,CAAA,EAAA,aAAa,CAiFjC;4BAjFoB,aAAa;;;;;"}
@@ -1 +1 @@
1
- "use strict";var e=require("tslib"),t=require("@combos-fun/engine"),o=require("@combos-fun/inspector-decorator"),i=require("@combos-fun/plugin-renderer-3d");class n extends t.Component{constructor(){super(...arguments),this.resource="",this.autoPlay=!0,this.animationIndex=0,this.speed=1,this.positionX=0,this.positionY=0,this.positionZ=0,this.rotationX=0,this.rotationY=0,this.rotationZ=0,this.scaleX=1,this.scaleY=1,this.scaleZ=1}static{this.componentName="Model3D"}init(e){e&&Object.assign(this,e)}}e.__decorate([o.type("string")],n.prototype,"resource",void 0),e.__decorate([o.type("boolean")],n.prototype,"autoPlay",void 0),e.__decorate([o.type("number")],n.prototype,"animationIndex",void 0),e.__decorate([o.type("number"),o.step(.1)],n.prototype,"speed",void 0),e.__decorate([o.type("number"),o.step(.1)],n.prototype,"positionX",void 0),e.__decorate([o.type("number"),o.step(.1)],n.prototype,"positionY",void 0),e.__decorate([o.type("number"),o.step(.1)],n.prototype,"positionZ",void 0),e.__decorate([o.type("number"),o.step(.01)],n.prototype,"rotationX",void 0),e.__decorate([o.type("number"),o.step(.01)],n.prototype,"rotationY",void 0),e.__decorate([o.type("number"),o.step(.01)],n.prototype,"rotationZ",void 0),e.__decorate([o.type("number"),o.step(.1)],n.prototype,"scaleX",void 0),e.__decorate([o.type("number"),o.step(.1)],n.prototype,"scaleY",void 0),e.__decorate([o.type("number"),o.step(.1)],n.prototype,"scaleZ",void 0);let s=class extends i.Renderer3D{constructor(){super(...arguments),this.name="GLBSystem"}static{this.systemName="GLBSystem"}init(){this.game.getSystem(i.Renderer3DSystem).rendererManager.register(this)}componentChanged(e){if("Model3D"!==e.componentName)return;const o=e.component;e.type===t.OBSERVER_TYPE.ADD?this.handleAdd(e.gameObject,o):e.type===t.OBSERVER_TYPE.CHANGE?this.handleChange(e):e.type===t.OBSERVER_TYPE.REMOVE&&(this.increaseAsyncId(e.gameObject.id),this.threeContext.removeModel(e.gameObject.id))}rendererUpdate(e){const t=e.getComponent(n);if(!t)return;const o=this.threeContext.models.get(e.id);o&&(o.position.set(t.positionX,t.positionY,t.positionZ),o.rotation.set(t.rotationX,t.rotationY,t.rotationZ),o.scale.set(t.scaleX,t.scaleY,t.scaleZ))}async handleAdd(e,t){if(!t.resource)return;const o=this.increaseAsyncId(e.id);await this.threeContext.loadGLB(e.id,t.resource),this.validateAsyncId(e.id,o)&&t.autoPlay&&this.threeContext.playAnimation(e.id,t.animationIndex,t.speed)}async handleChange(e){const t=e.component,o=e.prop?.prop?.[0];if("resource"===o){if(this.threeContext.removeModel(e.gameObject.id),!t.resource)return;const o=this.increaseAsyncId(e.gameObject.id);if(await this.threeContext.loadGLB(e.gameObject.id,t.resource),!this.validateAsyncId(e.gameObject.id,o))return;t.autoPlay&&this.threeContext.playAnimation(e.gameObject.id,t.animationIndex,t.speed)}"speed"!==o&&"animationIndex"!==o||this.threeContext.playAnimation(e.gameObject.id,t.animationIndex,t.speed)}};s=e.__decorate([t.decorators.componentObserver({Model3D:["resource","positionX","positionY","positionZ","rotationX","rotationY","rotationZ","scaleX","scaleY","scaleZ","speed","animationIndex"]})],s);var r=s;exports.GLBSystem=r,exports.Model3D=n;
1
+ "use strict";var e=require("tslib"),t=require("@combos-fun/engine"),o=require("@combos-fun/inspector-decorator"),i=require("@combos-fun/plugin-renderer-3d");class n extends t.Component{constructor(){super(...arguments),this.resource="",this.autoPlay=!0,this.animationIndex=0,this.speed=1,this.positionX=0,this.positionY=0,this.positionZ=0,this.rotationX=0,this.rotationY=0,this.rotationZ=0,this.scaleX=1,this.scaleY=1,this.scaleZ=1}static{this.componentName="Model3D"}init(e){e&&Object.assign(this,e)}}e.__decorate([o.type("string")],n.prototype,"resource",void 0),e.__decorate([o.type("boolean")],n.prototype,"autoPlay",void 0),e.__decorate([o.type("number")],n.prototype,"animationIndex",void 0),e.__decorate([o.type("number"),o.step(.1)],n.prototype,"speed",void 0),e.__decorate([o.type("number"),o.step(.1)],n.prototype,"positionX",void 0),e.__decorate([o.type("number"),o.step(.1)],n.prototype,"positionY",void 0),e.__decorate([o.type("number"),o.step(.1)],n.prototype,"positionZ",void 0),e.__decorate([o.type("number"),o.step(.01)],n.prototype,"rotationX",void 0),e.__decorate([o.type("number"),o.step(.01)],n.prototype,"rotationY",void 0),e.__decorate([o.type("number"),o.step(.01)],n.prototype,"rotationZ",void 0),e.__decorate([o.type("number"),o.step(.1)],n.prototype,"scaleX",void 0),e.__decorate([o.type("number"),o.step(.1)],n.prototype,"scaleY",void 0),e.__decorate([o.type("number"),o.step(.1)],n.prototype,"scaleZ",void 0);let s=class extends i.Renderer3D{constructor(){super(...arguments),this.name="Model3DSystem"}static{this.systemName="Model3DSystem"}init(){this.game.getSystem(i.Renderer3DSystem).rendererManager.register(this)}componentChanged(e){if("Model3D"!==e.componentName)return;const o=e.component;e.type===t.OBSERVER_TYPE.ADD?this.handleAdd(e.gameObject,o):e.type===t.OBSERVER_TYPE.CHANGE?this.handleChange(e):e.type===t.OBSERVER_TYPE.REMOVE&&(this.increaseAsyncId(e.gameObject.id),this.threeContext.removeModel(e.gameObject.id))}rendererUpdate(e){const t=e.getComponent(n);if(!t)return;const o=this.threeContext.models.get(e.id);o&&(o.position.set(t.positionX,t.positionY,t.positionZ),o.rotation.set(t.rotationX,t.rotationY,t.rotationZ),o.scale.set(t.scaleX,t.scaleY,t.scaleZ))}async handleAdd(e,t){if(!t.resource)return;const o=this.increaseAsyncId(e.id);await this.threeContext.loadGLB(e.id,t.resource),this.validateAsyncId(e.id,o)&&t.autoPlay&&this.threeContext.playAnimation(e.id,t.animationIndex,t.speed)}async handleChange(e){const t=e.component,o=e.prop?.prop?.[0];if("resource"===o){if(this.threeContext.removeModel(e.gameObject.id),!t.resource)return;const o=this.increaseAsyncId(e.gameObject.id);if(await this.threeContext.loadGLB(e.gameObject.id,t.resource),!this.validateAsyncId(e.gameObject.id,o))return;t.autoPlay&&this.threeContext.playAnimation(e.gameObject.id,t.animationIndex,t.speed)}"speed"!==o&&"animationIndex"!==o||this.threeContext.playAnimation(e.gameObject.id,t.animationIndex,t.speed)}};s=e.__decorate([t.decorators.componentObserver({Model3D:["resource","positionX","positionY","positionZ","rotationX","rotationY","rotationZ","scaleX","scaleY","scaleZ","speed","animationIndex"]})],s);var r=s;exports.Model3D=n,exports.Model3DSystem=r;
@@ -34,7 +34,7 @@ declare class Model3D extends Component<Model3DParams> {
34
34
  init(obj?: Model3DParams): void;
35
35
  }
36
36
 
37
- declare class GLBSystem extends Renderer3D {
37
+ declare class Model3DSystem extends Renderer3D {
38
38
  static systemName: string;
39
39
  name: string;
40
40
  init(): void;
@@ -44,5 +44,5 @@ declare class GLBSystem extends Renderer3D {
44
44
  private handleChange;
45
45
  }
46
46
 
47
- export { GLBSystem, Model3D };
47
+ export { Model3D, Model3DSystem };
48
48
  export type { Model3DParams };
@@ -76,12 +76,12 @@ __decorate([
76
76
  step(0.1)
77
77
  ], Model3D.prototype, "scaleZ", void 0);
78
78
 
79
- let GLBSystem = class GLBSystem extends Renderer3D {
79
+ let Model3DSystem = class Model3DSystem extends Renderer3D {
80
80
  constructor() {
81
81
  super(...arguments);
82
- this.name = 'GLBSystem';
82
+ this.name = 'Model3DSystem';
83
83
  }
84
- static { this.systemName = 'GLBSystem'; }
84
+ static { this.systemName = 'Model3DSystem'; }
85
85
  init() {
86
86
  const renderer3DSystem = this.game.getSystem(Renderer3DSystem);
87
87
  renderer3DSystem.rendererManager.register(this);
@@ -143,7 +143,7 @@ let GLBSystem = class GLBSystem extends Renderer3D {
143
143
  }
144
144
  }
145
145
  };
146
- GLBSystem = __decorate([
146
+ Model3DSystem = __decorate([
147
147
  decorators.componentObserver({
148
148
  Model3D: [
149
149
  'resource',
@@ -153,8 +153,8 @@ GLBSystem = __decorate([
153
153
  'speed', 'animationIndex',
154
154
  ],
155
155
  })
156
- ], GLBSystem);
157
- var GLBSystem_default = GLBSystem;
156
+ ], Model3DSystem);
157
+ var Model3DSystem_default = Model3DSystem;
158
158
 
159
- export { GLBSystem_default as GLBSystem, Model3D };
159
+ export { Model3D, Model3DSystem_default as Model3DSystem };
160
160
  //# sourceMappingURL=plugin-renderer-3d-model.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-renderer-3d-model.esm.js","sources":["../lib/component.ts","../lib/system.ts"],"sourcesContent":["import { Component } from '@combos-fun/engine';\nimport { type, step } from '@combos-fun/inspector-decorator';\n\nexport interface Model3DParams {\n resource?: string;\n autoPlay?: boolean;\n animationIndex?: number;\n speed?: number;\n positionX?: number;\n positionY?: number;\n positionZ?: number;\n rotationX?: number;\n rotationY?: number;\n rotationZ?: number;\n scaleX?: number;\n scaleY?: number;\n scaleZ?: number;\n}\n\nexport default class Model3D extends Component<Model3DParams> {\n static componentName: string = 'Model3D';\n\n @type('string') resource: string = '';\n @type('boolean') autoPlay: boolean = true;\n @type('number') animationIndex: number = 0;\n @type('number') @step(0.1) speed: number = 1;\n @type('number') @step(0.1) positionX: number = 0;\n @type('number') @step(0.1) positionY: number = 0;\n @type('number') @step(0.1) positionZ: number = 0;\n @type('number') @step(0.01) rotationX: number = 0;\n @type('number') @step(0.01) rotationY: number = 0;\n @type('number') @step(0.01) rotationZ: number = 0;\n @type('number') @step(0.1) scaleX: number = 1;\n @type('number') @step(0.1) scaleY: number = 1;\n @type('number') @step(0.1) scaleZ: number = 1;\n\n init(obj?: Model3DParams) {\n if (obj) Object.assign(this, obj);\n }\n}\n","import { decorators, ComponentChanged, OBSERVER_TYPE, GameObject } from '@combos-fun/engine';\nimport { Renderer3D, Renderer3DSystem } from '@combos-fun/plugin-renderer-3d';\nimport Model3D from './component';\n\n@decorators.componentObserver({\n Model3D: [\n 'resource',\n 'positionX', 'positionY', 'positionZ',\n 'rotationX', 'rotationY', 'rotationZ',\n 'scaleX', 'scaleY', 'scaleZ',\n 'speed', 'animationIndex',\n ],\n})\nexport default class GLBSystem extends Renderer3D {\n static systemName = 'GLBSystem';\n name: string = 'GLBSystem';\n\n init() {\n const renderer3DSystem = this.game.getSystem(Renderer3DSystem) as Renderer3DSystem;\n renderer3DSystem.rendererManager.register(this);\n }\n\n componentChanged(changed: ComponentChanged) {\n if (changed.componentName !== 'Model3D') return;\n\n const component = changed.component as Model3D;\n\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.handleAdd(changed.gameObject, component);\n } else if (changed.type === OBSERVER_TYPE.CHANGE) {\n this.handleChange(changed);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.increaseAsyncId(changed.gameObject.id);\n this.threeContext.removeModel(changed.gameObject.id);\n }\n }\n\n rendererUpdate(gameObject: GameObject) {\n const component = gameObject.getComponent(Model3D) as Model3D;\n if (!component) return;\n\n const model = this.threeContext.models.get(gameObject.id);\n if (!model) return;\n\n model.position.set(component.positionX, component.positionY, component.positionZ);\n model.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n model.scale.set(component.scaleX, component.scaleY, component.scaleZ);\n }\n\n private async handleAdd(gameObject: GameObject, component: Model3D) {\n if (!component.resource) return;\n\n const asyncId = this.increaseAsyncId(gameObject.id);\n await this.threeContext.loadGLB(gameObject.id, component.resource);\n if (!this.validateAsyncId(gameObject.id, asyncId)) return;\n\n if (component.autoPlay) {\n this.threeContext.playAnimation(\n gameObject.id,\n component.animationIndex,\n component.speed,\n );\n }\n }\n\n private async handleChange(changed: ComponentChanged) {\n const component = changed.component as Model3D;\n const changedProp = changed.prop?.prop?.[0];\n\n if (changedProp === 'resource') {\n this.threeContext.removeModel(changed.gameObject.id);\n if (!component.resource) return;\n\n const asyncId = this.increaseAsyncId(changed.gameObject.id);\n await this.threeContext.loadGLB(changed.gameObject.id, component.resource);\n if (!this.validateAsyncId(changed.gameObject.id, asyncId)) return;\n\n if (component.autoPlay) {\n this.threeContext.playAnimation(\n changed.gameObject.id,\n component.animationIndex,\n component.speed,\n );\n }\n }\n\n if (changedProp === 'speed' || changedProp === 'animationIndex') {\n this.threeContext.playAnimation(\n changed.gameObject.id,\n component.animationIndex,\n component.speed,\n );\n }\n }\n}\n"],"names":[],"mappings":";;;;;AAmBc,MAAO,OAAQ,SAAQ,SAAwB,CAAA;AAA7D,IAAA,WAAA,GAAA;;QAGkB,IAAA,CAAA,QAAQ,GAAW,EAAE;QACpB,IAAA,CAAA,QAAQ,GAAY,IAAI;QACzB,IAAA,CAAA,cAAc,GAAW,CAAC;QACf,IAAA,CAAA,KAAK,GAAW,CAAC;QACjB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACpB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACtB,IAAA,CAAA,MAAM,GAAW,CAAC;QAClB,IAAA,CAAA,MAAM,GAAW,CAAC;QAClB,IAAA,CAAA,MAAM,GAAW,CAAC;IAK/C;aAnBS,IAAA,CAAA,aAAa,GAAW,SAAX,CAAqB;AAgBzC,IAAA,IAAI,CAAC,GAAmB,EAAA;AACtB,QAAA,IAAI,GAAG;AAAE,YAAA,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC;IACnC;;AAhBgB,UAAA,CAAA;IAAf,IAAI,CAAC,QAAQ;AAAwB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BAAiB,CAAC;AAC5B,QAAA,OAAO,EAAE;YACP,UAAU;YACV,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,QAAQ,EAAE,QAAQ,EAAE,QAAQ;AAC5B,YAAA,OAAO,EAAE,gBAAgB;AAC1B,SAAA;KACF;AACoB,CAAA,EAAA,SAAS,CAiF7B;wBAjFoB,SAAS;;;;"}
1
+ {"version":3,"file":"plugin-renderer-3d-model.esm.js","sources":["../lib/component.ts","../lib/system.ts"],"sourcesContent":["import { Component } from '@combos-fun/engine';\nimport { type, step } from '@combos-fun/inspector-decorator';\n\nexport interface Model3DParams {\n resource?: string;\n autoPlay?: boolean;\n animationIndex?: number;\n speed?: number;\n positionX?: number;\n positionY?: number;\n positionZ?: number;\n rotationX?: number;\n rotationY?: number;\n rotationZ?: number;\n scaleX?: number;\n scaleY?: number;\n scaleZ?: number;\n}\n\nexport default class Model3D extends Component<Model3DParams> {\n static componentName: string = 'Model3D';\n\n @type('string') resource: string = '';\n @type('boolean') autoPlay: boolean = true;\n @type('number') animationIndex: number = 0;\n @type('number') @step(0.1) speed: number = 1;\n @type('number') @step(0.1) positionX: number = 0;\n @type('number') @step(0.1) positionY: number = 0;\n @type('number') @step(0.1) positionZ: number = 0;\n @type('number') @step(0.01) rotationX: number = 0;\n @type('number') @step(0.01) rotationY: number = 0;\n @type('number') @step(0.01) rotationZ: number = 0;\n @type('number') @step(0.1) scaleX: number = 1;\n @type('number') @step(0.1) scaleY: number = 1;\n @type('number') @step(0.1) scaleZ: number = 1;\n\n init(obj?: Model3DParams) {\n if (obj) Object.assign(this, obj);\n }\n}\n","import { decorators, ComponentChanged, OBSERVER_TYPE, GameObject } from '@combos-fun/engine';\nimport { Renderer3D, Renderer3DSystem } from '@combos-fun/plugin-renderer-3d';\nimport Model3D from './component';\n\n@decorators.componentObserver({\n Model3D: [\n 'resource',\n 'positionX', 'positionY', 'positionZ',\n 'rotationX', 'rotationY', 'rotationZ',\n 'scaleX', 'scaleY', 'scaleZ',\n 'speed', 'animationIndex',\n ],\n})\nexport default class Model3DSystem extends Renderer3D {\n static systemName = 'Model3DSystem';\n name: string = 'Model3DSystem';\n\n init() {\n const renderer3DSystem = this.game.getSystem(Renderer3DSystem) as Renderer3DSystem;\n renderer3DSystem.rendererManager.register(this);\n }\n\n componentChanged(changed: ComponentChanged) {\n if (changed.componentName !== 'Model3D') return;\n\n const component = changed.component as Model3D;\n\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.handleAdd(changed.gameObject, component);\n } else if (changed.type === OBSERVER_TYPE.CHANGE) {\n this.handleChange(changed);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.increaseAsyncId(changed.gameObject.id);\n this.threeContext.removeModel(changed.gameObject.id);\n }\n }\n\n rendererUpdate(gameObject: GameObject) {\n const component = gameObject.getComponent(Model3D) as Model3D;\n if (!component) return;\n\n const model = this.threeContext.models.get(gameObject.id);\n if (!model) return;\n\n model.position.set(component.positionX, component.positionY, component.positionZ);\n model.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n model.scale.set(component.scaleX, component.scaleY, component.scaleZ);\n }\n\n private async handleAdd(gameObject: GameObject, component: Model3D) {\n if (!component.resource) return;\n\n const asyncId = this.increaseAsyncId(gameObject.id);\n await this.threeContext.loadGLB(gameObject.id, component.resource);\n if (!this.validateAsyncId(gameObject.id, asyncId)) return;\n\n if (component.autoPlay) {\n this.threeContext.playAnimation(\n gameObject.id,\n component.animationIndex,\n component.speed,\n );\n }\n }\n\n private async handleChange(changed: ComponentChanged) {\n const component = changed.component as Model3D;\n const changedProp = changed.prop?.prop?.[0];\n\n if (changedProp === 'resource') {\n this.threeContext.removeModel(changed.gameObject.id);\n if (!component.resource) return;\n\n const asyncId = this.increaseAsyncId(changed.gameObject.id);\n await this.threeContext.loadGLB(changed.gameObject.id, component.resource);\n if (!this.validateAsyncId(changed.gameObject.id, asyncId)) return;\n\n if (component.autoPlay) {\n this.threeContext.playAnimation(\n changed.gameObject.id,\n component.animationIndex,\n component.speed,\n );\n }\n }\n\n if (changedProp === 'speed' || changedProp === 'animationIndex') {\n this.threeContext.playAnimation(\n changed.gameObject.id,\n component.animationIndex,\n component.speed,\n );\n }\n }\n}\n"],"names":[],"mappings":";;;;;AAmBc,MAAO,OAAQ,SAAQ,SAAwB,CAAA;AAA7D,IAAA,WAAA,GAAA;;QAGkB,IAAA,CAAA,QAAQ,GAAW,EAAE;QACpB,IAAA,CAAA,QAAQ,GAAY,IAAI;QACzB,IAAA,CAAA,cAAc,GAAW,CAAC;QACf,IAAA,CAAA,KAAK,GAAW,CAAC;QACjB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACpB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACtB,IAAA,CAAA,MAAM,GAAW,CAAC;QAClB,IAAA,CAAA,MAAM,GAAW,CAAC;QAClB,IAAA,CAAA,MAAM,GAAW,CAAC;IAK/C;aAnBS,IAAA,CAAA,aAAa,GAAW,SAAX,CAAqB;AAgBzC,IAAA,IAAI,CAAC,GAAmB,EAAA;AACtB,QAAA,IAAI,GAAG;AAAE,YAAA,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC;IACnC;;AAhBgB,UAAA,CAAA;IAAf,IAAI,CAAC,QAAQ;AAAwB,CAAA,EAAA,OAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AACrB,UAAA,CAAA;IAAhB,IAAI,CAAC,SAAS;AAA2B,CAAA,EAAA,OAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAC1B,UAAA,CAAA;IAAf,IAAI,CAAC,QAAQ;AAA6B,CAAA,EAAA,OAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,MAAA,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ED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@combos-fun/plugin-renderer-3d-model",
3
- "version": "0.0.8",
4
- "description": "@combos-fun/plugin-renderer-3d-model",
3
+ "version": "0.0.10",
4
+ "description": "GLB / GLTF 3D model loader and animator",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-renderer-3d-model.esm.js",
7
7
  "bundle": "CombosFun.plugin.renderer.3d.model",
@@ -27,10 +27,19 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "three": "^0.172.0",
30
- "@combos-fun/engine": "0.0.8",
31
- "@combos-fun/inspector-decorator": "0.0.8",
32
- "@combos-fun/plugin-renderer-3d": "0.0.8"
30
+ "@combos-fun/engine": "0.0.10",
31
+ "@combos-fun/inspector-decorator": "0.0.10",
32
+ "@combos-fun/plugin-renderer-3d": "0.0.10"
33
33
  },
34
+ "keywords": [
35
+ "combos-fun",
36
+ "3d",
37
+ "model",
38
+ "glb",
39
+ "gltf",
40
+ "animation",
41
+ "mesh"
42
+ ],
34
43
  "scripts": {
35
44
  "build": "node ../../scripts/build-package.mjs"
36
45
  }