Beispiel #1
0
 public AnimationState(AnimationStateDescription stateDesc, AnimationPackage package)
 {
     Name         = stateDesc.Name;
     MinDuration  = TimeSpan.FromSeconds(stateDesc.MinDurationInSeconds);
     timeInState  = TimeSpan.Zero;
     playbackRate = 1.0f;
     blendTree    = AnimationNode.Create(package.NodeDescriptions[stateDesc.BlendTreeNodeName], package);
 }
Beispiel #2
0
        public BinaryAdditiveBlendNode(BinaryAdditiveBlendNodeDescription nodeDesc, AnimationPackage package)
        {
            Name = nodeDesc.Name;

            targetPose     = AnimationNode.Create(package.NodeDescriptions[nodeDesc.TargetNodeName], package);
            differencePose = AnimationNode.Create(package.NodeDescriptions[nodeDesc.DifferenceNodeName], package);

            playbackRate = 1.0f;
            PlaybackRate = nodeDesc.PlaybackRate;
        }
Beispiel #3
0
        public BinaryRateRampBlendNode(BinaryRateRampBlendNodeDescription nodeDesc, AnimationPackage package)
        {
            Name  = nodeDesc.Name;
            rate1 = nodeDesc.Rate1;
            rate2 = nodeDesc.Rate2;

            child = AnimationNode.Create(package.NodeDescriptions[nodeDesc.ChildNodeName], package);

            playbackRate = 1.0f;
            BlendFactor  = nodeDesc.BlendFactor;
        }
Beispiel #4
0
        public BinaryLerpBlendNode(BinaryLerpBlendNodeDescription nodeDesc, AnimationPackage package)
        {
            Name         = nodeDesc.Name;
            BlendFactor  = nodeDesc.BlendFactor;
            playbackRate = nodeDesc.PlaybackRate;

            child1 = AnimationNode.Create(package.NodeDescriptions[nodeDesc.Child1NodeName], package);
            child2 = AnimationNode.Create(package.NodeDescriptions[nodeDesc.Child2NodeName], package);

            playbackRate = 1.0f;
            PlaybackRate = nodeDesc.PlaybackRate;   // Make sure the child nodes are populated so this value can propagate down.
        }
Beispiel #5
0
        public Continuous1DLerpBlendNode(Continuous1DLerpBlendNodeDescription nodeDesc, AnimationPackage package)
        {
            Name               = nodeDesc.Name;
            BlendPosition      = nodeDesc.BlendPosition;
            ChildrenByPosition = new Dictionary <float, AnimationNode>();

            for (int c = 0; c < nodeDesc.ChildNodeNames.Count; c++)
            {
                AnimationNode childNode = AnimationNode.Create(package.NodeDescriptions[nodeDesc.ChildNodeNames[c]], package);
                ChildrenByPosition.Add(nodeDesc.ChildPositionsByName[nodeDesc.ChildNodeNames[c]], childNode);
            }

            playbackRate = 1.0f;
            PlaybackRate = nodeDesc.PlaybackRate;
        }
Beispiel #6
0
        public TernaryLerpBlendNode(TernaryLerpBlendNodeDescription nodeDesc, AnimationPackage package)
        {
            Name           = nodeDesc.Name;
            BlendPosition  = nodeDesc.BlendPosition;
            Child1Position = nodeDesc.Child1NodePosition;
            Child2Position = nodeDesc.Child2NodePosition;
            Child3Position = nodeDesc.Child3NodePosition;

            child1 = AnimationNode.Create(package.NodeDescriptions[nodeDesc.Child1NodeName], package);
            child2 = AnimationNode.Create(package.NodeDescriptions[nodeDesc.Child2NodeName], package);
            child3 = AnimationNode.Create(package.NodeDescriptions[nodeDesc.Child3NodeName], package);

            playbackRate = 1.0f;
            PlaybackRate = nodeDesc.PlaybackRate;
        }
Beispiel #7
0
        public General1DPositionalBlendNode(General1DPositionalBlendNodeDescription nodeDesc, AnimationPackage package)
        {
            Name             = nodeDesc.Name;
            BlendPosition    = nodeDesc.BlendPosition;
            children         = new List <AnimationNode>();
            Partition        = nodeDesc.ChildRangesByName;
            SyncClipNodeName = nodeDesc.SyncClipNodeName;

            for (int c = 0; c < nodeDesc.ChildNodeNames.Count; c++)
            {
                children.Add(AnimationNode.Create(package.NodeDescriptions[nodeDesc.ChildNodeNames[c]], package));
            }

            playbackRate = 1.0f;
            PlaybackRate = nodeDesc.PlaybackRate;
        }
Beispiel #8
0
        public General2DPositionalBlendNode(General2DPositionalBlendNodeDescription nodeDesc, AnimationPackage package)
        {
            Name          = nodeDesc.Name;
            BlendPosition = nodeDesc.BlendPosition;
            Triangulation = new List <TernaryLerpBlendNode>();

            foreach (string triNodeName in nodeDesc.TriangleNodeNames)
            {
                Triangulation.Add((TernaryLerpBlendNode)(AnimationNode.Create(package.NodeDescriptions[triNodeName], package)));
            }

            children = new AnimationNode[Triangulation.Count];

            for (int c = 0; c < Triangulation.Count; c++)
            {
                children[c] = Triangulation[c];
            }

            playbackRate = 1.0f;
            PlaybackRate = nodeDesc.PlaybackRate;
        }