FlatRedBall.Camera.IsYInView C# (CSharp) Method

IsYInView() public method

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