Beispiel #1
0
 public override void Get(string table, int index, DictionaryStringString items)
 {
     if (table == "nodes")
     {
         Node k = m.nodes[index];
         items.Set("name", k.name);
         items.Set("paren", k.parentName);
         items.Set("x", p.FloatToString(k.posx));
         items.Set("y", p.FloatToString(k.posy));
         items.Set("z", p.FloatToString(k.posz));
         items.Set("rotx", p.FloatToString(k.rotatex));
         items.Set("roty", p.FloatToString(k.rotatey));
         items.Set("rotz", p.FloatToString(k.rotatez));
         items.Set("sizex", p.FloatToString(k.sizex));
         items.Set("sizey", p.FloatToString(k.sizey));
         items.Set("sizez", p.FloatToString(k.sizez));
         items.Set("u", p.FloatToString(k.u));
         items.Set("v", p.FloatToString(k.v));
         items.Set("pivx", p.FloatToString(k.pivotx));
         items.Set("pivy", p.FloatToString(k.pivoty));
         items.Set("pivz", p.FloatToString(k.pivotz));
         items.Set("scalx", p.FloatToString(k.scalex));
         items.Set("scaly", p.FloatToString(k.scaley));
         items.Set("scalz", p.FloatToString(k.scalez));
         items.Set("head", p.FloatToString(k.head));
     }
     if (table == "keyframes")
     {
         Keyframe k = m.keyframes[index];
         items.Set("anim", k.animationName);
         items.Set("node", k.nodeName);
         items.Set("frame", p.FloatToString(k.frame));
         items.Set("type", KeyframeType.GetName(k.frame));
         items.Set("x", p.FloatToString(k.x));
         items.Set("y", p.FloatToString(k.y));
         items.Set("z", p.FloatToString(k.z));
     }
     if (table == "animations")
     {
         Animation k = m.animations[index];
         items.Set("name", k.name);
         items.Set("len", p.FloatToString(k.length));
     }
     if (table == "global")
     {
         AnimationGlobal global = m.global;
         items.Set("texw", p.FloatToString(global.texw));
         items.Set("texh", p.FloatToString(global.texh));
     }
 }
Beispiel #2
0
 public AnimatedModel()
 {
     global = new AnimationGlobal();
 }
Beispiel #3
0
 public override void Set(string table, int index, string column, string value)
 {
     if (table == "nodes")
     {
         if (index >= m.nodesCount)
         {
             m.nodesCount = index + 1;
         }
         if (m.nodes[index] == null)
         {
             m.nodes[index] = new Node();
         }
         Node k = m.nodes[index];
         if (column == "name")
         {
             k.name = value;
         }
         if (column == "paren")
         {
             k.parentName = value;
         }
         if (column == "x")
         {
             k.posx = FloatParse(value);
         }
         if (column == "y")
         {
             k.posy = FloatParse(value);
         }
         if (column == "z")
         {
             k.posz = FloatParse(value);
         }
         if (column == "rotx")
         {
             k.rotatex = FloatParse(value);
         }
         if (column == "roty")
         {
             k.rotatey = FloatParse(value);
         }
         if (column == "rotz")
         {
             k.rotatez = FloatParse(value);
         }
         if (column == "sizex")
         {
             k.sizex = FloatParse(value);
         }
         if (column == "sizey")
         {
             k.sizey = FloatParse(value);
         }
         if (column == "sizez")
         {
             k.sizez = FloatParse(value);
         }
         if (column == "u")
         {
             k.u = FloatParse(value);
         }
         if (column == "v")
         {
             k.v = FloatParse(value);
         }
         if (column == "pivx")
         {
             k.pivotx = FloatParse(value);
         }
         if (column == "pivy")
         {
             k.pivoty = FloatParse(value);
         }
         if (column == "pivz")
         {
             k.pivotz = FloatParse(value);
         }
         if (column == "scalx")
         {
             k.scalex = FloatParse(value);
         }
         if (column == "scaly")
         {
             k.scaley = FloatParse(value);
         }
         if (column == "scalz")
         {
             k.scalez = FloatParse(value);
         }
         if (column == "head")
         {
             k.head = FloatParse(value);
         }
     }
     if (table == "keyframes")
     {
         if (index >= m.keyframesCount)
         {
             m.keyframesCount = index + 1;
         }
         if (m.keyframes[index] == null)
         {
             m.keyframes[index] = new Keyframe();
         }
         Keyframe k = m.keyframes[index];
         if (column == "anim")
         {
             k.animationName = value;
         }
         if (column == "node")
         {
             k.nodeName = value;
         }
         if (column == "frame")
         {
             k.frame = IntParse(value);
         }
         if (column == "type")
         {
             k.keyframeType = KeyframeType.GetValue(value);
         }
         if (column == "x")
         {
             k.x = FloatParse(value);
         }
         if (column == "y")
         {
             k.y = FloatParse(value);
         }
         if (column == "z")
         {
             k.z = FloatParse(value);
         }
     }
     if (table == "animations")
     {
         if (index >= m.animationsCount)
         {
             m.animationsCount = index + 1;
         }
         if (m.animations[index] == null)
         {
             m.animations[index] = new Animation();
         }
         Animation k = m.animations[index];
         if (column == "name")
         {
             k.name = value;
         }
         if (column == "len")
         {
             k.length = IntParse(value);
         }
     }
     if (table == "global")
     {
         AnimationGlobal global = m.global;
         if (column == "texw")
         {
             global.texw = IntParse(value);
         }
         if (column == "texh")
         {
             global.texh = IntParse(value);
         }
     }
 }
 public AnimatedModel()
 {
     global = new AnimationGlobal();
 }