@combos-fun/plugin-renderer-3d-graphics 0.0.54 → 0.1.1
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/plugin-renderer-3d-graphics.cjs.js +2 -2
- package/dist/plugin-renderer-3d-graphics.cjs.js.map +1 -1
- package/dist/plugin-renderer-3d-graphics.cjs.prod.js +1 -1
- package/dist/plugin-renderer-3d-graphics.esm.js +2 -2
- package/dist/plugin-renderer-3d-graphics.esm.js.map +1 -1
- package/package.json +4 -4
|
@@ -570,7 +570,7 @@ let Graphics3DSystem = class Graphics3DSystem extends pluginRenderer3d.Renderer3
|
|
|
570
570
|
renderer3DSystem.rendererManager.register(this);
|
|
571
571
|
}
|
|
572
572
|
componentChanged(changed) {
|
|
573
|
-
if (changed.componentName === '
|
|
573
|
+
if (changed.componentName === 'GameObject') {
|
|
574
574
|
this.threeContext.reparentGameObject(changed.gameObject);
|
|
575
575
|
return;
|
|
576
576
|
}
|
|
@@ -728,7 +728,7 @@ Graphics3DSystem = tslib.__decorate([
|
|
|
728
728
|
'opacity', 'roughness', 'metalness', 'emissive',
|
|
729
729
|
'map', 'doubleSide', 'material', 'parts',
|
|
730
730
|
],
|
|
731
|
-
|
|
731
|
+
GameObject: ['parent'],
|
|
732
732
|
})
|
|
733
733
|
], Graphics3DSystem);
|
|
734
734
|
var Graphics3DSystem_default = Graphics3DSystem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-renderer-3d-graphics.cjs.js","sources":["../lib/component.ts","../lib/shapes.ts","../lib/resources.ts","../lib/system.ts"],"sourcesContent":["import { Component } from '@combos-fun/engine';\nimport { Field } from '@combos-fun/inspector-decorator';\n\nexport type Graphics3DMaterialKind = 'standard' | 'basic' | 'lambert' | 'toon';\n\nexport type Graphics3DShape =\n | 'box'\n | 'sphere'\n | 'cylinder'\n | 'plane'\n | 'cone'\n | 'torus'\n | 'capsule';\n\nexport interface Graphics3DPartParams {\n shape?: Graphics3DShape | string;\n color?: number;\n wireframe?: boolean;\n width?: number;\n height?: number;\n depth?: number;\n radius?: number;\n segments?: number;\n tube?: 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 roughness?: number;\n metalness?: number;\n emissive?: number;\n map?: string;\n doubleSide?: boolean;\n material?: Graphics3DMaterialKind | string;\n}\n\nexport interface Graphics3DParams extends Graphics3DPartParams {\n parts?: Graphics3DPartParams[];\n}\n\nexport default class Graphics3D extends Component<Graphics3DParams> {\n static componentName: string = 'Graphics3D';\n\n @Field({\n type: 'string',\n group: 'Graphics3D',\n label: 'shape',\n description: 'Primitive shape kind.',\n editor: 'enum',\n enumOptions: ['box', 'sphere', 'cylinder', 'plane', 'cone', 'torus', 'capsule'],\n })\n shape: string = 'box';\n\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\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\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\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\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\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\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 = 12;\n\n @Field({\n type: 'number',\n step: 0.05,\n group: 'Graphics3D',\n label: 'tube',\n description: 'Torus tube radius. 0 means 0.4 × radius.',\n editor: 'number-stepper',\n })\n tube: number = 0;\n\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\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\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\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\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\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\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\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\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\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 @Field({\n type: 'number',\n step: 0.05,\n min: 0,\n max: 1,\n group: 'Graphics3D',\n label: 'roughness',\n description: 'PBR roughness (standard material).',\n editor: 'number-slider',\n })\n roughness: number = 1;\n\n @Field({\n type: 'number',\n step: 0.05,\n min: 0,\n max: 1,\n group: 'Graphics3D',\n label: 'metalness',\n description: 'PBR metalness (standard material).',\n editor: 'number-slider',\n })\n metalness: number = 0;\n\n @Field({\n type: 'number',\n group: 'Graphics3D',\n label: 'emissive',\n description: 'Emissive color (hex).',\n editor: 'number-stepper',\n })\n emissive: number = 0;\n\n @Field({\n type: 'string',\n group: 'Graphics3D',\n label: 'map',\n description: 'Named IMAGE resource used as a color map.',\n editor: 'text',\n })\n map: string = '';\n\n @Field({\n type: 'boolean',\n group: 'Graphics3D',\n label: 'doubleSide',\n description: 'Render both sides of the mesh.',\n editor: 'toggle',\n })\n doubleSide: boolean = false;\n\n @Field({\n type: 'string',\n group: 'Graphics3D',\n label: 'material',\n description: 'Surface shader.',\n editor: 'enum',\n enumOptions: ['standard', 'basic', 'lambert', 'toon'],\n })\n material: string = 'standard';\n\n parts: Graphics3DPartParams[] | undefined = undefined;\n\n init(obj?: Graphics3DParams) {\n if (obj) Object.assign(this, obj);\n }\n}\n","import {\n BoxGeometry,\n SphereGeometry,\n CylinderGeometry,\n PlaneGeometry,\n ConeGeometry,\n TorusGeometry,\n CapsuleGeometry,\n} from 'three';\nimport type { BufferGeometry } from 'three';\nimport type { Graphics3DPartParams } from './component';\n\nexport interface ResolvedPrimitive {\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 tube: 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 roughness: number;\n metalness: number;\n emissive: number;\n map: string;\n doubleSide: boolean;\n material: string;\n}\n\nexport function torusTube(radius: number, tube?: number): number {\n return tube && tube > 0 ? tube : radius * 0.4;\n}\n\nexport function resolvePrimitive(\n part: Graphics3DPartParams,\n fallback?: Graphics3DPartParams,\n): ResolvedPrimitive {\n const src = { ...fallback, ...part };\n const radius = src.radius ?? 0.5;\n return {\n shape: src.shape || 'box',\n color: src.color ?? 0x00ff00,\n wireframe: !!src.wireframe,\n width: src.width ?? 1,\n height: src.height ?? 1,\n depth: src.depth ?? 1,\n radius,\n segments: Math.max(3, Math.round(src.segments ?? 12)),\n tube: torusTube(radius, src.tube),\n positionX: src.positionX ?? 0,\n positionY: src.positionY ?? 0,\n positionZ: src.positionZ ?? 0,\n rotationX: src.rotationX ?? 0,\n rotationY: src.rotationY ?? 0,\n rotationZ: src.rotationZ ?? 0,\n scaleX: src.scaleX ?? 1,\n scaleY: src.scaleY ?? 1,\n scaleZ: src.scaleZ ?? 1,\n opacity: src.opacity ?? 1,\n roughness: src.roughness ?? 1,\n metalness: src.metalness ?? 0,\n emissive: src.emissive ?? 0,\n map: src.map || '',\n doubleSide: !!src.doubleSide,\n material: src.material || 'standard',\n };\n}\n\nexport function geometryKey(p: ResolvedPrimitive): string {\n switch (p.shape) {\n case 'sphere':\n return `sphere:${p.radius}:${p.segments}`;\n case 'cylinder':\n return `cylinder:${p.radius}:${p.height}:${p.segments}`;\n case 'cone':\n return `cone:${p.radius}:${p.height}:${p.segments}`;\n case 'plane':\n return `plane:${p.width}:${p.height}:${p.segments}`;\n case 'torus':\n return `torus:${p.radius}:${p.tube}:${p.segments}`;\n case 'capsule':\n return `capsule:${p.radius}:${p.height}:${p.segments}`;\n case 'box':\n default:\n return `box:${p.width}:${p.height}:${p.depth}`;\n }\n}\n\nexport function createGeometry(p: ResolvedPrimitive): BufferGeometry {\n const segs = p.segments;\n switch (p.shape) {\n case 'sphere':\n return new SphereGeometry(p.radius, segs, segs);\n case 'cylinder':\n return new CylinderGeometry(p.radius, p.radius, p.height, segs);\n case 'plane':\n return new PlaneGeometry(p.width, p.height, segs, segs);\n case 'cone':\n return new ConeGeometry(p.radius, p.height, segs);\n case 'torus':\n return new TorusGeometry(p.radius, p.tube, 8, segs);\n case 'capsule': {\n const length = Math.max(0, p.height - 2 * p.radius);\n return new CapsuleGeometry(p.radius, length, 4, segs);\n }\n case 'box':\n default:\n return new BoxGeometry(p.width, p.height, p.depth);\n }\n}\n\nexport function materialKey(p: ResolvedPrimitive): string {\n return [\n p.material,\n p.color,\n p.wireframe ? 1 : 0,\n p.opacity,\n p.roughness,\n p.metalness,\n p.emissive,\n p.map,\n p.doubleSide ? 1 : 0,\n ].join(':');\n}\n\nexport function poseKey(\n px: number, py: number, pz: number,\n rx: number, ry: number, rz: number,\n sx: number, sy: number, sz: number,\n): string {\n return `${px},${py},${pz},${rx},${ry},${rz},${sx},${sy},${sz}`;\n}\n","import {\n DoubleSide,\n FrontSide,\n MeshBasicMaterial,\n MeshLambertMaterial,\n MeshStandardMaterial,\n MeshToonMaterial,\n} from 'three';\nimport type { BufferGeometry, Material, Texture } from 'three';\nimport { textureFromNamedImage } from '@combos-fun/plugin-renderer-3d';\nimport { createGeometry, geometryKey, materialKey } from './shapes';\nimport type { ResolvedPrimitive } from './shapes';\n\nclass RefCache<T> {\n private items = new Map<string, { value: T; refs: number }>();\n\n get(key: string): T | undefined {\n return this.items.get(key)?.value;\n }\n\n acquire(key: string, create: () => T): T {\n const hit = this.items.get(key);\n if (hit) {\n hit.refs += 1;\n return hit.value;\n }\n const value = create();\n this.items.set(key, { value, refs: 1 });\n return value;\n }\n\n release(key: string, dispose: (value: T) => void): void {\n const hit = this.items.get(key);\n if (!hit) return;\n hit.refs -= 1;\n if (hit.refs > 0) return;\n dispose(hit.value);\n this.items.delete(key);\n }\n\n clear(dispose: (value: T) => void): void {\n for (const hit of this.items.values()) {\n dispose(hit.value);\n }\n this.items.clear();\n }\n}\n\nexport class GeometryCache {\n private cache = new RefCache<BufferGeometry>();\n\n acquire(primitive: ResolvedPrimitive): { key: string; geometry: BufferGeometry } {\n const key = geometryKey(primitive);\n return { key, geometry: this.cache.acquire(key, () => createGeometry(primitive)) };\n }\n\n release(key: string): void {\n this.cache.release(key, (geometry) => geometry.dispose());\n }\n\n clear(): void {\n this.cache.clear((geometry) => geometry.dispose());\n }\n}\n\nclass TextureCache {\n private items = new Map<string, { texture: Texture; refs: number }>();\n private inflight = new Map<string, Promise<Texture>>();\n\n async acquire(name: string): Promise<Texture> {\n const hit = this.items.get(name);\n if (hit) {\n hit.refs += 1;\n return hit.texture;\n }\n let pending = this.inflight.get(name);\n if (!pending) {\n pending = textureFromNamedImage(name);\n this.inflight.set(name, pending);\n }\n const texture = await pending;\n this.inflight.delete(name);\n const existing = this.items.get(name);\n if (existing) {\n existing.refs += 1;\n return existing.texture;\n }\n this.items.set(name, { texture, refs: 1 });\n return texture;\n }\n\n release(name: string): void {\n if (!name) return;\n const hit = this.items.get(name);\n if (!hit) return;\n hit.refs -= 1;\n if (hit.refs > 0) return;\n hit.texture.dispose();\n this.items.delete(name);\n }\n\n clear(): void {\n for (const hit of this.items.values()) {\n hit.texture.dispose();\n }\n this.items.clear();\n this.inflight.clear();\n }\n}\n\nfunction createMaterial(p: ResolvedPrimitive, map: Texture | null): Material {\n const common = {\n color: p.color,\n wireframe: p.wireframe,\n transparent: p.opacity < 1 || !!map,\n opacity: p.opacity,\n side: p.doubleSide ? DoubleSide : FrontSide,\n map,\n };\n switch (p.material) {\n case 'basic':\n return new MeshBasicMaterial(common);\n case 'lambert':\n return new MeshLambertMaterial(common);\n case 'toon':\n return new MeshToonMaterial(common);\n case 'standard':\n default:\n return new MeshStandardMaterial({\n ...common,\n roughness: p.roughness,\n metalness: p.metalness,\n emissive: p.emissive,\n });\n }\n}\n\nexport class MaterialCache {\n private cache = new RefCache<Material>();\n private maps = new Map<string, string>();\n readonly textures = new TextureCache();\n\n async acquire(primitive: ResolvedPrimitive): Promise<{ key: string; material: Material }> {\n const key = materialKey(primitive);\n const hit = this.cache.get(key);\n if (hit) {\n this.cache.acquire(key, () => hit);\n return { key, material: hit };\n }\n const texture = primitive.map ? await this.textures.acquire(primitive.map) : null;\n const again = this.cache.get(key);\n if (again) {\n if (primitive.map) this.textures.release(primitive.map);\n this.cache.acquire(key, () => again);\n return { key, material: again };\n }\n const material = createMaterial(primitive, texture);\n this.cache.acquire(key, () => material);\n if (primitive.map) this.maps.set(key, primitive.map);\n return { key, material };\n }\n\n release(key: string): void {\n const mapName = this.maps.get(key);\n this.cache.release(key, (material) => {\n material.dispose();\n if (mapName) {\n this.textures.release(mapName);\n this.maps.delete(key);\n }\n });\n }\n\n clear(): void {\n this.cache.clear((material) => material.dispose());\n this.maps.clear();\n this.textures.clear();\n }\n}\n","import { decorators, ComponentChanged, OBSERVER_TYPE, GameObject } from '@combos-fun/engine';\nimport {\n Renderer3D,\n Renderer3DSystem,\n tagObject3D,\n Transform3D,\n VisualPoseBridge,\n} from '@combos-fun/plugin-renderer-3d';\nimport { Group, Mesh } from 'three';\nimport type { BufferGeometry, Material } from 'three';\nimport Graphics3D from './component';\nimport { GeometryCache, MaterialCache } from './resources';\nimport { poseKey, resolvePrimitive } from './shapes';\nimport type { ResolvedPrimitive } from './shapes';\n\ninterface PreparedPart {\n primitive: ResolvedPrimitive;\n geoKey: string;\n matKey: string;\n geometry: BufferGeometry;\n material: Material;\n}\n\ninterface Graphics3DEntry {\n group: Group;\n prepared: PreparedPart[];\n lastPose?: string;\n poseBridge: VisualPoseBridge;\n}\n\nconst POSE_PROPS = new Set([\n 'positionX', 'positionY', 'positionZ',\n 'rotationX', 'rotationY', 'rotationZ',\n 'scaleX', 'scaleY', 'scaleZ',\n]);\n\n@decorators.componentObserver({\n Graphics3D: [\n 'shape', 'color', 'wireframe',\n 'width', 'height', 'depth', 'radius', 'segments', 'tube',\n 'positionX', 'positionY', 'positionZ',\n 'rotationX', 'rotationY', 'rotationZ',\n 'scaleX', 'scaleY', 'scaleZ',\n 'opacity', 'roughness', 'metalness', 'emissive',\n 'map', 'doubleSide', 'material', 'parts',\n ],\n Transform: ['_parent'],\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 private geos = new GeometryCache();\n private mats = new MaterialCache();\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 === 'Transform') {\n this.threeContext.reparentGameObject(changed.gameObject);\n return;\n }\n if (changed.componentName !== 'Graphics3D') return;\n\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.mount(changed.gameObject, changed.component as Graphics3D);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.handleRemove(changed.gameObject.id);\n } else {\n const changedProp = changed.prop?.prop?.[0];\n if (POSE_PROPS.has(changedProp)) return;\n this.handleRemove(changed.gameObject.id);\n this.mount(changed.gameObject, changed.component as Graphics3D);\n }\n }\n\n rendererUpdate(gameObject: GameObject) {\n const component = gameObject.getComponent(Graphics3D) as Graphics3D;\n if (!component) return;\n const entry = this.entries.get(gameObject.id);\n if (!entry) return;\n\n const transform = gameObject.getComponent(Transform3D) as Transform3D | undefined;\n const applyVisualPose = entry.poseBridge.sync(component, transform);\n const next = poseKey(\n component.positionX, component.positionY, component.positionZ,\n component.rotationX, component.rotationY, component.rotationZ,\n component.scaleX, component.scaleY, component.scaleZ,\n );\n\n if (!applyVisualPose) {\n entry.lastPose = next;\n entry.group.position.set(0, 0, 0);\n entry.group.rotation.set(0, 0, 0);\n entry.group.scale.set(1, 1, 1);\n return;\n }\n\n if (entry.lastPose === next) return;\n entry.lastPose = next;\n entry.group.position.set(component.positionX, component.positionY, component.positionZ);\n entry.group.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n entry.group.scale.set(component.scaleX, component.scaleY, component.scaleZ);\n }\n\n private async mount(gameObject: GameObject, component: Graphics3D) {\n const asyncId = this.increaseAsyncId(gameObject.id);\n let prepared: PreparedPart[];\n try {\n prepared = await this.prepare(component);\n } catch (err) {\n console.error(`Graphics3D prepare failed for ${gameObject.name}`, err);\n return;\n }\n if (!this.validateAsyncId(gameObject.id, asyncId)) {\n this.releasePrepared(prepared);\n return;\n }\n this.attachGroup(gameObject, component, prepared);\n }\n\n private async prepare(component: Graphics3D): Promise<PreparedPart[]> {\n const specs = this.resolveParts(component);\n const prepared: PreparedPart[] = [];\n try {\n for (const primitive of specs) {\n const { key: geoKey, geometry } = this.geos.acquire(primitive);\n try {\n const { key: matKey, material } = await this.mats.acquire(primitive);\n prepared.push({ primitive, geoKey, matKey, geometry, material });\n } catch (err) {\n this.geos.release(geoKey);\n throw err;\n }\n }\n } catch (err) {\n this.releasePrepared(prepared);\n throw err;\n }\n return prepared;\n }\n\n private resolveParts(component: Graphics3D): ResolvedPrimitive[] {\n if (component.parts && component.parts.length > 0) {\n return component.parts.map((part) => resolvePrimitive(part, component));\n }\n return [resolvePrimitive(component)];\n }\n\n private attachGroup(\n gameObject: GameObject,\n component: Graphics3D,\n prepared: PreparedPart[],\n ) {\n const group = new Group();\n const shadows = !!this.threeContext.shadows;\n for (const part of prepared) {\n const mesh = new Mesh(part.geometry, part.material);\n mesh.position.set(part.primitive.positionX, part.primitive.positionY, part.primitive.positionZ);\n mesh.rotation.set(part.primitive.rotationX, part.primitive.rotationY, part.primitive.rotationZ);\n mesh.scale.set(part.primitive.scaleX, part.primitive.scaleY, part.primitive.scaleZ);\n mesh.castShadow = shadows;\n mesh.receiveShadow = shadows;\n group.add(mesh);\n }\n tagObject3D(group, gameObject.id);\n const transform = gameObject.getComponent(Transform3D) as Transform3D | undefined;\n const poseBridge = new VisualPoseBridge();\n const applyVisualPose = poseBridge.sync(component, transform);\n if (applyVisualPose) {\n group.position.set(component.positionX, component.positionY, component.positionZ);\n group.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n group.scale.set(component.scaleX, component.scaleY, component.scaleZ);\n } else {\n group.position.set(0, 0, 0);\n group.rotation.set(0, 0, 0);\n group.scale.set(1, 1, 1);\n }\n const lastPose = poseKey(\n component.positionX, component.positionY, component.positionZ,\n component.rotationX, component.rotationY, component.rotationZ,\n component.scaleX, component.scaleY, component.scaleZ,\n );\n this.threeContext.attachVisual(gameObject.id, group, gameObject);\n this.entries.set(gameObject.id, {\n group,\n prepared,\n lastPose,\n poseBridge,\n });\n }\n\n private releasePrepared(prepared: PreparedPart[]): void {\n for (const part of prepared) {\n this.geos.release(part.geoKey);\n this.mats.release(part.matKey);\n }\n }\n\n private handleRemove(id: number) {\n this.increaseAsyncId(id);\n const entry = this.entries.get(id);\n if (!entry) return;\n this.threeContext.detachVisual(id, entry.group);\n this.releasePrepared(entry.prepared);\n this.entries.delete(id);\n }\n\n onDestroy() {\n for (const [id] of this.entries) {\n this.handleRemove(id);\n }\n this.entries.clear();\n this.geos.clear();\n this.mats.clear();\n }\n}\n"],"names":["Component","__decorate","Field","SphereGeometry","CylinderGeometry","PlaneGeometry","ConeGeometry","TorusGeometry","CapsuleGeometry","BoxGeometry","textureFromNamedImage","DoubleSide","FrontSide","MeshBasicMaterial","MeshLambertMaterial","MeshToonMaterial","MeshStandardMaterial","Renderer3D","Renderer3DSystem","OBSERVER_TYPE","Transform3D","Group","Mesh","tagObject3D","VisualPoseBridge","decorators"],"mappings":";;;;;;;;AA8Cc,MAAO,UAAW,SAAQA,gBAA2B,CAAA;AAAnE,IAAA,WAAA,GAAA;;QAWE,IAAA,CAAA,KAAK,GAAW,KAAK;QASrB,IAAA,CAAA,KAAK,GAAW,QAAQ;QASxB,IAAA,CAAA,SAAS,GAAY,KAAK;QAU1B,IAAA,CAAA,KAAK,GAAW,CAAC;QAUjB,IAAA,CAAA,MAAM,GAAW,CAAC;QAUlB,IAAA,CAAA,KAAK,GAAW,CAAC;QAUjB,IAAA,CAAA,MAAM,GAAW,GAAG;QAUpB,IAAA,CAAA,QAAQ,GAAW,EAAE;QAUrB,IAAA,CAAA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;AAClC,QAAA,IAAI,CAAC,KAAK;YAAE;QACZ,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC;AAC/C,QAAA,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,QAAQ,CAAC;AACpC,QAAA,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IACzB;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;AACpB,QAAA,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;AACjB,QAAA,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;IACnB;;AA3KmB,gBAAgB,GAAAvB,gBAAA,CAAA;IAZpCwB,iBAAU,CAAC,iBAAiB,CAAC;AAC5B,QAAA,UAAU,EAAE;YACV,OAAO,EAAE,OAAO,EAAE,WAAW;YAC7B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM;YACxD,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,QAAQ,EAAE,QAAQ,EAAE,QAAQ;AAC5B,YAAA,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU;AAC/C,YAAA,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO;AACzC,SAAA;QACD,SAAS,EAAE,CAAC,SAAS,CAAC;KACvB;AACoB,CAAA,EAAA,gBAAgB,CA4KpC;+BA5KoB,gBAAgB;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin-renderer-3d-graphics.cjs.js","sources":["../lib/component.ts","../lib/shapes.ts","../lib/resources.ts","../lib/system.ts"],"sourcesContent":["import { Component } from '@combos-fun/engine';\nimport { Field } from '@combos-fun/inspector-decorator';\n\nexport type Graphics3DMaterialKind = 'standard' | 'basic' | 'lambert' | 'toon';\n\nexport type Graphics3DShape =\n | 'box'\n | 'sphere'\n | 'cylinder'\n | 'plane'\n | 'cone'\n | 'torus'\n | 'capsule';\n\nexport interface Graphics3DPartParams {\n shape?: Graphics3DShape | string;\n color?: number;\n wireframe?: boolean;\n width?: number;\n height?: number;\n depth?: number;\n radius?: number;\n segments?: number;\n tube?: 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 roughness?: number;\n metalness?: number;\n emissive?: number;\n map?: string;\n doubleSide?: boolean;\n material?: Graphics3DMaterialKind | string;\n}\n\nexport interface Graphics3DParams extends Graphics3DPartParams {\n parts?: Graphics3DPartParams[];\n}\n\nexport default class Graphics3D extends Component<Graphics3DParams> {\n static componentName: string = 'Graphics3D';\n\n @Field({\n type: 'string',\n group: 'Graphics3D',\n label: 'shape',\n description: 'Primitive shape kind.',\n editor: 'enum',\n enumOptions: ['box', 'sphere', 'cylinder', 'plane', 'cone', 'torus', 'capsule'],\n })\n shape: string = 'box';\n\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\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\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\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\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\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\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 = 12;\n\n @Field({\n type: 'number',\n step: 0.05,\n group: 'Graphics3D',\n label: 'tube',\n description: 'Torus tube radius. 0 means 0.4 × radius.',\n editor: 'number-stepper',\n })\n tube: number = 0;\n\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\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\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\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\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\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\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\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\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\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 @Field({\n type: 'number',\n step: 0.05,\n min: 0,\n max: 1,\n group: 'Graphics3D',\n label: 'roughness',\n description: 'PBR roughness (standard material).',\n editor: 'number-slider',\n })\n roughness: number = 1;\n\n @Field({\n type: 'number',\n step: 0.05,\n min: 0,\n max: 1,\n group: 'Graphics3D',\n label: 'metalness',\n description: 'PBR metalness (standard material).',\n editor: 'number-slider',\n })\n metalness: number = 0;\n\n @Field({\n type: 'number',\n group: 'Graphics3D',\n label: 'emissive',\n description: 'Emissive color (hex).',\n editor: 'number-stepper',\n })\n emissive: number = 0;\n\n @Field({\n type: 'string',\n group: 'Graphics3D',\n label: 'map',\n description: 'Named IMAGE resource used as a color map.',\n editor: 'text',\n })\n map: string = '';\n\n @Field({\n type: 'boolean',\n group: 'Graphics3D',\n label: 'doubleSide',\n description: 'Render both sides of the mesh.',\n editor: 'toggle',\n })\n doubleSide: boolean = false;\n\n @Field({\n type: 'string',\n group: 'Graphics3D',\n label: 'material',\n description: 'Surface shader.',\n editor: 'enum',\n enumOptions: ['standard', 'basic', 'lambert', 'toon'],\n })\n material: string = 'standard';\n\n parts: Graphics3DPartParams[] | undefined = undefined;\n\n init(obj?: Graphics3DParams) {\n if (obj) Object.assign(this, obj);\n }\n}\n","import {\n BoxGeometry,\n SphereGeometry,\n CylinderGeometry,\n PlaneGeometry,\n ConeGeometry,\n TorusGeometry,\n CapsuleGeometry,\n} from 'three';\nimport type { BufferGeometry } from 'three';\nimport type { Graphics3DPartParams } from './component';\n\nexport interface ResolvedPrimitive {\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 tube: 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 roughness: number;\n metalness: number;\n emissive: number;\n map: string;\n doubleSide: boolean;\n material: string;\n}\n\nexport function torusTube(radius: number, tube?: number): number {\n return tube && tube > 0 ? tube : radius * 0.4;\n}\n\nexport function resolvePrimitive(\n part: Graphics3DPartParams,\n fallback?: Graphics3DPartParams,\n): ResolvedPrimitive {\n const src = { ...fallback, ...part };\n const radius = src.radius ?? 0.5;\n return {\n shape: src.shape || 'box',\n color: src.color ?? 0x00ff00,\n wireframe: !!src.wireframe,\n width: src.width ?? 1,\n height: src.height ?? 1,\n depth: src.depth ?? 1,\n radius,\n segments: Math.max(3, Math.round(src.segments ?? 12)),\n tube: torusTube(radius, src.tube),\n positionX: src.positionX ?? 0,\n positionY: src.positionY ?? 0,\n positionZ: src.positionZ ?? 0,\n rotationX: src.rotationX ?? 0,\n rotationY: src.rotationY ?? 0,\n rotationZ: src.rotationZ ?? 0,\n scaleX: src.scaleX ?? 1,\n scaleY: src.scaleY ?? 1,\n scaleZ: src.scaleZ ?? 1,\n opacity: src.opacity ?? 1,\n roughness: src.roughness ?? 1,\n metalness: src.metalness ?? 0,\n emissive: src.emissive ?? 0,\n map: src.map || '',\n doubleSide: !!src.doubleSide,\n material: src.material || 'standard',\n };\n}\n\nexport function geometryKey(p: ResolvedPrimitive): string {\n switch (p.shape) {\n case 'sphere':\n return `sphere:${p.radius}:${p.segments}`;\n case 'cylinder':\n return `cylinder:${p.radius}:${p.height}:${p.segments}`;\n case 'cone':\n return `cone:${p.radius}:${p.height}:${p.segments}`;\n case 'plane':\n return `plane:${p.width}:${p.height}:${p.segments}`;\n case 'torus':\n return `torus:${p.radius}:${p.tube}:${p.segments}`;\n case 'capsule':\n return `capsule:${p.radius}:${p.height}:${p.segments}`;\n case 'box':\n default:\n return `box:${p.width}:${p.height}:${p.depth}`;\n }\n}\n\nexport function createGeometry(p: ResolvedPrimitive): BufferGeometry {\n const segs = p.segments;\n switch (p.shape) {\n case 'sphere':\n return new SphereGeometry(p.radius, segs, segs);\n case 'cylinder':\n return new CylinderGeometry(p.radius, p.radius, p.height, segs);\n case 'plane':\n return new PlaneGeometry(p.width, p.height, segs, segs);\n case 'cone':\n return new ConeGeometry(p.radius, p.height, segs);\n case 'torus':\n return new TorusGeometry(p.radius, p.tube, 8, segs);\n case 'capsule': {\n const length = Math.max(0, p.height - 2 * p.radius);\n return new CapsuleGeometry(p.radius, length, 4, segs);\n }\n case 'box':\n default:\n return new BoxGeometry(p.width, p.height, p.depth);\n }\n}\n\nexport function materialKey(p: ResolvedPrimitive): string {\n return [\n p.material,\n p.color,\n p.wireframe ? 1 : 0,\n p.opacity,\n p.roughness,\n p.metalness,\n p.emissive,\n p.map,\n p.doubleSide ? 1 : 0,\n ].join(':');\n}\n\nexport function poseKey(\n px: number, py: number, pz: number,\n rx: number, ry: number, rz: number,\n sx: number, sy: number, sz: number,\n): string {\n return `${px},${py},${pz},${rx},${ry},${rz},${sx},${sy},${sz}`;\n}\n","import {\n DoubleSide,\n FrontSide,\n MeshBasicMaterial,\n MeshLambertMaterial,\n MeshStandardMaterial,\n MeshToonMaterial,\n} from 'three';\nimport type { BufferGeometry, Material, Texture } from 'three';\nimport { textureFromNamedImage } from '@combos-fun/plugin-renderer-3d';\nimport { createGeometry, geometryKey, materialKey } from './shapes';\nimport type { ResolvedPrimitive } from './shapes';\n\nclass RefCache<T> {\n private items = new Map<string, { value: T; refs: number }>();\n\n get(key: string): T | undefined {\n return this.items.get(key)?.value;\n }\n\n acquire(key: string, create: () => T): T {\n const hit = this.items.get(key);\n if (hit) {\n hit.refs += 1;\n return hit.value;\n }\n const value = create();\n this.items.set(key, { value, refs: 1 });\n return value;\n }\n\n release(key: string, dispose: (value: T) => void): void {\n const hit = this.items.get(key);\n if (!hit) return;\n hit.refs -= 1;\n if (hit.refs > 0) return;\n dispose(hit.value);\n this.items.delete(key);\n }\n\n clear(dispose: (value: T) => void): void {\n for (const hit of this.items.values()) {\n dispose(hit.value);\n }\n this.items.clear();\n }\n}\n\nexport class GeometryCache {\n private cache = new RefCache<BufferGeometry>();\n\n acquire(primitive: ResolvedPrimitive): { key: string; geometry: BufferGeometry } {\n const key = geometryKey(primitive);\n return { key, geometry: this.cache.acquire(key, () => createGeometry(primitive)) };\n }\n\n release(key: string): void {\n this.cache.release(key, (geometry) => geometry.dispose());\n }\n\n clear(): void {\n this.cache.clear((geometry) => geometry.dispose());\n }\n}\n\nclass TextureCache {\n private items = new Map<string, { texture: Texture; refs: number }>();\n private inflight = new Map<string, Promise<Texture>>();\n\n async acquire(name: string): Promise<Texture> {\n const hit = this.items.get(name);\n if (hit) {\n hit.refs += 1;\n return hit.texture;\n }\n let pending = this.inflight.get(name);\n if (!pending) {\n pending = textureFromNamedImage(name);\n this.inflight.set(name, pending);\n }\n const texture = await pending;\n this.inflight.delete(name);\n const existing = this.items.get(name);\n if (existing) {\n existing.refs += 1;\n return existing.texture;\n }\n this.items.set(name, { texture, refs: 1 });\n return texture;\n }\n\n release(name: string): void {\n if (!name) return;\n const hit = this.items.get(name);\n if (!hit) return;\n hit.refs -= 1;\n if (hit.refs > 0) return;\n hit.texture.dispose();\n this.items.delete(name);\n }\n\n clear(): void {\n for (const hit of this.items.values()) {\n hit.texture.dispose();\n }\n this.items.clear();\n this.inflight.clear();\n }\n}\n\nfunction createMaterial(p: ResolvedPrimitive, map: Texture | null): Material {\n const common = {\n color: p.color,\n wireframe: p.wireframe,\n transparent: p.opacity < 1 || !!map,\n opacity: p.opacity,\n side: p.doubleSide ? DoubleSide : FrontSide,\n map,\n };\n switch (p.material) {\n case 'basic':\n return new MeshBasicMaterial(common);\n case 'lambert':\n return new MeshLambertMaterial(common);\n case 'toon':\n return new MeshToonMaterial(common);\n case 'standard':\n default:\n return new MeshStandardMaterial({\n ...common,\n roughness: p.roughness,\n metalness: p.metalness,\n emissive: p.emissive,\n });\n }\n}\n\nexport class MaterialCache {\n private cache = new RefCache<Material>();\n private maps = new Map<string, string>();\n readonly textures = new TextureCache();\n\n async acquire(primitive: ResolvedPrimitive): Promise<{ key: string; material: Material }> {\n const key = materialKey(primitive);\n const hit = this.cache.get(key);\n if (hit) {\n this.cache.acquire(key, () => hit);\n return { key, material: hit };\n }\n const texture = primitive.map ? await this.textures.acquire(primitive.map) : null;\n const again = this.cache.get(key);\n if (again) {\n if (primitive.map) this.textures.release(primitive.map);\n this.cache.acquire(key, () => again);\n return { key, material: again };\n }\n const material = createMaterial(primitive, texture);\n this.cache.acquire(key, () => material);\n if (primitive.map) this.maps.set(key, primitive.map);\n return { key, material };\n }\n\n release(key: string): void {\n const mapName = this.maps.get(key);\n this.cache.release(key, (material) => {\n material.dispose();\n if (mapName) {\n this.textures.release(mapName);\n this.maps.delete(key);\n }\n });\n }\n\n clear(): void {\n this.cache.clear((material) => material.dispose());\n this.maps.clear();\n this.textures.clear();\n }\n}\n","import { decorators, ComponentChanged, OBSERVER_TYPE, GameObject } from '@combos-fun/engine';\nimport {\n Renderer3D,\n Renderer3DSystem,\n tagObject3D,\n Transform3D,\n VisualPoseBridge,\n} from '@combos-fun/plugin-renderer-3d';\nimport { Group, Mesh } from 'three';\nimport type { BufferGeometry, Material } from 'three';\nimport Graphics3D from './component';\nimport { GeometryCache, MaterialCache } from './resources';\nimport { poseKey, resolvePrimitive } from './shapes';\nimport type { ResolvedPrimitive } from './shapes';\n\ninterface PreparedPart {\n primitive: ResolvedPrimitive;\n geoKey: string;\n matKey: string;\n geometry: BufferGeometry;\n material: Material;\n}\n\ninterface Graphics3DEntry {\n group: Group;\n prepared: PreparedPart[];\n lastPose?: string;\n poseBridge: VisualPoseBridge;\n}\n\nconst POSE_PROPS = new Set([\n 'positionX', 'positionY', 'positionZ',\n 'rotationX', 'rotationY', 'rotationZ',\n 'scaleX', 'scaleY', 'scaleZ',\n]);\n\n@decorators.componentObserver({\n Graphics3D: [\n 'shape', 'color', 'wireframe',\n 'width', 'height', 'depth', 'radius', 'segments', 'tube',\n 'positionX', 'positionY', 'positionZ',\n 'rotationX', 'rotationY', 'rotationZ',\n 'scaleX', 'scaleY', 'scaleZ',\n 'opacity', 'roughness', 'metalness', 'emissive',\n 'map', 'doubleSide', 'material', 'parts',\n ],\n GameObject: ['parent'],\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 private geos = new GeometryCache();\n private mats = new MaterialCache();\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 === 'GameObject') {\n this.threeContext.reparentGameObject(changed.gameObject);\n return;\n }\n if (changed.componentName !== 'Graphics3D') return;\n\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.mount(changed.gameObject, changed.component as Graphics3D);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.handleRemove(changed.gameObject.id);\n } else {\n const changedProp = changed.prop?.prop?.[0];\n if (POSE_PROPS.has(changedProp)) return;\n this.handleRemove(changed.gameObject.id);\n this.mount(changed.gameObject, changed.component as Graphics3D);\n }\n }\n\n rendererUpdate(gameObject: GameObject) {\n const component = gameObject.getComponent(Graphics3D) as Graphics3D;\n if (!component) return;\n const entry = this.entries.get(gameObject.id);\n if (!entry) return;\n\n const transform = gameObject.getComponent(Transform3D) as Transform3D | undefined;\n const applyVisualPose = entry.poseBridge.sync(component, transform);\n const next = poseKey(\n component.positionX, component.positionY, component.positionZ,\n component.rotationX, component.rotationY, component.rotationZ,\n component.scaleX, component.scaleY, component.scaleZ,\n );\n\n if (!applyVisualPose) {\n entry.lastPose = next;\n entry.group.position.set(0, 0, 0);\n entry.group.rotation.set(0, 0, 0);\n entry.group.scale.set(1, 1, 1);\n return;\n }\n\n if (entry.lastPose === next) return;\n entry.lastPose = next;\n entry.group.position.set(component.positionX, component.positionY, component.positionZ);\n entry.group.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n entry.group.scale.set(component.scaleX, component.scaleY, component.scaleZ);\n }\n\n private async mount(gameObject: GameObject, component: Graphics3D) {\n const asyncId = this.increaseAsyncId(gameObject.id);\n let prepared: PreparedPart[];\n try {\n prepared = await this.prepare(component);\n } catch (err) {\n console.error(`Graphics3D prepare failed for ${gameObject.name}`, err);\n return;\n }\n if (!this.validateAsyncId(gameObject.id, asyncId)) {\n this.releasePrepared(prepared);\n return;\n }\n this.attachGroup(gameObject, component, prepared);\n }\n\n private async prepare(component: Graphics3D): Promise<PreparedPart[]> {\n const specs = this.resolveParts(component);\n const prepared: PreparedPart[] = [];\n try {\n for (const primitive of specs) {\n const { key: geoKey, geometry } = this.geos.acquire(primitive);\n try {\n const { key: matKey, material } = await this.mats.acquire(primitive);\n prepared.push({ primitive, geoKey, matKey, geometry, material });\n } catch (err) {\n this.geos.release(geoKey);\n throw err;\n }\n }\n } catch (err) {\n this.releasePrepared(prepared);\n throw err;\n }\n return prepared;\n }\n\n private resolveParts(component: Graphics3D): ResolvedPrimitive[] {\n if (component.parts && component.parts.length > 0) {\n return component.parts.map((part) => resolvePrimitive(part, component));\n }\n return [resolvePrimitive(component)];\n }\n\n private attachGroup(\n gameObject: GameObject,\n component: Graphics3D,\n prepared: PreparedPart[],\n ) {\n const group = new Group();\n const shadows = !!this.threeContext.shadows;\n for (const part of prepared) {\n const mesh = new Mesh(part.geometry, part.material);\n mesh.position.set(part.primitive.positionX, part.primitive.positionY, part.primitive.positionZ);\n mesh.rotation.set(part.primitive.rotationX, part.primitive.rotationY, part.primitive.rotationZ);\n mesh.scale.set(part.primitive.scaleX, part.primitive.scaleY, part.primitive.scaleZ);\n mesh.castShadow = shadows;\n mesh.receiveShadow = shadows;\n group.add(mesh);\n }\n tagObject3D(group, gameObject.id);\n const transform = gameObject.getComponent(Transform3D) as Transform3D | undefined;\n const poseBridge = new VisualPoseBridge();\n const applyVisualPose = poseBridge.sync(component, transform);\n if (applyVisualPose) {\n group.position.set(component.positionX, component.positionY, component.positionZ);\n group.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n group.scale.set(component.scaleX, component.scaleY, component.scaleZ);\n } else {\n group.position.set(0, 0, 0);\n group.rotation.set(0, 0, 0);\n group.scale.set(1, 1, 1);\n }\n const lastPose = poseKey(\n component.positionX, component.positionY, component.positionZ,\n component.rotationX, component.rotationY, component.rotationZ,\n component.scaleX, component.scaleY, component.scaleZ,\n );\n this.threeContext.attachVisual(gameObject.id, group, gameObject);\n this.entries.set(gameObject.id, {\n group,\n prepared,\n lastPose,\n poseBridge,\n });\n }\n\n private releasePrepared(prepared: PreparedPart[]): void {\n for (const part of prepared) {\n this.geos.release(part.geoKey);\n this.mats.release(part.matKey);\n }\n }\n\n private handleRemove(id: number) {\n this.increaseAsyncId(id);\n const entry = this.entries.get(id);\n if (!entry) return;\n this.threeContext.detachVisual(id, entry.group);\n this.releasePrepared(entry.prepared);\n this.entries.delete(id);\n }\n\n onDestroy() {\n for (const [id] of this.entries) {\n this.handleRemove(id);\n }\n this.entries.clear();\n this.geos.clear();\n this.mats.clear();\n }\n}\n"],"names":["Component","__decorate","Field","SphereGeometry","CylinderGeometry","PlaneGeometry","ConeGeometry","TorusGeometry","CapsuleGeometry","BoxGeometry","textureFromNamedImage","DoubleSide","FrontSide","MeshBasicMaterial","MeshLambertMaterial","MeshToonMaterial","MeshStandardMaterial","Renderer3D","Renderer3DSystem","OBSERVER_TYPE","Transform3D","Group","Mesh","tagObject3D","VisualPoseBridge","decorators"],"mappings":";;;;;;;;AA8Cc,MAAO,UAAW,SAAQA,gBAA2B,CAAA;AAAnE,IAAA,WAAA,GAAA;;QAWE,IAAA,CAAA,KAAK,GAAW,KAAK;QASrB,IAAA,CAAA,KAAK,GAAW,QAAQ;QASxB,IAAA,CAAA,SAAS,GAAY,KAAK;QAU1B,IAAA,CAAA,KAAK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A4KpC;+BA5KoB,gBAAgB;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),t=require("@combos-fun/engine"),s=require("@combos-fun/inspector-decorator"),i=require("@combos-fun/plugin-renderer-3d"),r=require("three");class o 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=12,this.tube=0,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,this.roughness=1,this.metalness=0,this.emissive=0,this.map="",this.doubleSide=!1,this.material="standard",this.parts=void 0}static{this.componentName="Graphics3D"}init(e){e&&Object.assign(this,e)}}function a(e,t){return t&&t>0?t:.4*e}function n(e,t){const s={...t,...e},i=s.radius??.5;return{shape:s.shape||"box",color:s.color??65280,wireframe:!!s.wireframe,width:s.width??1,height:s.height??1,depth:s.depth??1,radius:i,segments:Math.max(3,Math.round(s.segments??12)),tube:a(i,s.tube),positionX:s.positionX??0,positionY:s.positionY??0,positionZ:s.positionZ??0,rotationX:s.rotationX??0,rotationY:s.rotationY??0,rotationZ:s.rotationZ??0,scaleX:s.scaleX??1,scaleY:s.scaleY??1,scaleZ:s.scaleZ??1,opacity:s.opacity??1,roughness:s.roughness??1,metalness:s.metalness??0,emissive:s.emissive??0,map:s.map||"",doubleSide:!!s.doubleSide,material:s.material||"standard"}}function p(e,t,s,i,r,o,a,n,p){return`${e},${t},${s},${i},${r},${o},${a},${n},${p}`}e.__decorate([s.Field({type:"string",group:"Graphics3D",label:"shape",description:"Primitive shape kind.",editor:"enum",enumOptions:["box","sphere","cylinder","plane","cone","torus","capsule"]})],o.prototype,"shape",void 0),e.__decorate([s.Field({type:"number",group:"Graphics3D",label:"color",description:"Color value.",editor:"number-stepper"})],o.prototype,"color",void 0),e.__decorate([s.Field({type:"boolean",group:"Graphics3D",label:"wireframe",description:"Draw as wireframe.",editor:"toggle"})],o.prototype,"wireframe",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Graphics3D",label:"width",description:"Width.",editor:"number-stepper"})],o.prototype,"width",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Graphics3D",label:"height",description:"Height.",editor:"number-stepper"})],o.prototype,"height",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Graphics3D",label:"depth",description:"Depth.",editor:"number-stepper"})],o.prototype,"depth",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Graphics3D",label:"radius",description:"Radius.",editor:"number-stepper"})],o.prototype,"radius",void 0),e.__decorate([s.Field({type:"number",step:1,group:"Graphics3D",label:"segments",description:"Mesh segment count.",editor:"number-stepper"})],o.prototype,"segments",void 0),e.__decorate([s.Field({type:"number",step:.05,group:"Graphics3D",label:"tube",description:"Torus tube radius. 0 means 0.4 × radius.",editor:"number-stepper"})],o.prototype,"tube",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Graphics3D",label:"positionX",description:"Local X position.",editor:"number-stepper"})],o.prototype,"positionX",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Graphics3D",label:"positionY",description:"Local Y position.",editor:"number-stepper"})],o.prototype,"positionY",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Graphics3D",label:"positionZ",description:"Local Z position.",editor:"number-stepper"})],o.prototype,"positionZ",void 0),e.__decorate([s.Field({type:"number",step:.01,group:"Graphics3D",label:"rotationX",description:"Rotation around X in radians.",editor:"number-stepper"})],o.prototype,"rotationX",void 0),e.__decorate([s.Field({type:"number",step:.01,group:"Graphics3D",label:"rotationY",description:"Rotation around Y in radians.",editor:"number-stepper"})],o.prototype,"rotationY",void 0),e.__decorate([s.Field({type:"number",step:.01,group:"Graphics3D",label:"rotationZ",description:"Rotation around Z in radians.",editor:"number-stepper"})],o.prototype,"rotationZ",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Graphics3D",label:"scaleX",description:"Scale on X.",editor:"number-stepper"})],o.prototype,"scaleX",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Graphics3D",label:"scaleY",description:"Scale on Y.",editor:"number-stepper"})],o.prototype,"scaleY",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Graphics3D",label:"scaleZ",description:"Scale on Z.",editor:"number-stepper"})],o.prototype,"scaleZ",void 0),e.__decorate([s.Field({type:"number",step:.01,min:0,max:1,group:"Graphics3D",label:"opacity",description:"Opacity from 0 to 1.",editor:"number-slider"})],o.prototype,"opacity",void 0),e.__decorate([s.Field({type:"number",step:.05,min:0,max:1,group:"Graphics3D",label:"roughness",description:"PBR roughness (standard material).",editor:"number-slider"})],o.prototype,"roughness",void 0),e.__decorate([s.Field({type:"number",step:.05,min:0,max:1,group:"Graphics3D",label:"metalness",description:"PBR metalness (standard material).",editor:"number-slider"})],o.prototype,"metalness",void 0),e.__decorate([s.Field({type:"number",group:"Graphics3D",label:"emissive",description:"Emissive color (hex).",editor:"number-stepper"})],o.prototype,"emissive",void 0),e.__decorate([s.Field({type:"string",group:"Graphics3D",label:"map",description:"Named IMAGE resource used as a color map.",editor:"text"})],o.prototype,"map",void 0),e.__decorate([s.Field({type:"boolean",group:"Graphics3D",label:"doubleSide",description:"Render both sides of the mesh.",editor:"toggle"})],o.prototype,"doubleSide",void 0),e.__decorate([s.Field({type:"string",group:"Graphics3D",label:"material",description:"Surface shader.",editor:"enum",enumOptions:["standard","basic","lambert","toon"]})],o.prototype,"material",void 0);class c{constructor(){this.items=new Map}get(e){return this.items.get(e)?.value}acquire(e,t){const s=this.items.get(e);if(s)return s.refs+=1,s.value;const i=t();return this.items.set(e,{value:i,refs:1}),i}release(e,t){const s=this.items.get(e);s&&(s.refs-=1,s.refs>0||(t(s.value),this.items.delete(e)))}clear(e){for(const t of this.items.values())e(t.value);this.items.clear()}}class d{constructor(){this.cache=new c}acquire(e){const t=function(e){switch(e.shape){case"sphere":return`sphere:${e.radius}:${e.segments}`;case"cylinder":return`cylinder:${e.radius}:${e.height}:${e.segments}`;case"cone":return`cone:${e.radius}:${e.height}:${e.segments}`;case"plane":return`plane:${e.width}:${e.height}:${e.segments}`;case"torus":return`torus:${e.radius}:${e.tube}:${e.segments}`;case"capsule":return`capsule:${e.radius}:${e.height}:${e.segments}`;default:return`box:${e.width}:${e.height}:${e.depth}`}}(e);return{key:t,geometry:this.cache.acquire(t,()=>function(e){const t=e.segments;switch(e.shape){case"sphere":return new r.SphereGeometry(e.radius,t,t);case"cylinder":return new r.CylinderGeometry(e.radius,e.radius,e.height,t);case"plane":return new r.PlaneGeometry(e.width,e.height,t,t);case"cone":return new r.ConeGeometry(e.radius,e.height,t);case"torus":return new r.TorusGeometry(e.radius,e.tube,8,t);case"capsule":{const s=Math.max(0,e.height-2*e.radius);return new r.CapsuleGeometry(e.radius,s,4,t)}default:return new r.BoxGeometry(e.width,e.height,e.depth)}}(e))}}release(e){this.cache.release(e,e=>e.dispose())}clear(){this.cache.clear(e=>e.dispose())}}class l{constructor(){this.items=new Map,this.inflight=new Map}async acquire(e){const t=this.items.get(e);if(t)return t.refs+=1,t.texture;let s=this.inflight.get(e);s||(s=i.textureFromNamedImage(e),this.inflight.set(e,s));const r=await s;this.inflight.delete(e);const o=this.items.get(e);return o?(o.refs+=1,o.texture):(this.items.set(e,{texture:r,refs:1}),r)}release(e){if(!e)return;const t=this.items.get(e);t&&(t.refs-=1,t.refs>0||(t.texture.dispose(),this.items.delete(e)))}clear(){for(const e of this.items.values())e.texture.dispose();this.items.clear(),this.inflight.clear()}}class h{constructor(){this.cache=new c,this.maps=new Map,this.textures=new l}async acquire(e){const t=[(s=e).material,s.color,s.wireframe?1:0,s.opacity,s.roughness,s.metalness,s.emissive,s.map,s.doubleSide?1:0].join(":");var s;const i=this.cache.get(t);if(i)return this.cache.acquire(t,()=>i),{key:t,material:i};const o=e.map?await this.textures.acquire(e.map):null,a=this.cache.get(t);if(a)return e.map&&this.textures.release(e.map),this.cache.acquire(t,()=>a),{key:t,material:a};const n=function(e,t){const s={color:e.color,wireframe:e.wireframe,transparent:e.opacity<1||!!t,opacity:e.opacity,side:e.doubleSide?r.DoubleSide:r.FrontSide,map:t};switch(e.material){case"basic":return new r.MeshBasicMaterial(s);case"lambert":return new r.MeshLambertMaterial(s);case"toon":return new r.MeshToonMaterial(s);default:return new r.MeshStandardMaterial({...s,roughness:e.roughness,metalness:e.metalness,emissive:e.emissive})}}(e,o);return this.cache.acquire(t,()=>n),e.map&&this.maps.set(t,e.map),{key:t,material:n}}release(e){const t=this.maps.get(e);this.cache.release(e,s=>{s.dispose(),t&&(this.textures.release(t),this.maps.delete(e))})}clear(){this.cache.clear(e=>e.dispose()),this.maps.clear(),this.textures.clear()}}const u=new Set(["positionX","positionY","positionZ","rotationX","rotationY","rotationZ","scaleX","scaleY","scaleZ"]);let m=class extends i.Renderer3D{constructor(){super(...arguments),this.name="Graphics3DSystem",this.entries=new Map,this.geos=new d,this.mats=new h}static{this.systemName="Graphics3DSystem"}init(){this.game.getSystem(i.Renderer3DSystem).rendererManager.register(this)}componentChanged(e){if("Transform"!==e.componentName){if("Graphics3D"===e.componentName)if(e.type===t.OBSERVER_TYPE.ADD)this.mount(e.gameObject,e.component);else if(e.type===t.OBSERVER_TYPE.REMOVE)this.handleRemove(e.gameObject.id);else{const t=e.prop?.prop?.[0];if(u.has(t))return;this.handleRemove(e.gameObject.id),this.mount(e.gameObject,e.component)}}else this.threeContext.reparentGameObject(e.gameObject)}rendererUpdate(e){const t=e.getComponent(o);if(!t)return;const s=this.entries.get(e.id);if(!s)return;const r=e.getComponent(i.Transform3D),a=s.poseBridge.sync(t,r),n=p(t.positionX,t.positionY,t.positionZ,t.rotationX,t.rotationY,t.rotationZ,t.scaleX,t.scaleY,t.scaleZ);if(!a)return s.lastPose=n,s.group.position.set(0,0,0),s.group.rotation.set(0,0,0),void s.group.scale.set(1,1,1);s.lastPose!==n&&(s.lastPose=n,s.group.position.set(t.positionX,t.positionY,t.positionZ),s.group.rotation.set(t.rotationX,t.rotationY,t.rotationZ),s.group.scale.set(t.scaleX,t.scaleY,t.scaleZ))}async mount(e,t){const s=this.increaseAsyncId(e.id);let i;try{i=await this.prepare(t)}catch(t){return void console.error(`Graphics3D prepare failed for ${e.name}`,t)}this.validateAsyncId(e.id,s)?this.attachGroup(e,t,i):this.releasePrepared(i)}async prepare(e){const t=this.resolveParts(e),s=[];try{for(const e of t){const{key:t,geometry:i}=this.geos.acquire(e);try{const{key:r,material:o}=await this.mats.acquire(e);s.push({primitive:e,geoKey:t,matKey:r,geometry:i,material:o})}catch(e){throw this.geos.release(t),e}}}catch(e){throw this.releasePrepared(s),e}return s}resolveParts(e){return e.parts&&e.parts.length>0?e.parts.map(t=>n(t,e)):[n(e)]}attachGroup(e,t,s){const o=new r.Group,a=!!this.threeContext.shadows;for(const e of s){const t=new r.Mesh(e.geometry,e.material);t.position.set(e.primitive.positionX,e.primitive.positionY,e.primitive.positionZ),t.rotation.set(e.primitive.rotationX,e.primitive.rotationY,e.primitive.rotationZ),t.scale.set(e.primitive.scaleX,e.primitive.scaleY,e.primitive.scaleZ),t.castShadow=a,t.receiveShadow=a,o.add(t)}i.tagObject3D(o,e.id);const n=e.getComponent(i.Transform3D),c=new i.VisualPoseBridge;c.sync(t,n)?(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)):(o.position.set(0,0,0),o.rotation.set(0,0,0),o.scale.set(1,1,1));const d=p(t.positionX,t.positionY,t.positionZ,t.rotationX,t.rotationY,t.rotationZ,t.scaleX,t.scaleY,t.scaleZ);this.threeContext.attachVisual(e.id,o,e),this.entries.set(e.id,{group:o,prepared:s,lastPose:d,poseBridge:c})}releasePrepared(e){for(const t of e)this.geos.release(t.geoKey),this.mats.release(t.matKey)}handleRemove(e){this.increaseAsyncId(e);const t=this.entries.get(e);t&&(this.threeContext.detachVisual(e,t.group),this.releasePrepared(t.prepared),this.entries.delete(e))}onDestroy(){for(const[e]of this.entries)this.handleRemove(e);this.entries.clear(),this.geos.clear(),this.mats.clear()}};m=e.__decorate([t.decorators.componentObserver({Graphics3D:["shape","color","wireframe","width","height","depth","radius","segments","tube","positionX","positionY","positionZ","rotationX","rotationY","rotationZ","scaleX","scaleY","scaleZ","opacity","roughness","metalness","emissive","map","doubleSide","material","parts"],Transform:["_parent"]})],m);var g=m;exports.Graphics3D=o,exports.Graphics3DSystem=g;
|
|
1
|
+
"use strict";var e=require("tslib"),t=require("@combos-fun/engine"),s=require("@combos-fun/inspector-decorator"),i=require("@combos-fun/plugin-renderer-3d"),r=require("three");class o 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=12,this.tube=0,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,this.roughness=1,this.metalness=0,this.emissive=0,this.map="",this.doubleSide=!1,this.material="standard",this.parts=void 0}static{this.componentName="Graphics3D"}init(e){e&&Object.assign(this,e)}}function a(e,t){return t&&t>0?t:.4*e}function n(e,t){const s={...t,...e},i=s.radius??.5;return{shape:s.shape||"box",color:s.color??65280,wireframe:!!s.wireframe,width:s.width??1,height:s.height??1,depth:s.depth??1,radius:i,segments:Math.max(3,Math.round(s.segments??12)),tube:a(i,s.tube),positionX:s.positionX??0,positionY:s.positionY??0,positionZ:s.positionZ??0,rotationX:s.rotationX??0,rotationY:s.rotationY??0,rotationZ:s.rotationZ??0,scaleX:s.scaleX??1,scaleY:s.scaleY??1,scaleZ:s.scaleZ??1,opacity:s.opacity??1,roughness:s.roughness??1,metalness:s.metalness??0,emissive:s.emissive??0,map:s.map||"",doubleSide:!!s.doubleSide,material:s.material||"standard"}}function p(e,t,s,i,r,o,a,n,p){return`${e},${t},${s},${i},${r},${o},${a},${n},${p}`}e.__decorate([s.Field({type:"string",group:"Graphics3D",label:"shape",description:"Primitive shape kind.",editor:"enum",enumOptions:["box","sphere","cylinder","plane","cone","torus","capsule"]})],o.prototype,"shape",void 0),e.__decorate([s.Field({type:"number",group:"Graphics3D",label:"color",description:"Color value.",editor:"number-stepper"})],o.prototype,"color",void 0),e.__decorate([s.Field({type:"boolean",group:"Graphics3D",label:"wireframe",description:"Draw as wireframe.",editor:"toggle"})],o.prototype,"wireframe",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Graphics3D",label:"width",description:"Width.",editor:"number-stepper"})],o.prototype,"width",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Graphics3D",label:"height",description:"Height.",editor:"number-stepper"})],o.prototype,"height",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Graphics3D",label:"depth",description:"Depth.",editor:"number-stepper"})],o.prototype,"depth",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Graphics3D",label:"radius",description:"Radius.",editor:"number-stepper"})],o.prototype,"radius",void 0),e.__decorate([s.Field({type:"number",step:1,group:"Graphics3D",label:"segments",description:"Mesh segment count.",editor:"number-stepper"})],o.prototype,"segments",void 0),e.__decorate([s.Field({type:"number",step:.05,group:"Graphics3D",label:"tube",description:"Torus tube radius. 0 means 0.4 × radius.",editor:"number-stepper"})],o.prototype,"tube",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Graphics3D",label:"positionX",description:"Local X position.",editor:"number-stepper"})],o.prototype,"positionX",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Graphics3D",label:"positionY",description:"Local Y position.",editor:"number-stepper"})],o.prototype,"positionY",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Graphics3D",label:"positionZ",description:"Local Z position.",editor:"number-stepper"})],o.prototype,"positionZ",void 0),e.__decorate([s.Field({type:"number",step:.01,group:"Graphics3D",label:"rotationX",description:"Rotation around X in radians.",editor:"number-stepper"})],o.prototype,"rotationX",void 0),e.__decorate([s.Field({type:"number",step:.01,group:"Graphics3D",label:"rotationY",description:"Rotation around Y in radians.",editor:"number-stepper"})],o.prototype,"rotationY",void 0),e.__decorate([s.Field({type:"number",step:.01,group:"Graphics3D",label:"rotationZ",description:"Rotation around Z in radians.",editor:"number-stepper"})],o.prototype,"rotationZ",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Graphics3D",label:"scaleX",description:"Scale on X.",editor:"number-stepper"})],o.prototype,"scaleX",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Graphics3D",label:"scaleY",description:"Scale on Y.",editor:"number-stepper"})],o.prototype,"scaleY",void 0),e.__decorate([s.Field({type:"number",step:.1,group:"Graphics3D",label:"scaleZ",description:"Scale on Z.",editor:"number-stepper"})],o.prototype,"scaleZ",void 0),e.__decorate([s.Field({type:"number",step:.01,min:0,max:1,group:"Graphics3D",label:"opacity",description:"Opacity from 0 to 1.",editor:"number-slider"})],o.prototype,"opacity",void 0),e.__decorate([s.Field({type:"number",step:.05,min:0,max:1,group:"Graphics3D",label:"roughness",description:"PBR roughness (standard material).",editor:"number-slider"})],o.prototype,"roughness",void 0),e.__decorate([s.Field({type:"number",step:.05,min:0,max:1,group:"Graphics3D",label:"metalness",description:"PBR metalness (standard material).",editor:"number-slider"})],o.prototype,"metalness",void 0),e.__decorate([s.Field({type:"number",group:"Graphics3D",label:"emissive",description:"Emissive color (hex).",editor:"number-stepper"})],o.prototype,"emissive",void 0),e.__decorate([s.Field({type:"string",group:"Graphics3D",label:"map",description:"Named IMAGE resource used as a color map.",editor:"text"})],o.prototype,"map",void 0),e.__decorate([s.Field({type:"boolean",group:"Graphics3D",label:"doubleSide",description:"Render both sides of the mesh.",editor:"toggle"})],o.prototype,"doubleSide",void 0),e.__decorate([s.Field({type:"string",group:"Graphics3D",label:"material",description:"Surface shader.",editor:"enum",enumOptions:["standard","basic","lambert","toon"]})],o.prototype,"material",void 0);class c{constructor(){this.items=new Map}get(e){return this.items.get(e)?.value}acquire(e,t){const s=this.items.get(e);if(s)return s.refs+=1,s.value;const i=t();return this.items.set(e,{value:i,refs:1}),i}release(e,t){const s=this.items.get(e);s&&(s.refs-=1,s.refs>0||(t(s.value),this.items.delete(e)))}clear(e){for(const t of this.items.values())e(t.value);this.items.clear()}}class d{constructor(){this.cache=new c}acquire(e){const t=function(e){switch(e.shape){case"sphere":return`sphere:${e.radius}:${e.segments}`;case"cylinder":return`cylinder:${e.radius}:${e.height}:${e.segments}`;case"cone":return`cone:${e.radius}:${e.height}:${e.segments}`;case"plane":return`plane:${e.width}:${e.height}:${e.segments}`;case"torus":return`torus:${e.radius}:${e.tube}:${e.segments}`;case"capsule":return`capsule:${e.radius}:${e.height}:${e.segments}`;default:return`box:${e.width}:${e.height}:${e.depth}`}}(e);return{key:t,geometry:this.cache.acquire(t,()=>function(e){const t=e.segments;switch(e.shape){case"sphere":return new r.SphereGeometry(e.radius,t,t);case"cylinder":return new r.CylinderGeometry(e.radius,e.radius,e.height,t);case"plane":return new r.PlaneGeometry(e.width,e.height,t,t);case"cone":return new r.ConeGeometry(e.radius,e.height,t);case"torus":return new r.TorusGeometry(e.radius,e.tube,8,t);case"capsule":{const s=Math.max(0,e.height-2*e.radius);return new r.CapsuleGeometry(e.radius,s,4,t)}default:return new r.BoxGeometry(e.width,e.height,e.depth)}}(e))}}release(e){this.cache.release(e,e=>e.dispose())}clear(){this.cache.clear(e=>e.dispose())}}class l{constructor(){this.items=new Map,this.inflight=new Map}async acquire(e){const t=this.items.get(e);if(t)return t.refs+=1,t.texture;let s=this.inflight.get(e);s||(s=i.textureFromNamedImage(e),this.inflight.set(e,s));const r=await s;this.inflight.delete(e);const o=this.items.get(e);return o?(o.refs+=1,o.texture):(this.items.set(e,{texture:r,refs:1}),r)}release(e){if(!e)return;const t=this.items.get(e);t&&(t.refs-=1,t.refs>0||(t.texture.dispose(),this.items.delete(e)))}clear(){for(const e of this.items.values())e.texture.dispose();this.items.clear(),this.inflight.clear()}}class h{constructor(){this.cache=new c,this.maps=new Map,this.textures=new l}async acquire(e){const t=[(s=e).material,s.color,s.wireframe?1:0,s.opacity,s.roughness,s.metalness,s.emissive,s.map,s.doubleSide?1:0].join(":");var s;const i=this.cache.get(t);if(i)return this.cache.acquire(t,()=>i),{key:t,material:i};const o=e.map?await this.textures.acquire(e.map):null,a=this.cache.get(t);if(a)return e.map&&this.textures.release(e.map),this.cache.acquire(t,()=>a),{key:t,material:a};const n=function(e,t){const s={color:e.color,wireframe:e.wireframe,transparent:e.opacity<1||!!t,opacity:e.opacity,side:e.doubleSide?r.DoubleSide:r.FrontSide,map:t};switch(e.material){case"basic":return new r.MeshBasicMaterial(s);case"lambert":return new r.MeshLambertMaterial(s);case"toon":return new r.MeshToonMaterial(s);default:return new r.MeshStandardMaterial({...s,roughness:e.roughness,metalness:e.metalness,emissive:e.emissive})}}(e,o);return this.cache.acquire(t,()=>n),e.map&&this.maps.set(t,e.map),{key:t,material:n}}release(e){const t=this.maps.get(e);this.cache.release(e,s=>{s.dispose(),t&&(this.textures.release(t),this.maps.delete(e))})}clear(){this.cache.clear(e=>e.dispose()),this.maps.clear(),this.textures.clear()}}const u=new Set(["positionX","positionY","positionZ","rotationX","rotationY","rotationZ","scaleX","scaleY","scaleZ"]);let m=class extends i.Renderer3D{constructor(){super(...arguments),this.name="Graphics3DSystem",this.entries=new Map,this.geos=new d,this.mats=new h}static{this.systemName="Graphics3DSystem"}init(){this.game.getSystem(i.Renderer3DSystem).rendererManager.register(this)}componentChanged(e){if("GameObject"!==e.componentName){if("Graphics3D"===e.componentName)if(e.type===t.OBSERVER_TYPE.ADD)this.mount(e.gameObject,e.component);else if(e.type===t.OBSERVER_TYPE.REMOVE)this.handleRemove(e.gameObject.id);else{const t=e.prop?.prop?.[0];if(u.has(t))return;this.handleRemove(e.gameObject.id),this.mount(e.gameObject,e.component)}}else this.threeContext.reparentGameObject(e.gameObject)}rendererUpdate(e){const t=e.getComponent(o);if(!t)return;const s=this.entries.get(e.id);if(!s)return;const r=e.getComponent(i.Transform3D),a=s.poseBridge.sync(t,r),n=p(t.positionX,t.positionY,t.positionZ,t.rotationX,t.rotationY,t.rotationZ,t.scaleX,t.scaleY,t.scaleZ);if(!a)return s.lastPose=n,s.group.position.set(0,0,0),s.group.rotation.set(0,0,0),void s.group.scale.set(1,1,1);s.lastPose!==n&&(s.lastPose=n,s.group.position.set(t.positionX,t.positionY,t.positionZ),s.group.rotation.set(t.rotationX,t.rotationY,t.rotationZ),s.group.scale.set(t.scaleX,t.scaleY,t.scaleZ))}async mount(e,t){const s=this.increaseAsyncId(e.id);let i;try{i=await this.prepare(t)}catch(t){return void console.error(`Graphics3D prepare failed for ${e.name}`,t)}this.validateAsyncId(e.id,s)?this.attachGroup(e,t,i):this.releasePrepared(i)}async prepare(e){const t=this.resolveParts(e),s=[];try{for(const e of t){const{key:t,geometry:i}=this.geos.acquire(e);try{const{key:r,material:o}=await this.mats.acquire(e);s.push({primitive:e,geoKey:t,matKey:r,geometry:i,material:o})}catch(e){throw this.geos.release(t),e}}}catch(e){throw this.releasePrepared(s),e}return s}resolveParts(e){return e.parts&&e.parts.length>0?e.parts.map(t=>n(t,e)):[n(e)]}attachGroup(e,t,s){const o=new r.Group,a=!!this.threeContext.shadows;for(const e of s){const t=new r.Mesh(e.geometry,e.material);t.position.set(e.primitive.positionX,e.primitive.positionY,e.primitive.positionZ),t.rotation.set(e.primitive.rotationX,e.primitive.rotationY,e.primitive.rotationZ),t.scale.set(e.primitive.scaleX,e.primitive.scaleY,e.primitive.scaleZ),t.castShadow=a,t.receiveShadow=a,o.add(t)}i.tagObject3D(o,e.id);const n=e.getComponent(i.Transform3D),c=new i.VisualPoseBridge;c.sync(t,n)?(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)):(o.position.set(0,0,0),o.rotation.set(0,0,0),o.scale.set(1,1,1));const d=p(t.positionX,t.positionY,t.positionZ,t.rotationX,t.rotationY,t.rotationZ,t.scaleX,t.scaleY,t.scaleZ);this.threeContext.attachVisual(e.id,o,e),this.entries.set(e.id,{group:o,prepared:s,lastPose:d,poseBridge:c})}releasePrepared(e){for(const t of e)this.geos.release(t.geoKey),this.mats.release(t.matKey)}handleRemove(e){this.increaseAsyncId(e);const t=this.entries.get(e);t&&(this.threeContext.detachVisual(e,t.group),this.releasePrepared(t.prepared),this.entries.delete(e))}onDestroy(){for(const[e]of this.entries)this.handleRemove(e);this.entries.clear(),this.geos.clear(),this.mats.clear()}};m=e.__decorate([t.decorators.componentObserver({Graphics3D:["shape","color","wireframe","width","height","depth","radius","segments","tube","positionX","positionY","positionZ","rotationX","rotationY","rotationZ","scaleX","scaleY","scaleZ","opacity","roughness","metalness","emissive","map","doubleSide","material","parts"],GameObject:["parent"]})],m);var g=m;exports.Graphics3D=o,exports.Graphics3DSystem=g;
|
|
@@ -568,7 +568,7 @@ let Graphics3DSystem = class Graphics3DSystem extends Renderer3D {
|
|
|
568
568
|
renderer3DSystem.rendererManager.register(this);
|
|
569
569
|
}
|
|
570
570
|
componentChanged(changed) {
|
|
571
|
-
if (changed.componentName === '
|
|
571
|
+
if (changed.componentName === 'GameObject') {
|
|
572
572
|
this.threeContext.reparentGameObject(changed.gameObject);
|
|
573
573
|
return;
|
|
574
574
|
}
|
|
@@ -726,7 +726,7 @@ Graphics3DSystem = __decorate([
|
|
|
726
726
|
'opacity', 'roughness', 'metalness', 'emissive',
|
|
727
727
|
'map', 'doubleSide', 'material', 'parts',
|
|
728
728
|
],
|
|
729
|
-
|
|
729
|
+
GameObject: ['parent'],
|
|
730
730
|
})
|
|
731
731
|
], Graphics3DSystem);
|
|
732
732
|
var Graphics3DSystem_default = Graphics3DSystem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-renderer-3d-graphics.esm.js","sources":["../lib/component.ts","../lib/shapes.ts","../lib/resources.ts","../lib/system.ts"],"sourcesContent":["import { Component } from '@combos-fun/engine';\nimport { Field } from '@combos-fun/inspector-decorator';\n\nexport type Graphics3DMaterialKind = 'standard' | 'basic' | 'lambert' | 'toon';\n\nexport type Graphics3DShape =\n | 'box'\n | 'sphere'\n | 'cylinder'\n | 'plane'\n | 'cone'\n | 'torus'\n | 'capsule';\n\nexport interface Graphics3DPartParams {\n shape?: Graphics3DShape | string;\n color?: number;\n wireframe?: boolean;\n width?: number;\n height?: number;\n depth?: number;\n radius?: number;\n segments?: number;\n tube?: 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 roughness?: number;\n metalness?: number;\n emissive?: number;\n map?: string;\n doubleSide?: boolean;\n material?: Graphics3DMaterialKind | string;\n}\n\nexport interface Graphics3DParams extends Graphics3DPartParams {\n parts?: Graphics3DPartParams[];\n}\n\nexport default class Graphics3D extends Component<Graphics3DParams> {\n static componentName: string = 'Graphics3D';\n\n @Field({\n type: 'string',\n group: 'Graphics3D',\n label: 'shape',\n description: 'Primitive shape kind.',\n editor: 'enum',\n enumOptions: ['box', 'sphere', 'cylinder', 'plane', 'cone', 'torus', 'capsule'],\n })\n shape: string = 'box';\n\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\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\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\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\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\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\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 = 12;\n\n @Field({\n type: 'number',\n step: 0.05,\n group: 'Graphics3D',\n label: 'tube',\n description: 'Torus tube radius. 0 means 0.4 × radius.',\n editor: 'number-stepper',\n })\n tube: number = 0;\n\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\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\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\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\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\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\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\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\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\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 @Field({\n type: 'number',\n step: 0.05,\n min: 0,\n max: 1,\n group: 'Graphics3D',\n label: 'roughness',\n description: 'PBR roughness (standard material).',\n editor: 'number-slider',\n })\n roughness: number = 1;\n\n @Field({\n type: 'number',\n step: 0.05,\n min: 0,\n max: 1,\n group: 'Graphics3D',\n label: 'metalness',\n description: 'PBR metalness (standard material).',\n editor: 'number-slider',\n })\n metalness: number = 0;\n\n @Field({\n type: 'number',\n group: 'Graphics3D',\n label: 'emissive',\n description: 'Emissive color (hex).',\n editor: 'number-stepper',\n })\n emissive: number = 0;\n\n @Field({\n type: 'string',\n group: 'Graphics3D',\n label: 'map',\n description: 'Named IMAGE resource used as a color map.',\n editor: 'text',\n })\n map: string = '';\n\n @Field({\n type: 'boolean',\n group: 'Graphics3D',\n label: 'doubleSide',\n description: 'Render both sides of the mesh.',\n editor: 'toggle',\n })\n doubleSide: boolean = false;\n\n @Field({\n type: 'string',\n group: 'Graphics3D',\n label: 'material',\n description: 'Surface shader.',\n editor: 'enum',\n enumOptions: ['standard', 'basic', 'lambert', 'toon'],\n })\n material: string = 'standard';\n\n parts: Graphics3DPartParams[] | undefined = undefined;\n\n init(obj?: Graphics3DParams) {\n if (obj) Object.assign(this, obj);\n }\n}\n","import {\n BoxGeometry,\n SphereGeometry,\n CylinderGeometry,\n PlaneGeometry,\n ConeGeometry,\n TorusGeometry,\n CapsuleGeometry,\n} from 'three';\nimport type { BufferGeometry } from 'three';\nimport type { Graphics3DPartParams } from './component';\n\nexport interface ResolvedPrimitive {\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 tube: 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 roughness: number;\n metalness: number;\n emissive: number;\n map: string;\n doubleSide: boolean;\n material: string;\n}\n\nexport function torusTube(radius: number, tube?: number): number {\n return tube && tube > 0 ? tube : radius * 0.4;\n}\n\nexport function resolvePrimitive(\n part: Graphics3DPartParams,\n fallback?: Graphics3DPartParams,\n): ResolvedPrimitive {\n const src = { ...fallback, ...part };\n const radius = src.radius ?? 0.5;\n return {\n shape: src.shape || 'box',\n color: src.color ?? 0x00ff00,\n wireframe: !!src.wireframe,\n width: src.width ?? 1,\n height: src.height ?? 1,\n depth: src.depth ?? 1,\n radius,\n segments: Math.max(3, Math.round(src.segments ?? 12)),\n tube: torusTube(radius, src.tube),\n positionX: src.positionX ?? 0,\n positionY: src.positionY ?? 0,\n positionZ: src.positionZ ?? 0,\n rotationX: src.rotationX ?? 0,\n rotationY: src.rotationY ?? 0,\n rotationZ: src.rotationZ ?? 0,\n scaleX: src.scaleX ?? 1,\n scaleY: src.scaleY ?? 1,\n scaleZ: src.scaleZ ?? 1,\n opacity: src.opacity ?? 1,\n roughness: src.roughness ?? 1,\n metalness: src.metalness ?? 0,\n emissive: src.emissive ?? 0,\n map: src.map || '',\n doubleSide: !!src.doubleSide,\n material: src.material || 'standard',\n };\n}\n\nexport function geometryKey(p: ResolvedPrimitive): string {\n switch (p.shape) {\n case 'sphere':\n return `sphere:${p.radius}:${p.segments}`;\n case 'cylinder':\n return `cylinder:${p.radius}:${p.height}:${p.segments}`;\n case 'cone':\n return `cone:${p.radius}:${p.height}:${p.segments}`;\n case 'plane':\n return `plane:${p.width}:${p.height}:${p.segments}`;\n case 'torus':\n return `torus:${p.radius}:${p.tube}:${p.segments}`;\n case 'capsule':\n return `capsule:${p.radius}:${p.height}:${p.segments}`;\n case 'box':\n default:\n return `box:${p.width}:${p.height}:${p.depth}`;\n }\n}\n\nexport function createGeometry(p: ResolvedPrimitive): BufferGeometry {\n const segs = p.segments;\n switch (p.shape) {\n case 'sphere':\n return new SphereGeometry(p.radius, segs, segs);\n case 'cylinder':\n return new CylinderGeometry(p.radius, p.radius, p.height, segs);\n case 'plane':\n return new PlaneGeometry(p.width, p.height, segs, segs);\n case 'cone':\n return new ConeGeometry(p.radius, p.height, segs);\n case 'torus':\n return new TorusGeometry(p.radius, p.tube, 8, segs);\n case 'capsule': {\n const length = Math.max(0, p.height - 2 * p.radius);\n return new CapsuleGeometry(p.radius, length, 4, segs);\n }\n case 'box':\n default:\n return new BoxGeometry(p.width, p.height, p.depth);\n }\n}\n\nexport function materialKey(p: ResolvedPrimitive): string {\n return [\n p.material,\n p.color,\n p.wireframe ? 1 : 0,\n p.opacity,\n p.roughness,\n p.metalness,\n p.emissive,\n p.map,\n p.doubleSide ? 1 : 0,\n ].join(':');\n}\n\nexport function poseKey(\n px: number, py: number, pz: number,\n rx: number, ry: number, rz: number,\n sx: number, sy: number, sz: number,\n): string {\n return `${px},${py},${pz},${rx},${ry},${rz},${sx},${sy},${sz}`;\n}\n","import {\n DoubleSide,\n FrontSide,\n MeshBasicMaterial,\n MeshLambertMaterial,\n MeshStandardMaterial,\n MeshToonMaterial,\n} from 'three';\nimport type { BufferGeometry, Material, Texture } from 'three';\nimport { textureFromNamedImage } from '@combos-fun/plugin-renderer-3d';\nimport { createGeometry, geometryKey, materialKey } from './shapes';\nimport type { ResolvedPrimitive } from './shapes';\n\nclass RefCache<T> {\n private items = new Map<string, { value: T; refs: number }>();\n\n get(key: string): T | undefined {\n return this.items.get(key)?.value;\n }\n\n acquire(key: string, create: () => T): T {\n const hit = this.items.get(key);\n if (hit) {\n hit.refs += 1;\n return hit.value;\n }\n const value = create();\n this.items.set(key, { value, refs: 1 });\n return value;\n }\n\n release(key: string, dispose: (value: T) => void): void {\n const hit = this.items.get(key);\n if (!hit) return;\n hit.refs -= 1;\n if (hit.refs > 0) return;\n dispose(hit.value);\n this.items.delete(key);\n }\n\n clear(dispose: (value: T) => void): void {\n for (const hit of this.items.values()) {\n dispose(hit.value);\n }\n this.items.clear();\n }\n}\n\nexport class GeometryCache {\n private cache = new RefCache<BufferGeometry>();\n\n acquire(primitive: ResolvedPrimitive): { key: string; geometry: BufferGeometry } {\n const key = geometryKey(primitive);\n return { key, geometry: this.cache.acquire(key, () => createGeometry(primitive)) };\n }\n\n release(key: string): void {\n this.cache.release(key, (geometry) => geometry.dispose());\n }\n\n clear(): void {\n this.cache.clear((geometry) => geometry.dispose());\n }\n}\n\nclass TextureCache {\n private items = new Map<string, { texture: Texture; refs: number }>();\n private inflight = new Map<string, Promise<Texture>>();\n\n async acquire(name: string): Promise<Texture> {\n const hit = this.items.get(name);\n if (hit) {\n hit.refs += 1;\n return hit.texture;\n }\n let pending = this.inflight.get(name);\n if (!pending) {\n pending = textureFromNamedImage(name);\n this.inflight.set(name, pending);\n }\n const texture = await pending;\n this.inflight.delete(name);\n const existing = this.items.get(name);\n if (existing) {\n existing.refs += 1;\n return existing.texture;\n }\n this.items.set(name, { texture, refs: 1 });\n return texture;\n }\n\n release(name: string): void {\n if (!name) return;\n const hit = this.items.get(name);\n if (!hit) return;\n hit.refs -= 1;\n if (hit.refs > 0) return;\n hit.texture.dispose();\n this.items.delete(name);\n }\n\n clear(): void {\n for (const hit of this.items.values()) {\n hit.texture.dispose();\n }\n this.items.clear();\n this.inflight.clear();\n }\n}\n\nfunction createMaterial(p: ResolvedPrimitive, map: Texture | null): Material {\n const common = {\n color: p.color,\n wireframe: p.wireframe,\n transparent: p.opacity < 1 || !!map,\n opacity: p.opacity,\n side: p.doubleSide ? DoubleSide : FrontSide,\n map,\n };\n switch (p.material) {\n case 'basic':\n return new MeshBasicMaterial(common);\n case 'lambert':\n return new MeshLambertMaterial(common);\n case 'toon':\n return new MeshToonMaterial(common);\n case 'standard':\n default:\n return new MeshStandardMaterial({\n ...common,\n roughness: p.roughness,\n metalness: p.metalness,\n emissive: p.emissive,\n });\n }\n}\n\nexport class MaterialCache {\n private cache = new RefCache<Material>();\n private maps = new Map<string, string>();\n readonly textures = new TextureCache();\n\n async acquire(primitive: ResolvedPrimitive): Promise<{ key: string; material: Material }> {\n const key = materialKey(primitive);\n const hit = this.cache.get(key);\n if (hit) {\n this.cache.acquire(key, () => hit);\n return { key, material: hit };\n }\n const texture = primitive.map ? await this.textures.acquire(primitive.map) : null;\n const again = this.cache.get(key);\n if (again) {\n if (primitive.map) this.textures.release(primitive.map);\n this.cache.acquire(key, () => again);\n return { key, material: again };\n }\n const material = createMaterial(primitive, texture);\n this.cache.acquire(key, () => material);\n if (primitive.map) this.maps.set(key, primitive.map);\n return { key, material };\n }\n\n release(key: string): void {\n const mapName = this.maps.get(key);\n this.cache.release(key, (material) => {\n material.dispose();\n if (mapName) {\n this.textures.release(mapName);\n this.maps.delete(key);\n }\n });\n }\n\n clear(): void {\n this.cache.clear((material) => material.dispose());\n this.maps.clear();\n this.textures.clear();\n }\n}\n","import { decorators, ComponentChanged, OBSERVER_TYPE, GameObject } from '@combos-fun/engine';\nimport {\n Renderer3D,\n Renderer3DSystem,\n tagObject3D,\n Transform3D,\n VisualPoseBridge,\n} from '@combos-fun/plugin-renderer-3d';\nimport { Group, Mesh } from 'three';\nimport type { BufferGeometry, Material } from 'three';\nimport Graphics3D from './component';\nimport { GeometryCache, MaterialCache } from './resources';\nimport { poseKey, resolvePrimitive } from './shapes';\nimport type { ResolvedPrimitive } from './shapes';\n\ninterface PreparedPart {\n primitive: ResolvedPrimitive;\n geoKey: string;\n matKey: string;\n geometry: BufferGeometry;\n material: Material;\n}\n\ninterface Graphics3DEntry {\n group: Group;\n prepared: PreparedPart[];\n lastPose?: string;\n poseBridge: VisualPoseBridge;\n}\n\nconst POSE_PROPS = new Set([\n 'positionX', 'positionY', 'positionZ',\n 'rotationX', 'rotationY', 'rotationZ',\n 'scaleX', 'scaleY', 'scaleZ',\n]);\n\n@decorators.componentObserver({\n Graphics3D: [\n 'shape', 'color', 'wireframe',\n 'width', 'height', 'depth', 'radius', 'segments', 'tube',\n 'positionX', 'positionY', 'positionZ',\n 'rotationX', 'rotationY', 'rotationZ',\n 'scaleX', 'scaleY', 'scaleZ',\n 'opacity', 'roughness', 'metalness', 'emissive',\n 'map', 'doubleSide', 'material', 'parts',\n ],\n Transform: ['_parent'],\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 private geos = new GeometryCache();\n private mats = new MaterialCache();\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 === 'Transform') {\n this.threeContext.reparentGameObject(changed.gameObject);\n return;\n }\n if (changed.componentName !== 'Graphics3D') return;\n\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.mount(changed.gameObject, changed.component as Graphics3D);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.handleRemove(changed.gameObject.id);\n } else {\n const changedProp = changed.prop?.prop?.[0];\n if (POSE_PROPS.has(changedProp)) return;\n this.handleRemove(changed.gameObject.id);\n this.mount(changed.gameObject, changed.component as Graphics3D);\n }\n }\n\n rendererUpdate(gameObject: GameObject) {\n const component = gameObject.getComponent(Graphics3D) as Graphics3D;\n if (!component) return;\n const entry = this.entries.get(gameObject.id);\n if (!entry) return;\n\n const transform = gameObject.getComponent(Transform3D) as Transform3D | undefined;\n const applyVisualPose = entry.poseBridge.sync(component, transform);\n const next = poseKey(\n component.positionX, component.positionY, component.positionZ,\n component.rotationX, component.rotationY, component.rotationZ,\n component.scaleX, component.scaleY, component.scaleZ,\n );\n\n if (!applyVisualPose) {\n entry.lastPose = next;\n entry.group.position.set(0, 0, 0);\n entry.group.rotation.set(0, 0, 0);\n entry.group.scale.set(1, 1, 1);\n return;\n }\n\n if (entry.lastPose === next) return;\n entry.lastPose = next;\n entry.group.position.set(component.positionX, component.positionY, component.positionZ);\n entry.group.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n entry.group.scale.set(component.scaleX, component.scaleY, component.scaleZ);\n }\n\n private async mount(gameObject: GameObject, component: Graphics3D) {\n const asyncId = this.increaseAsyncId(gameObject.id);\n let prepared: PreparedPart[];\n try {\n prepared = await this.prepare(component);\n } catch (err) {\n console.error(`Graphics3D prepare failed for ${gameObject.name}`, err);\n return;\n }\n if (!this.validateAsyncId(gameObject.id, asyncId)) {\n this.releasePrepared(prepared);\n return;\n }\n this.attachGroup(gameObject, component, prepared);\n }\n\n private async prepare(component: Graphics3D): Promise<PreparedPart[]> {\n const specs = this.resolveParts(component);\n const prepared: PreparedPart[] = [];\n try {\n for (const primitive of specs) {\n const { key: geoKey, geometry } = this.geos.acquire(primitive);\n try {\n const { key: matKey, material } = await this.mats.acquire(primitive);\n prepared.push({ primitive, geoKey, matKey, geometry, material });\n } catch (err) {\n this.geos.release(geoKey);\n throw err;\n }\n }\n } catch (err) {\n this.releasePrepared(prepared);\n throw err;\n }\n return prepared;\n }\n\n private resolveParts(component: Graphics3D): ResolvedPrimitive[] {\n if (component.parts && component.parts.length > 0) {\n return component.parts.map((part) => resolvePrimitive(part, component));\n }\n return [resolvePrimitive(component)];\n }\n\n private attachGroup(\n gameObject: GameObject,\n component: Graphics3D,\n prepared: PreparedPart[],\n ) {\n const group = new Group();\n const shadows = !!this.threeContext.shadows;\n for (const part of prepared) {\n const mesh = new Mesh(part.geometry, part.material);\n mesh.position.set(part.primitive.positionX, part.primitive.positionY, part.primitive.positionZ);\n mesh.rotation.set(part.primitive.rotationX, part.primitive.rotationY, part.primitive.rotationZ);\n mesh.scale.set(part.primitive.scaleX, part.primitive.scaleY, part.primitive.scaleZ);\n mesh.castShadow = shadows;\n mesh.receiveShadow = shadows;\n group.add(mesh);\n }\n tagObject3D(group, gameObject.id);\n const transform = gameObject.getComponent(Transform3D) as Transform3D | undefined;\n const poseBridge = new VisualPoseBridge();\n const applyVisualPose = poseBridge.sync(component, transform);\n if (applyVisualPose) {\n group.position.set(component.positionX, component.positionY, component.positionZ);\n group.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n group.scale.set(component.scaleX, component.scaleY, component.scaleZ);\n } else {\n group.position.set(0, 0, 0);\n group.rotation.set(0, 0, 0);\n group.scale.set(1, 1, 1);\n }\n const lastPose = poseKey(\n component.positionX, component.positionY, component.positionZ,\n component.rotationX, component.rotationY, component.rotationZ,\n component.scaleX, component.scaleY, component.scaleZ,\n );\n this.threeContext.attachVisual(gameObject.id, group, gameObject);\n this.entries.set(gameObject.id, {\n group,\n prepared,\n lastPose,\n poseBridge,\n });\n }\n\n private releasePrepared(prepared: PreparedPart[]): void {\n for (const part of prepared) {\n this.geos.release(part.geoKey);\n this.mats.release(part.matKey);\n }\n }\n\n private handleRemove(id: number) {\n this.increaseAsyncId(id);\n const entry = this.entries.get(id);\n if (!entry) return;\n this.threeContext.detachVisual(id, entry.group);\n this.releasePrepared(entry.prepared);\n this.entries.delete(id);\n }\n\n onDestroy() {\n for (const [id] of this.entries) {\n this.handleRemove(id);\n }\n this.entries.clear();\n this.geos.clear();\n this.mats.clear();\n }\n}\n"],"names":[],"mappings":";;;;;;AA8Cc,MAAO,UAAW,SAAQ,SAA2B,CAAA;AAAnE,IAAA,WAAA,GAAA;;QAWE,IAAA,CAAA,KAAK,GAAW,KAAK;QASrB,IAAA,CAAA,KAAK,GAAW,QAAQ;QASxB,IAAA,CAAA,SAAS,GAAY,KAAK;QAU1B,IAAA,CAAA,KAAK,GAAW,CAAC;QAUjB,IAAA,CAAA,MAAM,GAAW,CAAC;QAUlB,IAAA,CAAA,KAAK,GAAW,CAAC;QAUjB,IAAA,CAAA,MAAM,GAAW,GAAG;QAUpB,IAAA,CAAA,QAAQ,GAAW,EAAE;QAUrB,IAAA,CAAA,IAAI,GAAW,CAAC;QAUhB,IAAA,CAAA,SAAS,GAAW,CAAC;QAUrB,IAAA,CAAA,SAAS,GAAW,CAAC;QAUrB,IAAA,CAAA,SAAS,GAAW,CAAC;QAU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AC,IAAI,IAAI,CAAC,OAAO,EAAE;AAC/B,YAAA,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QACvB;AACA,QAAA,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;AACpB,QAAA,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;AACjB,QAAA,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;IACnB;;AA3KmB,gBAAgB,GAAA,UAAA,CAAA;IAZpC,UAAU,CAAC,iBAAiB,CAAC;AAC5B,QAAA,UAAU,EAAE;YACV,OAAO,EAAE,OAAO,EAAE,WAAW;YAC7B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM;YACxD,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,QAAQ,EAAE,QAAQ,EAAE,QAAQ;AAC5B,YAAA,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU;AAC/C,YAAA,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO;AACzC,SAAA;QACD,SAAS,EAAE,CAAC,SAAS,CAAC;KACvB;AACoB,CAAA,EAAA,gBAAgB,CA4KpC;+BA5KoB,gBAAgB;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin-renderer-3d-graphics.esm.js","sources":["../lib/component.ts","../lib/shapes.ts","../lib/resources.ts","../lib/system.ts"],"sourcesContent":["import { Component } from '@combos-fun/engine';\nimport { Field } from '@combos-fun/inspector-decorator';\n\nexport type Graphics3DMaterialKind = 'standard' | 'basic' | 'lambert' | 'toon';\n\nexport type Graphics3DShape =\n | 'box'\n | 'sphere'\n | 'cylinder'\n | 'plane'\n | 'cone'\n | 'torus'\n | 'capsule';\n\nexport interface Graphics3DPartParams {\n shape?: Graphics3DShape | string;\n color?: number;\n wireframe?: boolean;\n width?: number;\n height?: number;\n depth?: number;\n radius?: number;\n segments?: number;\n tube?: 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 roughness?: number;\n metalness?: number;\n emissive?: number;\n map?: string;\n doubleSide?: boolean;\n material?: Graphics3DMaterialKind | string;\n}\n\nexport interface Graphics3DParams extends Graphics3DPartParams {\n parts?: Graphics3DPartParams[];\n}\n\nexport default class Graphics3D extends Component<Graphics3DParams> {\n static componentName: string = 'Graphics3D';\n\n @Field({\n type: 'string',\n group: 'Graphics3D',\n label: 'shape',\n description: 'Primitive shape kind.',\n editor: 'enum',\n enumOptions: ['box', 'sphere', 'cylinder', 'plane', 'cone', 'torus', 'capsule'],\n })\n shape: string = 'box';\n\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\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\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\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\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\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\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 = 12;\n\n @Field({\n type: 'number',\n step: 0.05,\n group: 'Graphics3D',\n label: 'tube',\n description: 'Torus tube radius. 0 means 0.4 × radius.',\n editor: 'number-stepper',\n })\n tube: number = 0;\n\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\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\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\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\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\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\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\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\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\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 @Field({\n type: 'number',\n step: 0.05,\n min: 0,\n max: 1,\n group: 'Graphics3D',\n label: 'roughness',\n description: 'PBR roughness (standard material).',\n editor: 'number-slider',\n })\n roughness: number = 1;\n\n @Field({\n type: 'number',\n step: 0.05,\n min: 0,\n max: 1,\n group: 'Graphics3D',\n label: 'metalness',\n description: 'PBR metalness (standard material).',\n editor: 'number-slider',\n })\n metalness: number = 0;\n\n @Field({\n type: 'number',\n group: 'Graphics3D',\n label: 'emissive',\n description: 'Emissive color (hex).',\n editor: 'number-stepper',\n })\n emissive: number = 0;\n\n @Field({\n type: 'string',\n group: 'Graphics3D',\n label: 'map',\n description: 'Named IMAGE resource used as a color map.',\n editor: 'text',\n })\n map: string = '';\n\n @Field({\n type: 'boolean',\n group: 'Graphics3D',\n label: 'doubleSide',\n description: 'Render both sides of the mesh.',\n editor: 'toggle',\n })\n doubleSide: boolean = false;\n\n @Field({\n type: 'string',\n group: 'Graphics3D',\n label: 'material',\n description: 'Surface shader.',\n editor: 'enum',\n enumOptions: ['standard', 'basic', 'lambert', 'toon'],\n })\n material: string = 'standard';\n\n parts: Graphics3DPartParams[] | undefined = undefined;\n\n init(obj?: Graphics3DParams) {\n if (obj) Object.assign(this, obj);\n }\n}\n","import {\n BoxGeometry,\n SphereGeometry,\n CylinderGeometry,\n PlaneGeometry,\n ConeGeometry,\n TorusGeometry,\n CapsuleGeometry,\n} from 'three';\nimport type { BufferGeometry } from 'three';\nimport type { Graphics3DPartParams } from './component';\n\nexport interface ResolvedPrimitive {\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 tube: 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 roughness: number;\n metalness: number;\n emissive: number;\n map: string;\n doubleSide: boolean;\n material: string;\n}\n\nexport function torusTube(radius: number, tube?: number): number {\n return tube && tube > 0 ? tube : radius * 0.4;\n}\n\nexport function resolvePrimitive(\n part: Graphics3DPartParams,\n fallback?: Graphics3DPartParams,\n): ResolvedPrimitive {\n const src = { ...fallback, ...part };\n const radius = src.radius ?? 0.5;\n return {\n shape: src.shape || 'box',\n color: src.color ?? 0x00ff00,\n wireframe: !!src.wireframe,\n width: src.width ?? 1,\n height: src.height ?? 1,\n depth: src.depth ?? 1,\n radius,\n segments: Math.max(3, Math.round(src.segments ?? 12)),\n tube: torusTube(radius, src.tube),\n positionX: src.positionX ?? 0,\n positionY: src.positionY ?? 0,\n positionZ: src.positionZ ?? 0,\n rotationX: src.rotationX ?? 0,\n rotationY: src.rotationY ?? 0,\n rotationZ: src.rotationZ ?? 0,\n scaleX: src.scaleX ?? 1,\n scaleY: src.scaleY ?? 1,\n scaleZ: src.scaleZ ?? 1,\n opacity: src.opacity ?? 1,\n roughness: src.roughness ?? 1,\n metalness: src.metalness ?? 0,\n emissive: src.emissive ?? 0,\n map: src.map || '',\n doubleSide: !!src.doubleSide,\n material: src.material || 'standard',\n };\n}\n\nexport function geometryKey(p: ResolvedPrimitive): string {\n switch (p.shape) {\n case 'sphere':\n return `sphere:${p.radius}:${p.segments}`;\n case 'cylinder':\n return `cylinder:${p.radius}:${p.height}:${p.segments}`;\n case 'cone':\n return `cone:${p.radius}:${p.height}:${p.segments}`;\n case 'plane':\n return `plane:${p.width}:${p.height}:${p.segments}`;\n case 'torus':\n return `torus:${p.radius}:${p.tube}:${p.segments}`;\n case 'capsule':\n return `capsule:${p.radius}:${p.height}:${p.segments}`;\n case 'box':\n default:\n return `box:${p.width}:${p.height}:${p.depth}`;\n }\n}\n\nexport function createGeometry(p: ResolvedPrimitive): BufferGeometry {\n const segs = p.segments;\n switch (p.shape) {\n case 'sphere':\n return new SphereGeometry(p.radius, segs, segs);\n case 'cylinder':\n return new CylinderGeometry(p.radius, p.radius, p.height, segs);\n case 'plane':\n return new PlaneGeometry(p.width, p.height, segs, segs);\n case 'cone':\n return new ConeGeometry(p.radius, p.height, segs);\n case 'torus':\n return new TorusGeometry(p.radius, p.tube, 8, segs);\n case 'capsule': {\n const length = Math.max(0, p.height - 2 * p.radius);\n return new CapsuleGeometry(p.radius, length, 4, segs);\n }\n case 'box':\n default:\n return new BoxGeometry(p.width, p.height, p.depth);\n }\n}\n\nexport function materialKey(p: ResolvedPrimitive): string {\n return [\n p.material,\n p.color,\n p.wireframe ? 1 : 0,\n p.opacity,\n p.roughness,\n p.metalness,\n p.emissive,\n p.map,\n p.doubleSide ? 1 : 0,\n ].join(':');\n}\n\nexport function poseKey(\n px: number, py: number, pz: number,\n rx: number, ry: number, rz: number,\n sx: number, sy: number, sz: number,\n): string {\n return `${px},${py},${pz},${rx},${ry},${rz},${sx},${sy},${sz}`;\n}\n","import {\n DoubleSide,\n FrontSide,\n MeshBasicMaterial,\n MeshLambertMaterial,\n MeshStandardMaterial,\n MeshToonMaterial,\n} from 'three';\nimport type { BufferGeometry, Material, Texture } from 'three';\nimport { textureFromNamedImage } from '@combos-fun/plugin-renderer-3d';\nimport { createGeometry, geometryKey, materialKey } from './shapes';\nimport type { ResolvedPrimitive } from './shapes';\n\nclass RefCache<T> {\n private items = new Map<string, { value: T; refs: number }>();\n\n get(key: string): T | undefined {\n return this.items.get(key)?.value;\n }\n\n acquire(key: string, create: () => T): T {\n const hit = this.items.get(key);\n if (hit) {\n hit.refs += 1;\n return hit.value;\n }\n const value = create();\n this.items.set(key, { value, refs: 1 });\n return value;\n }\n\n release(key: string, dispose: (value: T) => void): void {\n const hit = this.items.get(key);\n if (!hit) return;\n hit.refs -= 1;\n if (hit.refs > 0) return;\n dispose(hit.value);\n this.items.delete(key);\n }\n\n clear(dispose: (value: T) => void): void {\n for (const hit of this.items.values()) {\n dispose(hit.value);\n }\n this.items.clear();\n }\n}\n\nexport class GeometryCache {\n private cache = new RefCache<BufferGeometry>();\n\n acquire(primitive: ResolvedPrimitive): { key: string; geometry: BufferGeometry } {\n const key = geometryKey(primitive);\n return { key, geometry: this.cache.acquire(key, () => createGeometry(primitive)) };\n }\n\n release(key: string): void {\n this.cache.release(key, (geometry) => geometry.dispose());\n }\n\n clear(): void {\n this.cache.clear((geometry) => geometry.dispose());\n }\n}\n\nclass TextureCache {\n private items = new Map<string, { texture: Texture; refs: number }>();\n private inflight = new Map<string, Promise<Texture>>();\n\n async acquire(name: string): Promise<Texture> {\n const hit = this.items.get(name);\n if (hit) {\n hit.refs += 1;\n return hit.texture;\n }\n let pending = this.inflight.get(name);\n if (!pending) {\n pending = textureFromNamedImage(name);\n this.inflight.set(name, pending);\n }\n const texture = await pending;\n this.inflight.delete(name);\n const existing = this.items.get(name);\n if (existing) {\n existing.refs += 1;\n return existing.texture;\n }\n this.items.set(name, { texture, refs: 1 });\n return texture;\n }\n\n release(name: string): void {\n if (!name) return;\n const hit = this.items.get(name);\n if (!hit) return;\n hit.refs -= 1;\n if (hit.refs > 0) return;\n hit.texture.dispose();\n this.items.delete(name);\n }\n\n clear(): void {\n for (const hit of this.items.values()) {\n hit.texture.dispose();\n }\n this.items.clear();\n this.inflight.clear();\n }\n}\n\nfunction createMaterial(p: ResolvedPrimitive, map: Texture | null): Material {\n const common = {\n color: p.color,\n wireframe: p.wireframe,\n transparent: p.opacity < 1 || !!map,\n opacity: p.opacity,\n side: p.doubleSide ? DoubleSide : FrontSide,\n map,\n };\n switch (p.material) {\n case 'basic':\n return new MeshBasicMaterial(common);\n case 'lambert':\n return new MeshLambertMaterial(common);\n case 'toon':\n return new MeshToonMaterial(common);\n case 'standard':\n default:\n return new MeshStandardMaterial({\n ...common,\n roughness: p.roughness,\n metalness: p.metalness,\n emissive: p.emissive,\n });\n }\n}\n\nexport class MaterialCache {\n private cache = new RefCache<Material>();\n private maps = new Map<string, string>();\n readonly textures = new TextureCache();\n\n async acquire(primitive: ResolvedPrimitive): Promise<{ key: string; material: Material }> {\n const key = materialKey(primitive);\n const hit = this.cache.get(key);\n if (hit) {\n this.cache.acquire(key, () => hit);\n return { key, material: hit };\n }\n const texture = primitive.map ? await this.textures.acquire(primitive.map) : null;\n const again = this.cache.get(key);\n if (again) {\n if (primitive.map) this.textures.release(primitive.map);\n this.cache.acquire(key, () => again);\n return { key, material: again };\n }\n const material = createMaterial(primitive, texture);\n this.cache.acquire(key, () => material);\n if (primitive.map) this.maps.set(key, primitive.map);\n return { key, material };\n }\n\n release(key: string): void {\n const mapName = this.maps.get(key);\n this.cache.release(key, (material) => {\n material.dispose();\n if (mapName) {\n this.textures.release(mapName);\n this.maps.delete(key);\n }\n });\n }\n\n clear(): void {\n this.cache.clear((material) => material.dispose());\n this.maps.clear();\n this.textures.clear();\n }\n}\n","import { decorators, ComponentChanged, OBSERVER_TYPE, GameObject } from '@combos-fun/engine';\nimport {\n Renderer3D,\n Renderer3DSystem,\n tagObject3D,\n Transform3D,\n VisualPoseBridge,\n} from '@combos-fun/plugin-renderer-3d';\nimport { Group, Mesh } from 'three';\nimport type { BufferGeometry, Material } from 'three';\nimport Graphics3D from './component';\nimport { GeometryCache, MaterialCache } from './resources';\nimport { poseKey, resolvePrimitive } from './shapes';\nimport type { ResolvedPrimitive } from './shapes';\n\ninterface PreparedPart {\n primitive: ResolvedPrimitive;\n geoKey: string;\n matKey: string;\n geometry: BufferGeometry;\n material: Material;\n}\n\ninterface Graphics3DEntry {\n group: Group;\n prepared: PreparedPart[];\n lastPose?: string;\n poseBridge: VisualPoseBridge;\n}\n\nconst POSE_PROPS = new Set([\n 'positionX', 'positionY', 'positionZ',\n 'rotationX', 'rotationY', 'rotationZ',\n 'scaleX', 'scaleY', 'scaleZ',\n]);\n\n@decorators.componentObserver({\n Graphics3D: [\n 'shape', 'color', 'wireframe',\n 'width', 'height', 'depth', 'radius', 'segments', 'tube',\n 'positionX', 'positionY', 'positionZ',\n 'rotationX', 'rotationY', 'rotationZ',\n 'scaleX', 'scaleY', 'scaleZ',\n 'opacity', 'roughness', 'metalness', 'emissive',\n 'map', 'doubleSide', 'material', 'parts',\n ],\n GameObject: ['parent'],\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 private geos = new GeometryCache();\n private mats = new MaterialCache();\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 === 'GameObject') {\n this.threeContext.reparentGameObject(changed.gameObject);\n return;\n }\n if (changed.componentName !== 'Graphics3D') return;\n\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.mount(changed.gameObject, changed.component as Graphics3D);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.handleRemove(changed.gameObject.id);\n } else {\n const changedProp = changed.prop?.prop?.[0];\n if (POSE_PROPS.has(changedProp)) return;\n this.handleRemove(changed.gameObject.id);\n this.mount(changed.gameObject, changed.component as Graphics3D);\n }\n }\n\n rendererUpdate(gameObject: GameObject) {\n const component = gameObject.getComponent(Graphics3D) as Graphics3D;\n if (!component) return;\n const entry = this.entries.get(gameObject.id);\n if (!entry) return;\n\n const transform = gameObject.getComponent(Transform3D) as Transform3D | undefined;\n const applyVisualPose = entry.poseBridge.sync(component, transform);\n const next = poseKey(\n component.positionX, component.positionY, component.positionZ,\n component.rotationX, component.rotationY, component.rotationZ,\n component.scaleX, component.scaleY, component.scaleZ,\n );\n\n if (!applyVisualPose) {\n entry.lastPose = next;\n entry.group.position.set(0, 0, 0);\n entry.group.rotation.set(0, 0, 0);\n entry.group.scale.set(1, 1, 1);\n return;\n }\n\n if (entry.lastPose === next) return;\n entry.lastPose = next;\n entry.group.position.set(component.positionX, component.positionY, component.positionZ);\n entry.group.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n entry.group.scale.set(component.scaleX, component.scaleY, component.scaleZ);\n }\n\n private async mount(gameObject: GameObject, component: Graphics3D) {\n const asyncId = this.increaseAsyncId(gameObject.id);\n let prepared: PreparedPart[];\n try {\n prepared = await this.prepare(component);\n } catch (err) {\n console.error(`Graphics3D prepare failed for ${gameObject.name}`, err);\n return;\n }\n if (!this.validateAsyncId(gameObject.id, asyncId)) {\n this.releasePrepared(prepared);\n return;\n }\n this.attachGroup(gameObject, component, prepared);\n }\n\n private async prepare(component: Graphics3D): Promise<PreparedPart[]> {\n const specs = this.resolveParts(component);\n const prepared: PreparedPart[] = [];\n try {\n for (const primitive of specs) {\n const { key: geoKey, geometry } = this.geos.acquire(primitive);\n try {\n const { key: matKey, material } = await this.mats.acquire(primitive);\n prepared.push({ primitive, geoKey, matKey, geometry, material });\n } catch (err) {\n this.geos.release(geoKey);\n throw err;\n }\n }\n } catch (err) {\n this.releasePrepared(prepared);\n throw err;\n }\n return prepared;\n }\n\n private resolveParts(component: Graphics3D): ResolvedPrimitive[] {\n if (component.parts && component.parts.length > 0) {\n return component.parts.map((part) => resolvePrimitive(part, component));\n }\n return [resolvePrimitive(component)];\n }\n\n private attachGroup(\n gameObject: GameObject,\n component: Graphics3D,\n prepared: PreparedPart[],\n ) {\n const group = new Group();\n const shadows = !!this.threeContext.shadows;\n for (const part of prepared) {\n const mesh = new Mesh(part.geometry, part.material);\n mesh.position.set(part.primitive.positionX, part.primitive.positionY, part.primitive.positionZ);\n mesh.rotation.set(part.primitive.rotationX, part.primitive.rotationY, part.primitive.rotationZ);\n mesh.scale.set(part.primitive.scaleX, part.primitive.scaleY, part.primitive.scaleZ);\n mesh.castShadow = shadows;\n mesh.receiveShadow = shadows;\n group.add(mesh);\n }\n tagObject3D(group, gameObject.id);\n const transform = gameObject.getComponent(Transform3D) as Transform3D | undefined;\n const poseBridge = new VisualPoseBridge();\n const applyVisualPose = poseBridge.sync(component, transform);\n if (applyVisualPose) {\n group.position.set(component.positionX, component.positionY, component.positionZ);\n group.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n group.scale.set(component.scaleX, component.scaleY, component.scaleZ);\n } else {\n group.position.set(0, 0, 0);\n group.rotation.set(0, 0, 0);\n group.scale.set(1, 1, 1);\n }\n const lastPose = poseKey(\n component.positionX, component.positionY, component.positionZ,\n component.rotationX, component.rotationY, component.rotationZ,\n component.scaleX, component.scaleY, component.scaleZ,\n );\n this.threeContext.attachVisual(gameObject.id, group, gameObject);\n this.entries.set(gameObject.id, {\n group,\n prepared,\n lastPose,\n poseBridge,\n });\n }\n\n private releasePrepared(prepared: PreparedPart[]): void {\n for (const part of prepared) {\n this.geos.release(part.geoKey);\n this.mats.release(part.matKey);\n }\n }\n\n private handleRemove(id: number) {\n this.increaseAsyncId(id);\n const entry = this.entries.get(id);\n if (!entry) return;\n this.threeContext.detachVisual(id, entry.group);\n this.releasePrepared(entry.prepared);\n this.entries.delete(id);\n }\n\n onDestroy() {\n for (const [id] of this.entries) {\n this.handleRemove(id);\n }\n this.entries.clear();\n this.geos.clear();\n this.mats.clear();\n }\n}\n"],"names":[],"mappings":";;;;;;AA8Cc,MAAO,UAAW,SAAQ,SAA2B,CAAA;AAAnE,IAAA,WAAA,GAAA;;QAWE,IAAA,CAAA,KAAK,GAAW,KAAK;QASrB,IAAA,CAAA,KAAK,GAAW,QAAQ;QASxB,IAAA,CAAA,SAAS,GAAY,KAAK;QAU1B,IAAA,CAAA,KAAK,GAAW,CAAC;QAUjB,IAAA,CAAA,MAAM,GAAW,CAAC;QAUlB,IAAA,CAAA,KAAK,GAAW,CAAC;QAUjB,IAAA,CAAA,MAAM,GAAW,GAAG;QAUpB,IAAA,CAAA,QAAQ,GAAW,EAAE;QAUrB,IAAA,CAAA,IAAI,GAAW,CAAC;QAUhB,IAAA,CAAA,SAAS,GAAW,CAAC;QAUrB,IAAA,CAAA,SAAS,GAAW,CAAC;QAUrB,IAAA,CAAA,SAAS,GAAW,CAAC;QAUrB,IAAA,CAAA,SAAS,GAAW,CAAC;QAUrB,IAAA,CAAA,SAAS,GAAW,CAAC;QAUrB,IAAA,CAAA,SAAS,GAAW,CAAC;QAUrB,IAAA,CAAA,MAAM,GAAW,CAAC;QAUlB,IAAA,CAAA,MAAM,GAAW,CAAC;QAUlB,IAAA,CAAA,MAAM,GAAW,CAAC;QAYlB,IAAA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;IACnB;;AA3KmB,gBAAgB,GAAA,UAAA,CAAA;IAZpC,UAAU,CAAC,iBAAiB,CAAC;AAC5B,QAAA,UAAU,EAAE;YACV,OAAO,EAAE,OAAO,EAAE,WAAW;YAC7B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM;YACxD,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,QAAQ,EAAE,QAAQ,EAAE,QAAQ;AAC5B,YAAA,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU;AAC/C,YAAA,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO;AACzC,SAAA;QACD,UAAU,EAAE,CAAC,QAAQ,CAAC;KACvB;AACoB,CAAA,EAAA,gBAAgB,CA4KpC;+BA5KoB,gBAAgB;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@combos-fun/plugin-renderer-3d-graphics",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Procedural 3D primitive shapes",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/plugin-renderer-3d-graphics.esm.js",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"three": "^0.172.0",
|
|
30
|
-
"@combos-fun/
|
|
31
|
-
"@combos-fun/
|
|
32
|
-
"@combos-fun/
|
|
30
|
+
"@combos-fun/engine": "0.1.1",
|
|
31
|
+
"@combos-fun/inspector-decorator": "0.1.1",
|
|
32
|
+
"@combos-fun/plugin-renderer-3d": "0.1.1"
|
|
33
33
|
},
|
|
34
34
|
"keywords": [
|
|
35
35
|
"combos-fun",
|