/// <summary> /// Creates a new SnapPoint from the stored data. /// Mostly used to restore a SnapPoint that was stored during Play-Mode. /// </summary> /// <param name="data">The data of the SnapPoint.</param> /// <returns>The geerated SnapPoint.</returns> private SnapPoint LoadSnapPoint(SnapPointData data) { SnapPoint record = GenerateSnapPoint(); record.LoadData(data, this.transform); record.LoadGhost(ghostProvider); return(record); }
/// <summary> /// Creates a new SnapPoint at the exact pose of a given hand. /// Mostly used with Hand-Tracking at Play-Mode /// </summary> /// <param name="puppet">The user controlled hand.</param> /// <returns>The generated SnapPoint.</returns> public SnapPoint AddSnapPoint(HandPuppet puppet) { HandPose rawPose = puppet.TrackedPose(this.transform, true); SnapPoint snapPoint = GenerateSnapPoint(); snapPoint.SetPose(rawPose, this.transform); snapPoint.LoadGhost(ghostProvider); return(snapPoint); }