Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Alfakhori
Gengenbach
Commits
436b1908
Commit
436b1908
authored
Sep 21, 2026
by
Alfakhori
Browse files
prettier
parent
b59e55dd
Pipeline
#12463
passed with stage
in 26 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
public/ar_main.js
View file @
436b1908
...
...
@@ -366,90 +366,71 @@ function placeModel(
);
const
loader
=
new
THREE
.
GLTFLoader
();
const
loader
=
new
THREE
.
GLTFLoader
();
if
(
modelCache
.
has
(
filePath
))
{
if
(
modelCache
.
has
(
filePath
))
{
// Use the already loaded model
const
cachedModel
=
modelCache
.
get
(
filePath
);
const
model
=
cachedModel
.
clone
(
true
);
// Use the already loaded model
const
cachedModel
=
modelCache
.
get
(
filePath
);
const
model
=
cachedModel
.
clone
(
true
);
if
(
modelConfig
&&
modelConfig
.
scale
)
{
if
(
modelConfig
&&
modelConfig
.
scale
)
{
model
.
scale
.
set
(
modelConfig
.
scale
.
x
,
modelConfig
.
scale
.
y
,
modelConfig
.
scale
.
z
modelConfig
.
scale
.
x
,
modelConfig
.
scale
.
y
,
modelConfig
.
scale
.
z
,
);
}
}
model
.
position
.
copy
(
position
);
model
.
position
.
copy
(
position
);
model
.
isPlacedModel
=
true
;
model
.
modelConfig
=
modelConfig
;
model
.
isPlacedModel
=
true
;
model
.
modelConfig
=
modelConfig
;
scene
.
add
(
model
);
scene
.
add
(
model
);
if
(
onPlace
)
{
if
(
onPlace
)
{
onPlace
(
model
);
}
}
else
{
// Model has not been loaded yet
loader
.
load
(
}
}
else
{
// Model has not been loaded yet
loader
.
load
(
filePath
,
(
gltf
)
=>
{
// Store the original model in the cache
modelCache
.
set
(
filePath
,
gltf
.
scene
);
// Store the original model in the cache
modelCache
.
set
(
filePath
,
gltf
.
scene
);
const
model
=
gltf
.
scene
.
clone
(
true
);
const
model
=
gltf
.
scene
.
clone
(
true
);
if
(
modelConfig
&&
modelConfig
.
scale
)
{
model
.
scale
.
set
(
modelConfig
.
scale
.
x
,
modelConfig
.
scale
.
y
,
modelConfig
.
scale
.
z
);
}
if
(
modelConfig
&&
modelConfig
.
scale
)
{
model
.
scale
.
set
(
modelConfig
.
scale
.
x
,
modelConfig
.
scale
.
y
,
modelConfig
.
scale
.
z
,
);
}
model
.
position
.
copy
(
position
);
model
.
position
.
copy
(
position
);
model
.
isPlacedModel
=
true
;
model
.
isPlacedModel
=
true
;
model
.
modelConfig
=
modelConfig
;
model
.
modelConfig
=
modelConfig
;
scene
.
add
(
model
);
scene
.
add
(
model
);
if
(
onPlace
)
{
onPlace
(
model
);
}
if
(
onPlace
)
{
onPlace
(
model
);
}
},
undefined
,
(
error
)
=>
{
console
.
error
(
"
Fehler beim Laden des Modells:
"
,
error
);
}
);
}
console
.
error
(
"
Fehler beim Laden des Modells:
"
,
error
);
},
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment