import { Object3D } from './Object3D';
const __ = {
private: Symbol('private'),
}
/**
* AttachedPoint - 挂接点
*
* 提供挂点物体能力,挂点物体可以忽略父物体的缩放和旋转,但仍会同步相对位置。
*
* @class AttachedPoint
* @memberof THING
* @extends THING.Object3D
* @public
*/
class AttachedPoint extends Object3D {
static defaultTagArray = ['Dummy'];
/**
* 提供挂点物体能力。挂点物体可以忽略父物体的缩放和旋转,但是仍旧会同步相对位置。
* @param {object} param 初始参数。
*/
constructor(param = {}) {
super(param);
// Before super class could set local position in constructor, so we need to define out of private field
this._offset = this._offset || null;
this[__.private] = {};
let _private = this[__.private];
_private.object = null;
this.node.setAttribute('MatrixUpdateMode', 'EliminateParentRS')
}
// #region Overrides
onLoadResource(options, resolve, reject) {
resolve();
}
/**
* 获取/设置 相对父物体坐标系下位置
* @type {Array<number>}
* @public
*/
// get localPosition() {
// return this._offset;
// }
// set localPosition(value) {
// this._offset = value.slice(0);
// }
/**
* 判断是否为挂点物体类或继承于此类
* @type {boolean}
* @example
* let point = new THING.AttachedPoint();
* let ret = point.isAttachedPoint;
* // @expect(ret == true);
* @public
*/
get isAttachedPoint() {
return true;
}
}
export { AttachedPoint }