Skip to content

Commit

Permalink
public class EdgeSamplerFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
ikpil committed May 30, 2024
1 parent 17ecdb1 commit e9a5512
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 14 deletions.
7 changes: 4 additions & 3 deletions src/DotRecast.Detour.Extras/Jumplink/ClimbTrajectory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using DotRecast.Core;
using DotRecast.Core.Numerics;

namespace DotRecast.Detour.Extras.Jumplink
Expand All @@ -9,9 +10,9 @@ public override RcVec3f Apply(RcVec3f start, RcVec3f end, float u)
{
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))
};
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/DotRecast.Detour.Extras/Jumplink/EdgeSamplerFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace DotRecast.Detour.Extras.Jumplink
{
class EdgeSamplerFactory
public class EdgeSamplerFactory
{
public EdgeSampler Get(JumpLinkBuilderConfig acfg, JumpLinkType type, JumpEdge edge)
{
Expand Down
2 changes: 1 addition & 1 deletion src/DotRecast.Detour.Extras/Jumplink/JumpSegmentBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace DotRecast.Detour.Extras.Jumplink
{
class JumpSegmentBuilder
public class JumpSegmentBuilder
{
public JumpSegment[] Build(JumpLinkBuilderConfig acfg, EdgeSampler es)
{
Expand Down
5 changes: 3 additions & 2 deletions src/DotRecast.Detour.Extras/Jumplink/JumpTrajectory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using DotRecast.Core;
using DotRecast.Core.Numerics;

namespace DotRecast.Detour.Extras.Jumplink
Expand All @@ -16,9 +17,9 @@ public override RcVec3f Apply(RcVec3f start, RcVec3f end, float u)
{
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)
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace DotRecast.Detour.Extras.Jumplink
{
class NavMeshGroundSampler : AbstractGroundSampler
public class NavMeshGroundSampler : AbstractGroundSampler
{
public override void Sample(JumpLinkBuilderConfig acfg, RcBuilderResult result, EdgeSampler es)
{
Expand Down
5 changes: 0 additions & 5 deletions src/DotRecast.Detour.Extras/Jumplink/Trajectory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/DotRecast.Detour.Extras/Jumplink/TrajectorySampler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace DotRecast.Detour.Extras.Jumplink
{
class TrajectorySampler
public class TrajectorySampler
{
public void Sample(JumpLinkBuilderConfig acfg, RcHeightfield heightfield, EdgeSampler es)
{
Expand Down

0 comments on commit e9a5512

Please sign in to comment.