示例#1
0
        private void MoveToPosition(int positionIndex, int fixedBoneIndex)
        {
            if (_animatePositionChanges)
            {
                _fullWrist.HideBonesWithNoKinematics(_currentPositionIndex); //TODO: Should be a better way (also, this hides bones for the last position!)
                animateChangeInPosition(_currentPositionIndex, positionIndex, _fixedBoneIndex, fixedBoneIndex);
            }
            else
            {
                //this will hide the needed bones are move everything
                _fullWrist.SetToPositionAndFixedBone(positionIndex, fixedBoneIndex);
            }

            //now that we are done, lets save the last positions
            _currentPositionIndex = positionIndex;
            _fixedBoneIndex       = fixedBoneIndex;
        }
示例#2
0
        private void advanceFrame()
        {
            _currentFrame++; //TODO: problem, shouldn't this happen at the end....?

            showFrame(_currentFrame);

            //now lets check if this was the last frame & we are not looping
            if (_currentFrame == _numberOfFrames - 1) //need -1 from end, because we want to know immediatly when its the last frame
            {
                //if here, we want to stop and announce the event
                _timer.Stop();                     //top the timer, so we don't get called again
                if (EndOfAnimationReached != null) //if anyone is listening, lets announce ourselves!
                {
                    EndOfAnimationReached(this, new EventArgs());
                }

                //add the color back in, if it existed
                _fullWrist.SetToPositionAndFixedBone(_endPositionIndex, _endFixedBoneIndex);
            }
        }