Source: objects/AmbientLight.js

import { Utils } from '../common/Utils';
import { BaseLight } from './BaseLight';

/**
 * @class AmbientLight
 * The ambient light object.
 * @memberof THING
 * @extends THING.BaseLight
 * @public
 */
class AmbientLight extends BaseLight {

	/**
	 * The ambient light object, just only need 1 in the scene normally.
	 * @param {Object} param The initial parameters.
	 */
	constructor(param = {}) {
		super(param);
	}

	onBeforeSetup(param) {
		param['renderableNode'] = param['renderableNode'] || Utils.createObject('AmbientLight');

		super.onBeforeSetup(param);
	}

	onBeforeDestroy() {
		if (!super.onBeforeDestroy()) {
			return false;
		}

		if (this.app.objectManager.keepAliveObjects.includes(this)) {
			return false;
		}

		return true;
	}

	// #region Accessor

	// #endregion

	/**
	 * Check whether it's AmbientLight type or inherit from it.
	 * @type {Boolean}
	 * @example
	 * let point = new THING.AttachedPoint();
	 * let ret = point.isAttachedPoint;
	 * // @expect(ret == true);
	 * @public
	 */
	get isAmbientLight() {
		return true;
	}

}

export { AmbientLight }