From d17b6c13c61f4de80834d5d506a1c0c2f41437d1 Mon Sep 17 00:00:00 2001 From: ikpil Date: Wed, 14 Jun 2023 00:00:45 +0900 Subject: [PATCH] mode state --- src/DotRecast.Recast.Demo/RecastDemo.cs | 13 ++++++------- src/DotRecast.Recast.Demo/Tools/ConvexVolumeTool.cs | 1 + 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/DotRecast.Recast.Demo/RecastDemo.cs b/src/DotRecast.Recast.Demo/RecastDemo.cs index 5b4523e..492e738 100644 --- a/src/DotRecast.Recast.Demo/RecastDemo.cs +++ b/src/DotRecast.Recast.Demo/RecastDemo.cs @@ -74,7 +74,7 @@ public class RecastDemo private bool processHitTest = false; private bool processHitTestShift; - private int modState; + private int _modState; private readonly float[] mousePos = new float[2]; @@ -190,7 +190,7 @@ public class RecastDemo public void OnMouseUpAndDown(IMouse mouse, MouseButton button, bool down) { - modState = 0; + _modState = 0; if (down) { if (button == MouseButton.Right) @@ -241,8 +241,7 @@ public class RecastDemo if (!_mouseOverMenu) { processHitTest = true; - //processHitTestShift = (mods & Keys.GLFW_MOD_SHIFT) != 0 ? true : false; - //processHitTestShift = (mods & Keys.) != 0 ? true : false; + processHitTestShift = _modState != 0 ? true : false; } } else if (button == MouseButton.Middle) @@ -411,7 +410,7 @@ public class RecastDemo var tempMoveDown = keyboard.IsKeyPressed(Key.E) || keyboard.IsKeyPressed(Key.PageDown) ? 1.0f : -1f; var tempMoveAccel = keyboard.IsKeyPressed(Key.ShiftLeft) || keyboard.IsKeyPressed(Key.ShiftRight) ? 1.0f : -1f; - modState = keyboard.IsKeyPressed(Key.ControlLeft) || keyboard.IsKeyPressed(Key.ShiftRight) ? 1 : 0; + _modState |= keyboard.IsKeyPressed(Key.ControlLeft) || keyboard.IsKeyPressed(Key.ShiftLeft) || keyboard.IsKeyPressed(Key.ShiftRight) ? 1 : 0; _moveFront = Clamp(_moveFront + tempMoveFront * dt * 4.0f, 0, 2.0f); _moveLeft = Clamp(_moveLeft + tempMoveLeft * dt * 4.0f, 0, 2.0f); _moveBack = Clamp(_moveBack + tempMoveBack * dt * 4.0f, 0, 2.0f); @@ -652,7 +651,7 @@ public class RecastDemo if (hit.HasValue) { float hitTime = hit.Value; - if (0 != modState) + if (0 != _modState) { // Marker markerPositionSet = true; @@ -674,7 +673,7 @@ public class RecastDemo } else { - if (0 != modState) + if (0 != _modState) { // Marker markerPositionSet = false; diff --git a/src/DotRecast.Recast.Demo/Tools/ConvexVolumeTool.cs b/src/DotRecast.Recast.Demo/Tools/ConvexVolumeTool.cs index 1e06e46..a70f17d 100644 --- a/src/DotRecast.Recast.Demo/Tools/ConvexVolumeTool.cs +++ b/src/DotRecast.Recast.Demo/Tools/ConvexVolumeTool.cs @@ -35,6 +35,7 @@ namespace DotRecast.Recast.Demo.Tools; public class ConvexVolumeTool : IRcTool { private readonly ConvexVolumeToolImpl _impl; + private int areaTypeValue = SampleAreaModifications.SAMPLE_AREAMOD_GRASS.Value; private AreaModification areaType = SampleAreaModifications.SAMPLE_AREAMOD_GRASS; private float boxHeight = 6f;