private void SetInfluences(params InfluenceDef[] influences)
        {
            Remapper remap = new Remapper();

            remap.Remap(influences);
            for (int i = 0; i < remap.RemapTable.Length; ++i)
            {
                _facePoints[i].InfluenceIndex = remap.RemapTable[i];
            }
            _influences = new InfluenceDef[remap.ImplementationLength];
            for (int i = 0; i < remap.ImplementationLength; ++i)
            {
                _influences[i] = influences[remap.ImplementationTable[i]];
            }

            HashSet <string> utilized = new HashSet <string>();

            foreach (InfluenceDef inf in _influences)
            {
                if (inf != null)
                {
                    for (int i = 0; i < inf.WeightCount; ++i)
                    {
                        utilized.Add(inf.Weights[i].Bone);
                    }
                }
            }
            _utilizedBones = utilized.ToArray();
        }
Example #2
0
        public override bool Equals(object obj)
        {
            InfluenceDef other = obj as InfluenceDef;

            if (other == null || WeightCount == other.WeightCount)
            {
                return(false);
            }

            for (int i = 0; i < WeightCount; ++i)
            {
                if (Weights[i] != other.Weights[i])
                {
                    return(false);
                }
            }

            return(true);
        }
Example #3
0
 public Vertex(Vec3 position, InfluenceDef inf, Vec2 texCoord)
     : this(position, inf)
 {
     TexCoord = texCoord;
 }
Example #4
0
 public Vertex(Vec3 position, InfluenceDef inf, Vec3 normal, Vec3 binormal, Vec3 tangent, Vec2 texCoord, ColorF4 color)
     : this(position, inf, normal, texCoord, color)
 {
     Binormal = binormal; Tangent = tangent;
 }
Example #5
0
 public Vertex(Vec3 position, InfluenceDef inf, Vec3 normal, Vec2 texCoord, ColorF4 color)
     : this(position, inf, normal, texCoord)
 {
     Color = color;
 }
Example #6
0
 public Vertex(Vec3 position, InfluenceDef inf, Vec3 normal)
     : this(position, inf)
 {
     Normal = normal;
 }
Example #7
0
 public Vertex(Vec3 position, InfluenceDef inf)
     : this(position) { Influence = inf; }
Example #8
0
 public Vertex(InfluenceDef inf)
 {
     Influence = inf;
 }