export default class TransformInfo {
    public position: Laya.Vector3;
    public rotation: Laya.Quaternion;
    public scale: Laya.Vector3;
    public name: string;
    public type:number;
    public tag:string;
    public copyTo(trans: Laya.Transform3D) {
        let position = trans.position;
        this.position.cloneTo(position);
        trans.position = position;

        let rotation = trans.rotation;
        this.rotation.cloneTo(rotation);
        trans.rotation = rotation;
        if (this.scale) {
            let scale = trans.localScale;
            this.scale.cloneTo(scale);
            trans.localScale = scale;
        }
    }

    public static CopyPositionTo(pos: Laya.Vector3, trans: Laya.Transform3D) {
        let position = trans.position;
        pos.cloneTo(position);
        trans.position = position;
    }
    public static CopyRotationTo(rot: Laya.Quaternion, trans: Laya.Transform3D) {
        let rotation = trans.rotation;
        rot.cloneTo(rotation);
        trans.rotation = rotation;
    }

    public static CopyScaleTo(scale: Laya.Vector3, trans: Laya.Transform3D) {
        let localscale = trans.localScale;
        scale.cloneTo(localscale);
        trans.localScale = localscale;
    }
}