Engines/FlatRedBallXNA/FlatRedBall.Content/ModelAnimation/AsfAmc/AsfImporter.cs
/// <summary>
/// Imports Acclaim AFS (motion capture skeleton).
/// Stores dof spec (degrees of freedom) as string in OpaqueData for each bone.
/// </summary>
Imports Acclaim AFS (motion capture skeleton).
Stores dof spec (degrees of freedom) as string in OpaqueData for each bone.
Imports Acclaim AFS ( motion capture skeleton ) . Stores dof spec ( degrees of freedom ) as string in OpaqueData for each bone .
public override BoneContent Import(string filename, ContentImporterContext context)
        {
            this.context = context;
            contentId = new ContentIdentity(filename);
            BoneContent root = new BoneContent();
            root.Name = "root";
            root.Identity = cId;
            root.Transform = Matrix.Identity;
            bones = new NamedValueDictionary<BoneContent>();
            bones.Add("root", root);
            if (!File.Exists(filename)) 
                throw new InvalidContentException("file " + filename + " not found");
            reader = new StreamReader(filename);
            String line;
            while ((line = readLine()) != ":bonedata")
            {
                if (line == null) throw new InvalidContentException("no bone data found", cId);
            }
            BoneContent bone;
            while ((bone=importBone()) != null)
            {
                bones.Add(bone.Name, bone);
            }
            importHierarchy();
            foreach (BoneContent b in bones.Values)
            {
                if (b.Name != "root" && b.Parent == null)
                {
                    throw new InvalidContentException("incomplete hierarchy - bone " + b + " has no parent", cId);
                }
            }
            return root;
        }
public override BoneContent Import ( string filename , ContentImporterContext context ) { this . context = context ; contentId = new ContentIdentity ( filename ) ; BoneContent root = new BoneContent ( ) ; root . Name = " " ; root . Identity = cId ; root . Transform = Matrix . Identity ; bones = new NamedValueDictionary < BoneContent > ( ) ; bones . Add ( " " , root ) ; if ( ! File . Exists ( filename ) ) throw new InvalidContentException ( " " + filename + " " ) ; reader = new StreamReader ( filename ) ; String line ; while ( ( line = readLine ( ) ) != " " ) { if ( line == null ) throw new InvalidContentException ( " " , cId ) ; } BoneContent bone ; while ( ( bone = importBone ( ) ) != null ) { bones . Add ( bone . Name , bone ) ; } importHierarchy ( ) ; foreach ( BoneContent b in bones . Values ) { if ( b . Name != " " && b . Parent == null ) { throw new InvalidContentException ( " " + b + " " , cId ) ; } } return root ; }
Imports Acclaim AFS (motion capture skeleton).
Imports Acclaim AFS ( motion capture skeleton ) .
filename
string
context
ContentImporterContext