public CreateKeyFrame ( float time ) : |
||
time | float | Time within the animation at which this keyframe will lie. |
return |
protected void ReadKeyFrame(XmlNode node, AnimationTrack track) { float time = float.Parse(node.Attributes["time"].Value); // create a new keyframe with the specified length TransformKeyFrame keyFrame = (TransformKeyFrame)track.CreateKeyFrame(time); foreach (XmlNode childNode in node.ChildNodes) { switch (childNode.Name) { case "translate": keyFrame.Translate = ReadVector3(childNode); break; case "rotate": ReadRotate(childNode, keyFrame); break; default: DebugMessage(childNode); break; } } }
protected void AddKey(AnimationTrack track, float time, Vector3 translate) { TransformKeyFrame key = (TransformKeyFrame)track.CreateKeyFrame(time); key.Translate = translate; }