import { deprecation, v8_0_0 } from '../../../utils/logging/deprecation.mjs';
import { Container } from '../../scene/Container.mjs';
import { MeshGeometry } from './MeshGeometry.mjs';
import { MeshView } from './MeshView.mjs';

class Mesh extends Container {
  constructor(...args) {
    let options = args[0];
    if (options instanceof MeshGeometry) {
      deprecation(v8_0_0, "Mesh: use new Mesh({ geometry, shader }) instead");
      options = {
        geometry: options,
        shader: args[1]
      };
      if (args[3]) {
        deprecation(v8_0_0, "Mesh: topology argument has been removed, use geometry.topology instead");
        options.geometry.topology = args[3];
      }
    }
    super({
      view: new MeshView(options),
      label: "Mesh",
      ...options
    });
    this.allowChildren = false;
  }
  get texture() {
    return this.view.texture;
  }
  set texture(value) {
    this.view.texture = value;
  }
  get geometry() {
    return this.view.geometry;
  }
  set geometry(value) {
    this.view.geometry = value;
  }
  get material() {
    deprecation(v8_0_0, "mesh.material property has been removed, use mesh.shader instead");
    return this.view.shader;
  }
  get shader() {
    return this.view.shader;
  }
}

export { Mesh };
//# sourceMappingURL=Mesh.mjs.map
