protected void UpdateAnimation() { mAnimationState.Update(EngineSettings.Time.ElapsedGameTime.Milliseconds / 1000f); Skeleton.Update(EngineSettings.Time.ElapsedGameTime.Milliseconds / 1000f); mSkeleton.UpdateWorldTransform(); mAnimationState.Apply(mSkeleton); }
public void UpdateAnimation() { skeleton.Update(Time.deltaTime * timeScale); state.Update(Time.deltaTime * timeScale); state.Apply(skeleton); skeleton.UpdateWorldTransform(); }
public void RapidUpdate() { state.Update(Time.Delta); state.Apply(skeleton); skeleton.Update(Time.Delta); skeleton.UpdateWorldTransform(); }
public virtual void Update(float deltaTime) { if (!this.IsValid) { return; } deltaTime *= timeScale; skeleton.Update(deltaTime); state.Update(deltaTime); state.Apply(skeleton); if (UpdateLocal != null) { UpdateLocal(this); } skeleton.UpdateWorldTransform(); if (UpdateWorld != null) { UpdateWorld(this); skeleton.UpdateWorldTransform(); } if (UpdateComplete != null) { UpdateComplete(this); } }
public void OnUpdate() { if (!IsAvailable) { return; } _state.Update(Time.LastDelta / 1000f); _state.Apply(_skeleton); _skeleton.Update(Time.LastDelta / 1000f); }
public void SetGaugePercent(float percent) { if (this.skeletonRenderer != null) { Skeleton skeleton = this.skeletonRenderer.skeleton; if (skeleton != null) { this.fillAnimation.Animation.Apply(skeleton, 0f, percent, false, null, 1f, MixPose.Setup, MixDirection.In); skeleton.Update(Time.deltaTime); skeleton.UpdateWorldTransform(); } } }
//Public Methods: public void Update() { //set visibility: if (Hand.HandConfidence > .85f && !Visible) { Visible = true; OnVisibilityChanged?.Invoke(this, true); } else if (Hand.HandConfidence <= .85f && Visible) { Visible = false; OnVisibilityChanged?.Invoke(this, false); } Skeleton.Update(); Gesture.Update(); }
/** * Called each frame to update the view */ void Update() { handleCameraDimensions(); if (lastPose != null) { // act on last pose-event handleNodeMovement(lastPose.nose, nose, ref prevNoseCoord, "nose"); handleNodeMovement(lastPose.leftEye, leftEye, ref prevLeftEyeCoord, "leftEye"); handleNodeMovement(lastPose.rightEye, rightEye, ref prevRightEyeCoord, "rightEye"); handleNodeMovement(lastPose.leftEar, leftEar, ref prevLeftEarCoord, "leftEar"); handleNodeMovement(lastPose.rightEar, rightEar, ref prevRightEarCoord, "rightEar"); handleNodeMovement(lastPose.leftShoulder, leftShoulder, ref prevLeftShoulderCoord, "leftShoulder"); handleNodeMovement(lastPose.rightShoulder, rightShoulder, ref prevRightShoulderCoord, "rightShoulder"); handleNodeMovement(lastPose.leftElbow, leftElbow, ref prevLeftElbowCoord, "leftElbow"); handleNodeMovement(lastPose.rightElbow, rightElbow, ref prevRightElbowCoord, "rightElbow"); handleNodeMovement(lastPose.leftWrist, leftHand, ref prevLeftWristCoord, "leftHand"); handleNodeMovement(lastPose.rightWrist, rightHand, ref prevRightWristCoord, "rightHand"); handleNodeMovement(lastPose.leftHip, leftHip, ref prevLeftHipCoord, "leftHip"); handleNodeMovement(lastPose.rightHip, rightHip, ref prevRightHipCoord, "rightHip"); handleNodeMovement(lastPose.leftKnee, leftKnee, ref prevLeftKneeCoord, "leftKnee"); handleNodeMovement(lastPose.rightKnee, rightKnee, ref prevRightKneeCoord, "rightKnee"); handleNodeMovement(lastPose.leftFoot, leftFoot, ref prevLeftFootCoord, "leftFoot"); handleNodeMovement(lastPose.rightFoot, rightFoot, ref prevRightFootCoord, "rightFoot"); PosePosition pelvisPose = new PosePosition(); pelvisPose.x = (lastPose.rightHip.x + lastPose.leftHip.x) / 2; pelvisPose.y = (lastPose.rightHip.y + lastPose.leftHip.y) / 2; PosePosition middleSpinePose = new PosePosition(); middleSpinePose.x = (lastPose.rightHip.x + lastPose.leftShoulder.x) / 2; middleSpinePose.y = (lastPose.leftShoulder.y + lastPose.leftHip.y) / 2; handleNodeMovement(pelvisPose, root, ref prevRootCoord, "Root"); handleNodeMovement(middleSpinePose, middleSpine, ref prevMiddleSpineCoord, "MiddleSpine"); processedPose = lastPose; lastPose = null; } else { // Debug.Log("No lastPose present"); } if (drawSkeleton && skeleton != null) { skeleton.Update(); } }
//Public Methods: public void Update() { //set visibility: if (Hand.HandConfidence > .85f && !Visible) { Visible = true; OnVisibilityChanged?.Invoke(this, true); } else if (Hand.HandConfidence <= .85f && Visible) { Visible = false; OnVisibilityChanged?.Invoke(this, false); } Skeleton.Update(); Gesture.Update(); Collider.Update(_handInput.palmCollisions); if (_handInput != null) { Collider.Update(_handInput.palmCollisions); } }
//Public Methods: public void Update() { //set visibility: if (Hand.HandConfidence > .85f && !Visible) { Visible = true; OnVisibilityChanged?.Invoke(this, true); } else if (Visible) { IntentPose pose = Gesture.Intent; var isPinching = (pose == IntentPose.Grasping || pose == IntentPose.Pinching); float minConfidence = isPinching ? .80f : .85f; if (Hand.HandConfidence <= minConfidence) { Visible = false; OnVisibilityChanged?.Invoke(this, false); } } Skeleton.Update(); Gesture.Update(); }
//Public Methods: public void Update() { //set visibility: if (Hand.HandConfidence > .85f && !Visible) { Visible = true; OnVisibilityChanged?.Invoke(this, true); } else if (Hand.HandConfidence <= .85f && Visible) { Visible = false; OnVisibilityChanged?.Invoke(this, false); } Skeleton.Update(); Gesture.Update(); // Modified here by prnvcher to not explode if using null hand input if (_handInput != null) { Collider?.Update(_handInput.palmCollisions); } }
public virtual void UpdateSkeleton() { skeleton.Update(Time.deltaTime * timeScale); skeleton.UpdateWorldTransform(); }
public void Update() { // Clear fields if missing information to render. if (skeletonDataAsset == null || skeletonDataAsset.GetSkeletonData(false) == null) { Clear(); return; } // Initialize fields. if (skeleton == null || skeleton.Data != skeletonDataAsset.GetSkeletonData(false)) { Initialize(); } // Keep AnimationState in sync with animationName and loop fields. if (animationName == null && state.Animation != null) { state.Clear(); } else if (state.Animation == null || animationName != state.Animation.Name) { Spine.Animation animation = skeleton.Data.FindAnimation(animationName); if (animation != null) { state.SetAnimation(animation, loop); } } state.Loop = loop; // Apply animation. skeleton.Update(Time.deltaTime * timeScale); state.Update(Time.deltaTime * timeScale); state.Apply(skeleton); skeleton.UpdateWorldTransform(); // Count quads. int quadCount = 0; List <Slot> drawOrder = skeleton.DrawOrder; for (int i = 0, n = drawOrder.Count; i < n; i++) { Slot slot = drawOrder[i]; Attachment attachment = slot.Attachment; if (attachment is RegionAttachment) { quadCount++; } } // Ensure mesh data is the right size. if (quadCount != this.quadCount) { this.quadCount = quadCount; vertices = new Vector3[quadCount * 4]; uvs = new Vector2[quadCount * 4]; triangles = new int[quadCount * 6]; } // Setup mesh. int quadIndex = 0; for (int i = 0, n = drawOrder.Count; i < n; i++) { Slot slot = drawOrder[i]; Attachment attachment = slot.Attachment; if (attachment is RegionAttachment) { RegionAttachment regionAttachment = (RegionAttachment)attachment; regionAttachment.UpdateVertices(slot.Bone); float[] regionVertices = regionAttachment.Vertices; int vertexIndex = quadIndex * 4; vertices[vertexIndex] = new Vector3(regionVertices[RegionAttachment.X1], regionVertices[RegionAttachment.Y1], 0); vertices[vertexIndex + 1] = new Vector3(regionVertices[RegionAttachment.X4], regionVertices[RegionAttachment.Y4], 0); vertices[vertexIndex + 2] = new Vector3(regionVertices[RegionAttachment.X2], regionVertices[RegionAttachment.Y2], 0); vertices[vertexIndex + 3] = new Vector3(regionVertices[RegionAttachment.X3], regionVertices[RegionAttachment.Y3], 0); float[] regionUVs = regionAttachment.UVs; uvs[vertexIndex] = new Vector2(regionUVs[RegionAttachment.X1], 1 - regionUVs[RegionAttachment.Y1]); uvs[vertexIndex + 1] = new Vector2(regionUVs[RegionAttachment.X4], 1 - regionUVs[RegionAttachment.Y4]); uvs[vertexIndex + 2] = new Vector2(regionUVs[RegionAttachment.X2], 1 - regionUVs[RegionAttachment.Y2]); uvs[vertexIndex + 3] = new Vector2(regionUVs[RegionAttachment.X3], 1 - regionUVs[RegionAttachment.Y3]); int index = quadIndex * 6; triangles[index] = vertexIndex; triangles[index + 1] = vertexIndex + 2; triangles[index + 2] = vertexIndex + 1; triangles[index + 3] = vertexIndex + 2; triangles[index + 4] = vertexIndex + 3; triangles[index + 5] = vertexIndex + 1; quadIndex++; } } mesh.vertices = vertices; mesh.uv = uvs; mesh.triangles = triangles; renderer.sharedMaterial = skeletonDataAsset.atlasAsset.material; }
/* */ private void UpdateSkeleton() { skeleton.Update(Time.deltaTime * animationSpeed); skeleton.UpdateWorldTransform(); }