public static void TransformPosArray(this M44d mat, V3d[] points) { for (int i = 0; i < points.Length; i++) { points[i] = mat.TransformPos(points[i]); } }
public static V3d[] TransformedPosArray(this M44d mat, ICollection <V3d> points) { var result = new V3d[points.Count]; int i = 0; foreach (var p in points) { result[i++] = mat.TransformPos(p); } return(result); }
/// <summary> /// Copies from the position array indexed by a backward map into /// a target array, starting at the supplied offset, thereby /// transforming all positions using the supplied matrix. /// </summary> /// <returns>target array</returns> public static V3f[] BackwardIndexedTransformPosAndCopyTo( this V3f[] source, V3f[] target, int[] backwardMap, int offset, M44d m44d) { var count = backwardMap.Length; for (int i = 0; i < count; i++) { target[i + offset] = (V3f)m44d.TransformPos((V3d)source[backwardMap[i]]); } return(target); }
public static V3d[] TransformedPos(this V3d[] points, M44d matrix) { return(points.Map(p => matrix.TransformPos(p))); }
/// <summary> /// Returns the ray transformed with the given matrix. /// </summary> public Ray3d Transformed(M44d mat) { return(new Ray3d(mat.TransformPos(Origin), mat.TransformDir(Direction))); }
/// <summary> /// Transforms a 2d polygon into 3d. /// The z-coordinate is assumed to be zero. /// </summary> public static Polygon3d Transformed(this Polygon2d polygon, M44d transform) { return(new Polygon3d(polygon.GetPointArray(p => transform.TransformPos(p.XYO)))); }