diff --git a/vnavmesh/IPCProvider.cs b/vnavmesh/IPCProvider.cs index 88eabe4..2fc07b4 100644 --- a/vnavmesh/IPCProvider.cs +++ b/vnavmesh/IPCProvider.cs @@ -16,7 +16,7 @@ public IPCProvider(NavmeshManager navmeshManager, FollowPath followPath, MainWin Register("Nav.Reload", () => navmeshManager.Reload(true)); Register("Nav.Rebuild", () => navmeshManager.Reload(false)); Register("Nav.IsAutoLoad", () => navmeshManager.AutoLoad); - Register("Nav.SetAutoLoad", v => navmeshManager.AutoLoad = v); + Register("Nav.SetAutoLoad", (bool v) => navmeshManager.AutoLoad = v); Register("Query.Mesh.NearestPoint", (p, r) => followPath.Query?.FindNearestPointOnMesh(p, r)); @@ -26,12 +26,14 @@ public IPCProvider(NavmeshManager navmeshManager, FollowPath followPath, MainWin Register("Path.IsRunning", () => followPath.Waypoints.Count > 0); Register("Path.NumWaypoints", () => followPath.Waypoints.Count); Register("Path.GetMovementAllowed", () => followPath.MovementAllowed); - Register("Path.SetMovementAllowed", v => followPath.MovementAllowed = v); + Register("Path.SetMovementAllowed", (bool v) => followPath.MovementAllowed = v); + Register("Path.GetAlignCamera", () => followPath.AlignCamera); + Register("Path.SetAlignCamera", (bool v) => followPath.AlignCamera = v); Register("Path.GetTolerance", () => followPath.Tolerance); - Register("Path.SetTolerance", v => followPath.Tolerance = v); + Register("Path.SetTolerance", (float v) => followPath.Tolerance = v); Register("Window.IsOpen", () => mainWindow.IsOpen); - Register("Window.SetOpen", v => mainWindow.IsOpen = v); + Register("Window.SetOpen", (bool v) => mainWindow.IsOpen = v); } public void Dispose() diff --git a/vnavmesh/Movement/FollowPath.cs b/vnavmesh/Movement/FollowPath.cs index cb99c68..ba78894 100644 --- a/vnavmesh/Movement/FollowPath.cs +++ b/vnavmesh/Movement/FollowPath.cs @@ -7,6 +7,7 @@ namespace Navmesh.Movement; public class FollowPath : IDisposable { public bool MovementAllowed = true; + public bool AlignCamera = false; public bool UseRaycasts = true; public bool UseStringPulling = true; public float Tolerance = 0.5f; @@ -60,10 +61,11 @@ public unsafe void Update() else { _movement.Enabled = MovementAllowed; - //_camera.Enabled = true; _movement.DesiredPosition = _waypoints[0]; + _camera.Enabled = AlignCamera; _camera.SpeedH = _camera.SpeedV = 360.Degrees(); _camera.DesiredAzimuth = Angle.FromDirectionXZ(_movement.DesiredPosition - player.Position) + 180.Degrees(); + _camera.DesiredAltitude = -30.Degrees(); } }