1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-21 22:45:36 +02:00
This commit is contained in:
syuilo
2026-03-03 15:51:58 +09:00
parent e336cbad62
commit dbffa5520c
6 changed files with 198 additions and 3 deletions

View File

@@ -134,6 +134,7 @@ type ObjectDef<OpSc extends OptionsSchema = OptionsSchema> = {
loaderResult: BABYLON.ISceneLoaderAsyncResult;
meshUpdated: () => void;
findMesh: (keyword: string) => BABYLON.Mesh;
findMeshes: (keyword: string) => BABYLON.Mesh[];
findMaterial: (keyword: string) => BABYLON.PBRMaterial;
}) => RoomObjectInstance<GetOptionsSchemaValues<OpSc>>;
};
@@ -911,6 +912,10 @@ export class RoomEngine {
}
return mesh as BABYLON.Mesh;
},
findMeshes: (keyword) => {
const meshes = root.getChildMeshes().filter(m => m.name.includes(keyword));
return meshes as BABYLON.Mesh[];
},
findMaterial: (keyword) => {
for (const m of root.getChildMeshes()) {
if (m.material == null) continue;