toJson method

  1. @override
Map<String, dynamic> toJson({
  1. Object3dMeta? meta,
})
override

Create a JSON structure with details of this LOD object.

Implementation

@override
	Map<String,dynamic> toJson({Object3dMeta? meta}){
		final data = super.toJson(meta:meta);

		if(autoUpdate == false) data['object']['autoUpdate'] = false;

		data['object']['levels'] = [];

		final levels = this.levels;

		for (int i = 0, l = levels.length; i < l; i ++ ) {
			final level = levels[ i ];
			data['object']['levels'].add({
				'object': level.object?.uuid,
				'distance': level.distance
			});
		}

		return data;
	}