Skip to content

Commit c107d83

Browse files
committed
Formatting
1 parent b2596dc commit c107d83

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

fission/src/mirabuf/MirabufInstance.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ const CHROME_VERSION_FOR_INSTANCED_MESH = 139
1313
const detectInstancedMeshSupport = (): boolean => {
1414
const userAgent = navigator.userAgent
1515
const chromeMatch = userAgent.match(/Chrome\/(\d+)/)
16-
16+
1717
if (chromeMatch) {
1818
const chromeVersion = parseInt(chromeMatch[1], 10)
19-
console.log(`Detected Chrome ${chromeVersion}, using ${chromeVersion >= CHROME_VERSION_FOR_INSTANCED_MESH ? 'InstancedMesh' : 'BatchedMesh'}`)
19+
console.log(
20+
`Detected Chrome ${chromeVersion}, using ${chromeVersion >= CHROME_VERSION_FOR_INSTANCED_MESH ? "InstancedMesh" : "BatchedMesh"}`
21+
)
2022
return chromeVersion >= CHROME_VERSION_FOR_INSTANCED_MESH
2123
}
22-
24+
2325
console.log(`Non-Chrome browser detected (${userAgent}), using BatchedMesh`)
2426
return false
2527
}
@@ -194,7 +196,7 @@ class MirabufInstance {
194196
Object.values(instances).forEach(instance => {
195197
const definition = assembly.data!.parts!.partDefinitions![instance.partDefinitionReference!]
196198
const bodies = definition?.bodies ?? []
197-
199+
198200
bodies.forEach(body => {
199201
const mesh = body?.triangleMesh?.mesh
200202
if (!mesh?.verts || !mesh.normals || !mesh.uv || !mesh.indices) return
@@ -208,7 +210,7 @@ class MirabufInstance {
208210

209211
const geometry = new THREE.BufferGeometry()
210212
transformGeometry(geometry, mesh)
211-
213+
212214
// Create InstancedMesh with count of 1 for this body
213215
const instancedMesh = new THREE.InstancedMesh(geometry, material, 1)
214216
instancedMesh.castShadow = true
@@ -245,7 +247,7 @@ class MirabufInstance {
245247

246248
const batchMap = new Map<THREE.Material, Map<string, [mirabuf.IBody, Array<mirabuf.IPartInstance>]>>()
247249
const countMap = new Map<THREE.Material, BatchCounts>()
248-
250+
249251
// Filter all instances by first material, then body
250252
Object.values(instances).forEach(instance => {
251253
const definition = assembly.data!.parts!.partDefinitions![instance.partDefinitionReference!]

fission/src/mirabuf/MirabufSceneObject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ class MirabufSceneObject extends SceneObject implements ContextSupplier {
474474
meshes.forEach(([mesh, index]) => {
475475
mesh.setMatrixAt(index, partTransform)
476476
// Only update instanceMatrix for InstancedMesh
477-
if ('instanceMatrix' in mesh) {
477+
if ("instanceMatrix" in mesh) {
478478
mesh.instanceMatrix.needsUpdate = true
479479
}
480480
})

0 commit comments

Comments
 (0)