void Update() { if (BodySourceManager == null) { Debug.Log("Forgot to attach BodySourceManager to this script/object in Inspector"); return; } _BodyManager = BodySourceManager.GetComponent<BodySourceManager>(); if (_BodyManager == null) { Debug.Log("Forgot to attach BodySourceManager script to BodyManager object"); return; } Body[] data = _BodyManager.GetData(); if (data == null) { jointsXY = "NONE"; //Debug.Log("no body"); return; } // If the body is being tracked, then send data if(data[0].IsTracked) { // let BodySourceView take care of jointsXY } // Else send error data else { //jointsXY = "NONE"; //Debug.Log("not tracked"); } }
//public List<MonoBehaviour> array_scrips_to_disabled; // Use this for initialization void Start() { if (gameObject.activeSelf == true) { if (manager == null) { manager = GameObject.Find("ManagerInitialPosition"); comment_text = GameObject.Find("comment_text").GetComponent <Text>(); panel_camera = GameObject.Find("PanelInitialPosition"); } bodyManager = manager.GetComponent <BodySourceManager> (); panel_camera.transform.localScale = Vector3.zero; sensor = KinectSensor.GetDefault(); if (sensor != null) { sensor.Open(); if (sensor.IsOpen) { lostBody(); } } } }
public bool isTracked() { if (kinectController == null) { return(false); } _bodyManager = kinectController.GetComponent <BodySourceManager>(); if (_bodyManager == null) { return(false); } Body[] data = _bodyManager.GetData(); if (data == null) { return(false); } foreach (var body in data) { if (body == null) { continue; } if (body.IsTracked) { return(true); } } return(false); }
// Use this for initialization void Start() { // get the default body source manager b_src_man = BodySrcManager.GetComponent <BodySourceManager>(); descriptors = new Dictionary <JointType, Transform>() { { JointType.WristRight, rightHandObj }, { JointType.WristLeft, leftHandObj }, { JointType.AnkleRight, rightFootObj }, { JointType.AnkleLeft, leftFootObj }, { JointType.ElbowLeft, leftElbowObj }, { JointType.ElbowRight, rightElbowObj }, { JointType.KneeLeft, leftKneeObj }, { JointType.KneeRight, rightKneeObj }, { JointType.Head, headKameraObj } }; sliders = new Dictionary <JointType, SlidingWindow>() { { JointType.WristRight, new SlidingWindow(sliding_window_size) }, { JointType.WristLeft, new SlidingWindow(sliding_window_size) }, { JointType.AnkleRight, new SlidingWindow(sliding_window_size) }, { JointType.AnkleLeft, new SlidingWindow(sliding_window_size) }, { JointType.ElbowLeft, new SlidingWindow(sliding_window_size) }, { JointType.ElbowRight, new SlidingWindow(sliding_window_size) }, { JointType.KneeLeft, new SlidingWindow(sliding_window_size) }, { JointType.KneeRight, new SlidingWindow(sliding_window_size) }, { JointType.Head, new SlidingWindow(slider_head_size) } }; }
public void Start() { bodySourceManager = GameObject.FindObjectOfType <BodySourceManager>(); startPosition = transform.position; rpm = this.GetComponent <RecordedPointMan>(); kpc = GameObject.FindObjectOfType <KinectPointController>(); }
public Vector3 GetJointPosition(Kinect.JointType jointType) { if (bodyScales != null && bodyOffsets != null && BodySourceManager != null) { _BodyManager = BodySourceManager.GetComponent <BodySourceManager>(); if (_BodyManager != null) { Kinect.Body[] data = _BodyManager.GetData(); if (data != null) { foreach (var body in data) { if (body == null) { continue; } if (body.IsTracked) { var joints = body.Joints; var joint = joints[jointType]; Vector3 res = new Vector3((bodyOffsets.x + joint.Position.X) * bodyScales.x, (bodyOffsets.y + joint.Position.Y) * bodyScales.y, (bodyOffsets.z + joint.Position.Z) * bodyScales.z); return(res); } } } } } return(Vector3.zero); }
// Use this for initialization void Start() { greenSphere = GameObject.FindGameObjectWithTag("Green Sphere"); // Load Artworks Scene currentScene = SceneManager.GetActiveScene(); string sceneName = currentScene.name; if (sceneName == "ColouringBook") { this.Cat = GameObject.Find("Cat").GetComponent <Renderer>(); this.Unicorn = GameObject.Find("Unicorn").GetComponent <Renderer>(); this.Mushroom = GameObject.Find("Mushroom").GetComponent <Renderer>(); this.Cat.enabled = false; this.Mushroom.enabled = false; this.Unicorn.enabled = false; } myMeshRenderer = quadHitPoint.GetComponent <TrailRenderer>(); myMeshRenderer.enabled = false; NewLine(); if (BodySrcManager == null) { Debug.Log("Assign Game Object with Body Source Manager"); } else { bodyManager = BodySrcManager.GetComponent <BodySourceManager>(); } }
// Update is called once per frame void Update () { if (BodySourceManager == null) { return; } _BodyManager = BodySourceManager.GetComponent<BodySourceManager>(); if (_BodyManager == null) { return; } Windows.Kinect.Body[] data = _BodyManager.GetData(); if (data == null) { return; } foreach (var body in data) { if (body == null) { continue; } if (body.IsTracked) { CameraSpacePoint cameraSpacePoint = body.Joints[Windows.Kinect.JointType.HandLeft].Position; colorSpacePoint = kinectSensor.CoordinateMapper.MapCameraPointToColorSpace(cameraSpacePoint); } } }
// Use this for initialization void Start() { GameObject t = GameObject.Find("BodySourceManager"); BodySourceManager temp = t.GetComponent <BodySourceManager>(); // BodySourceManager temp = .GetComponent<BodySourceManager>; _BodyManager = temp; Ref = _UnityChan.transform.Find("Character1_Reference").gameObject; Hips = Ref.gameObject.transform.Find("Character1_Hips").gameObject; LeftUpLeg = Hips.transform.Find("Character1_LeftUpLeg").gameObject; LeftLeg = LeftUpLeg.transform.Find("Character1_LeftLeg").gameObject; RightUpLeg = Hips.transform.Find("Character1_RightUpLeg").gameObject; RightLeg = RightUpLeg.transform.Find("Character1_RightLeg").gameObject; Spine1 = Hips.transform.Find("Character1_Spine").gameObject.transform.Find("Character1_Spine1").gameObject; Spine2 = Spine1.transform.Find("Character1_Spine2").gameObject; LeftShoulder = Spine2.transform.Find("Character1_LeftShoulder").gameObject; LeftArm = LeftShoulder.transform.Find("Character1_LeftArm").gameObject; LeftForeArm = LeftArm.transform.Find("Character1_LeftForeArm").gameObject; LeftHand = LeftForeArm.transform.Find("Character1_LeftHand").gameObject; RightShoulder = Spine2.transform.Find("Character1_RightShoulder").gameObject; RightArm = RightShoulder.transform.Find("Character1_RightArm").gameObject; RightForeArm = RightArm.transform.Find("Character1_RightForeArm").gameObject; RightHand = RightForeArm.transform.Find("Character1_RightHand").gameObject; Neck = Spine2.transform.Find("Character1_Neck").gameObject; Head = Neck.transform.Find("Character1_Head").gameObject; }
// Update is called once per frame void Update() { _BodyManager = BodySourceManager.GetComponent<BodySourceManager>(); if (_BodyManager == null) { return; } Kinect.Body[] data = _BodyManager.GetData(); if (data == null) { return; } Kinect.Body body = data [0]; if (!body.IsTracked) return; transform.localPosition = GetVector3FromJoint(body.Joints[Kinect.JointType.Head]); // 形状位置を更新 Vector3 centerpoint; Vector3 wr = GetVector3FromJoint (body.Joints [Kinect.JointType.WristRight]); Vector3 er = GetVector3FromJoint (body.Joints [Kinect.JointType.ElbowRight]); centerpoint = (wr + er) / 2; Vector3 front = wr - er; rightarm.transform.rotation = Quaternion.LookRotation (front) * r; rightarm.transform.position = centerpoint; }
// Update is called once per frame void Update() { _BodyManager = BodySourceManager.GetComponent <BodySourceManager>(); if (_BodyManager == null) { return; } Kinect.Body[] data = _BodyManager.GetData(); if (data == null) { return; } Kinect.Body body = data [0]; if (!body.IsTracked) { return; } transform.localPosition = GetVector3FromJoint(body.Joints[Kinect.JointType.Head]); // 形状位置を更新 Vector3 centerpoint; Vector3 wr = GetVector3FromJoint(body.Joints [Kinect.JointType.WristRight]); Vector3 er = GetVector3FromJoint(body.Joints [Kinect.JointType.ElbowRight]); centerpoint = (wr + er) / 2; Vector3 front = wr - er; rightarm.transform.rotation = Quaternion.LookRotation(front) * r; rightarm.transform.position = centerpoint; }
void Start() { lrc = GetComponent <LineRendererController>(); bodySourceManager = GameObject.FindObjectOfType <BodySourceManager>(); //_bonePos = new Vector4[(int)BoneIndex.Num_Bones]; _BoneMap = new Dictionary <JointType, GameObject>() { { JointType.SpineBase, SpineBase }, { JointType.SpineMid, SpineMid }, { JointType.Neck, Neck }, { JointType.Head, Head }, { JointType.ShoulderLeft, ShoulderLeft }, { JointType.ElbowLeft, ElbowLeft }, { JointType.WristLeft, WristLeft }, { JointType.HandLeft, HandLeft }, { JointType.ShoulderRight, ShoulderRight }, { JointType.ElbowRight, ElbowRight }, { JointType.WristRight, WristRight }, { JointType.HandRight, HandRight }, { JointType.HipLeft, HipLeft }, { JointType.KneeLeft, KneeLeft }, { JointType.AnkleLeft, AnkleLeft }, { JointType.FootLeft, FootLeft }, { JointType.HipRight, HipRight }, { JointType.KneeRight, KneeRight }, { JointType.AnkleRight, AnkleRight }, { JointType.FootRight, FootRight }, { JointType.SpineShoulder, SpineShoulder }, { JointType.HandTipLeft, HandTipLeft }, { JointType.ThumbLeft, ThumbLeft }, { JointType.HandTipRight, HandTipRight }, { JointType.ThumbRight, ThumbRight } }; }
void Update() { if (BodySourceManager == null) { return; } _BodyManager = BodySourceManager.GetComponent <BodySourceManager>(); if (_BodyManager == null) { return; } Kinect.Body[] data = _BodyManager.GetData(); if (data == null) { return; } // For each body (we will only use one but it mught be body[0] or body[2], we dont know for sure) foreach (var body in data) { if (body == null) { continue; } if (body.IsTracked) { // refreshes how we show it in unity, won't really be necessary on the final version RefreshBodyObject(body, bodyGameObject); // need to send the joints, here is where I can grab the data, // put it on some float vector and udp it -> int i = 0; foreach (var joint in body.Joints) { //print(joint.Key.ToString() + " " + GetVector3FromJoint(joint.Value)); bodyJoints[i * 3 + 0] = joint.Value.Position.X; bodyJoints[i * 3 + 1] = joint.Value.Position.Y; bodyJoints[i * 3 + 2] = joint.Value.Position.Z; i++; } // Store data to be reused! if (saveFileFlag) { saveToFile(bodyJoints); } // send joints if (sendDataFlag) { UDPSend(bodyJoints); } } } }
void Update () { if (BodySourceManager == null) { return; } _BodyManager = BodySourceManager.GetComponent<BodySourceManager>(); if (_BodyManager == null) { return; } Kinect.Body[] data = _BodyManager.GetData(); if (data == null) { return; } List<ulong> trackedIds = new List<ulong>(); foreach(var body in data) { if (body == null) { continue; } if(body.IsTracked) { trackedIds.Add (body.TrackingId); } } List<ulong> knownIds = new List<ulong>(_Bodies.Keys); // First delete untracked bodies foreach(ulong trackingId in knownIds) { if(!trackedIds.Contains(trackingId)) { GameObject bodyObject = _Bodies[trackingId]; foreach(GameObject tracker in _TrackerMap[bodyObject].TrackerMap.Values) { Destroy(tracker); } _TrackerMap.Remove(bodyObject); Destroy(bodyObject); _Bodies.Remove(trackingId); } } foreach(var body in data) { if (body == null) { continue; } if(body.IsTracked) { if(!_Bodies.ContainsKey(body.TrackingId)) { _Bodies[body.TrackingId] = CreateBodyObject(body.TrackingId); } RefreshBodyObject(body, _Bodies[body.TrackingId]); } } }
// Update is called once per frame void Update() { tick++; time += Time.deltaTime; if (_bodySourceManager == null) { return; } _bodyManager = _bodySourceManager.GetComponent <BodySourceManager>(); if (_bodyManager == null) { return; } Body[] data = _bodyManager.GetData(); if (data == null) { return; } // get the first tracked body... foreach (var body in data) { if (body == null) { continue; } if (body.IsTracked) { var pos = body.Joints[_jointType].Position; float k = 10f; var headPos = body.Joints [JointType.Head].Position; float x = (-pos.X + -1 * headPos.X * 2) * k; float y = pos.Y * k; float z = pos.Z * k; // Update speed //calculateSpeed(); if (moveActive) { this.gameObject.transform.localPosition = new Vector3(x, y, z); } calculateSpeed(); break; } } }
void UpdateJoints(Body a_body) { foreach (var l_joint in i_jointsMap) { i_jointsMap[l_joint.Key].transform.position = BodySourceManager.CSPtoVector3(a_body.Joints[l_joint.Key].Position); i_jointsMap[l_joint.Key].transform.rotation = BodySourceManager.JointOrientationToQuatertnion(a_body.JointOrientations[l_joint.Key]); } }
void Start() { if (BodySourceManager == null) { return; } _BodyManager = BodySourceManager.GetComponent <BodySourceManager>(); }
private WindowsKinect.Body[] GetAllSkeletonsInTheScreen(BodySourceManager bodyManager) { WindowsKinect.Body[] bodyManagerData = bodyManager.GetData(); WindowsKinect.Body[] trackedBodies = bodyManagerData == null ? new WindowsKinect.Body[0] : System.Array.FindAll(bodyManagerData, body => body.IsTracked && IsInRange(body)); return(trackedBodies.Length == 0 ? new WindowsKinect.Body[0] : trackedBodies); }
// Use this for initialization void Start () { if (BodySrcManager == null) { Debug.Log ("Assign Game Object with Body Source manager"); } else { bodyManager = BodySrcManager.GetComponent<BodySourceManager>(); } }
// Use this for initialization void Start() { this.rb = this.GetComponent <Rigidbody2D>(); this.maxheigth = getCameraHeight() - coordinateOffcetY; this.maxweidgt = getCameraWidth() - coordinateOffcetX; bodyManager = FindObjectOfType <BodySourceManager>(); }
private WindowsKinect.Body[] GetAllSkeletonsInTheScreen(BodySourceManager bodyManager) { WindowsKinect.Body[] bodyManagerData = bodyManager.GetData(); WindowsKinect.Body[] trackedBodies = bodyManagerData == null ? new WindowsKinect.Body[0] : System.Array.FindAll(bodyManagerData, body => body.IsTracked && IsInRange(body)); return trackedBodies.Length == 0 ? new WindowsKinect.Body[0] : trackedBodies; }
void Update() { if (BodySourceManager == null) { return; } _BodyManager = BodySourceManager.GetComponent <BodySourceManager>(); if (_BodyManager == null) { return; } Kinect.Body[] data = _BodyManager.GetData(); if (data == null) { return; } List <ulong> trackedIds = new List <ulong>(); foreach (var body in data) { if (body == null) { continue; } if (body.IsTracked) { trackedIds.Add(body.TrackingId); } } List <ulong> knownIds = new List <ulong>(_Bodies.Keys); foreach (ulong trackingId in knownIds) { if (!trackedIds.Contains(trackingId)) { Destroy(_Bodies[trackingId]); _Bodies.Remove(trackingId); } } foreach (var body in data) { if (body == null) { continue; } if (body.IsTracked) { HandInFist(Kinect.JointType.ThumbRight, body); } } }
void Awake() { if (instance != null && instance != this) { Destroy(gameObject); } instance = this; }
public bool OutOfRange() { if (BodySourceManager != null) { _BodyManager = BodySourceManager.GetComponent <BodySourceManager>(); if (_BodyManager != null) { Kinect.Body[] data = _BodyManager.GetData(); if (data != null) { foreach (var body in data) { if (body == null) { continue; } if (body.IsTracked) { Kinect.JointType jointType = Kinect.JointType.SpineBase; var joints = body.Joints; var joint = joints[jointType]; //print(joint.Position.X); //z check if (joint.Position.Z < 1.5f || joint.Position.Z > 2.5f) { return(false); } //x check if (joint.Position.X > right_hand_x || joint.Position.X < left_hand_x) { return(false); } jointType = Kinect.JointType.SpineBase; joint = joints[jointType]; //y check if (joint.Position.Y > head_y) { return(false); } return(true); } } } } } return(false); }
// Update is called once per frame void Update() { if (_bodySourceManager == null) { return; } _bodyManager = _bodySourceManager.GetComponent <BodySourceManager>(); if (_bodyManager == null) { return; } Body[] data = _bodyManager.GetData(); if (data == null) { return; } // get the first tracked body... foreach (var body in data) { if (body == null) { continue; } if (body.IsTracked) { if (yScale == 10) { pos = body.Joints[JointType.Head].Position; float realPos = (float)(pos.Y * scale - transform.position.y); if (realPos > 5) { yScale = (float)(realPos - 5); } if (realPos < 5) { yScale = (float)(realPos + 5); } } pos = body.Joints[JointType.HandLeft].Position; HandLeft.transform.position = Vector3.Lerp(HandLeft.transform.position, new Vector3(pos.X * scale, pos.Y * scale - yScale, -1) - transform.position, Time.deltaTime * smoothMovement); pos = body.Joints[JointType.HandRight].Position; HandRight.transform.position = Vector3.Lerp(HandRight.transform.position, new Vector3(pos.X * scale, pos.Y * scale - yScale, -1) - transform.position, Time.deltaTime * smoothMovement); pos = body.Joints[JointType.Head].Position; Head.transform.position = Vector3.Lerp(Head.transform.position, new Vector3(pos.X * scale, pos.Y * scale - yScale, -1) - transform.position, Time.deltaTime * smoothMovement); Camera.main.transform.position = Vector3.Lerp(Camera.main.transform.position, new Vector3((Head.transform.position.x - Camera.main.transform.position.x) / 3, (Head.transform.position.y - Camera.main.transform.position.y) / 3, Camera.main.transform.position.z), Time.deltaTime * smoothMovement); Camera.main.transform.LookAt(offsetNode.transform); //Head.transform.position = Vector3.Lerp(Head.transform.position,new Vector3(pos.X*scale, pos.Y*scale, -1)-transform.position,Time.deltaTime*smoothMovement); break; } } }
void Start() { nextWallL = 0; nextWallR = 0; permitL = false; permitR = false; playerLdone = false; playerRdone = false; camMoveTickL = camMoveSpeed; camMoveTickR = camMoveSpeed; armVelocity = new Vector3(0.0f, 8.0f, 4.0f); legVelocity = new Vector3(0.0f, 9.5f, 4.0f); materialL.mainTexture = tex[0]; materialR.mainTexture = tex[0]; failStateL = 0; failStateR = 0; CreateWalls(); // PRECONDITION must come after CreateWalls() CreateEnv(); { Vector3 pos = camL.transform.position; pos.x = railL.transform.position.x; camL.transform.position = pos; } { Vector3 pos = camR.transform.position; pos.x = railR.transform.position.x; camR.transform.position = pos; } { Vector3 pos = camL.transform.position; pos.z += 2.0f; charL.transform.position = pos; } { Vector3 pos = camR.transform.position; pos.z += 2.0f; charR.transform.position = pos; } _BodyManager = BodySourceManager.GetComponent <BodySourceManager>(); StartCoroutine(IntroFly()); }
// Use this for initialization void Start () { if(BodySourceManager == null) { Debug.Log("Attach Body Source Manager"); } else { bodyManager = BodySourceManager.GetComponent<BodySourceManager>(); } }
private void Start() { if (!isServer) { return; } _bodySourceManager = GetComponent <BodySourceManager>(); Debug.Log(_bodySourceManager); _cameraGameObject = GameObject.FindGameObjectWithTag("MainCamera"); }
// Use this for initialization void Start () { //rootPosition = transform.position; if (BodySrcManager == null) { Debug.Log ("Assign Game Object with Body Source manager"); } else { bodyManager = BodySrcManager.GetComponent<BodySourceManager>(); } }
// Use this for initialization void Start() { if (BodySourceManagerGO == null) { Debug.Log("Game object not initialized"); return; } bodyManager = BodySourceManagerGO.GetComponent <BodySourceManager>(); isTracked = false; }
// Update is called once per frame void Update() { if (_bodySourceManager == null) { return; } _bodyManager = _bodySourceManager.GetComponent <BodySourceManager>(); if (_bodyManager == null) { return; } Body[] data = _bodyManager.GetData(); if (data == null) { return; } foreach (var body in data) { if (body == null) { continue; } if (body.IsTracked) { switch (body.HandLeftState) { case HandState.Unknown: break; case HandState.NotTracked: break; case HandState.Open: Debug.Log("Left hand open"); this.gameObject.SetActive(false); break; case HandState.Closed: Debug.Log("Left hand closed"); this.gameObject.SetActive(true); break; case HandState.Lasso: break; default: break; } } } }
public void Initialize(DIOManager dioManager) { this.dioManager = dioManager; this.BodySrcManager = dioManager.bodySrcManager; updateFrame = 0; // one sensor is currently supported kinectSensor = KinectSensor.GetDefault(); // set the maximum number of bodies that would be tracked by Kinect bodyCount = kinectSensor.BodyFrameSource.BodyCount; // allocate storage to store body objects bodies = new Body[bodyCount]; if (BodySrcManager == null) { Debug.Log("Falta asignar Game Object as BodySrcManager"); } else { bodyManager = BodySrcManager.GetComponent <BodySourceManager>(); } // specify the required face frame results FaceFrameFeatures faceFrameFeatures = FaceFrameFeatures.BoundingBoxInColorSpace | FaceFrameFeatures.PointsInColorSpace | FaceFrameFeatures.BoundingBoxInInfraredSpace | FaceFrameFeatures.PointsInInfraredSpace | FaceFrameFeatures.RotationOrientation | FaceFrameFeatures.FaceEngagement | FaceFrameFeatures.Glasses | FaceFrameFeatures.Happy | FaceFrameFeatures.LeftEyeClosed | FaceFrameFeatures.RightEyeClosed | FaceFrameFeatures.LookingAway | FaceFrameFeatures.MouthMoved | FaceFrameFeatures.MouthOpen; // create a face frame source + reader to track each face in the FOV faceFrameSources = new FaceFrameSource[bodyCount]; faceFrameReaders = new FaceFrameReader[bodyCount]; for (int i = 0; i < bodyCount; i++) { // create the face frame source with the required face frame features and an initial tracking Id of 0 faceFrameSources[i] = FaceFrameSource.Create(kinectSensor, 0, faceFrameFeatures); // open the corresponding reader faceFrameReaders[i] = faceFrameSources[i].OpenReader(); } initialize = true; }
// Use this for initialization void Start() { if (BodySrcManager == null) { Debug.Log("assign"); } else { bodyManager = BodySrcManager.GetComponent <BodySourceManager>(); } }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
// Use this for initialization void Start() { if (BodySrcManager == null) { Debug.Log("No Gameobject bodySrcManager Assigned!!"); } else { bodyManager = BodySrcManager.GetComponent <BodySourceManager>(); } }
// Use this for initialization void Start () { if (BodySrcManager == null) { Debug.Log("Asign Game Object with Body Source Manager"); } else { bodyManager = BodySrcManager.GetComponent<BodySourceManager>(); } }
// Start is called before the first frame update void Start() { if (BodySrcManager == null) { Debug.Log("Assignez un objet avec le gestionnaire de source du corps"); } else { bodyManager = BodySrcManager.GetComponent <BodySourceManager>(); } }
// Use this for initialization void Start() { if (BodySrcManager == null) { Debug.Log("Ne pas oublier d'assigner l'objet dans Unity avec Body Source Manager"); } else { bodyManager = BodySrcManager.GetComponent <BodySourceManager>(); } }
public void Awake() { try { var gameObject = new GameObject(); _bodySourceManager = gameObject.AddComponent<BodySourceManager>(); _expController = new ExpressionController(_bodySourceManager); Util.Log("Awake."); } catch (Exception ex) { Util.Log("{0}: {1}\n{2}", ex.GetType(), ex.Message, ex.StackTrace); } }
void Update() { if (_bodySourceManager == null) { return; } _bodyManager = _bodySourceManager.GetComponent<BodySourceManager>(); if (_bodyManager == null) { return; } Body[] data = _bodyManager.GetData(); if (data == null) { return; } foreach (var body in data) { if (body != null) { if (body.IsTracked) { /* if(visited == false){ trackId = (int)body.TrackingId; visited = true; } if(newBody == false){ if((int)body.TrackingId != trackId){ newBody = true; trackId2 = (int)body.TrackingId; //l_one.clone(); //r_one.clone(); Debug.Log("cloning : "+running); } } */ var pos = body.Joints [_jointType].Position; rb.transform.position = new Vector3 (pos.X * 10, pos.Y * 10, pos.Z * 10); } } } }
// Update is called once per frame void Update () { if (BodySourceManager == null) { return; } _BodyManager = BodySourceManager.GetComponent<BodySourceManager>(); if (_BodyManager == null) { return; } Kinect.Body[] data = _BodyManager.GetData(); if (data == null) { return; } List<ulong> trackedIds = new List<ulong>(); foreach(var body in data) { if (body == null) { continue; } if(body.IsTracked) { trackedIds.Add (body.TrackingId); trackedBody = body; break; } } // just get the first tracked id if (trackedIds.Count == 0) { Debug.Log ("没有追踪到目标用户"); } else { Debug.Log("追踪到了目标用户"); // analysis the action of user analysisUserAction(); } }
// Update is called once per frame void Update() { _BodyManager = BodySourceManager.GetComponent<BodySourceManager>(); if (_BodyManager == null) { return; } Kinect.Body[] data = _BodyManager.GetData(); if (data == null) { return; } Kinect.Body body = data [0]; if (!body.IsTracked) return; transform.localPosition = GetVector3FromJoint(body.Joints[Kinect.JointType.ElbowLeft ]); // 形状位置を更新 }
void Update() { if (BodySourceManager == null) { return; } _BodyManager = BodySourceManager.GetComponent<BodySourceManager>(); if (_BodyManager == null) { return; } Kinect.Body[] data = _BodyManager.GetData(); if (data == null) { return; } List<ulong> trackedIds = new List<ulong>(); if (!HasBody()) { foreach (var body in data) { if (body == null) { continue; } if (body.IsTracked) { trackedIds.Add(body.TrackingId); } } } List<ulong> knownIds = new List<ulong>(_Bodies.Keys); // First delete untracked bodies foreach (ulong trackingId in knownIds) { if (!trackedIds.Contains(trackingId)) { Destroy(_Bodies[trackingId]); _Bodies.Remove(trackingId); } } foreach (var body in data) { if (body == null) { continue; } if (body.IsTracked) { RefreshBodyObject(body); } } }
void Update () { if (_bodySourceManager == null) { return; } _bodyManager = _bodySourceManager.GetComponent<BodySourceManager>(); if (_bodyManager == null) { return; } //get available bodies Body[] data = _bodyManager.GetData(); if (data == null) { return; } //process each body foreach (var body in data) { if (body == null) { continue; } if (body.IsTracked) { //change object position var pos = body.Joints[_jointType].Position; this.gameObject.transform.position = new Vector3(pos.X*5, pos.Y*5, pos.Z*5); break; } } }
void Update() { if (BodySourceManager == null) { return; } _BodyManager = BodySourceManager.GetComponent<BodySourceManager>(); if (_BodyManager == null) { return; } Kinect.Body[] data = _BodyManager.GetData(); if (data == null) { return; } List<ulong> trackedIds = new List<ulong>(); bool checkedFirst = false; ulong firstBody = 0; ulong persistBody = 0; foreach (var body in data) { if (body == null) { continue; } if(body.IsTracked) { if (!assigned) { bodyOnly = body.TrackingId; assigned = true; } if (!checkedFirst) { firstBody = body.TrackingId; checkedFirst = true; } if (body.TrackingId == bodyOnly) { persistBody = body.TrackingId; } trackedIds.Add (body.TrackingId); } } if (persistBody == bodyOnly) { bodyOnly = persistBody; } else { bodyOnly = firstBody; } if (bodyOnly == 0) assigned = false; // Debug.Log("Calling here: " + bodyOnly); // assigned = false; List<ulong> knownIds = new List<ulong>(_Bodies.Keys); // First delete untracked bodies foreach(ulong trackingId in knownIds) { if(!trackedIds.Contains(trackingId)) { Destroy(_Bodies[trackingId]); _Bodies.Remove(trackingId); } } foreach(var body in data) { if (body == null) { continue; } if(body.IsTracked) { if(!_Bodies.ContainsKey(body.TrackingId)) { _Bodies[body.TrackingId] = CreateBodyObject(body.TrackingId); } RefreshBodyObject(body, _Bodies[body.TrackingId]); } } }
void Update() { //如果沒有負責建立骨骼資料的GameObject則跳出這個Function。 if (BodySourceManager == null) { return; } //讀取建立骨骼資料的Script。 _BodyManager = BodySourceManager.GetComponent<BodySourceManager>(); if (_BodyManager == null) { return; } //取得記錄骨骼資料的_Data陣列,如果取到的資料為null則離開這個Function。。 Kinect.Body[] data = _BodyManager.GetData(); if (data == null) { return; } //new一個新的uLong的List,用來記錄當下(該次Update)所讀取到的骨骼的ID。 List<ulong> trackedIds = new List<ulong>(); foreach(var body in data) { if (body == null) { continue; } if(body.IsTracked) { trackedIds.Add (body.TrackingId); } } //new一個新的uLong的List,顯示當前已經建立出來的骨骼模型,用來與上面建立的當前讀取骨骼做比對。 List<ulong> knownIds = new List<ulong>(_Bodies.Keys); //如果在比對的過程中,骨骼模型的ID並沒有在當前骨骼的ID中,代表此玩家已經離開了,因此刪除該GameObject。 foreach(ulong trackingId in knownIds) { if(!trackedIds.Contains(trackingId)) { Destroy(_Bodies[trackingId]); _Bodies.Remove(trackingId); } } //在刪除已經不在的玩家之後,繼續比對如果骨骼物件中沒有當前讀取到的骨骼ID,則建立新的骨骼物件。 //若是比對的結果是骨骼物件也有繼續在當前ID中讀取到該ID,代表玩家還在進行中,則進行更新玩家動作的Function。 foreach(var body in data) { if (body == null) { continue; } if(body.IsTracked) { if(!_Bodies.ContainsKey(body.TrackingId)) { _Bodies[body.TrackingId] = CreateBodyObject(body.TrackingId); } RefreshBodyObject(body, _Bodies[body.TrackingId]); } } }
void Update() { if (BodySourceManager == null) { return; } _BodyManager = BodySourceManager.GetComponent<BodySourceManager>(); if (_BodyManager == null) { return; } Windows.Kinect.Body[] data = _BodyManager.GetData(); if (data == null) { return; } List<ulong> trackedIds = new List<ulong>(); foreach(var body in data) { if (body == null) { continue; } if(body.IsTracked) { trackedIds.Add (body.TrackingId); } } List<ulong> knownIds = new List<ulong>(_Bodies.Keys); // First delete untracked bodies foreach(ulong trackingId in knownIds) { if(!trackedIds.Contains(trackingId)) { Destroy(_Bodies[trackingId]); _Bodies.Remove(trackingId); } } if (rendering) { foreach (var body in data) { if (body != null) { if (body.IsTracked) { if (!_Bodies.ContainsKey (body.TrackingId)) { _Bodies [body.TrackingId] = CreateBodyObject (body.TrackingId); } RefreshBodyObject (body, _Bodies [body.TrackingId]); currentId = body.TrackingId; } } } } if (Input.GetKeyDown (KeyCode.B)) { if (rendering) disableRendering (); else enableRendering(); } }
void FixedUpdate() { bodySourceGameObject = GameObject.Find("BodyManager"); if (bodySourceGameObject == null) { Debug.Log("Couldn't find body manager object"); return; } bodySourceManager = bodySourceGameObject.GetComponent<BodySourceManager>(); if (bodySourceManager == null) { Debug.Log("Couldn't find BodySourceManager"); return; } bodies = bodySourceManager.GetData(); if (bodies == null) { return; } updateClosestPlayer(); }
// Update is called once per frame void Update () { if (bodySourceManager == null) { return; } bodyManager = bodySourceManager.GetComponent<BodySourceManager>(); if(bodyManager == null) { return; } // get data from kinect Kinect.Body[] data = bodyManager.GetData(); if(data == null) { return; } // get list of currently tracked bodies Kinect.Body potentialNewTrackedBody = null; bool stillTrackingPreviousBody = false; // check if the previously tracked body is still there foreach(Kinect.Body body in data) { if(body == null) { continue; } if (body.IsTracked) { // no body being track, get the first body found if (currentTrackedObject == null) { currentTrackedObject = body; } // the previous body may already disappearred, save the first body found just in case if (potentialNewTrackedBody == null) { potentialNewTrackedBody = body; } // still tracking previous body if (body.TrackingId == currentTrackedObject.TrackingId) { stillTrackingPreviousBody = true; break; } } } // // the previously tracked body have disappear, get the new trackid found if(!stillTrackingPreviousBody) { currentTrackedObject = potentialNewTrackedBody; } if(currentTrackedObject == null) { return; } ////////////////////////////////////////// // Everything after this is getting data of the body and manipulate the world ScoreManager.ready = true; // if holding something and left hand is closed, move the object according to hand movement if (currentTrackedObject.HandLeftState == Kinect.HandState.Closed && grabbed) { Debug.Log("Holding Object"); DragObject(); } // if not holding anything and left hand is closed, attempt to grab the object in the desired direction else if (!grabbed && currentTrackedObject.HandLeftState == Kinect.HandState.Closed) { Debug.Log("Trying to Grab Object"); GrabObject(); } // release hand while holding something will initiate throw else if (currentTrackedObject.HandLeftState == Kinect.HandState.Open && grabbed) { Debug.Log("Throwing Object"); ThrowObject(); } // shoot wave bullet if two hand open else if (currentTrackedObject.HandLeftState == Kinect.HandState.Open && currentTrackedObject.HandRightState == Kinect.HandState.Open) { Debug.Log("Wave Attack"); UpdateAimTarget(); GetComponent<Shooting>().Shoot(waveBullet, aimTarget.transform.position, aimTarget.transform.rotation); } // shoot wave bullet if left hand open and not holding anything else if (currentTrackedObject.HandLeftState == Kinect.HandState.Open) { Debug.Log("Bullet Attack"); UpdateAimTarget(); GetComponent<Shooting>().Shoot(lightBullet, aimTarget.transform.position, aimTarget.transform.rotation); } // other action should reset holding state else { //currentlyGrabbedObj = null; Debug.Log("Unknow Action"); grabbed = false; } //Debug.Log(currentTrackedObject.HandRightState); //Debug.Log(previousHandState); previousHandState = currentTrackedObject.HandRightState; SaberControl(); }
public ExpressionController(BodySourceManager bodySourceManager) { _bodySourceManager = bodySourceManager; }
void Update () { if (BodySourceManager == null) { return; } _BodyManager = BodySourceManager.GetComponent<BodySourceManager>(); if (_BodyManager == null) { return; } Kinect.Body[] data = _BodyManager.GetData(); if (data == null) { return; } List<ulong> trackedIds = new List<ulong>(); foreach(var body in data) { if (body == null) { continue; } if(body.IsTracked) { trackedIds.Add (body.TrackingId); } } List<ulong> knownIds = new List<ulong>(_Bodies.Keys); // First delete untracked bodies foreach(ulong trackingId in knownIds) { if(!trackedIds.Contains(trackingId)) { Destroy(_Bodies[trackingId]); _Bodies.Remove(trackingId); } } bodyTracked = false; foreach(var body in data) { if (body == null) { continue; } if (bodyTracked){ continue; } if(body.IsTracked) { if(!_Bodies.ContainsKey(body.TrackingId)) { // Draws stick figure of body to screen //_Bodies[body.TrackingId] = CreateBodyObject(body.TrackingId); } //RefreshBodyObject(body, _Bodies[body.TrackingId]); // New head tracking code (testing) Kinect.Joint headJoint = body.Joints[Kinect.JointType.Head]; if (headJoint.TrackingState == Kinect.TrackingState.Tracked) { Kinect.KinectSensor sensor = _BodyManager.getSensor(); Kinect.DepthSpacePoint dsp = sensor.CoordinateMapper.MapCameraPointToDepthSpace(headJoint.Position); x = dsp.X; y = dsp.Y; bodyTracked = true; //Debug.Log (x); } } } }
//---------------------------------------------------------------- void Start() { // Get body from Kinect _BodyManager = this.GetComponent<BodySourceManager>(); if (_BodyManager == null) { return; } /*positionKalman = new KalmanFilter(); positionKalman.initialize(3, 3); positionKalman.setR(1.0f);*/ smoothedJoints = new Dictionary<Kinect.JointType, Vector3[]>(); for (Kinect.JointType jt = Kinect.JointType.SpineBase; jt <= Kinect.JointType.ThumbRight; jt++) { smoothedJoints[jt] = new Vector3[4]; } }
public void disableRendering() { rendering = false; _BodyManager = BodySourceManager.GetComponent<BodySourceManager>(); if (_BodyManager == null) { return; } Windows.Kinect.Body[] data = _BodyManager.GetData(); foreach (var body in data) { if (body == null) { continue; } if (body.IsTracked) { Destroy(_Bodies[body.TrackingId]); _Bodies.Remove(body.TrackingId); } } foreach(KeyValuePair<Windows.Kinect.JointType, GameObject> k in rot) { k.Value.SetActive(false); // do something with entry.Value or entry.Key } }
/*** Update with every frame *****/ void Update() { if (BodySourceManager == null) { return; } _BodyManager = BodySourceManager.GetComponent<BodySourceManager>(); if (_BodyManager == null) { return; } Kinect.Body[] data = _BodyManager.GetData(); if (data == null) { return; } List<ulong> trackedIds = new List<ulong>(); foreach(var body in data) { if (body == null) { //Debug.Log("Null Body"); continue; } if(body.IsTracked) { trackedIds.Add (body.TrackingId); } } List<ulong> knownIds = new List<ulong>(_Bodies.Keys); // First delete untracked bodies foreach(ulong trackingId in knownIds) { if(!trackedIds.Contains(trackingId)) { main_camera.transform.parent = null; Destroy(_Bodies[trackingId]); _Bodies.Remove(trackingId); if(IDToFirstBody == trackingId) { IsFirstBody = true; } } } foreach(var body in data) { if (body == null) { //Debug.Log("Null Body"); continue; } if(body.IsTracked) { if(IsFirstBody)// Start Detecting only one body { Debug.Log("It Is First Body, ID: " + body.TrackingId); //put rotation CurrentBody = body; IDToFirstBody = body.TrackingId; IsFirstBody =false; if(!_Bodies.ContainsKey(body.TrackingId)) { _Bodies[body.TrackingId] = CreateBodyObject (body.TrackingId); } } RefreshBodyObject(body, _Bodies[body.TrackingId]); getHandCoordinates(CurrentBody, _Bodies[body.TrackingId]); } } }
void Update() { int state = 0; if (BodySourceManager == null) { Debug.Log("Is BodyManager null" + BodySourceManager); return; } _BodyManager = BodySourceManager.GetComponent<BodySourceManager>(); if (_BodyManager == null) { return; } Kinect.Body[] data = _BodyManager.GetData(); if (data == null) { return; } List<ulong> trackedIds = new List<ulong>(); foreach (var body in data) { if (body == null) { continue; } if (body.IsTracked) { trackedIds.Add(body.TrackingId); } } List<ulong> knownIds = new List<ulong>(_Bodies.Keys); // First delete untracked bodies foreach (ulong trackingId in knownIds) { if (!trackedIds.Contains(trackingId)) { Destroy(_Bodies[trackingId]); _Bodies.Remove(trackingId); } } foreach (var body in data) { if (body == null) { continue; } if (body.IsTracked) { if (!_Bodies.ContainsKey(body.TrackingId)) { _Bodies[body.TrackingId] = CreateBodyObject(body.TrackingId); } //RefreshBodyObject(body, _Bodies[body.TrackingId]); //Check Hand State if body is being Tracked state = CheckLeftHandState(body.HandLeftState) + (2 * CheckRightHandState(body.HandRightState)); if (!levelHasGenerated) return; switch (state) { case 0: signalStart = false; break; case 1: //Left if (prevState == 0) platformRotate.TurnLeft(); Debug.Log("Left"); break; case 2: //Right Debug.Log("Right"); if (prevState == 0) platformRotate.TurnRight(); break; case 3: //Both Debug.Log("Both"); if (prevState == 0) { // playerScript.flipjump = true; platformRotate.Flip(); } break; default: break; } /* CheckRightHandState(body.HandRightState); CheckLeftHandState(body.HandLeftState); if(rightHandActive && leftHandActive) { //flip Debug.LogError("BOTH"); } */ } } }
void Start() { _BodyManager = FindObjectOfType<BodySourceManager>(); }
void Update() { /* // dont run Update() if there is no user BodySourceManager kinectManager; kinectManager = _bodySourceManager.GetComponent<BodySourceManager>(); if(autoChangeAlfterDelay && (!kinectManager)) return; */ if(!isSpinning) { if(slideChangeWithKeys) { if(Input.GetKeyDown(KeyCode.PageDown)) RotateToNext(); else if(Input.GetKeyDown(KeyCode.PageUp)) RotateToPrevious(); } // check for automatic slide-change after a given delay time if(autoChangeAlfterDelay && Time.realtimeSinceStartup >= slideWaitUntil) { RotateToNext(); } } else { // spin the presentation transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, spinSpeed * Time.deltaTime); // check if transform reaches the target rotation. If yes - stop spinning float deltaTargetX = Mathf.Abs(targetRotation.eulerAngles.x - transform.rotation.eulerAngles.x); float deltaTargetY = Mathf.Abs(targetRotation.eulerAngles.y - transform.rotation.eulerAngles.y); if(deltaTargetX < 1f && deltaTargetY < 1f) { // delay the slide slideWaitUntil = Time.realtimeSinceStartup + slideChangeAfterDelay; isSpinning = false; } } if (_bodySourceManager == null) { return; } _bodyManager = _bodySourceManager.GetComponent<BodySourceManager>(); if (_bodyManager == null) { return; } Body[] data = _bodyManager.GetData(); if (data == null) { return; } foreach (var body in data) { if (body == null) { continue; } if (body.IsTracked) { if(body.Joints[JointType.HandTipRight].Position.Y > body.Joints[JointType.Head].Position.Y){ if(!isSpinning) RotateToNext(); } if(body.Joints[JointType.HandTipLeft].Position.Y > body.Joints[JointType.Head].Position.Y){ if(!isSpinning) RotateToPrevious(); } string sideOfSquare = slideTextures[tex].name; if(body.HandRightState == HandState.Lasso && body.HandLeftState == HandState.Lasso){ if(sideOfSquare == "bomb"){ Application.LoadLevel("Main Scene"); } else if(sideOfSquare == "scores"){ Application.LoadLevel("Scores"); } else{ Application.LoadLevel("Second Scene"); } } } } }
// Update is called once per frame void Update() { if (BodySourceManager == null) { return; } _BodyManager = BodySourceManager.GetComponent<BodySourceManager>(); if (_BodyManager == null) { return; } Body[] data = _BodyManager.GetData(); if (data == null) { return; } List<ulong> trackedIds = new List<ulong>(); foreach(var body in data) { if (body == null) { continue; } if(body.IsTracked) { trackedIds.Add (body.TrackingId); } } List<ulong> knownIds = new List<ulong>(_Bodies.Keys); // First delete untracked bodies foreach(ulong trackingId in knownIds) { if(!trackedIds.Contains(trackingId)) { Destroy(_Bodies[trackingId]); _Bodies.Remove(trackingId); } } for (int i=0; i<data.Length; i++) { //foreach(var body in data) //{ if (data [i] == null) { continue; } if (data [i].IsTracked) { if(ctr==0){ initialPosition = data[i].Joints[JointType.SpineBase].Position } RefreshBodyObjectOrientation(data[i]); ctr++; } } }
// Update is called once per frame void Update() { if (BodySourceManager == null) { return; } _BodyManager = BodySourceManager.GetComponent<BodySourceManager>(); if (_BodyManager == null) { return; } Kinect.Body[] data = _BodyManager.GetData(); if (data == null) { return; } if (frameCount == 0) firstBody = data [0]; List<ulong> trackedIds = new List<ulong>(); foreach(var body in data) { if (body == null) { continue; } if(body.IsTracked) { trackedIds.Add (body.TrackingId); } } List<ulong> knownIds = new List<ulong>(_Bodies.Keys); // First delete untracked bodies foreach(ulong trackingId in knownIds) { if(!trackedIds.Contains(trackingId)) { Destroy(_Bodies[trackingId]); _Bodies.Remove(trackingId); } } for (int i=0; i<data.Length; i++) { //foreach(var body in data) //{ if (data[i] == null) { continue; } if(data[i].IsTracked) { //data[i] = NormalizedBody(data[i],firstBody); //RefreshBodyObject(data[i],firstBody); RefreshBodyObjectOrientation (data[i]); /*Debug.Log("ELBOW RIGHT-> "+ "W: "+data[i].JointOrientations [Kinect.JointType.ElbowRight].Orientation.W *Mathf.Rad2Deg + "X: "+data[i].JointOrientations [Kinect.JointType.ElbowRight].Orientation.X *Mathf.Rad2Deg+ "Y: "+data[i].JointOrientations [Kinect.JointType.ElbowRight].Orientation.Y *Mathf.Rad2Deg+ "Z: "+data[i].JointOrientations [Kinect.JointType.ElbowRight].Orientation.Z *Mathf.Rad2Deg );*/ } } /* //record skeleton and store to memory first if (Recording) { //bodyFrames.Clear(); Debug.Log("Recording..."); MySkeleton skel = new MySkeleton(); skel.JointId = new int[data[0].Joints.Count]; skel.Position = new Vector3Serializer[data[0].Joints.Count]; skel.Rotation = new QuaternionSerializer[data[0].Joints.Count]; //GetVector3FromJoint(body.Joints[Kinect.JointType.SpineBase]); for(int i=0;i<data[0].Joints.Count;i++){ //Vector3 a=GetVector3FromJoint(data[0].Joints[(Kinect.JointType)i]); skel.Position[i]= new Vector3Serializer(GetVector3FromJoint(data[0].Joints[(Kinect.JointType)i])); } bodyFrames.Add(skel); } if (Metadata) { //bodyFrames.Clear(); MySkeleton skel = new MySkeleton (); Debug.Log ("recording metadata"); skel.JointId = new int[data[0].Joints.Count]; skel.Position = new Vector3Serializer[data[0].Joints.Count]; skel.Rotation = new QuaternionSerializer[data[0].Joints.Count]; for(int i=0;i<data[0].Joints.Count;i++){ skel.Position[i] = new Vector3Serializer(GetVector3FromJoint(data[0].Joints[(Kinect.JointType)i])); } Debug.Log("asu"+skel.Position[0].getVector()); bodyFrames.Add(skel); } //serialize (store recorded skeleton as binary) if (isSaving) { Debug.Log("saving..."); isSaving = false; serialize(bodyFrames); bodyFrames.Clear(); } if(isSavingMetadata){ serializeLength(bodyFrames); Debug.Log("Skeletons count:"+boneLengths.Count); Debug.Log("saving metadata"); isSavingMetadata = false; bodyFrames.Clear(); } frameCount++; */ }
void Update() { if (BodySourceManager == null) { return; } _BodyManager = BodySourceManager.GetComponent<BodySourceManager>(); if (_BodyManager == null) { return; } Kinect.Body[] data = _BodyManager.GetData(); if (data == null) { return; } if ( _CoordinateMapper ==null ) { _CoordinateMapper = _BodyManager.Sensor.CoordinateMapper; } List<ulong> trackedIds = new List<ulong>(); foreach(var body in data) { if (body == null) { continue; } if(body.IsTracked) { trackedIds.Add (body.TrackingId); } } List<ulong> knownIds = new List<ulong>(_Bodies.Keys); // First delete untracked bodies foreach(ulong trackingId in knownIds) { if(!trackedIds.Contains(trackingId)) { Destroy(_Bodies[trackingId]); _Bodies.Remove(trackingId); } } foreach(var body in data) { if (body == null) { continue; } if(body.IsTracked) { if(!_Bodies.ContainsKey(body.TrackingId)) { // depth distance winnow Kinect.Joint head = body.Joints[Kinect.JointType.Head]; float z = head.Position.Z; if(z >= distanceThreshold){ //Destroy(bodyObject); continue; } // 認識してるボディの数表示 認識制限1人にする Debug.Log(_Bodies.Count); if(_Bodies.Count > 0){ Debug.Log("1人プレイだよ"); continue; } _Bodies[body.TrackingId] = CreateBodyObject(body.TrackingId); } RefreshBodyObject(body, _Bodies[body.TrackingId]); } } }