var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Object3D } from "three";
import { serializable } from "../engine/engine_serialization_decorator.js";
import { Behaviour } from "./Component.js";
/**
 * A LookAtConstraint is used by OrbitControls to make the camera look at a target.
 * This component is used by {@link OrbitControls} internally.
 *
 * @summary Look At Constraint for OrbitControls
 * @category Camera Controls
 * @group Components
 */
export class LookAtConstraint extends Behaviour {
    /**
     * When true the constraint is active.
     */
    constraintActive = true;
    /**
     * When true the look at is locked to the position of the assigned sources.
     */
    locked = false;
    /**
     * The sources to look at.
     */
    sources = [];
    /**
     * Set the position of the constraint.
     */
    setConstraintPosition(worldPosition) {
        const source = this.sources[0];
        if (source)
            source.worldPosition = worldPosition;
    }
}
__decorate([
    serializable()
], LookAtConstraint.prototype, "constraintActive", void 0);
__decorate([
    serializable()
], LookAtConstraint.prototype, "locked", void 0);
__decorate([
    serializable(Object3D)
], LookAtConstraint.prototype, "sources", void 0);
//# sourceMappingURL=LookAtConstraint.js.map