getNodeRef method
Returns a reference to a shared resource, cloning it if necessary.
Implementation
Object3D getNodeRef(Map<String,dynamic> cache, int index, Object3D object) {
if (cache["refs"][index] == null || cache["refs"][index] <= 1) return object;
final ref = object.clone();
void updateMappings(Object3D original, Object3D clone ){
final mappings = this.associations[original];
if ( mappings != null ) {
this.associations[clone] = mappings;
}
for ( final child in original.children) {
updateMappings( child, clone.children[ i ] );
}
};
updateMappings( object, ref );
ref.name += '_instance_${(cache["uses"][index]++)}';
return ref;
}