/// <summary> /// <para>Projects a position in [-1,+1] coordinates into a 3D position in world space, based on a projection depth</para> /// <para>[-1,+1] Coordinates are equivalent of the size of a DrawTarget, where (-1,-1) is bottom left, (1,1) is top right and (0,0) is centered</para> /// </summary> /// <param name="coordinate">Coordinate in [-1,+1] to project into world space</param> /// <param name="projectDepth">World space depth to project from the camera position</param> /// <param name="position">unprojected position</param> public void ProjectFromCoordinate(ref Vector2 coordinate, float projectDepth, out Vector3 position) { Vector2 size = Vector2.One; Camera3D.ProjectFromCoordinate(this, true, ref coordinate, projectDepth, out position, ref size); }
/// <summary> /// Projects a position in draw target pixel coordinates into a 3D position in world space, based on a projection depth /// </summary> /// <param name="coordinate">Coordinate in draw target pixels to project into world space</param> /// <param name="projectDepth">World space depth to project from the camera position</param> /// <param name="position">projected position</param> /// <param name="target">Draw Target space to unproject the point from</param> public void ProjectFromTarget(ref Vector2 coordinate, float projectDepth, out Vector3 position, Graphics.DrawTarget target) { Vector2 size = target.Size; Camera3D.ProjectFromCoordinate(this, true, ref coordinate, projectDepth, out position, ref size); }