11 public static class CopyFromOtherExtensions {
19 public static Frame CopyFrom(
this Frame frame, Frame source) {
21 frame.Timestamp = source.Timestamp;
22 frame.CurrentFramesPerSecond = source.CurrentFramesPerSecond;
24 frame.ResizeHandList(source.Hands.Count);
26 for (
int i = frame.Hands.Count; i-- != 0;) {
27 frame.Hands[i].CopyFrom(source.Hands[i]);
39 public static Hand CopyFrom(
this Hand hand, Hand source) {
41 hand.Confidence = source.Confidence;
42 hand.GrabStrength = source.GrabStrength;
43 hand.GrabAngle = source.GrabAngle;
44 hand.Rotation = source.Rotation;
45 hand.PinchStrength = source.PinchStrength;
46 hand.PinchDistance = source.PinchDistance;
47 hand.PalmWidth = source.PalmWidth;
48 hand.IsLeft = source.IsLeft;
49 hand.TimeVisible = source.TimeVisible;
50 hand.PalmPosition = source.PalmPosition;
51 hand.StabilizedPalmPosition = source.StabilizedPalmPosition;
52 hand.PalmVelocity = source.PalmVelocity;
53 hand.PalmNormal = source.PalmNormal;
54 hand.Direction = source.Direction;
55 hand.WristPosition = source.WristPosition;
57 hand.Arm.CopyFrom(source.Arm);
59 for (
int i = 5; i-- != 0;) {
60 hand.Fingers[i].CopyFrom(source.Fingers[i]);
72 public static Finger CopyFrom(
this Finger finger, Finger source) {
73 for (
int i = 4; i-- != 0;) {
74 finger.bones[i].CopyFrom(source.bones[i]);
77 finger.Id = source.Id;
78 finger.HandId = source.HandId;
79 finger.TimeVisible = source.TimeVisible;
81 finger.TipPosition = source.TipPosition;
82 finger.Direction = source.Direction;
83 finger.Width = source.Width;
84 finger.Length = source.Length;
85 finger.IsExtended = source.IsExtended;
86 finger.Type = source.Type;
97 public static Bone CopyFrom(
this Bone bone, Bone source) {
98 bone.PrevJoint = source.PrevJoint;
99 bone.NextJoint = source.NextJoint;
100 bone.Direction = source.Direction;
101 bone.Center = source.Center;
102 bone.Length = source.Length;
103 bone.Width = source.Width;
104 bone.Rotation = source.Rotation;
105 bone.Type = source.Type;