diff --git a/public/models/es/sensor_pressue/license.txt b/public/models/es/sensor_pressure/license.txt similarity index 100% rename from public/models/es/sensor_pressue/license.txt rename to public/models/es/sensor_pressure/license.txt diff --git a/public/models/es/sensor_pressue/scene.bin b/public/models/es/sensor_pressure/scene.bin similarity index 100% rename from public/models/es/sensor_pressue/scene.bin rename to public/models/es/sensor_pressure/scene.bin diff --git a/public/models/es/sensor_pressue/scene.gltf b/public/models/es/sensor_pressure/scene.gltf similarity index 100% rename from public/models/es/sensor_pressue/scene.gltf rename to public/models/es/sensor_pressure/scene.gltf diff --git a/public/models/es/sensor_pressue/textures/material_10_specularGlossiness.png b/public/models/es/sensor_pressure/textures/material_10_specularGlossiness.png similarity index 100% rename from public/models/es/sensor_pressue/textures/material_10_specularGlossiness.png rename to public/models/es/sensor_pressure/textures/material_10_specularGlossiness.png diff --git a/public/models/es/sensor_pressue/textures/material_diffuse.png b/public/models/es/sensor_pressure/textures/material_diffuse.png similarity index 100% rename from public/models/es/sensor_pressue/textures/material_diffuse.png rename to public/models/es/sensor_pressure/textures/material_diffuse.png diff --git a/public/models/es/sensor_pressue/textures/material_specularGlossiness.png b/public/models/es/sensor_pressure/textures/material_specularGlossiness.png similarity index 100% rename from public/models/es/sensor_pressue/textures/material_specularGlossiness.png rename to public/models/es/sensor_pressure/textures/material_specularGlossiness.png diff --git a/public/models/es/sensor_temperature/license.txt b/public/models/es/sensor_temp/license.txt similarity index 100% rename from public/models/es/sensor_temperature/license.txt rename to public/models/es/sensor_temp/license.txt diff --git a/public/models/es/sensor_temperature/scene.bin b/public/models/es/sensor_temp/scene.bin similarity index 100% rename from public/models/es/sensor_temperature/scene.bin rename to public/models/es/sensor_temp/scene.bin diff --git a/public/models/es/sensor_temperature/scene.gltf b/public/models/es/sensor_temp/scene.gltf similarity index 100% rename from public/models/es/sensor_temperature/scene.gltf rename to public/models/es/sensor_temp/scene.gltf diff --git a/public/models/es/sensor_temperature/textures/Anodized_Aluminum_Brushed_90_Black_1_normal.png b/public/models/es/sensor_temp/textures/Anodized_Aluminum_Brushed_90_Black_1_normal.png similarity index 100% rename from public/models/es/sensor_temperature/textures/Anodized_Aluminum_Brushed_90_Black_1_normal.png rename to public/models/es/sensor_temp/textures/Anodized_Aluminum_Brushed_90_Black_1_normal.png diff --git a/public/models/es/sensor_temperature/textures/Anodized_Aluminum_Brushed_90_Black_2_normal.png b/public/models/es/sensor_temp/textures/Anodized_Aluminum_Brushed_90_Black_2_normal.png similarity index 100% rename from public/models/es/sensor_temperature/textures/Anodized_Aluminum_Brushed_90_Black_2_normal.png rename to public/models/es/sensor_temp/textures/Anodized_Aluminum_Brushed_90_Black_2_normal.png diff --git a/public/models/es/sensor_temperature/textures/Titanium_Textured_2_normal.png b/public/models/es/sensor_temp/textures/Titanium_Textured_2_normal.png similarity index 100% rename from public/models/es/sensor_temperature/textures/Titanium_Textured_2_normal.png rename to public/models/es/sensor_temp/textures/Titanium_Textured_2_normal.png diff --git a/src/hooks/useDrawTopology.ts b/src/hooks/useDrawTopology.ts index dbe21fe..1a95fea 100644 --- a/src/hooks/useDrawTopology.ts +++ b/src/hooks/useDrawTopology.ts @@ -143,7 +143,7 @@ export async function useDrawTopology(dom: HTMLElement) { const loadModel = async ( type: number, modelPath: string, - scale: [number, number, number], + scaleFactor: number, rotationY: number ) => { const gltf: any = await new Promise((resolve) => { @@ -151,7 +151,7 @@ export async function useDrawTopology(dom: HTMLElement) { }) const modelTemplate = gltf.scene - modelTemplate.scale.set(...scale) + modelTemplate.scale.set(scaleFactor, scaleFactor, scaleFactor) modelTemplate.rotation.y = rotationY modelTemplate.traverse((object: any) => { if (object.isMesh) { @@ -166,52 +166,52 @@ export async function useDrawTopology(dom: HTMLElement) { await loadModel( NODE_TYPE.TSCH, '/models/wi-fi_router/scene.gltf', - [1.6, 1.6, 1.6], + 1.6, -Math.PI / 2 ) - await loadModel(NODE_TYPE.TSN, '/models/switch/scene.gltf', [7, 7, 7], 0) - await loadModel(NODE_TYPE.FIVE_G_GNB, '/models/5g_tower/scene.gltf', [6, 6, 6], 0) - await loadModel(NODE_TYPE.FIVE_G_UE, '/models/5g_ue/scene.gltf', [0.5, 0.5, 0.5], -Math.PI / 2) + await loadModel(NODE_TYPE.TSN, '/models/switch/scene.gltf', 7, 0) + await loadModel(NODE_TYPE.FIVE_G_GNB, '/models/5g_tower/scene.gltf', 6, 0) + await loadModel(NODE_TYPE.FIVE_G_UE, '/models/5g_ue/scene.gltf', 0.5, -Math.PI / 2) await loadModel( NODE_TYPE.END_SYSTEM_SERVER, '/models/es/server/scene.gltf', - [1.5, 1.5, 1.5], + 1.5, Math.PI / 2 ) await loadModel( NODE_TYPE.END_SYSTEM_SENSOR, '/models/es/sensor/scene.glb', - [2, 2, 2], + 2, -Math.PI / 3 ) await loadModel( NODE_TYPE.END_SYSTEM_SENSOR_TEMP, '/models/es/sensor_temp/scene.gltf', - [2, 2, 2], + 12, -Math.PI / 3 ) await loadModel( NODE_TYPE.END_SYSTEM_SENSOR_HUMIDITY, '/models/es/sensor_humidity/scene.gltf', - [2, 2, 2], + 100, -Math.PI / 3 ) await loadModel( NODE_TYPE.END_SYSTEM_SENSOR_PRESSURE, '/models/es/sensor_pressure/scene.gltf', - [2, 2, 2], + 16, -Math.PI / 3 ) await loadModel( NODE_TYPE.END_SYSTEM_ACTUATOR_ROBOTIC_ARM, '/models/es/robotic_arm/scene.gltf', - [0.004, 0.004, 0.004], + .004, -Math.PI / 2 ) await loadModel( NODE_TYPE.END_SYSTEM_ACTUATOR_PNEUMATIC, '/models/es/actuator_pneumatic/scene.gltf', - [0.004, 0.004, 0.004], + 8, -Math.PI / 2 ) Network.Logs.value[0] = `Loading resources...done.`