import { Angle, AppObjectEntity, getSingletonComponent, MemoizedAngle, MemoizedNumber, } from "@vived/core";
import { Transform3D } from "../../Transform3D";
export class CameraEntity extends AppObjectEntity {
}
CameraEntity.type = "CAMERA_ENTITY";
CameraEntity.get = (appObjects) => getSingletonComponent(CameraEntity.type, appObjects);
export function makeCameraEntity(appObject) {
    return new CameraEntityImp(appObject);
}
class CameraEntityImp extends CameraEntity {
    get nearClip() {
        return this.memoizedNearClip.val;
    }
    set nearClip(val) {
        this.memoizedNearClip.val = val;
    }
    get farClip() {
        return this.memoizedFarClip.val;
    }
    set farClip(val) {
        this.memoizedFarClip.val = val;
    }
    get fov() {
        return this.memoizedFOV.val;
    }
    set fov(val) {
        this.memoizedFOV.val = val;
    }
    constructor(appObject) {
        super(appObject, CameraEntity.type);
        this.memoizedNearClip = new MemoizedNumber(0.01, this.notifyOnChange);
        this.memoizedFarClip = new MemoizedNumber(10, this.notifyOnChange);
        this.memoizedFOV = new MemoizedAngle(Angle.FromRadians(0.26), this.notifyOnChange);
        this.transform = Transform3D.addIfMissing(appObject);
        this.transform.addChangeObserver(this.notifyOnChange);
    }
}
//# sourceMappingURL=CameraEntity.js.map