I am trying to check if a point is inside the screen, but I can’t get it to work. I am constructing a rect that should represent the normalised screen area and I am trying to detect if the mouse position is inside this rect. My screen resolution is 1920 by 1200. Let me know if I am doing something terribly wrong.
Vector2 bbox_min = Vector2(0.0,0.0);
Vector2 bbox_max = Vector2(0.9,0.9);
bbox = Rect(bbox_min, bbox_max);
Camera* camera = scene_->GetChild("Camera")->GetComponent<Camera>();
Vector3 result = camera->WorldToScreenPoint(mousePosition);
cout << "Inside" << endl;