Skip to content

Commit

Permalink
Fix naming of Mat.TransposedTransformProj methods
Browse files Browse the repository at this point in the history
  • Loading branch information
hyazinthh committed Jul 8, 2024
1 parent 051e576 commit e0fc90f
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 27 deletions.
112 changes: 88 additions & 24 deletions src/Aardvark.Base/Math/Trafos/Matrix_auto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24332,17 +24332,21 @@ public static V2i TransposedTransformPos(this M33i m, V2i p)
/// Transforms point p (v.Z is presumed 1.0) by transposed version of matrix m.
/// Projective transform is performed. Perspective Division is performed.
/// </summary>
public static V2i TransposedTransformProj(this M33i m, V2i p)
public static V2i TransposedTransformPosProj(this M33i m, V2i p)
{
var s = m.M02 * p.X + m.M12 * p.Y + m.M22;
return TransposedTransformPos(m, p) * (1 / s);
}

[Obsolete("Use TransposedTransformPosProj instead.")]
public static V2i TransposedTransformProj(this M33i m, V2i p)
=> m.TransposedTransformPosProj(p);

/// <summary>
/// Transforms point p (v.Z is presumed 1.0) by transposed version of matrix m.
/// Projective transform is performed. Perspective Division is performed.
/// Projective transform is performed.
/// </summary>
public static V3i TransposedTransformProjFull(this M33i m, V2i p)
public static V3i TransposedTransformPosProjFull(this M33i m, V2i p)
{
return new V3i(
m.M00 * p.X + m.M10 * p.Y + m.M20,
Expand All @@ -24351,6 +24355,10 @@ public static V3i TransposedTransformProjFull(this M33i m, V2i p)
);
}

[Obsolete("Use TransposedTransformPosProjFull instead.")]
public static V3i TransposedTransformProjFull(this M33i m, V2i p)
=> m.TransposedTransformPosProjFull(p);

#endregion

#region Operations
Expand Down Expand Up @@ -27645,17 +27653,21 @@ public static V2l TransposedTransformPos(this M33l m, V2l p)
/// Transforms point p (v.Z is presumed 1.0) by transposed version of matrix m.
/// Projective transform is performed. Perspective Division is performed.
/// </summary>
public static V2l TransposedTransformProj(this M33l m, V2l p)
public static V2l TransposedTransformPosProj(this M33l m, V2l p)
{
var s = m.M02 * p.X + m.M12 * p.Y + m.M22;
return TransposedTransformPos(m, p) * (1 / s);
}

[Obsolete("Use TransposedTransformPosProj instead.")]
public static V2l TransposedTransformProj(this M33l m, V2l p)
=> m.TransposedTransformPosProj(p);

/// <summary>
/// Transforms point p (v.Z is presumed 1.0) by transposed version of matrix m.
/// Projective transform is performed. Perspective Division is performed.
/// Projective transform is performed.
/// </summary>
public static V3l TransposedTransformProjFull(this M33l m, V2l p)
public static V3l TransposedTransformPosProjFull(this M33l m, V2l p)
{
return new V3l(
m.M00 * p.X + m.M10 * p.Y + m.M20,
Expand All @@ -27664,6 +27676,10 @@ public static V3l TransposedTransformProjFull(this M33l m, V2l p)
);
}

[Obsolete("Use TransposedTransformPosProjFull instead.")]
public static V3l TransposedTransformProjFull(this M33l m, V2l p)
=> m.TransposedTransformPosProjFull(p);

#endregion

#region Operations
Expand Down Expand Up @@ -31171,17 +31187,21 @@ public static V2f TransposedTransformPos(this M33f m, V2f p)
/// Transforms point p (v.Z is presumed 1.0) by transposed version of matrix m.
/// Projective transform is performed. Perspective Division is performed.
/// </summary>
public static V2f TransposedTransformProj(this M33f m, V2f p)
public static V2f TransposedTransformPosProj(this M33f m, V2f p)
{
var s = m.M02 * p.X + m.M12 * p.Y + m.M22;
return TransposedTransformPos(m, p) * (1 / s);
}

[Obsolete("Use TransposedTransformPosProj instead.")]
public static V2f TransposedTransformProj(this M33f m, V2f p)
=> m.TransposedTransformPosProj(p);

/// <summary>
/// Transforms point p (v.Z is presumed 1.0) by transposed version of matrix m.
/// Projective transform is performed. Perspective Division is performed.
/// Projective transform is performed.
/// </summary>
public static V3f TransposedTransformProjFull(this M33f m, V2f p)
public static V3f TransposedTransformPosProjFull(this M33f m, V2f p)
{
return new V3f(
m.M00 * p.X + m.M10 * p.Y + m.M20,
Expand All @@ -31190,6 +31210,10 @@ public static V3f TransposedTransformProjFull(this M33f m, V2f p)
);
}

[Obsolete("Use TransposedTransformPosProjFull instead.")]
public static V3f TransposedTransformProjFull(this M33f m, V2f p)
=> m.TransposedTransformPosProjFull(p);

#endregion

#region Operations
Expand Down Expand Up @@ -34802,17 +34826,21 @@ public static V2d TransposedTransformPos(this M33d m, V2d p)
/// Transforms point p (v.Z is presumed 1.0) by transposed version of matrix m.
/// Projective transform is performed. Perspective Division is performed.
/// </summary>
public static V2d TransposedTransformProj(this M33d m, V2d p)
public static V2d TransposedTransformPosProj(this M33d m, V2d p)
{
var s = m.M02 * p.X + m.M12 * p.Y + m.M22;
return TransposedTransformPos(m, p) * (1 / s);
}

[Obsolete("Use TransposedTransformPosProj instead.")]
public static V2d TransposedTransformProj(this M33d m, V2d p)
=> m.TransposedTransformPosProj(p);

/// <summary>
/// Transforms point p (v.Z is presumed 1.0) by transposed version of matrix m.
/// Projective transform is performed. Perspective Division is performed.
/// Projective transform is performed.
/// </summary>
public static V3d TransposedTransformProjFull(this M33d m, V2d p)
public static V3d TransposedTransformPosProjFull(this M33d m, V2d p)
{
return new V3d(
m.M00 * p.X + m.M10 * p.Y + m.M20,
Expand All @@ -34821,6 +34849,10 @@ public static V3d TransposedTransformProjFull(this M33d m, V2d p)
);
}

[Obsolete("Use TransposedTransformPosProjFull instead.")]
public static V3d TransposedTransformProjFull(this M33d m, V2d p)
=> m.TransposedTransformPosProjFull(p);

#endregion

#region Operations
Expand Down Expand Up @@ -52309,17 +52341,21 @@ public static V3i TransposedTransformPos(this M44i m, V3i p)
/// Transforms point p (v.W is presumed 1.0) by transposed version of matrix m.
/// Projective transform is performed. Perspective Division is performed.
/// </summary>
public static V3i TransposedTransformProj(this M44i m, V3i p)
public static V3i TransposedTransformPosProj(this M44i m, V3i p)
{
var s = m.M03 * p.X + m.M13 * p.Y + m.M23 * p.Z + m.M33;
return TransposedTransformPos(m, p) * (1 / s);
}

[Obsolete("Use TransposedTransformPosProj instead.")]
public static V3i TransposedTransformProj(this M44i m, V3i p)
=> m.TransposedTransformPosProj(p);

/// <summary>
/// Transforms point p (v.W is presumed 1.0) by transposed version of matrix m.
/// Projective transform is performed. Perspective Division is performed.
/// Projective transform is performed.
/// </summary>
public static V4i TransposedTransformProjFull(this M44i m, V3i p)
public static V4i TransposedTransformPosProjFull(this M44i m, V3i p)
{
return new V4i(
m.M00 * p.X + m.M10 * p.Y + m.M20 * p.Z + m.M30,
Expand All @@ -52329,6 +52365,10 @@ public static V4i TransposedTransformProjFull(this M44i m, V3i p)
);
}

[Obsolete("Use TransposedTransformPosProjFull instead.")]
public static V4i TransposedTransformProjFull(this M44i m, V3i p)
=> m.TransposedTransformPosProjFull(p);

#endregion

#region Operations
Expand Down Expand Up @@ -56221,17 +56261,21 @@ public static V3l TransposedTransformPos(this M44l m, V3l p)
/// Transforms point p (v.W is presumed 1.0) by transposed version of matrix m.
/// Projective transform is performed. Perspective Division is performed.
/// </summary>
public static V3l TransposedTransformProj(this M44l m, V3l p)
public static V3l TransposedTransformPosProj(this M44l m, V3l p)
{
var s = m.M03 * p.X + m.M13 * p.Y + m.M23 * p.Z + m.M33;
return TransposedTransformPos(m, p) * (1 / s);
}

[Obsolete("Use TransposedTransformPosProj instead.")]
public static V3l TransposedTransformProj(this M44l m, V3l p)
=> m.TransposedTransformPosProj(p);

/// <summary>
/// Transforms point p (v.W is presumed 1.0) by transposed version of matrix m.
/// Projective transform is performed. Perspective Division is performed.
/// Projective transform is performed.
/// </summary>
public static V4l TransposedTransformProjFull(this M44l m, V3l p)
public static V4l TransposedTransformPosProjFull(this M44l m, V3l p)
{
return new V4l(
m.M00 * p.X + m.M10 * p.Y + m.M20 * p.Z + m.M30,
Expand All @@ -56241,6 +56285,10 @@ public static V4l TransposedTransformProjFull(this M44l m, V3l p)
);
}

[Obsolete("Use TransposedTransformPosProjFull instead.")]
public static V4l TransposedTransformProjFull(this M44l m, V3l p)
=> m.TransposedTransformPosProjFull(p);

#endregion

#region Operations
Expand Down Expand Up @@ -60322,17 +60370,21 @@ public static V3f TransposedTransformPos(this M44f m, V3f p)
/// Transforms point p (v.W is presumed 1.0) by transposed version of matrix m.
/// Projective transform is performed. Perspective Division is performed.
/// </summary>
public static V3f TransposedTransformProj(this M44f m, V3f p)
public static V3f TransposedTransformPosProj(this M44f m, V3f p)
{
var s = m.M03 * p.X + m.M13 * p.Y + m.M23 * p.Z + m.M33;
return TransposedTransformPos(m, p) * (1 / s);
}

[Obsolete("Use TransposedTransformPosProj instead.")]
public static V3f TransposedTransformProj(this M44f m, V3f p)
=> m.TransposedTransformPosProj(p);

/// <summary>
/// Transforms point p (v.W is presumed 1.0) by transposed version of matrix m.
/// Projective transform is performed. Perspective Division is performed.
/// Projective transform is performed.
/// </summary>
public static V4f TransposedTransformProjFull(this M44f m, V3f p)
public static V4f TransposedTransformPosProjFull(this M44f m, V3f p)
{
return new V4f(
m.M00 * p.X + m.M10 * p.Y + m.M20 * p.Z + m.M30,
Expand All @@ -60342,6 +60394,10 @@ public static V4f TransposedTransformProjFull(this M44f m, V3f p)
);
}

[Obsolete("Use TransposedTransformPosProjFull instead.")]
public static V4f TransposedTransformProjFull(this M44f m, V3f p)
=> m.TransposedTransformPosProjFull(p);

#endregion

#region Operations
Expand Down Expand Up @@ -64551,17 +64607,21 @@ public static V3d TransposedTransformPos(this M44d m, V3d p)
/// Transforms point p (v.W is presumed 1.0) by transposed version of matrix m.
/// Projective transform is performed. Perspective Division is performed.
/// </summary>
public static V3d TransposedTransformProj(this M44d m, V3d p)
public static V3d TransposedTransformPosProj(this M44d m, V3d p)
{
var s = m.M03 * p.X + m.M13 * p.Y + m.M23 * p.Z + m.M33;
return TransposedTransformPos(m, p) * (1 / s);
}

[Obsolete("Use TransposedTransformPosProj instead.")]
public static V3d TransposedTransformProj(this M44d m, V3d p)
=> m.TransposedTransformPosProj(p);

/// <summary>
/// Transforms point p (v.W is presumed 1.0) by transposed version of matrix m.
/// Projective transform is performed. Perspective Division is performed.
/// Projective transform is performed.
/// </summary>
public static V4d TransposedTransformProjFull(this M44d m, V3d p)
public static V4d TransposedTransformPosProjFull(this M44d m, V3d p)
{
return new V4d(
m.M00 * p.X + m.M10 * p.Y + m.M20 * p.Z + m.M30,
Expand All @@ -64571,6 +64631,10 @@ public static V4d TransposedTransformProjFull(this M44d m, V3d p)
);
}

[Obsolete("Use TransposedTransformPosProjFull instead.")]
public static V4d TransposedTransformProjFull(this M44d m, V3d p)
=> m.TransposedTransformPosProjFull(p);

#endregion

#region Operations
Expand Down
14 changes: 11 additions & 3 deletions src/Aardvark.Base/Math/Trafos/Matrix_template.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1825,23 +1825,31 @@ public static __vmsub1type__ TransposedTransformPos(this __nmtype__ m, __vmsub1t
/// Transforms point p (v.__fields[m-1]__ is presumed 1.0) by transposed version of matrix m.
/// Projective transform is performed. Perspective Division is performed.
/// </summary>
public static __vmsub1type__ TransposedTransformProj(this __nmtype__ m, __vmsub1type__ p)
public static __vmsub1type__ TransposedTransformPosProj(this __nmtype__ m, __vmsub1type__ p)
{
var s = /*# mfields.Take(msub1).ForEach((fr, r) => { */m.M__r____msub1__ * p.__fr__/*#}, add);*/ + m.M__msub1____msub1__;
return TransposedTransformPos(m, p) * (1 / s);
}

[Obsolete("Use TransposedTransformPosProj instead.")]
public static __vmsub1type__ TransposedTransformProj(this __nmtype__ m, __vmsub1type__ p)
=> m.TransposedTransformPosProj(p);

/// <summary>
/// Transforms point p (v.__fields[m-1]__ is presumed 1.0) by transposed version of matrix m.
/// Projective transform is performed. Perspective Division is performed.
/// Projective transform is performed.
/// </summary>
public static __vmtype__ TransposedTransformProjFull(this __nmtype__ m, __vmsub1type__ p)
public static __vmtype__ TransposedTransformPosProjFull(this __nmtype__ m, __vmsub1type__ p)
{
return new __vmtype__(/*# m.ForEach(s => { */
/*# mfields.Take(msub1).ForEach((fr, r) => { */m.M__r____s__ * p.__fr__/*#}, add);*/ + m.M__msub1____s__/*#}, comma);*/
);
}

[Obsolete("Use TransposedTransformPosProjFull instead.")]
public static __vmtype__ TransposedTransformProjFull(this __nmtype__ m, __vmsub1type__ p)
=> m.TransposedTransformPosProjFull(p);

//# } // n != m
//# } // m > 2
//# if (m == n + 1) {
Expand Down

0 comments on commit e0fc90f

Please sign in to comment.