void PrintBody(Astra.BodyFrame bodyFrame) { if (bodyFrame != null) { Body[] bodies = { }; bodyFrame.CopyBodyData(ref bodies); foreach (Body body in bodies) { Astra.Joint headJoint = body.Joints[(int)JointType.Head]; Debug.Log("Body " + body.Id + " COM " + body.CenterOfMass + " Head Depth: " + headJoint.DepthPosition.X + "," + headJoint.DepthPosition.Y + " World: " + headJoint.WorldPosition.X + "," + headJoint.WorldPosition.Y + "," + headJoint.WorldPosition.Z + " Status: " + headJoint.Status.ToString()); } } }
public void OnNewFrame(Astra.BodyStream bodyStream, Astra.BodyFrame frame) { if (frame.Width == 0 || frame.Height == 0) { return; } if (_lastFrameIndex == frame.FrameIndex) { return; } _lastFrameIndex = frame.FrameIndex; frame.CopyBodyData(ref _bodies); UpdateSkeletonsFromBodies(_bodies); UpdateBodyFeatures(bodyStream, _bodies); }
public void OnNewFrame(Astra.BodyStream bodyStream, Astra.BodyFrame frame) { if (frame.Width == 0 || frame.Height == 0) { return; } if (_lastFrameIndex == frame.FrameIndex) { return; } _lastFrameIndex = frame.FrameIndex; frame.CopyBodyData(ref _bodies); if (_bodies.Length > 0) { UpdateBone(_bodies[0]); } }
public void OnNewFrame(Astra.BodyStream bodyStream, Astra.BodyFrame frame) { if (frame.Width == 0 || frame.Height == 0) { return; } if (_lastFrameIndex == frame.FrameIndex) { return; } _lastFrameIndex = frame.FrameIndex; frame.CopyBodyData(ref _bodies); var body = GetFirstBody(_bodies); if (body != null) { UpdateBone(body); } }