mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-12 08:14:08 +02:00
wip
This commit is contained in:
@@ -164,6 +164,7 @@ type ObjectDef<OpSc extends OptionsSchema = OptionsSchema> = {
|
||||
findMesh: (keyword: string) => BABYLON.Mesh;
|
||||
findMeshes: (keyword: string) => BABYLON.Mesh[];
|
||||
findMaterial: (keyword: string) => BABYLON.PBRMaterial;
|
||||
findTransformNode: (keyword: string) => BABYLON.TransformNode;
|
||||
}) => RoomObjectInstance<GetOptionsSchemaValues<OpSc>>;
|
||||
};
|
||||
|
||||
@@ -956,6 +957,13 @@ export class RoomEngine {
|
||||
findMaterial: (keyword) => {
|
||||
return findMaterial(root, keyword);
|
||||
},
|
||||
findTransformNode: (keyword) => {
|
||||
const node = root.getChildTransformNodes().find(n => n.name.includes(keyword));
|
||||
if (node == null) {
|
||||
throw new Error(`TransformNode with keyword "${keyword}" not found for object ${args.type} (${args.id})`);
|
||||
}
|
||||
return node;
|
||||
},
|
||||
});
|
||||
|
||||
this.objectInstances.set(args.id, objectInstance);
|
||||
|
||||
Reference in New Issue
Block a user