diff --git a/src/DotRecast.Detour.Extras/Jumplink/ClimbTrajectory.cs b/src/DotRecast.Detour.Extras/Jumplink/ClimbTrajectory.cs index e11ac57..a8abd77 100644 --- a/src/DotRecast.Detour.Extras/Jumplink/ClimbTrajectory.cs +++ b/src/DotRecast.Detour.Extras/Jumplink/ClimbTrajectory.cs @@ -1,4 +1,5 @@ using System; +using DotRecast.Core; using DotRecast.Core.Numerics; namespace DotRecast.Detour.Extras.Jumplink @@ -9,9 +10,9 @@ namespace DotRecast.Detour.Extras.Jumplink { return new RcVec3f() { - X = Lerp(start.X, end.X, Math.Min(2f * u, 1f)), - Y = Lerp(start.Y, end.Y, Math.Max(0f, 2f * u - 1f)), - Z = Lerp(start.Z, end.Z, Math.Min(2f * u, 1f)) + X = RcMath.Lerp(start.X, end.X, Math.Min(2f * u, 1f)), + Y = RcMath.Lerp(start.Y, end.Y, Math.Max(0f, 2f * u - 1f)), + Z = RcMath.Lerp(start.Z, end.Z, Math.Min(2f * u, 1f)) }; } } diff --git a/src/DotRecast.Detour.Extras/Jumplink/EdgeSamplerFactory.cs b/src/DotRecast.Detour.Extras/Jumplink/EdgeSamplerFactory.cs index 3b0b976..01c16d7 100644 --- a/src/DotRecast.Detour.Extras/Jumplink/EdgeSamplerFactory.cs +++ b/src/DotRecast.Detour.Extras/Jumplink/EdgeSamplerFactory.cs @@ -3,7 +3,7 @@ using DotRecast.Core.Numerics; namespace DotRecast.Detour.Extras.Jumplink { - class EdgeSamplerFactory + public class EdgeSamplerFactory { public EdgeSampler Get(JumpLinkBuilderConfig acfg, JumpLinkType type, JumpEdge edge) { diff --git a/src/DotRecast.Detour.Extras/Jumplink/JumpSegmentBuilder.cs b/src/DotRecast.Detour.Extras/Jumplink/JumpSegmentBuilder.cs index e4fc68d..73f5758 100644 --- a/src/DotRecast.Detour.Extras/Jumplink/JumpSegmentBuilder.cs +++ b/src/DotRecast.Detour.Extras/Jumplink/JumpSegmentBuilder.cs @@ -4,7 +4,7 @@ using DotRecast.Core; namespace DotRecast.Detour.Extras.Jumplink { - class JumpSegmentBuilder + public class JumpSegmentBuilder { public JumpSegment[] Build(JumpLinkBuilderConfig acfg, EdgeSampler es) { diff --git a/src/DotRecast.Detour.Extras/Jumplink/JumpTrajectory.cs b/src/DotRecast.Detour.Extras/Jumplink/JumpTrajectory.cs index 07221db..080eff3 100644 --- a/src/DotRecast.Detour.Extras/Jumplink/JumpTrajectory.cs +++ b/src/DotRecast.Detour.Extras/Jumplink/JumpTrajectory.cs @@ -1,4 +1,5 @@ using System; +using DotRecast.Core; using DotRecast.Core.Numerics; namespace DotRecast.Detour.Extras.Jumplink @@ -16,9 +17,9 @@ namespace DotRecast.Detour.Extras.Jumplink { return new RcVec3f { - X = Lerp(start.X, end.X, u), + X = RcMath.Lerp(start.X, end.X, u), Y = InterpolateHeight(start.Y, end.Y, u), - Z = Lerp(start.Z, end.Z, u) + Z = RcMath.Lerp(start.Z, end.Z, u) }; } diff --git a/src/DotRecast.Detour.Extras/Jumplink/NavMeshGroundSampler.cs b/src/DotRecast.Detour.Extras/Jumplink/NavMeshGroundSampler.cs index 5a62246..b14de89 100644 --- a/src/DotRecast.Detour.Extras/Jumplink/NavMeshGroundSampler.cs +++ b/src/DotRecast.Detour.Extras/Jumplink/NavMeshGroundSampler.cs @@ -4,7 +4,7 @@ using DotRecast.Recast; namespace DotRecast.Detour.Extras.Jumplink { - class NavMeshGroundSampler : AbstractGroundSampler + public class NavMeshGroundSampler : AbstractGroundSampler { public override void Sample(JumpLinkBuilderConfig acfg, RcBuilderResult result, EdgeSampler es) { diff --git a/src/DotRecast.Detour.Extras/Jumplink/Trajectory.cs b/src/DotRecast.Detour.Extras/Jumplink/Trajectory.cs index 4e3cc7d..e51802c 100644 --- a/src/DotRecast.Detour.Extras/Jumplink/Trajectory.cs +++ b/src/DotRecast.Detour.Extras/Jumplink/Trajectory.cs @@ -5,11 +5,6 @@ namespace DotRecast.Detour.Extras.Jumplink { public class Trajectory { - public float Lerp(float f, float g, float u) - { - return u * g + (1f - u) * f; - } - public virtual RcVec3f Apply(RcVec3f start, RcVec3f end, float u) { throw new NotImplementedException(); diff --git a/src/DotRecast.Detour.Extras/Jumplink/TrajectorySampler.cs b/src/DotRecast.Detour.Extras/Jumplink/TrajectorySampler.cs index dc2dc6f..a2ec1f1 100644 --- a/src/DotRecast.Detour.Extras/Jumplink/TrajectorySampler.cs +++ b/src/DotRecast.Detour.Extras/Jumplink/TrajectorySampler.cs @@ -5,7 +5,7 @@ using DotRecast.Recast; namespace DotRecast.Detour.Extras.Jumplink { - class TrajectorySampler + public class TrajectorySampler { public void Sample(JumpLinkBuilderConfig acfg, RcHeightfield heightfield, EdgeSampler es) {