progress
This commit is contained in:
parent
50822a031d
commit
d8b5018cb2
69 changed files with 3302 additions and 3652 deletions
40
ui/src/core/model/scene_asset.ts
Normal file
40
ui/src/core/model/scene_asset.ts
Normal file
|
@ -0,0 +1,40 @@
|
|||
import { IsArray, IsEnum, IsNumber, IsOptional, IsString, ValidateNested } from "class-validator";
|
||||
import { Type } from "class-transformer";
|
||||
import { CameraModel } from "./camera_model";
|
||||
import { SceneModelsTypes } from "./scene_models_type";
|
||||
import { RobotModel } from "./robot_model";
|
||||
import { SolidModel } from "./solid_model";
|
||||
import { PointModel } from "./point_model";
|
||||
import { ZoneModel } from "./zone_model";
|
||||
import { CoreThreeRepository } from "../repository/core_three_repository";
|
||||
import { LightModel } from "./light_model";
|
||||
import { Vector3 } from "three";
|
||||
|
||||
export abstract class Instance {
|
||||
abstract icon: string;
|
||||
@Type(() => Vector3)
|
||||
vector3: Vector3;
|
||||
quaternion: number[];
|
||||
name: string;
|
||||
toWebGl = (coreThreeRepository: CoreThreeRepository) => {};
|
||||
update = (coreThreeRepository: CoreThreeRepository) => {};
|
||||
}
|
||||
|
||||
export class SceneAsset {
|
||||
@IsArray()
|
||||
@Type(() => Instance, {
|
||||
discriminator: {
|
||||
property: "type",
|
||||
subTypes: [
|
||||
{ value: SolidModel, name: SceneModelsTypes.SOLID },
|
||||
{ value: CameraModel, name: SceneModelsTypes.CAMERA },
|
||||
{ value: RobotModel, name: SceneModelsTypes.ROBOT },
|
||||
{ value: PointModel, name: SceneModelsTypes.POINT },
|
||||
{ value: LightModel, name: SceneModelsTypes.LIGHT },
|
||||
{ value: ZoneModel, name: SceneModelsTypes.ZONE },
|
||||
],
|
||||
},
|
||||
keepDiscriminatorProperty: true,
|
||||
})
|
||||
scene: (Instance | SolidModel | CameraModel | RobotModel | PointModel | ZoneModel)[];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue