toJSON method

Map<String, dynamic> toJSON()

Transforms this instance into a JSON object.

Implementation

Map<String,dynamic> toJSON() {
	return {
		'type': runtimeType.toString(),
		'uuid': uuid,
		'name': name,
		'active': active,
		'children': entitiesToIds( children ),
		'parent': parent?.uuid,
		'neighbors': entitiesToIds( neighbors ),
		'neighborhoodRadius': neighborhoodRadius,
		'updateNeighborhood': updateNeighborhood,
		'position': position.storage,
		'rotation': rotation.storage,
		'scale': scale.storage,
		'forward': forward.storage,
		'up': up.storage,
		'boundingRadius': boundingRadius,
		'maxTurnRate': maxTurnRate,
		'canActivateTrigger': canActivateTrigger,
		'worldMatrix': worldMatrix().elements,
		'_localMatrix': _localMatrix.elements,
		'_cache': {
			position: _cache['position'].storage,
			rotation: _cache['rotation'].storage,
			scale: _cache['scale'].storage,
		},
		'_started': started
	};
}