Removed RcVecUtils.Dot()

This commit is contained in:
ikpil 2024-06-04 00:34:07 +09:00
parent f8ae77a192
commit 099636cd7c
4 changed files with 8 additions and 24 deletions

View File

@ -16,7 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Nothing - Nothing
### Removed ### Removed
- Nothing - Removed RcVecUtils.Dot()
### Special Thanks ### Special Thanks
- [@Doprez](https://github.com/Doprez) - [@Doprez](https://github.com/Doprez)

View File

@ -118,22 +118,6 @@ namespace DotRecast.Core.Numerics
@out[n + 2] = @in[m + 2]; @out[n + 2] = @in[m + 2];
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float Dot(float[] v1, float[] v2)
{
return v1[0] * v2[0] +
v1[1] * v2[1] +
v1[2] * v2[2];
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float Dot(float[] v1, RcVec3f vector2)
{
return v1[0] * vector2.X +
v1[1] * vector2.Y +
v1[2] * vector2.Z;
}
/// Returns the distance between two points. /// Returns the distance between two points.
/// @param[in] v1 A point. [(x, y, z)] /// @param[in] v1 A point. [(x, y, z)]
/// @param[in] v2 A point. [(x, y, z)] /// @param[in] v2 A point. [(x, y, z)]

View File

@ -5,6 +5,6 @@ namespace DotRecast.Detour.Extras.Jumplink
{ {
public interface ITrajectory public interface ITrajectory
{ {
public RcVec3f Apply(RcVec3f start, RcVec3f end, float u); RcVec3f Apply(RcVec3f start, RcVec3f end, float u);
} }
} }

View File

@ -525,7 +525,7 @@ namespace DotRecast.Recast
{ {
if (MathF.Abs(planes[j][1]) > EPSILON) if (MathF.Abs(planes[j][1]) > EPSILON)
{ {
float dotNormalPoint = RcVecUtils.Dot(planes[j], point); float dotNormalPoint = RcVec3f.Dot(RcVecUtils.Create(planes[j]), point);
float t = (planes[j][3] - dotNormalPoint) / planes[j][1]; float t = (planes[j][3] - dotNormalPoint) / planes[j][1];
float y = point.Y + t; float y = point.Y + t;
bool valid = true; bool valid = true;
@ -729,15 +729,15 @@ namespace DotRecast.Recast
private static bool RayTriangleIntersection(RcVec3f point, int plane, float[][] planes, out float y) private static bool RayTriangleIntersection(RcVec3f point, int plane, float[][] planes, out float y)
{ {
y = 0.0f; y = 0.0f;
float t = (planes[plane][3] - RcVecUtils.Dot(planes[plane], point)) / planes[plane][1]; float t = (planes[plane][3] - RcVec3f.Dot(RcVecUtils.Create(planes[plane]), point)) / planes[plane][1];
float[] s = { point.X, point.Y + t, point.Z }; RcVec3f s = new RcVec3f(point.X, point.Y + t, point.Z);
float u = RcVecUtils.Dot(s, planes[plane + 1]) - planes[plane + 1][3]; float u = RcVec3f.Dot(s, RcVecUtils.Create(planes[plane + 1])) - planes[plane + 1][3];
if (u < 0.0f || u > 1.0f) if (u < 0.0f || u > 1.0f)
{ {
return false; return false;
} }
float v = RcVecUtils.Dot(s, planes[plane + 2]) - planes[plane + 2][3]; float v = RcVec3f.Dot(s, RcVecUtils.Create(planes[plane + 2])) - planes[plane + 2][3];
if (v < 0.0f) if (v < 0.0f)
{ {
return false; return false;
@ -749,7 +749,7 @@ namespace DotRecast.Recast
return false; return false;
} }
y = s[1]; y = s.Y;
return true; return true;
} }