import {Vector3D} from "@awayjs/core" import {Billboard, AlignmentMode, OrientationMode} from "@awayjs/scene"; import {MaterialBase as AwayMaterialBase} from "@awayjs/materials"; import {Entity} from "./Entity"; import {MaterialBase} from "../materials/MaterialBase"; import {Object3D} from "../core/base/Object3D"; export class Sprite3D extends Entity { constructor(mat:MaterialBase, width:number, height:number) { super(new Billboard( mat.adaptee)); ( this._adaptee).orientationMode = OrientationMode.CAMERA_PLANE; ( this._adaptee).alignmentMode = AlignmentMode.REGISTRATION_POINT; ( this._adaptee).width = width; ( this._adaptee).height = height; ( this._adaptee).registrationPoint = new Vector3D(width/2, height/2, 0) } public get material():MaterialBase { return (( this._adaptee).material? ( this._adaptee).material.adapter : null); } public set material(value:MaterialBase) { ( this._adaptee).material = (value? value.adaptee : null); } }