import {element, type ElementAttributes} from '@lume/element' import {Element3D, type Element3DAttributes} from '../core/Element3D.js' import {autoDefineElements} from '../LumeConfig.js' import type {ElementWithBehaviors} from '../behaviors/ElementWithBehaviors.js' import type {ObjModelBehavior, ObjModelBehaviorAttributes} from '../behaviors/index.js' export type ObjModelAttributes = Element3DAttributes | ObjModelBehaviorAttributes /** * @element lume-obj-model * @class ObjModel - * * Defines the `` element, short for ``, for loading 3D models in the OBJ format (`.obj` files * paired with `.mtl` files). * * HTML Example: * * ```html * * * * * ``` * * JavaScript Example: * * ```js * const scene = new Scene * scene.webgl = true * document.body.append(scene) * const model = new ObjModel * model.obj = 'path/to/model.obj' * model.mtl = 'path/to/model.mtl' * model.on('MODEL_LOAD', () => console.log('loaded')) * scene.add(model) * ``` */ export @element('lume-obj-model', autoDefineElements) class ObjModel extends Element3D { override initialBehaviors = {model: 'obj'} } export interface ObjModel extends ElementWithBehaviors {} declare module 'solid-js' { namespace JSX { interface IntrinsicElements { 'lume-obj-model': ElementAttributes } } } declare global { interface HTMLElementTagNameMap { 'lume-obj-model': ObjModel } }