本文整理汇总了C#中Source.GetInput方法的典型用法代码示例。如果您正苦于以下问题:C# Source.GetInput方法的具体用法?C# Source.GetInput怎么用?C# Source.GetInput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Source
的用法示例。
在下文中一共展示了Source.GetInput方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SkinController
public SkinController(Geometry geometry, Skeleton skeleton)
: base(ns + "controller", geometry.ID + "_skin")
{
this.Skeleton = skeleton;
this.Geometry = geometry;
List<Bone> bones = skeleton.GetSelfAndDescendents().ToList();
List<string> jntsyms = bones.Select(b => b.Joint.Symbol).ToList();
Dictionary<string, int> jntrevindex = jntsyms.Select((s, i) => new KeyValuePair<string, int>(s, i)).ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Source jointsrc = new Source(ID + "_jnt", "JOINT", "JOINT", bones.Select(b => new IDREF(b.ID)), bones.Count);
Source bindsrc = new Source(ID + "_bnd", "INV_BIND_MATRIX", "TRANSFORM", bones.Select(b => b.Joint.ReverseBindingMatrix), bones.Count);
Source weightsrc = new Source(ID + "_wgt", "WEIGHT", "WEIGHT", Enumerable.Range(0, 256).Select(v => v / 255.0), 256);
this.Add(
//new XAttribute("name", ID),
new XElement(ns + "skin",
new XAttribute("source", "#" + geometry.ID),
new XElement(ns + "bind_shape_matrix", GetString(Matrix4.Identity)),
jointsrc,
bindsrc,
weightsrc,
new XElement(ns + "joints",
jointsrc.GetInput(),
bindsrc.GetInput()
),
new XElement(ns + "vertex_weights",
new XAttribute("count", geometry.VertexList.Count()),
jointsrc.GetInput(0),
weightsrc.GetInput(1),
ValueList(geometry.VertexList.Select(v => v.JointInfluence.Select(j => new int[] { jntrevindex[j.Joint.Symbol], (int)((j.Influence * 255.0) + 0.25) })))
)
)
);
}