toJson method

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

meta - object containing metadata such as textures or images in objects' descendants.

Convert the camera to three.js JSON Object/Scene format.

Implementation

@override
Map<String, dynamic> toJson({Object3dMeta? meta}) {
  Map<String, dynamic> output = super.toJson(meta: meta);
  Map<String, dynamic> object = output["object"];

  object["fov"] = fov;
  object["zoom"] = zoom;

  object["near"] = near;
  object["far"] = far;
  object["focus"] = focus;

  object["aspect"] = aspect;

  if (view != null) object["view"] = json.decode(json.encode(view!.toMap));

  object["filmGauge"] = filmGauge;
  object["filmOffset"] = filmOffset;

  return output;
}