public Vector3 Project(Vector3 source, Matrix projection, Matrix view, Matrix world)
{
Matrix matrix = Matrix.Multiply(Matrix.Multiply(world, view), projection);
Vector3 vector3 = Vector3.Transform(source, matrix);
float a = (float)((double)source.X * (double)matrix.M14 + (double)source.Y * (double)matrix.M24 + (double)source.Z * (double)matrix.M34) + matrix.M44;
if (!Viewport.WithinEpsilon(a, 1f))
{
vector3 /= a;
}
vector3.X = (float)(((double)vector3.X + 1.0) * 0.5) * (float)this.Width + (float)this.X;
vector3.Y = (float)((-(double)vector3.Y + 1.0) * 0.5) * (float)this.Height + (float)this.Y;
vector3.Z = vector3.Z * (this.MaxDepth - this.MinDepth) + this.MinDepth;
return(vector3);
}