/// <summary> /// Get the world position of a local space normalized point of a Quad /// </summary> /// <param name="fp"></param> /// <returns></returns> Vector3 GetWorldPoint(FeaturePoint fp) { Vector3 fpLocal = NormalizePoint(fp); return(transform.TransformPoint(fpLocal)); }
/// <summary> /// Get a normalized position based on the input texture /// </summary> /// <param name="fp">Feature point to normalize</param> /// <returns>A normalized local point with XY coordinates</returns> Vector3 NormalizePoint(FeaturePoint fp) { if (DebugTexture == null) { return(Vector3.zero); } return(new Vector3(fp.x / (float)DebugTexture.width - 0.5f, (1 - fp.y / (float)DebugTexture.height) - 0.5f, 0)); }