66 const bool headEqual = fabs(deg_d_to_d(lhs.
pitch) - deg_d_to_d(rhs.
pitch)) <= tolerance
67 && fabs(deg_d_to_d(lhs.
yaw) - deg_d_to_d(rhs.
yaw)) <= tolerance
68 && fabs(cm_d_to_d(lhs.
height) - cm_d_to_d(rhs.
height)) <= tolerance;
86 const centimetres_d totalHeight = camera_pivot.
height + camera.
height;
87 const double cosPitch = cos(deg_d_to_rad_d(camera_pivot.
pitch));
88 const double sinPitch = sin(deg_d_to_rad_d(camera_pivot.
pitch));
89 return (totalHeight - camera.
height * d_to_cm_d(1.0 - cosPitch)) - camera.
centerOffset * d_to_cm_d(sinPitch);
97 const degrees_d pitchToObject = camera_pivot.
pitch + camera.
vDirection - d_to_deg_d(pct_d_to_d(coord.
y)) * (camera.
vFov / 2.0);
98 return pitchToObject > 0.0 && pitchToObject < 90.0;
104 const degrees_d yaw = coord.
direction - camera_pivot.
yaw;
105 const radians_d yawRad = deg_d_to_rad_d(coord.
direction);
106 const double frontDistance = cm_d_to_d(mm_u_to_cm_d(coord.
distance)) * cos(rad_d_to_d(yawRad)) + cm_d_to_d(camera.
centerOffset);
108 const degrees_d totalPitch = 90.0 - rad_d_to_deg_d(d_to_rad_d(atan2(frontDistance, cm_d_to_d(actualCameraHeight))));
109 const degrees_d pitch = totalPitch - camera.
vDirection - camera_pivot.
pitch;
110 const degrees_d yawBound = camera.
hFov / 2.0;
111 const degrees_d pitchBound = camera.
vFov / 2.0;
112 return yaw >= -yawBound && yaw <= yawBound && pitch >= -pitchBound && pitch <= pitchBound;
bool gu_camera_equals(const gu_camera lhs, const gu_camera rhs, const double tolerance)
bool gu_camera_pivot_equals(const gu_camera_pivot lhs, const gu_camera_pivot rhs, const double tolerance)
centimetres_d gu_camera_pivot_calculate_camera_height(const gu_camera_pivot camera_pivot, const int cameraOffset)
bool gu_camera_pivot_object_on_ground(const gu_camera_pivot camera_pivot, const int cameraOffset, const gu_percent_coordinate coord)
bool gu_camera_pivot_can_see_object(const gu_camera_pivot camera_pivot, const int cameraOffset, const gu_relative_coordinate coord)
A gu_camera_pivot represents the pivot point which a gu_camera is attached to.
degrees_d pitch
The vertical orientation of the pivot point.
degrees_d yaw
The horizontal orientation of the pivot point.
centimetres_d height
The vertical distance from the ground to the pivot point.
gu_camera cameras[2]
The gu_cameras attached to this pivot point.
int numCameras
The number of elements in cameras.
centimetres_d centerOffset
The distance the camera is from the center point.
centimetres_d height
The height from the pivot of the camera to the middle of the camera.
degrees_d hFov
The horizontal field of view.
degrees_d vFov
The vertical field of view.
degrees_d vDirection
The degree in which the camera is facing in the vertical direction.
A gu_percent_coordinate represents the coordinate of a pixel within an image.
percent_d y
The y coordinate of the pixel within the image as a percentage.
A coordinate that is relative to some other coordinate.
degrees_d direction
The heading towards the coordinate.
millimetres_u distance
The distance to the coordinate.