FlatRedBall.Camera.IsXInView C# (CSharp) Method

IsXInView() public method

Determines if the X value is in view, assuming the camera is viewing down the Z axis.
Currently, this method assumes viewing down the Z axis.
public IsXInView ( double x, double absoluteZ ) : bool
x double The absolute X position of the point.
absoluteZ double The absolute Z position of the point.
return bool
        public bool IsXInView(double x, double absoluteZ)
        {
            if (mOrthogonal)
            {
                return (x > Position.X - mOrthogonalWidth / 2.0f && x < Position.X + mOrthogonalWidth / 2.0f);
            }
            else
            {
#if FRB_MDX
                double cameraDistance = (absoluteZ - Position.Z) / 100.0;
#else
                double cameraDistance = (Position.Z - absoluteZ) / 100.0;
#endif
                if (x > Position.X - mXEdge * cameraDistance && x < Position.X + mXEdge * cameraDistance)
                    return true;
                else
                    return false;
            }
        }