toJSON method

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

Implementation

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

  data["object"]["color"] = color!.getHex();
  data["object"]["intensity"] = intensity;

  if (groundColor != null) {
    data["object"]["groundColor"] = groundColor!.getHex();
  }

  if (distance != null) {
    data["object"]["distance"] = distance;
  }
  if (angle != null) {
    data["object"]["angle"] = angle;
  }
  if (decay != null) {
    data["object"]["decay"] = decay;
  }
  if (penumbra != null) {
    data["object"]["penumbra"] = penumbra;
  }

  if (shadow != null) {
    data["object"]["shadow"] = shadow!.toJSON();
  }

  return data;
}