public CompressedVertex(DependencyReader reader) { Position = new RealVector3D(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()); Normal = new HenDN3(reader.ReadUInt32()); Binormal = new HenDN3(reader.ReadUInt32()); Tangent = new HenDN3(reader.ReadUInt32()); TexCoords = new RealVector2D(reader.ReadInt16() / (float)short.MaxValue, reader.ReadInt16() / (float)short.MaxValue); NodeIndex1 = (short)(reader.ReadByte() / 3); NodeIndex2 = (short)(reader.ReadByte() / 3); var node0Weight = reader.ReadUInt16() / (float)short.MaxValue; NodeWeights = new RealVector2D(node0Weight, 1 - node0Weight); }
public override void UpdateFromMetaValue(MetaValueBase meta, string fieldId) { switch (fieldId) { case FieldId.Position: case FieldId.Orientation: var multi = meta as MultiValue; if (fieldId == FieldId.Position) { Position = new RealVector3D(multi.Value1, multi.Value2, multi.Value3); } else { Orientation = new RealVector2D(multi.Value1, multi.Value2); } break; } }
public static Vector2 ToVector(this RealVector2D vector) { return(new Vector2(vector.I, vector.K)); }
public void CopyFrom(StartPosition other) { Orientation = other.Orientation; Position = other.Position; }