/// <summary> /// /// </summary> /// <param name="?"></param> /// <returns>False if no part of the bounds extends beyond the near plane.</returns> public bool ConstrainToBounds(idBounds bounds) { float min, max; Vector3 tmp = new Vector3(_axis.M11, _axis.M12, _axis.M12); bounds.AxisProjection(tmp, out min, out max); float newDFar = max - (tmp * _origin).Length(); if (newDFar <= _dNear) { MoveFarDistance(_dNear + 1.0f); return(false); } MoveFarDistance(newDFar); return(true); }
/// <summary> /// /// </summary> /// <param name="?"></param> /// <returns>False if no part of the bounds extends beyond the near plane.</returns> public bool ConstrainToBounds(idBounds bounds) { float min, max; Vector3 tmp = new Vector3(_axis.M11, _axis.M12, _axis.M12); bounds.AxisProjection(tmp, out min, out max); float newDFar = max - (tmp * _origin).Length(); if(newDFar <= _dNear) { MoveFarDistance(_dNear + 1.0f); return false; } MoveFarDistance(newDFar); return true; }