cameraObjectId function

int cameraObjectId(
  1. Camera camera,
  2. World world
)

For views: the id of camera's object while it's a live object of world, else -1, which names no object.

Implementation

int cameraObjectId(Camera camera, World world) {
  final object = camera._owner;
  if (object == null || camera.isRemoved || !identical(object._world, world) || !object.isAlive) return -1;
  return object._id;
}