@combos-fun/plugin-renderer-3d-graphics 0.0.39 → 0.0.41

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.
@@ -260,6 +260,7 @@ let Graphics3DSystem = class Graphics3DSystem extends pluginRenderer3d.Renderer3
260
260
  opacity: component.opacity,
261
261
  });
262
262
  const mesh = new three.Mesh(geometry, material);
263
+ pluginRenderer3d.tagObject3D(mesh, gameObject.id);
263
264
  mesh.position.set(component.positionX, component.positionY, component.positionZ);
264
265
  mesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);
265
266
  mesh.scale.set(component.scaleX, component.scaleY, component.scaleZ);
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-renderer-3d-graphics.cjs.js","sources":["../lib/component.ts","../lib/system.ts"],"sourcesContent":["import { Component } from '@combos-fun/engine';\nimport { Field } from '@combos-fun/inspector-decorator';\n\nexport interface Graphics3DParams {\n shape?: string;\n color?: number;\n wireframe?: boolean;\n width?: number;\n height?: number;\n depth?: number;\n radius?: number;\n segments?: 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 opacity?: number;\n}\n\nexport default class Graphics3D extends Component<Graphics3DParams> {\n static componentName: string = 'Graphics3D';\n\n @Field({\n\n type: 'string',\n\n group: 'Graphics3D',\n\n label: 'shape',\n\n description: 'Primitive shape kind.',\n\n editor: 'text',\n\n })\n\n shape: string = 'box';\n @Field({\n type: 'number',\n group: 'Graphics3D',\n label: 'color',\n description: 'Color value.',\n editor: 'number-stepper',\n })\n color: number = 0x00ff00;\n @Field({\n type: 'boolean',\n group: 'Graphics3D',\n label: 'wireframe',\n description: 'Draw as wireframe.',\n editor: 'toggle',\n })\n wireframe: boolean = false;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'width',\n description: 'Width.',\n editor: 'number-stepper',\n })\n width: number = 1;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'height',\n description: 'Height.',\n editor: 'number-stepper',\n })\n height: number = 1;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'depth',\n description: 'Depth.',\n editor: 'number-stepper',\n })\n depth: number = 1;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'radius',\n description: 'Radius.',\n editor: 'number-stepper',\n })\n radius: number = 0.5;\n @Field({\n type: 'number',\n step: 1,\n group: 'Graphics3D',\n label: 'segments',\n description: 'Mesh segment count.',\n editor: 'number-stepper',\n })\n segments: number = 32;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'positionX',\n description: 'Local X position.',\n editor: 'number-stepper',\n })\n positionX: number = 0;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'positionY',\n description: 'Local Y position.',\n editor: 'number-stepper',\n })\n positionY: number = 0;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'positionZ',\n description: 'Local Z position.',\n editor: 'number-stepper',\n })\n positionZ: number = 0;\n @Field({\n type: 'number',\n step: 0.01,\n group: 'Graphics3D',\n label: 'rotationX',\n description: 'Rotation around X in radians.',\n editor: 'number-stepper',\n })\n rotationX: number = 0;\n @Field({\n type: 'number',\n step: 0.01,\n group: 'Graphics3D',\n label: 'rotationY',\n description: 'Rotation around Y in radians.',\n editor: 'number-stepper',\n })\n rotationY: number = 0;\n @Field({\n type: 'number',\n step: 0.01,\n group: 'Graphics3D',\n label: 'rotationZ',\n description: 'Rotation around Z in radians.',\n editor: 'number-stepper',\n })\n rotationZ: number = 0;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'scaleX',\n description: 'Scale on X.',\n editor: 'number-stepper',\n })\n scaleX: number = 1;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'scaleY',\n description: 'Scale on Y.',\n editor: 'number-stepper',\n })\n scaleY: number = 1;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'scaleZ',\n description: 'Scale on Z.',\n editor: 'number-stepper',\n })\n scaleZ: number = 1;\n @Field({\n type: 'number',\n step: 0.01,\n min: 0,\n max: 1,\n group: 'Graphics3D',\n label: 'opacity',\n description: 'Opacity from 0 to 1.',\n editor: 'number-slider',\n })\n opacity: number = 1;\n\n init(obj?: Graphics3DParams) {\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 {\n BoxGeometry,\n SphereGeometry,\n CylinderGeometry,\n PlaneGeometry,\n ConeGeometry,\n TorusGeometry,\n MeshStandardMaterial,\n Mesh,\n} from 'three';\nimport type { BufferGeometry } from 'three';\nimport Graphics3D from './component';\n\ninterface Graphics3DEntry {\n mesh: Mesh;\n}\n\nconst GEOMETRY_PROPS = ['shape', 'width', 'height', 'depth', 'radius', 'segments'];\nconst MATERIAL_PROPS = ['color', 'wireframe', 'opacity'];\n\n@decorators.componentObserver({\n Graphics3D: [\n 'shape', 'color', 'wireframe',\n 'width', 'height', 'depth', 'radius', 'segments',\n 'positionX', 'positionY', 'positionZ',\n 'rotationX', 'rotationY', 'rotationZ',\n 'scaleX', 'scaleY', 'scaleZ',\n 'opacity',\n ],\n})\nexport default class Graphics3DSystem extends Renderer3D {\n static systemName = 'Graphics3DSystem';\n name: string = 'Graphics3DSystem';\n\n private entries: Map<number, Graphics3DEntry> = new Map();\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 !== 'Graphics3D') return;\n\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.handleAdd(changed.gameObject, changed.component as Graphics3D);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.handleRemove(changed.gameObject.id);\n } else {\n this.handleChange(changed);\n }\n }\n\n rendererUpdate(gameObject: GameObject) {\n const component = gameObject.getComponent(Graphics3D) as Graphics3D;\n if (!component) return;\n\n const entry = this.entries.get(gameObject.id);\n if (!entry) return;\n\n entry.mesh.position.set(component.positionX, component.positionY, component.positionZ);\n entry.mesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n entry.mesh.scale.set(component.scaleX, component.scaleY, component.scaleZ);\n }\n\n private handleAdd(gameObject: GameObject, component: Graphics3D) {\n const geometry = this.createGeometry(component);\n const material = new MeshStandardMaterial({\n color: component.color,\n wireframe: component.wireframe,\n transparent: component.opacity < 1,\n opacity: component.opacity,\n });\n const mesh = new Mesh(geometry, material);\n mesh.position.set(component.positionX, component.positionY, component.positionZ);\n mesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n mesh.scale.set(component.scaleX, component.scaleY, component.scaleZ);\n\n this.threeContext.scene.add(mesh);\n this.entries.set(gameObject.id, { mesh });\n }\n\n private handleChange(changed: ComponentChanged) {\n const component = changed.component as Graphics3D;\n const changedProp = changed.prop?.prop?.[0];\n const entry = this.entries.get(changed.gameObject.id);\n if (!entry) return;\n\n if (GEOMETRY_PROPS.includes(changedProp)) {\n entry.mesh.geometry.dispose();\n entry.mesh.geometry = this.createGeometry(component);\n }\n\n if (MATERIAL_PROPS.includes(changedProp)) {\n const material = entry.mesh.material as MeshStandardMaterial;\n material.color.setHex(component.color);\n material.wireframe = component.wireframe;\n material.opacity = component.opacity;\n material.transparent = component.opacity < 1;\n }\n }\n\n private handleRemove(id: number) {\n const entry = this.entries.get(id);\n if (!entry) return;\n\n this.threeContext.scene.remove(entry.mesh);\n entry.mesh.geometry.dispose();\n (entry.mesh.material as MeshStandardMaterial).dispose();\n this.entries.delete(id);\n }\n\n private createGeometry(component: Graphics3D): BufferGeometry {\n switch (component.shape) {\n case 'sphere':\n return new SphereGeometry(component.radius, component.segments, component.segments);\n case 'cylinder':\n return new CylinderGeometry(\n component.radius, component.radius, component.height, component.segments,\n );\n case 'plane':\n return new PlaneGeometry(component.width, component.height);\n case 'cone':\n return new ConeGeometry(component.radius, component.height, component.segments);\n case 'torus':\n return new TorusGeometry(\n component.radius, component.radius * 0.4, 16, component.segments,\n );\n case 'box':\n default:\n return new BoxGeometry(component.width, component.height, component.depth);\n }\n }\n\n onDestroy() {\n for (const [id] of this.entries) {\n this.handleRemove(id);\n }\n this.entries.clear();\n }\n}\n"],"names":["Component","__decorate","Field","Renderer3D","Renderer3DSystem","OBSERVER_TYPE","MeshStandardMaterial","Mesh","SphereGeometry","CylinderGeometry","PlaneGeometry","ConeGeometry","TorusGeometry","BoxGeometry","decorators"],"mappings":";;;;;;;;AAwBc,MAAO,UAAW,SAAQA,gBAA2B,CAAA;AAAnE,IAAA,WAAA,GAAA;;QAiBE,IAAA,CAAA,KAAK,GAAW,KAAK;QAQrB,IAAA,CAAA,KAAK,GAAW,QAAQ;QAQxB,IAAA,CAAA,SAAS,GAAY,KAAK;QAS1B,IAAA,CAAA,KAAK,GAAW,CAAC;QASjB,IAAA,CAAA,MAAM,GAAW,CAAC;QASlB,IAAA,CAAA,KAAK,GAAW,CAAC;QASjB,IAAA,CAAA,MAAM,GAAW,GAAG;QASpB,IAAA,CAAA,QAAQ,GAAW,EAAE;QASrB,IAAA,CAAA,SAAS,GAAW,CAAC;QASrB,IAAA,CAAA,SAAS,GAAW,CAAC;QASrB,IAAA,CAAA,SAAS,GAAW,CAAC;QASrB,IAAA,CAAA,SAAS,GAAW,CAAC;QASrB,IAAA,CAAA,SAAS,GAAW,CAAC;QASrB,IAAA,CAAA,SAAS,GAAW,CAAC;QASrB,IAAA,CAAA,MAAM,GAAW,CAAC;QASlB,IAAA,CAAA,MAAM,GAAW,CAAC;QASlB,IAAA,CAAA,MAAM,GAAW,CAAC;QAWlB,IAAA,CAAA,OAAO,GAAW,CAAC;IAKrB;aA9KS,IAAA,CAAA,aAAa,GAA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import { Component } from '@combos-fun/engine';\nimport { Field } from '@combos-fun/inspector-decorator';\n\nexport interface Graphics3DParams {\n shape?: string;\n color?: number;\n wireframe?: boolean;\n width?: number;\n height?: number;\n depth?: number;\n radius?: number;\n segments?: 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 opacity?: number;\n}\n\nexport default class Graphics3D extends Component<Graphics3DParams> {\n static componentName: string = 'Graphics3D';\n\n @Field({\n\n type: 'string',\n\n group: 'Graphics3D',\n\n label: 'shape',\n\n description: 'Primitive shape kind.',\n\n editor: 'text',\n\n })\n\n shape: string = 'box';\n @Field({\n type: 'number',\n group: 'Graphics3D',\n label: 'color',\n description: 'Color value.',\n editor: 'number-stepper',\n })\n color: number = 0x00ff00;\n @Field({\n type: 'boolean',\n group: 'Graphics3D',\n label: 'wireframe',\n description: 'Draw as wireframe.',\n editor: 'toggle',\n })\n wireframe: boolean = false;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'width',\n description: 'Width.',\n editor: 'number-stepper',\n })\n width: number = 1;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'height',\n description: 'Height.',\n editor: 'number-stepper',\n })\n height: number = 1;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'depth',\n description: 'Depth.',\n editor: 'number-stepper',\n })\n depth: number = 1;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'radius',\n description: 'Radius.',\n editor: 'number-stepper',\n })\n radius: number = 0.5;\n @Field({\n type: 'number',\n step: 1,\n group: 'Graphics3D',\n label: 'segments',\n description: 'Mesh segment count.',\n editor: 'number-stepper',\n })\n segments: number = 32;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'positionX',\n description: 'Local X position.',\n editor: 'number-stepper',\n })\n positionX: number = 0;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'positionY',\n description: 'Local Y position.',\n editor: 'number-stepper',\n })\n positionY: number = 0;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'positionZ',\n description: 'Local Z position.',\n editor: 'number-stepper',\n })\n positionZ: number = 0;\n @Field({\n type: 'number',\n step: 0.01,\n group: 'Graphics3D',\n label: 'rotationX',\n description: 'Rotation around X in radians.',\n editor: 'number-stepper',\n })\n rotationX: number = 0;\n @Field({\n type: 'number',\n step: 0.01,\n group: 'Graphics3D',\n label: 'rotationY',\n description: 'Rotation around Y in radians.',\n editor: 'number-stepper',\n })\n rotationY: number = 0;\n @Field({\n type: 'number',\n step: 0.01,\n group: 'Graphics3D',\n label: 'rotationZ',\n description: 'Rotation around Z in radians.',\n editor: 'number-stepper',\n })\n rotationZ: number = 0;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'scaleX',\n description: 'Scale on X.',\n editor: 'number-stepper',\n })\n scaleX: number = 1;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'scaleY',\n description: 'Scale on Y.',\n editor: 'number-stepper',\n })\n scaleY: number = 1;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'scaleZ',\n description: 'Scale on Z.',\n editor: 'number-stepper',\n })\n scaleZ: number = 1;\n @Field({\n type: 'number',\n step: 0.01,\n min: 0,\n max: 1,\n group: 'Graphics3D',\n label: 'opacity',\n description: 'Opacity from 0 to 1.',\n editor: 'number-slider',\n })\n opacity: number = 1;\n\n init(obj?: Graphics3DParams) {\n if (obj) Object.assign(this, obj);\n }\n}\n","import { decorators, ComponentChanged, OBSERVER_TYPE, GameObject } from '@combos-fun/engine';\nimport { Renderer3D, Renderer3DSystem, tagObject3D } from '@combos-fun/plugin-renderer-3d';\nimport {\n BoxGeometry,\n SphereGeometry,\n CylinderGeometry,\n PlaneGeometry,\n ConeGeometry,\n TorusGeometry,\n MeshStandardMaterial,\n Mesh,\n} from 'three';\nimport type { BufferGeometry } from 'three';\nimport Graphics3D from './component';\n\ninterface Graphics3DEntry {\n mesh: Mesh;\n}\n\nconst GEOMETRY_PROPS = ['shape', 'width', 'height', 'depth', 'radius', 'segments'];\nconst MATERIAL_PROPS = ['color', 'wireframe', 'opacity'];\n\n@decorators.componentObserver({\n Graphics3D: [\n 'shape', 'color', 'wireframe',\n 'width', 'height', 'depth', 'radius', 'segments',\n 'positionX', 'positionY', 'positionZ',\n 'rotationX', 'rotationY', 'rotationZ',\n 'scaleX', 'scaleY', 'scaleZ',\n 'opacity',\n ],\n})\nexport default class Graphics3DSystem extends Renderer3D {\n static systemName = 'Graphics3DSystem';\n name: string = 'Graphics3DSystem';\n\n private entries: Map<number, Graphics3DEntry> = new Map();\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 !== 'Graphics3D') return;\n\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.handleAdd(changed.gameObject, changed.component as Graphics3D);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.handleRemove(changed.gameObject.id);\n } else {\n this.handleChange(changed);\n }\n }\n\n rendererUpdate(gameObject: GameObject) {\n const component = gameObject.getComponent(Graphics3D) as Graphics3D;\n if (!component) return;\n\n const entry = this.entries.get(gameObject.id);\n if (!entry) return;\n\n entry.mesh.position.set(component.positionX, component.positionY, component.positionZ);\n entry.mesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n entry.mesh.scale.set(component.scaleX, component.scaleY, component.scaleZ);\n }\n\n private handleAdd(gameObject: GameObject, component: Graphics3D) {\n const geometry = this.createGeometry(component);\n const material = new MeshStandardMaterial({\n color: component.color,\n wireframe: component.wireframe,\n transparent: component.opacity < 1,\n opacity: component.opacity,\n });\n const mesh = new Mesh(geometry, material);\n tagObject3D(mesh, gameObject.id);\n mesh.position.set(component.positionX, component.positionY, component.positionZ);\n mesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n mesh.scale.set(component.scaleX, component.scaleY, component.scaleZ);\n\n this.threeContext.scene.add(mesh);\n this.entries.set(gameObject.id, { mesh });\n }\n\n private handleChange(changed: ComponentChanged) {\n const component = changed.component as Graphics3D;\n const changedProp = changed.prop?.prop?.[0];\n const entry = this.entries.get(changed.gameObject.id);\n if (!entry) return;\n\n if (GEOMETRY_PROPS.includes(changedProp)) {\n entry.mesh.geometry.dispose();\n entry.mesh.geometry = this.createGeometry(component);\n }\n\n if (MATERIAL_PROPS.includes(changedProp)) {\n const material = entry.mesh.material as MeshStandardMaterial;\n material.color.setHex(component.color);\n material.wireframe = component.wireframe;\n material.opacity = component.opacity;\n material.transparent = component.opacity < 1;\n }\n }\n\n private handleRemove(id: number) {\n const entry = this.entries.get(id);\n if (!entry) return;\n\n this.threeContext.scene.remove(entry.mesh);\n entry.mesh.geometry.dispose();\n (entry.mesh.material as MeshStandardMaterial).dispose();\n this.entries.delete(id);\n }\n\n private createGeometry(component: Graphics3D): BufferGeometry {\n switch (component.shape) {\n case 'sphere':\n return new SphereGeometry(component.radius, component.segments, component.segments);\n case 'cylinder':\n return new CylinderGeometry(\n component.radius, component.radius, component.height, component.segments,\n );\n case 'plane':\n return new PlaneGeometry(component.width, component.height);\n case 'cone':\n return new ConeGeometry(component.radius, component.height, component.segments);\n case 'torus':\n return new TorusGeometry(\n component.radius, component.radius * 0.4, 16, component.segments,\n );\n case 'box':\n default:\n return new BoxGeometry(component.width, component.height, component.depth);\n }\n }\n\n onDestroy() {\n for (const [id] of this.entries) {\n this.handleRemove(id);\n }\n this.entries.clear();\n }\n}\n"],"names":["Component","__decorate","Field","Renderer3D","Renderer3DSystem","OBSERVER_TYPE","MeshStandardMaterial","Mesh","tagObject3D","SphereGeometry","CylinderGeometry","PlaneGeometry","ConeGeometry","TorusGeometry","BoxGeometry","decorators"],"mappings":";;;;;;;;AA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KAAK,KAAK;AACV,YAAA;AACE,gBAAA,OAAO,IAAIC,iBAAW,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC;;IAEhF;IAEA,SAAS,GAAA;QACP,KAAK,MAAM,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE;AAC/B,YAAA,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QACvB;AACA,QAAA,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;IACtB;;AA9GmB,gBAAgB,GAAAb,gBAAA,CAAA;IAVpCc,iBAAU,CAAC,iBAAiB,CAAC;AAC5B,QAAA,UAAU,EAAE;YACV,OAAO,EAAE,OAAO,EAAE,WAAW;AAC7B,YAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU;YAChD,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,QAAQ,EAAE,QAAQ,EAAE,QAAQ;YAC5B,SAAS;AACV,SAAA;KACF;AACoB,CAAA,EAAA,gBAAgB,CA+GpC;+BA/GoB,gBAAgB;;;;;"}
@@ -1 +1 @@
1
- "use strict";var e=require("tslib"),t=require("@combos-fun/engine"),o=require("@combos-fun/inspector-decorator"),r=require("@combos-fun/plugin-renderer-3d"),i=require("three");class s extends t.Component{constructor(){super(...arguments),this.shape="box",this.color=65280,this.wireframe=!1,this.width=1,this.height=1,this.depth=1,this.radius=.5,this.segments=32,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,this.opacity=1}static{this.componentName="Graphics3D"}init(e){e&&Object.assign(this,e)}}e.__decorate([o.Field({type:"string",group:"Graphics3D",label:"shape",description:"Primitive shape kind.",editor:"text"})],s.prototype,"shape",void 0),e.__decorate([o.Field({type:"number",group:"Graphics3D",label:"color",description:"Color value.",editor:"number-stepper"})],s.prototype,"color",void 0),e.__decorate([o.Field({type:"boolean",group:"Graphics3D",label:"wireframe",description:"Draw as wireframe.",editor:"toggle"})],s.prototype,"wireframe",void 0),e.__decorate([o.Field({type:"number",step:.1,group:"Graphics3D",label:"width",description:"Width.",editor:"number-stepper"})],s.prototype,"width",void 0),e.__decorate([o.Field({type:"number",step:.1,group:"Graphics3D",label:"height",description:"Height.",editor:"number-stepper"})],s.prototype,"height",void 0),e.__decorate([o.Field({type:"number",step:.1,group:"Graphics3D",label:"depth",description:"Depth.",editor:"number-stepper"})],s.prototype,"depth",void 0),e.__decorate([o.Field({type:"number",step:.1,group:"Graphics3D",label:"radius",description:"Radius.",editor:"number-stepper"})],s.prototype,"radius",void 0),e.__decorate([o.Field({type:"number",step:1,group:"Graphics3D",label:"segments",description:"Mesh segment count.",editor:"number-stepper"})],s.prototype,"segments",void 0),e.__decorate([o.Field({type:"number",step:.1,group:"Graphics3D",label:"positionX",description:"Local X position.",editor:"number-stepper"})],s.prototype,"positionX",void 0),e.__decorate([o.Field({type:"number",step:.1,group:"Graphics3D",label:"positionY",description:"Local Y position.",editor:"number-stepper"})],s.prototype,"positionY",void 0),e.__decorate([o.Field({type:"number",step:.1,group:"Graphics3D",label:"positionZ",description:"Local Z position.",editor:"number-stepper"})],s.prototype,"positionZ",void 0),e.__decorate([o.Field({type:"number",step:.01,group:"Graphics3D",label:"rotationX",description:"Rotation around X in radians.",editor:"number-stepper"})],s.prototype,"rotationX",void 0),e.__decorate([o.Field({type:"number",step:.01,group:"Graphics3D",label:"rotationY",description:"Rotation around Y in radians.",editor:"number-stepper"})],s.prototype,"rotationY",void 0),e.__decorate([o.Field({type:"number",step:.01,group:"Graphics3D",label:"rotationZ",description:"Rotation around Z in radians.",editor:"number-stepper"})],s.prototype,"rotationZ",void 0),e.__decorate([o.Field({type:"number",step:.1,group:"Graphics3D",label:"scaleX",description:"Scale on X.",editor:"number-stepper"})],s.prototype,"scaleX",void 0),e.__decorate([o.Field({type:"number",step:.1,group:"Graphics3D",label:"scaleY",description:"Scale on Y.",editor:"number-stepper"})],s.prototype,"scaleY",void 0),e.__decorate([o.Field({type:"number",step:.1,group:"Graphics3D",label:"scaleZ",description:"Scale on Z.",editor:"number-stepper"})],s.prototype,"scaleZ",void 0),e.__decorate([o.Field({type:"number",step:.01,min:0,max:1,group:"Graphics3D",label:"opacity",description:"Opacity from 0 to 1.",editor:"number-slider"})],s.prototype,"opacity",void 0);const p=["shape","width","height","depth","radius","segments"],a=["color","wireframe","opacity"];let n=class extends r.Renderer3D{constructor(){super(...arguments),this.name="Graphics3DSystem",this.entries=new Map}static{this.systemName="Graphics3DSystem"}init(){this.game.getSystem(r.Renderer3DSystem).rendererManager.register(this)}componentChanged(e){"Graphics3D"===e.componentName&&(e.type===t.OBSERVER_TYPE.ADD?this.handleAdd(e.gameObject,e.component):e.type===t.OBSERVER_TYPE.REMOVE?this.handleRemove(e.gameObject.id):this.handleChange(e))}rendererUpdate(e){const t=e.getComponent(s);if(!t)return;const o=this.entries.get(e.id);o&&(o.mesh.position.set(t.positionX,t.positionY,t.positionZ),o.mesh.rotation.set(t.rotationX,t.rotationY,t.rotationZ),o.mesh.scale.set(t.scaleX,t.scaleY,t.scaleZ))}handleAdd(e,t){const o=this.createGeometry(t),r=new i.MeshStandardMaterial({color:t.color,wireframe:t.wireframe,transparent:t.opacity<1,opacity:t.opacity}),s=new i.Mesh(o,r);s.position.set(t.positionX,t.positionY,t.positionZ),s.rotation.set(t.rotationX,t.rotationY,t.rotationZ),s.scale.set(t.scaleX,t.scaleY,t.scaleZ),this.threeContext.scene.add(s),this.entries.set(e.id,{mesh:s})}handleChange(e){const t=e.component,o=e.prop?.prop?.[0],r=this.entries.get(e.gameObject.id);if(r&&(p.includes(o)&&(r.mesh.geometry.dispose(),r.mesh.geometry=this.createGeometry(t)),a.includes(o))){const e=r.mesh.material;e.color.setHex(t.color),e.wireframe=t.wireframe,e.opacity=t.opacity,e.transparent=t.opacity<1}}handleRemove(e){const t=this.entries.get(e);t&&(this.threeContext.scene.remove(t.mesh),t.mesh.geometry.dispose(),t.mesh.material.dispose(),this.entries.delete(e))}createGeometry(e){switch(e.shape){case"sphere":return new i.SphereGeometry(e.radius,e.segments,e.segments);case"cylinder":return new i.CylinderGeometry(e.radius,e.radius,e.height,e.segments);case"plane":return new i.PlaneGeometry(e.width,e.height);case"cone":return new i.ConeGeometry(e.radius,e.height,e.segments);case"torus":return new i.TorusGeometry(e.radius,.4*e.radius,16,e.segments);default:return new i.BoxGeometry(e.width,e.height,e.depth)}}onDestroy(){for(const[e]of this.entries)this.handleRemove(e);this.entries.clear()}};n=e.__decorate([t.decorators.componentObserver({Graphics3D:["shape","color","wireframe","width","height","depth","radius","segments","positionX","positionY","positionZ","rotationX","rotationY","rotationZ","scaleX","scaleY","scaleZ","opacity"]})],n);var d=n;exports.Graphics3D=s,exports.Graphics3DSystem=d;
1
+ "use strict";var e=require("tslib"),t=require("@combos-fun/engine"),o=require("@combos-fun/inspector-decorator"),r=require("@combos-fun/plugin-renderer-3d"),i=require("three");class s extends t.Component{constructor(){super(...arguments),this.shape="box",this.color=65280,this.wireframe=!1,this.width=1,this.height=1,this.depth=1,this.radius=.5,this.segments=32,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,this.opacity=1}static{this.componentName="Graphics3D"}init(e){e&&Object.assign(this,e)}}e.__decorate([o.Field({type:"string",group:"Graphics3D",label:"shape",description:"Primitive shape kind.",editor:"text"})],s.prototype,"shape",void 0),e.__decorate([o.Field({type:"number",group:"Graphics3D",label:"color",description:"Color value.",editor:"number-stepper"})],s.prototype,"color",void 0),e.__decorate([o.Field({type:"boolean",group:"Graphics3D",label:"wireframe",description:"Draw as wireframe.",editor:"toggle"})],s.prototype,"wireframe",void 0),e.__decorate([o.Field({type:"number",step:.1,group:"Graphics3D",label:"width",description:"Width.",editor:"number-stepper"})],s.prototype,"width",void 0),e.__decorate([o.Field({type:"number",step:.1,group:"Graphics3D",label:"height",description:"Height.",editor:"number-stepper"})],s.prototype,"height",void 0),e.__decorate([o.Field({type:"number",step:.1,group:"Graphics3D",label:"depth",description:"Depth.",editor:"number-stepper"})],s.prototype,"depth",void 0),e.__decorate([o.Field({type:"number",step:.1,group:"Graphics3D",label:"radius",description:"Radius.",editor:"number-stepper"})],s.prototype,"radius",void 0),e.__decorate([o.Field({type:"number",step:1,group:"Graphics3D",label:"segments",description:"Mesh segment count.",editor:"number-stepper"})],s.prototype,"segments",void 0),e.__decorate([o.Field({type:"number",step:.1,group:"Graphics3D",label:"positionX",description:"Local X position.",editor:"number-stepper"})],s.prototype,"positionX",void 0),e.__decorate([o.Field({type:"number",step:.1,group:"Graphics3D",label:"positionY",description:"Local Y position.",editor:"number-stepper"})],s.prototype,"positionY",void 0),e.__decorate([o.Field({type:"number",step:.1,group:"Graphics3D",label:"positionZ",description:"Local Z position.",editor:"number-stepper"})],s.prototype,"positionZ",void 0),e.__decorate([o.Field({type:"number",step:.01,group:"Graphics3D",label:"rotationX",description:"Rotation around X in radians.",editor:"number-stepper"})],s.prototype,"rotationX",void 0),e.__decorate([o.Field({type:"number",step:.01,group:"Graphics3D",label:"rotationY",description:"Rotation around Y in radians.",editor:"number-stepper"})],s.prototype,"rotationY",void 0),e.__decorate([o.Field({type:"number",step:.01,group:"Graphics3D",label:"rotationZ",description:"Rotation around Z in radians.",editor:"number-stepper"})],s.prototype,"rotationZ",void 0),e.__decorate([o.Field({type:"number",step:.1,group:"Graphics3D",label:"scaleX",description:"Scale on X.",editor:"number-stepper"})],s.prototype,"scaleX",void 0),e.__decorate([o.Field({type:"number",step:.1,group:"Graphics3D",label:"scaleY",description:"Scale on Y.",editor:"number-stepper"})],s.prototype,"scaleY",void 0),e.__decorate([o.Field({type:"number",step:.1,group:"Graphics3D",label:"scaleZ",description:"Scale on Z.",editor:"number-stepper"})],s.prototype,"scaleZ",void 0),e.__decorate([o.Field({type:"number",step:.01,min:0,max:1,group:"Graphics3D",label:"opacity",description:"Opacity from 0 to 1.",editor:"number-slider"})],s.prototype,"opacity",void 0);const p=["shape","width","height","depth","radius","segments"],a=["color","wireframe","opacity"];let n=class extends r.Renderer3D{constructor(){super(...arguments),this.name="Graphics3DSystem",this.entries=new Map}static{this.systemName="Graphics3DSystem"}init(){this.game.getSystem(r.Renderer3DSystem).rendererManager.register(this)}componentChanged(e){"Graphics3D"===e.componentName&&(e.type===t.OBSERVER_TYPE.ADD?this.handleAdd(e.gameObject,e.component):e.type===t.OBSERVER_TYPE.REMOVE?this.handleRemove(e.gameObject.id):this.handleChange(e))}rendererUpdate(e){const t=e.getComponent(s);if(!t)return;const o=this.entries.get(e.id);o&&(o.mesh.position.set(t.positionX,t.positionY,t.positionZ),o.mesh.rotation.set(t.rotationX,t.rotationY,t.rotationZ),o.mesh.scale.set(t.scaleX,t.scaleY,t.scaleZ))}handleAdd(e,t){const o=this.createGeometry(t),s=new i.MeshStandardMaterial({color:t.color,wireframe:t.wireframe,transparent:t.opacity<1,opacity:t.opacity}),p=new i.Mesh(o,s);r.tagObject3D(p,e.id),p.position.set(t.positionX,t.positionY,t.positionZ),p.rotation.set(t.rotationX,t.rotationY,t.rotationZ),p.scale.set(t.scaleX,t.scaleY,t.scaleZ),this.threeContext.scene.add(p),this.entries.set(e.id,{mesh:p})}handleChange(e){const t=e.component,o=e.prop?.prop?.[0],r=this.entries.get(e.gameObject.id);if(r&&(p.includes(o)&&(r.mesh.geometry.dispose(),r.mesh.geometry=this.createGeometry(t)),a.includes(o))){const e=r.mesh.material;e.color.setHex(t.color),e.wireframe=t.wireframe,e.opacity=t.opacity,e.transparent=t.opacity<1}}handleRemove(e){const t=this.entries.get(e);t&&(this.threeContext.scene.remove(t.mesh),t.mesh.geometry.dispose(),t.mesh.material.dispose(),this.entries.delete(e))}createGeometry(e){switch(e.shape){case"sphere":return new i.SphereGeometry(e.radius,e.segments,e.segments);case"cylinder":return new i.CylinderGeometry(e.radius,e.radius,e.height,e.segments);case"plane":return new i.PlaneGeometry(e.width,e.height);case"cone":return new i.ConeGeometry(e.radius,e.height,e.segments);case"torus":return new i.TorusGeometry(e.radius,.4*e.radius,16,e.segments);default:return new i.BoxGeometry(e.width,e.height,e.depth)}}onDestroy(){for(const[e]of this.entries)this.handleRemove(e);this.entries.clear()}};n=e.__decorate([t.decorators.componentObserver({Graphics3D:["shape","color","wireframe","width","height","depth","radius","segments","positionX","positionY","positionZ","rotationX","rotationY","rotationZ","scaleX","scaleY","scaleZ","opacity"]})],n);var d=n;exports.Graphics3D=s,exports.Graphics3DSystem=d;
@@ -1,7 +1,7 @@
1
1
  import { __decorate } from 'tslib';
