format project
This commit is contained in:
@@ -25,18 +25,18 @@ function Asset({ geometry: incomingGeo }) {
|
||||
}, [incomingGeo])
|
||||
if (!incomingGeo) return null
|
||||
|
||||
let groupData = incomingGeo.children ? incomingGeo : null
|
||||
if(lastGroup && lastGroup != groupData){
|
||||
const groupData = incomingGeo.children ? incomingGeo : null
|
||||
if (lastGroup && lastGroup != groupData) {
|
||||
state.scene.remove(lastGroup)
|
||||
lastGroup.children.forEach(c=>c?.geometry?.dispose())
|
||||
lastGroup.children.forEach((c) => c?.geometry?.dispose())
|
||||
// returning <primitive object={groupData} /> does not add the new group to the scene
|
||||
// there is probably some useRef magic that would make this work, but I don't have time to reseach it
|
||||
/// FIXME - do this properly with useRef or other react magic
|
||||
if(groupData) state.scene.add(groupData)
|
||||
if (groupData) state.scene.add(groupData)
|
||||
}
|
||||
lastGroup = groupData
|
||||
|
||||
if(groupData) return <primitive object={groupData} />
|
||||
if (groupData) return <primitive object={groupData} />
|
||||
|
||||
if (incomingGeo.children) return <primitive object={incomingGeo} />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user