diff --git a/src/DotRecast.Core/Numerics/RcVec3f.cs b/src/DotRecast.Core/Numerics/RcVec3f.cs index 4543f14..683b69d 100644 --- a/src/DotRecast.Core/Numerics/RcVec3f.cs +++ b/src/DotRecast.Core/Numerics/RcVec3f.cs @@ -122,28 +122,6 @@ namespace DotRecast.Core.Numerics } - - - /// Derives the dot product of two vectors on the xz-plane. (@p u . @p v) - /// @param[in] u A vector [(x, y, z)] - /// @param[in] v A vector [(x, y, z)] - /// @return The dot product on the xz-plane. - /// - /// The vectors are projected onto the xz-plane, so the y-values are - /// ignored. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly float Dot2D(RcVec3f v) - { - return X * v.X + Z * v.Z; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly float Dot2D(float[] v, int vi) - { - return X * v[vi] + Z * v[vi + 2]; - } - - public override bool Equals(object obj) { if (!(obj is RcVec3f)) diff --git a/src/DotRecast.Core/Numerics/RcVecExtensions.cs b/src/DotRecast.Core/Numerics/RcVecExtensions.cs index d2e5dd7..b17786c 100644 --- a/src/DotRecast.Core/Numerics/RcVecExtensions.cs +++ b/src/DotRecast.Core/Numerics/RcVecExtensions.cs @@ -28,11 +28,32 @@ namespace DotRecast.Core.Numerics default: throw new IndexOutOfRangeException("vector3f index out of range"); } } - + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static RcVec3f Scale(this RcVec3f v, float scale) { return v * scale; } + + /// Derives the dot product of two vectors on the xz-plane. (@p u . @p v) + /// @param[in] u A vector [(x, y, z)] + /// @param[in] v A vector [(x, y, z)] + /// @return The dot product on the xz-plane. + /// + /// The vectors are projected onto the xz-plane, so the y-values are + /// ignored. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Dot2D(this RcVec3f @this, RcVec3f v) + { + return @this.X * v.X + + @this.Z * v.Z; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Dot2D(this RcVec3f @this, float[] v, int vi) + { + return @this.X * v[vi] + + @this.Z * v[vi + 2]; + } } } \ No newline at end of file