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
Show whitespace changes
Inline
Side-by-side
public/ar_main.js
View file @
436b1908
...
@@ -366,22 +366,18 @@ function placeModel(
...
@@ -366,22 +366,18 @@ 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
// Use the already loaded model
const
cachedModel
=
modelCache
.
get
(
filePath
);
const
cachedModel
=
modelCache
.
get
(
filePath
);
const
model
=
cachedModel
.
clone
(
true
);
const
model
=
cachedModel
.
clone
(
true
);
if
(
if
(
modelConfig
&&
modelConfig
.
scale
)
{
modelConfig
&&
modelConfig
.
scale
)
{
model
.
scale
.
set
(
model
.
scale
.
set
(
modelConfig
.
scale
.
x
,
modelConfig
.
scale
.
x
,
modelConfig
.
scale
.
y
,
modelConfig
.
scale
.
y
,
modelConfig
.
scale
.
z
modelConfig
.
scale
.
z
,
);
);
}
}
...
@@ -395,33 +391,22 @@ if (modelCache.has(filePath)) {
...
@@ -395,33 +391,22 @@ if (modelCache.has(filePath)) {
if
(
onPlace
)
{
if
(
onPlace
)
{
onPlace
(
model
);
onPlace
(
model
);
}
}
}
else
{
}
else
{
// Model has not been loaded yet
// Model has not been loaded yet
loader
.
load
(
loader
.
load
(
filePath
,
filePath
,
(
gltf
)
=>
{
(
gltf
)
=>
{
// Store the original model in the cache
// Store the original model in the cache
modelCache
.
set
(
modelCache
.
set
(
filePath
,
gltf
.
scene
);
filePath
,
gltf
.
scene
);
const
model
=
const
model
=
gltf
.
scene
.
clone
(
true
);
gltf
.
scene
.
clone
(
true
);
if
(
if
(
modelConfig
&&
modelConfig
.
scale
)
{
modelConfig
&&
modelConfig
.
scale
)
{
model
.
scale
.
set
(
model
.
scale
.
set
(
modelConfig
.
scale
.
x
,
modelConfig
.
scale
.
x
,
modelConfig
.
scale
.
y
,
modelConfig
.
scale
.
y
,
modelConfig
.
scale
.
z
modelConfig
.
scale
.
z
,
);
);
}
}
...
@@ -429,8 +414,7 @@ if (modelCache.has(filePath)) {
...
@@ -429,8 +414,7 @@ if (modelCache.has(filePath)) {
model
.
isPlacedModel
=
true
;
model
.
isPlacedModel
=
true
;
model
.
modelConfig
=
model
.
modelConfig
=
modelConfig
;
modelConfig
;
scene
.
add
(
model
);
scene
.
add
(
model
);
...
@@ -442,14 +426,11 @@ if (modelCache.has(filePath)) {
...
@@ -442,14 +426,11 @@ if (modelCache.has(filePath)) {
undefined
,
undefined
,
(
error
)
=>
{
(
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