2
2
  import { Component, OBSERVER_TYPE, decorators } from '@combos-fun/engine';
3
3
  import { Field } from '@combos-fun/inspector-decorator';
4
- import { Renderer3D, Renderer3DSystem } from '@combos-fun/plugin-renderer-3d';
4
+ import { Renderer3D, Renderer3DSystem, tagObject3D } from '@combos-fun/plugin-renderer-3d';
5
5
  import { MeshStandardMaterial, Mesh, BoxGeometry, TorusGeometry, ConeGeometry, PlaneGeometry, CylinderGeometry, SphereGeometry } from 'three';
6
6
 
7
7
  class Graphics3D extends Component {
@@ -258,6 +258,7 @@ let Graphics3DSystem = class Graphics3DSystem extends Renderer3D {
258
258
  opacity: component.opacity,
259
259
  });
260
260
  const mesh = new Mesh(geometry, material);
261
+ tagObject3D(mesh, gameObject.id);
261
262
  mesh.position.set(component.positionX, component.positionY, component.positionZ);
262
263
  mesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);
263
264
  mesh.scale.set(component.scaleX, component.scaleY, component.scaleZ);
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-renderer-3d-graphics.esm.js","sources":["../lib/component.ts","../lib/system.ts"],"sourcesContent":["import { Component } from '@combos-fun/engine';\nimport { Field } from '@combos-fun/inspector-decorator';\n\nexport interface Graphics3DParams {\n shape?: string;\n color?: number;\n wireframe?: boolean;\n width?: number;\n height?: number;\n depth?: number;\n radius?: number;\n segments?: 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 opacity?: number;\n}\n\nexport default class Graphics3D extends Component<Graphics3DParams> {\n static componentName: string = 'Graphics3D';\n\n @Field({\n\n type: 'string',\n\n group: 'Graphics3D',\n\n label: 'shape',\n\n description: 'Primitive shape kind.',\n\n editor: 'text',\n\n })\n\n shape: string = 'box';\n @Field({\n type: 'number',\n group: 'Graphics3D',\n label: 'color',\n description: 'Color value.',\n editor: 'number-stepper',\n })\n color: number = 0x00ff00;\n @Field({\n type: 'boolean',\n group: 'Graphics3D',\n label: 'wireframe',\n description: 'Draw as wireframe.',\n editor: 'toggle',\n })\n wireframe: boolean = false;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'width',\n description: 'Width.',\n editor: 'number-stepper',\n })\n width: number = 1;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'height',\n description: 'Height.',\n editor: 'number-stepper',\n })\n height: number = 1;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'depth',\n description: 'Depth.',\n editor: 'number-stepper',\n })\n depth: number = 1;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'radius',\n description: 'Radius.',\n editor: 'number-stepper',\n })\n radius: number = 0.5;\n @Field({\n type: 'number',\n step: 1,\n group: 'Graphics3D',\n label: 'segments',\n description: 'Mesh segment count.',\n editor: 'number-stepper',\n })\n segments: number = 32;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'positionX',\n description: 'Local X position.',\n editor: 'number-stepper',\n })\n positionX: number = 0;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'positionY',\n description: 'Local Y position.',\n editor: 'number-stepper',\n })\n positionY: number = 0;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'positionZ',\n description: 'Local Z position.',\n editor: 'number-stepper',\n })\n positionZ: number = 0;\n @Field({\n type: 'number',\n step: 0.01,\n group: 'Graphics3D',\n label: 'rotationX',\n description: 'Rotation around X in radians.',\n editor: 'number-stepper',\n })\n rotationX: number = 0;\n @Field({\n type: 'number',\n step: 0.01,\n group: 'Graphics3D',\n label: 'rotationY',\n description: 'Rotation around Y in radians.',\n editor: 'number-stepper',\n })\n rotationY: number = 0;\n @Field({\n type: 'number',\n step: 0.01,\n group: 'Graphics3D',\n label: 'rotationZ',\n description: 'Rotation around Z in radians.',\n editor: 'number-stepper',\n })\n rotationZ: number = 0;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'scaleX',\n description: 'Scale on X.',\n editor: 'number-stepper',\n })\n scaleX: number = 1;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'scaleY',\n description: 'Scale on Y.',\n editor: 'number-stepper',\n })\n scaleY: number = 1;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'scaleZ',\n description: 'Scale on Z.',\n editor: 'number-stepper',\n })\n scaleZ: number = 1;\n @Field({\n type: 'number',\n step: 0.01,\n min: 0,\n max: 1,\n group: 'Graphics3D',\n label: 'opacity',\n description: 'Opacity from 0 to 1.',\n editor: 'number-slider',\n })\n opacity: number = 1;\n\n init(obj?: Graphics3DParams) {\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 {\n BoxGeometry,\n SphereGeometry,\n CylinderGeometry,\n PlaneGeometry,\n ConeGeometry,\n TorusGeometry,\n MeshStandardMaterial,\n Mesh,\n} from 'three';\nimport type { BufferGeometry } from 'three';\nimport Graphics3D from './component';\n\ninterface Graphics3DEntry {\n mesh: Mesh;\n}\n\nconst GEOMETRY_PROPS = ['shape', 'width', 'height', 'depth', 'radius', 'segments'];\nconst MATERIAL_PROPS = ['color', 'wireframe', 'opacity'];\n\n@decorators.componentObserver({\n Graphics3D: [\n 'shape', 'color', 'wireframe',\n 'width', 'height', 'depth', 'radius', 'segments',\n 'positionX', 'positionY', 'positionZ',\n 'rotationX', 'rotationY', 'rotationZ',\n 'scaleX', 'scaleY', 'scaleZ',\n 'opacity',\n ],\n})\nexport default class Graphics3DSystem extends Renderer3D {\n static systemName = 'Graphics3DSystem';\n name: string = 'Graphics3DSystem';\n\n private entries: Map<number, Graphics3DEntry> = new Map();\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 !== 'Graphics3D') return;\n\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.handleAdd(changed.gameObject, changed.component as Graphics3D);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.handleRemove(changed.gameObject.id);\n } else {\n this.handleChange(changed);\n }\n }\n\n rendererUpdate(gameObject: GameObject) {\n const component = gameObject.getComponent(Graphics3D) as Graphics3D;\n if (!component) return;\n\n const entry = this.entries.get(gameObject.id);\n if (!entry) return;\n\n entry.mesh.position.set(component.positionX, component.positionY, component.positionZ);\n entry.mesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n entry.mesh.scale.set(component.scaleX, component.scaleY, component.scaleZ);\n }\n\n private handleAdd(gameObject: GameObject, component: Graphics3D) {\n const geometry = this.createGeometry(component);\n const material = new MeshStandardMaterial({\n color: component.color,\n wireframe: component.wireframe,\n transparent: component.opacity < 1,\n opacity: component.opacity,\n });\n const mesh = new Mesh(geometry, material);\n mesh.position.set(component.positionX, component.positionY, component.positionZ);\n mesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n mesh.scale.set(component.scaleX, component.scaleY, component.scaleZ);\n\n this.threeContext.scene.add(mesh);\n this.entries.set(gameObject.id, { mesh });\n }\n\n private handleChange(changed: ComponentChanged) {\n const component = changed.component as Graphics3D;\n const changedProp = changed.prop?.prop?.[0];\n const entry = this.entries.get(changed.gameObject.id);\n if (!entry) return;\n\n if (GEOMETRY_PROPS.includes(changedProp)) {\n entry.mesh.geometry.dispose();\n entry.mesh.geometry = this.createGeometry(component);\n }\n\n if (MATERIAL_PROPS.includes(changedProp)) {\n const material = entry.mesh.material as MeshStandardMaterial;\n material.color.setHex(component.color);\n material.wireframe = component.wireframe;\n material.opacity = component.opacity;\n material.transparent = component.opacity < 1;\n }\n }\n\n private handleRemove(id: number) {\n const entry = this.entries.get(id);\n if (!entry) return;\n\n this.threeContext.scene.remove(entry.mesh);\n entry.mesh.geometry.dispose();\n (entry.mesh.material as MeshStandardMaterial).dispose();\n this.entries.delete(id);\n }\n\n private createGeometry(component: Graphics3D): BufferGeometry {\n switch (component.shape) {\n case 'sphere':\n return new SphereGeometry(component.radius, component.segments, component.segments);\n case 'cylinder':\n return new CylinderGeometry(\n component.radius, component.radius, component.height, component.segments,\n );\n case 'plane':\n return new PlaneGeometry(component.width, component.height);\n case 'cone':\n return new ConeGeometry(component.radius, component.height, component.segments);\n case 'torus':\n return new TorusGeometry(\n component.radius, component.radius * 0.4, 16, component.segments,\n );\n case 'box':\n default:\n return new BoxGeometry(component.width, component.height, component.depth);\n }\n }\n\n onDestroy() {\n for (const [id] of this.entries) {\n this.handleRemove(id);\n }\n this.entries.clear();\n }\n}\n"],"names":[],"mappings":";;;;;;AAwBc,MAAO,UAAW,SAAQ,SAA2B,CAAA;AAAnE,IAAA,WAAA,GAAA;;QAiBE,IAAA,CAAA,KAAK,GAAW,KAAK;QAQrB,IAAA,CAAA,KAAK,GAAW,QAAQ;QAQxB,IAAA,CAAA,SAAS,GAAY,KAAK;QAS1B,IAAA,CAAA,KAAK,GAAW,CAAC;QASjB,IAAA,CAAA,MAAM,GAAW,CAAC;QASlB,IAAA,CAAA,KAAK,GAAW,CAAC;QASjB,IAAA,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YAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU;YAChD,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,QAAQ,EAAE,QAAQ,EAAE,QAAQ;YAC5B,SAAS;AACV,SAAA;KACF;AACoB,CAAA,EAAA,gBAAgB,CA8GpC;+BA9GoB,gBAAgB;;;;"}
1
+ {"version":3,"file":"plugin-renderer-3d-graphics.esm.js","sources":["../lib/component.ts","../lib/system.ts"],"sourcesContent":["import { Component } from '@combos-fun/engine';\nimport { Field } from '@combos-fun/inspector-decorator';\n\nexport interface Graphics3DParams {\n shape?: string;\n color?: number;\n wireframe?: boolean;\n width?: number;\n height?: number;\n depth?: number;\n radius?: number;\n segments?: 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 opacity?: number;\n}\n\nexport default class Graphics3D extends Component<Graphics3DParams> {\n static componentName: string = 'Graphics3D';\n\n @Field({\n\n type: 'string',\n\n group: 'Graphics3D',\n\n label: 'shape',\n\n description: 'Primitive shape kind.',\n\n editor: 'text',\n\n })\n\n shape: string = 'box';\n @Field({\n type: 'number',\n group: 'Graphics3D',\n label: 'color',\n description: 'Color value.',\n editor: 'number-stepper',\n })\n color: number = 0x00ff00;\n @Field({\n type: 'boolean',\n group: 'Graphics3D',\n label: 'wireframe',\n description: 'Draw as wireframe.',\n editor: 'toggle',\n })\n wireframe: boolean = false;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'width',\n description: 'Width.',\n editor: 'number-stepper',\n })\n width: number = 1;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'height',\n description: 'Height.',\n editor: 'number-stepper',\n })\n height: number = 1;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'depth',\n description: 'Depth.',\n editor: 'number-stepper',\n })\n depth: number = 1;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'radius',\n description: 'Radius.',\n editor: 'number-stepper',\n })\n radius: number = 0.5;\n @Field({\n type: 'number',\n step: 1,\n group: 'Graphics3D',\n label: 'segments',\n description: 'Mesh segment count.',\n editor: 'number-stepper',\n })\n segments: number = 32;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'positionX',\n description: 'Local X position.',\n editor: 'number-stepper',\n })\n positionX: number = 0;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'positionY',\n description: 'Local Y position.',\n editor: 'number-stepper',\n })\n positionY: number = 0;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'positionZ',\n description: 'Local Z position.',\n editor: 'number-stepper',\n })\n positionZ: number = 0;\n @Field({\n type: 'number',\n step: 0.01,\n group: 'Graphics3D',\n label: 'rotationX',\n description: 'Rotation around X in radians.',\n editor: 'number-stepper',\n })\n rotationX: number = 0;\n @Field({\n type: 'number',\n step: 0.01,\n group: 'Graphics3D',\n label: 'rotationY',\n description: 'Rotation around Y in radians.',\n editor: 'number-stepper',\n })\n rotationY: number = 0;\n @Field({\n type: 'number',\n step: 0.01,\n group: 'Graphics3D',\n label: 'rotationZ',\n description: 'Rotation around Z in radians.',\n editor: 'number-stepper',\n })\n rotationZ: number = 0;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'scaleX',\n description: 'Scale on X.',\n editor: 'number-stepper',\n })\n scaleX: number = 1;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'scaleY',\n description: 'Scale on Y.',\n editor: 'number-stepper',\n })\n scaleY: number = 1;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Graphics3D',\n label: 'scaleZ',\n description: 'Scale on Z.',\n editor: 'number-stepper',\n })\n scaleZ: number = 1;\n @Field({\n type: 'number',\n step: 0.01,\n min: 0,\n max: 1,\n group: 'Graphics3D',\n label: 'opacity',\n description: 'Opacity from 0 to 1.',\n editor: 'number-slider',\n })\n opacity: number = 1;\n\n init(obj?: Graphics3DParams) {\n if (obj) Object.assign(this, obj);\n }\n}\n","import { decorators, ComponentChanged, OBSERVER_TYPE, GameObject } from '@combos-fun/engine';\nimport { Renderer3D, Renderer3DSystem, tagObject3D } from '@combos-fun/plugin-renderer-3d';\nimport {\n BoxGeometry,\n SphereGeometry,\n CylinderGeometry,\n PlaneGeometry,\n ConeGeometry,\n TorusGeometry,\n MeshStandardMaterial,\n Mesh,\n} from 'three';\nimport type { BufferGeometry } from 'three';\nimport Graphics3D from './component';\n\ninterface Graphics3DEntry {\n mesh: Mesh;\n}\n\nconst GEOMETRY_PROPS = ['shape', 'width', 'height', 'depth', 'radius', 'segments'];\nconst MATERIAL_PROPS = ['color', 'wireframe', 'opacity'];\n\n@decorators.componentObserver({\n Graphics3D: [\n 'shape', 'color', 'wireframe',\n 'width', 'height', 'depth', 'radius', 'segments',\n 'positionX', 'positionY', 'positionZ',\n 'rotationX', 'rotationY', 'rotationZ',\n 'scaleX', 'scaleY', 'scaleZ',\n 'opacity',\n ],\n})\nexport default class Graphics3DSystem extends Renderer3D {\n static systemName = 'Graphics3DSystem';\n name: string = 'Graphics3DSystem';\n\n private entries: Map<number, Graphics3DEntry> = new Map();\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 !== 'Graphics3D') return;\n\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.handleAdd(changed.gameObject, changed.component as Graphics3D);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.handleRemove(changed.gameObject.id);\n } else {\n this.handleChange(changed);\n }\n }\n\n rendererUpdate(gameObject: GameObject) {\n const component = gameObject.getComponent(Graphics3D) as Graphics3D;\n if (!component) return;\n\n const entry = this.entries.get(gameObject.id);\n if (!entry) return;\n\n entry.mesh.position.set(component.positionX, component.positionY, component.positionZ);\n entry.mesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n entry.mesh.scale.set(component.scaleX, component.scaleY, component.scaleZ);\n }\n\n private handleAdd(gameObject: GameObject, component: Graphics3D) {\n const geometry = this.createGeometry(component);\n const material = new MeshStandardMaterial({\n color: component.color,\n wireframe: component.wireframe,\n transparent: component.opacity < 1,\n opacity: component.opacity,\n });\n const mesh = new Mesh(geometry, material);\n tagObject3D(mesh, gameObject.id);\n mesh.position.set(component.positionX, component.positionY, component.positionZ);\n mesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n mesh.scale.set(component.scaleX, component.scaleY, component.scaleZ);\n\n this.threeContext.scene.add(mesh);\n this.entries.set(gameObject.id, { mesh });\n }\n\n private handleChange(changed: ComponentChanged) {\n const component = changed.component as Graphics3D;\n const changedProp = changed.prop?.prop?.[0];\n const entry = this.entries.get(changed.gameObject.id);\n if (!entry) return;\n\n if (GEOMETRY_PROPS.includes(changedProp)) {\n entry.mesh.geometry.dispose();\n entry.mesh.geometry = this.createGeometry(component);\n }\n\n if (MATERIAL_PROPS.includes(changedProp)) {\n const material = entry.mesh.material as MeshStandardMaterial;\n material.color.setHex(component.color);\n material.wireframe = component.wireframe;\n material.opacity = component.opacity;\n material.transparent = component.opacity < 1;\n }\n }\n\n private handleRemove(id: number) {\n const entry = this.entries.get(id);\n if (!entry) return;\n\n this.threeContext.scene.remove(entry.mesh);\n entry.mesh.geometry.dispose();\n (entry.mesh.material as MeshStandardMaterial).dispose();\n this.entries.delete(id);\n }\n\n private createGeometry(component: Graphics3D): BufferGeometry {\n switch (component.shape) {\n case 'sphere':\n return new SphereGeometry(component.radius, component.segments, component.segments);\n case 'cylinder':\n return new CylinderGeometry(\n component.radius, component.radius, component.height, component.segments,\n );\n case 'plane':\n return new PlaneGeometry(component.width, component.height);\n case 'cone':\n return new ConeGeometry(component.radius, component.height, component.segments);\n case 'torus':\n return new TorusGeometry(\n component.radius, component.radius * 0.4, 16, component.segments,\n );\n case 'box':\n default:\n return new BoxGeometry(component.width, component.height, component.depth);\n }\n }\n\n onDestroy() {\n for (const [id] of this.entries) {\n this.handleRemove(id);\n }\n this.entries.clear();\n }\n}\n"],"names":[],"mappings":";;;;;;AAwBc,MAAO,UAAW,SAAQ,SAA2B,CAAA;AAAnE,IAAA,WAAA,GAAA;;QAiBE,IAAA,CAAA,KAAK,GAAW,KAAK;QAQrB,IAAA,CAAA,KAAK,GAAW,QAAQ;QAQxB,IAAA,CAAA,SAAS,GAAY,KAAK;QAS1B,IAAA,CAAA,KAAK,GAAW,CAAC;QASjB,IAAA,CAAA,MAAM,GAAW,CAAC;QASlB,IAAA,CAAA,KAAK,GAAW,CAAC;QASjB,IAAA,CAAA,MAAM,GAAW,GAAG;QASpB,IAAA,CAAA,QAAQ,GAAW,EAAE;QASrB,IAAA,CAAA,SAAS,GAAW,CAAC;QASrB,IAAA,CAAA,SAAS,GAAW,CAAC;QASrB,IAAA,CAAA,SAAS,GAAW,CAAC;QASrB,IAAA,CAAA,SAAS,GAAW,CAAC;QASrB,IAAA,CAAA,SAAS,GAAW,CAAC;QASrB,IAAA,CAAA,SAAS,GAAW,CAAC;QASrB,IAAA,CAAA,MAAM,GAAW,CAAC;QASlB,IAAA,CAAA,MAAM,GAAW,CAAC;QASlB,IAAA,CAAA,MAAM,GAAW,CAAC;QAWlB,IAAA,CAAA,OAAO,GAAW,CAAC;IAKrB;aA9KS,IAAA,CAAA,aAAa,GAAW,YAAX,CAAwB;AA2K5C,IAAA,IAAI,CAAC,GAAsB,EAAA;AACzB,QAAA,IAAI,GAAG;AAAE,YAAA,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC;IACnC;;AA7JA,UAAA,CAAA;AAdC,IAAA,KAAK,CAAC;AAEL,QAAA,IAAI,EAAE,QAAQ;AAEd,QAAA,KAAK,EAAE,YAAY;AAEnB,QAAA,KAAK,EAA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EAAE,SAAS,CAAC,MAAM,GAAG,GAAG,EAAE,EAAE,EAAE,SAAS,CAAC,QAAQ,CACjE;AACH,YAAA,KAAK,KAAK;AACV,YAAA;AACE,gBAAA,OAAO,IAAI,WAAW,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC;;IAEhF;IAEA,SAAS,GAAA;QACP,KAAK,MAAM,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE;AAC/B,YAAA,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QACvB;AACA,QAAA,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;IACtB;;AA9GmB,gBAAgB,GAAA,UAAA,CAAA;IAVpC,UAAU,CAAC,iBAAiB,CAAC;AAC5B,QAAA,UAAU,EAAE;YACV,OAAO,EAAE,OAAO,EAAE,WAAW;AAC7B,YAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU;YAChD,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,QAAQ,EAAE,QAAQ,EAAE,QAAQ;YAC5B,SAAS;AACV,SAAA;KACF;AACoB,CAAA,EAAA,gBAAgB,CA+GpC;+BA/GoB,gBAAgB;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@combos-fun/plugin-renderer-3d-graphics",
3
- "version": "0.0.39",
3
+ "version": "0.0.41",
4
4
  "description": "Procedural 3D primitive shapes",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-renderer-3d-graphics.esm.js",
@@ -26,10 +26,10 @@
26
26
  "pluginManifest": "./combos-plugin.json"
27
27
  },
28
28
  "dependencies": {
29
- "@combos-fun/engine": "0.0.39",
30
- "@combos-fun/inspector-decorator": "0.0.39",
31
- "@combos-fun/plugin-renderer-3d": "0.0.39",
32
- "three": "^0.172.0"
29
+ "three": "^0.172.0",
30
+ "@combos-fun/engine": "0.0.41",
31
+ "@combos-fun/inspector-decorator": "0.0.41",
32
+ "@combos-fun/plugin-renderer-3d": "0.0.41"
33
33
  },
34
34
  "keywords": [
35
35
  "combos-fun",