import { Entity, Matrix, Vector3 } from "@galacean/engine"; import { AnchorType, CoordinateType, SearchComponentType } from "./enums/GroupState"; /** * dirty flag for the group */ export declare enum GroupDirtyFlag { /** * none */ None = 0, /** * anchor changed */ AnchorDirty = 1, /** * coordinate changed */ CoordinateDirty = 2, /** * anchor & coordinate changed */ All = 3 } /** * Group */ export declare class Group { private static _tempVec30; private static _tempMat0; private static _tempMat1; private static _tempBoundBox; _gizmoTransformDirty: boolean; private _entities; private _listeners; private _worldMatrix; private _anchorType; private _coordinateType; private _searchComponentType; private _dirtyFlag; get entities(): Entity[]; /** * get anchor type * @return anchor type, pivot or center */ get anchorType(): AnchorType; set anchorType(value: AnchorType); /** * get coordinate type * @return coordinate type, world or local */ get coordinateType(): CoordinateType; set coordinateType(value: CoordinateType); /** * search component type * @return current entity or include children */ get searchComponentType(): SearchComponentType; set searchComponentType(value: SearchComponentType); /** * add entity to the group * @param addEntity - entity to add */ addEntity(addEntity: Entity): boolean; /** * add entities to the group * @param addEntities - entities to add, in array */ addEntities(addEntities: Entity[]): void; /** * remove entity from the group * @param delEntity - entity to delete */ deleteEntity(delEntity: Entity): void; /** * remove entities from the group * @param delEntities - entities to delete, in array */ deleteEntities(delEntities: Entity[]): void; /** * get entity index in group * @param entity * @return number, -1 if not in group */ getIndexOf(entity: Entity): number; /** * clear the group */ reset(): void; /** * get group's world matrix * @param out - updated world matrix for the group * @return boolean, true if group's world matrix needs update */ getWorldMatrix(out?: Matrix): Boolean; /** * get group's world position * @param out - updated world position for the group */ getWorldPosition(out?: Vector3): void; /** * 获取主要的 Entity,即第一个选中的 Entity * @return Entity */ getPrimaryEntity(): Entity; /** * 从上个状态的矩阵变换到目标矩阵 * from 矩阵计算所有节点的在本次变换中的 local 姿态 * to 矩阵计算所有节点的在本次变换后的 world 姿态 * @param from - 初始矩阵 * @param to - 目标矩阵 */ applyTransform(from: Matrix, to: Matrix): void; /** * force update group dirty flag * @param flag - group dirty flag */ setDirtyFlagTrue(flag: GroupDirtyFlag): void; private _applyAdd; private _applyDel; private _onEntityWorldTransformChange; private _hasRelationship; private _updateAnchor; private _updateCoordinate; private _getCenter; }