AssetPoints based on type fixed, Asset Get,Create, 3d widget type updated in socket
This commit is contained in:
@@ -8,35 +8,10 @@ export interface assetData extends Document {
|
||||
isLocked: boolean;
|
||||
type: string;
|
||||
isVisible: boolean;
|
||||
isArchive:false
|
||||
// position: [];
|
||||
// rotation: {
|
||||
// x: number;
|
||||
// y: number;
|
||||
// z: number;
|
||||
// };
|
||||
points: {
|
||||
uuid: string;
|
||||
position: [];
|
||||
rotation: [];
|
||||
actions: [mongoose.Types.ObjectId];
|
||||
triggers: [mongoose.Types.ObjectId];
|
||||
connections: {
|
||||
source: {
|
||||
pathUUID: string;
|
||||
pointUUID: string;
|
||||
};
|
||||
targets: [
|
||||
{
|
||||
pathUUID: string;
|
||||
pointUUID: string;
|
||||
}
|
||||
];
|
||||
}[];
|
||||
}[];
|
||||
isArchive: false;
|
||||
points: [] | {};
|
||||
position: [];
|
||||
// rotation: [];
|
||||
rotation: {
|
||||
rotation: {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
@@ -44,37 +19,14 @@ export interface assetData extends Document {
|
||||
speed: number | string;
|
||||
}
|
||||
|
||||
// Define the Mongoose Schema
|
||||
const assetDataSchema: Schema = new Schema({
|
||||
isArchive:{type:Boolean,default:false},
|
||||
isArchive: { type: Boolean, default: false },
|
||||
modeluuid: { type: String },
|
||||
modelfileID: { type: String },
|
||||
modelname: { type: String },
|
||||
type: { type: String },
|
||||
// assetPosition: { type: Array },
|
||||
points: [
|
||||
{
|
||||
uuid: { type: String },
|
||||
position: { type: Array },
|
||||
rotation: { type: Array },
|
||||
actions: [{ type: mongoose.Schema.Types.ObjectId, ref: "Actions" }],
|
||||
triggers: [{ type: mongoose.Schema.Types.ObjectId, ref: "Triggers" }],
|
||||
connections: {
|
||||
source: {
|
||||
pathUUID: { type: String },
|
||||
pointUUID: { type: String },
|
||||
},
|
||||
targets: [
|
||||
{
|
||||
pathUUID: { type: String },
|
||||
pointUUID: { type: String },
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
position: { type: Array},
|
||||
// rotation: { type: Array},
|
||||
points: { type: Schema.Types.Mixed },
|
||||
position: { type: Array },
|
||||
rotation: {
|
||||
x: { type: Number },
|
||||
y: { type: Number },
|
||||
@@ -90,3 +42,96 @@ const assetModel = (db: string) => {
|
||||
return MainModel(db, "Assets", assetDataSchema, "Assets");
|
||||
};
|
||||
export default assetModel;
|
||||
|
||||
// import mongoose, { Document, Schema } from "mongoose";
|
||||
// import MainModel from "../../../connect/mongoose.ts";
|
||||
|
||||
// export interface assetData extends Document {
|
||||
// modeluuid: string;
|
||||
// modelfileID: string;
|
||||
// modelname: string;
|
||||
// isLocked: boolean;
|
||||
// type: string;
|
||||
// isVisible: boolean;
|
||||
// isArchive: false;
|
||||
// // position: [];
|
||||
// // rotation: {
|
||||
// // x: number;
|
||||
// // y: number;
|
||||
// // z: number;
|
||||
// // };
|
||||
// points: {
|
||||
// uuid: string;
|
||||
// position: [];
|
||||
// rotation: [];
|
||||
// actions: [mongoose.Types.ObjectId];
|
||||
// triggers: [mongoose.Types.ObjectId];
|
||||
// connections: {
|
||||
// source: {
|
||||
// pathUUID: string;
|
||||
// pointUUID: string;
|
||||
// };
|
||||
// targets: [
|
||||
// {
|
||||
// pathUUID: string;
|
||||
// pointUUID: string;
|
||||
// }
|
||||
// ];
|
||||
// }[];
|
||||
// }[];
|
||||
// position: [];
|
||||
// // rotation: [];
|
||||
// rotation: {
|
||||
// x: number;
|
||||
// y: number;
|
||||
// z: number;
|
||||
// };
|
||||
// speed: number | string;
|
||||
// }
|
||||
|
||||
// // Define the Mongoose Schema
|
||||
// const assetDataSchema: Schema = new Schema({
|
||||
// isArchive: { type: Boolean, default: false },
|
||||
// modeluuid: { type: String },
|
||||
// modelfileID: { type: String },
|
||||
// modelname: { type: String },
|
||||
// type: { type: String },
|
||||
// // assetPosition: { type: Array },
|
||||
// points: [
|
||||
// {
|
||||
// uuid: { type: String },
|
||||
// position: { type: Array },
|
||||
// rotation: { type: Array },
|
||||
// actions: [{ type: mongoose.Schema.Types.ObjectId, ref: "Actions" }],
|
||||
// triggers: [{ type: mongoose.Schema.Types.ObjectId, ref: "Triggers" }],
|
||||
// connections: {
|
||||
// source: {
|
||||
// pathUUID: { type: String },
|
||||
// pointUUID: { type: String },
|
||||
// },
|
||||
// targets: [
|
||||
// {
|
||||
// pathUUID: { type: String },
|
||||
// pointUUID: { type: String },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// position: { type: Array },
|
||||
// // rotation: { type: Array},
|
||||
// rotation: {
|
||||
// x: { type: Number },
|
||||
// y: { type: Number },
|
||||
// z: { type: Number },
|
||||
// },
|
||||
// speed: { type: Schema.Types.Mixed },
|
||||
// isLocked: { type: Boolean },
|
||||
// isVisible: { type: Boolean },
|
||||
// });
|
||||
|
||||
// // export default floorItemsModel;
|
||||
// const assetModel = (db: string) => {
|
||||
// return MainModel(db, "Assets", assetDataSchema, "Assets");
|
||||
// };
|
||||
// export default assetModel;
|
||||
|
||||
Reference in New Issue
Block a user