refactor: change loadModel parameter from string to string array
- Update loadModel signature: url: string -> urls: string[] - Update validation logic for array parameter - Update all demo files to pass array instead of single string
This commit is contained in:
@@ -331,7 +331,7 @@ const loadModel = () => {
|
||||
// 加载模型文件(从 model 目录)
|
||||
const modelUrl = 'https://lyz-1259524260.cos.ap-guangzhou.myqcloud.com/iflow/models/8634e556-a94e-4ba7-be3e-2ea1507cced5/';
|
||||
|
||||
engine.value.engine.loadModel(modelUrl, {
|
||||
engine.value.engine.loadModel([modelUrl], {
|
||||
position: [0, 0, 0], // 初始位置
|
||||
rotation: [0, 0, 0], // 初始旋转
|
||||
scale: [1, 1, 1] // 初始缩放
|
||||
@@ -361,7 +361,7 @@ const switchModel = () => {
|
||||
}
|
||||
|
||||
try {
|
||||
engine.value.engine.loadModel(newUrl.trim(), {
|
||||
engine.value.engine.loadModel([newUrl.trim()], {
|
||||
position: [0, 0, 0],
|
||||
rotation: [0, 0, 0],
|
||||
scale: [1, 1, 1]
|
||||
|
||||
Reference in New Issue
Block a user