Visualization Part 2d and floating API Completed. Template Save and Get API completed

This commit is contained in:
2025-03-29 17:31:08 +05:30
parent bb3ece0ff6
commit 7c0e59edad
21 changed files with 604 additions and 228 deletions

View File

@@ -1,44 +1,41 @@
import mongoose, { Document, Schema } from "mongoose";
import MainModel from "../../../connect/mongoose.ts";
interface IAction {
uuid: string;
name: string;
type: string;
material: string;
delay: string;
spawnInterval: string;
isUsed: boolean;
}
// Interface for TypeScript with PascalCase
export interface assetData extends Document {
modeluuid: string;
modelfileID: string;
modelname: string;
isLocked: boolean;
type: string;
isVisible: boolean;
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
// },
// target:[]
// }
}
];
// 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;
}
];
}[];
}[];
assetPosition: number[];
assetRotation: number[];
speed: number;
}
// Define the Mongoose Schema
@@ -46,7 +43,8 @@ const assetDataSchema: Schema = new Schema({
modeluuid: { type: String },
modelfileID: { type: String },
modelname: { type: String },
position: { type: Array },
type: { type: String },
// assetPosition: { type: Array },
points: [
{
uuid: { type: String },
@@ -54,15 +52,30 @@ const assetDataSchema: Schema = new Schema({
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 },
},
],
},
},
],
assetPosition: { type: [Number] },
assetRotation: { type: [Number] },
speed: { type: Number },
isLocked: { type: Boolean },
isVisible: { type: Boolean },
rotation: {
x: { type: Number },
y: { type: Number },
z: { type: Number },
},
// rotation: {
// x: { type: Number },
// y: { type: Number },
// z: { type: Number },
// },
});
// export default floorItemsModel;