public VertexPositionNormal(IVertexGeometry src) { Guard.NotNull(src, nameof(src)); this.Position = src.GetPosition(); src.TryGetNormal(out this.Normal); }
public static string _GetDebuggerDisplay(IVertexGeometry geo) { var txt = $"𝐏:{geo.GetPosition()}"; if (geo.TryGetNormal(out Vector3 n)) { txt += $" 𝚴:{n}"; } if (geo.TryGetTangent(out Vector4 t)) { txt += $" 𝚻:{t}"; } return(txt); }
public static TvP ConvertToGeometry <TvP>(this IVertexGeometry src) where TvP : struct, IVertexGeometry { if (src.GetType() == typeof(TvP)) { return((TvP)src); } var dst = default(TvP); dst.SetPosition(src.GetPosition()); if (src.TryGetNormal(out Vector3 nrm)) { dst.SetNormal(nrm); } if (src.TryGetTangent(out Vector4 tgt)) { dst.SetTangent(tgt); } return(dst); }
IVertexGeometry IVertexGeometry.ToDisplaceMorph(IVertexGeometry baseValue) { var bv = (VertexPosition)baseValue; return(new VertexPosition(this.Position - bv.Position)); }
IVertexGeometry IVertexGeometry.ToAbsoluteMorph(IVertexGeometry baseValue) { var bv = (VertexPosition)baseValue; return(new VertexPosition(this.Position + bv.Position)); }
public VertexPosition(IVertexGeometry src) { Guard.NotNull(src, nameof(src)); this.Position = src.GetPosition(); }
IVertexGeometry IVertexGeometry.ToDisplaceMorph(IVertexGeometry baseValue) { throw new NotSupportedException(); }
IVertexGeometry IVertexGeometry.ToAbsoluteMorph(IVertexGeometry baseValue) { throw new NotSupportedException(); }
public VertexGeometryDelta Subtract(IVertexGeometry baseValue) { return(new VertexGeometryDelta((VertexPosition)baseValue, this)); }